Commit 1adef964 authored by François Billioud's avatar François Billioud

move mobile website to the folder mobile

parent 26639b48
...@@ -22,7 +22,7 @@ var logUser = function() { ...@@ -22,7 +22,7 @@ var logUser = function() {
var IDProvider = $("input#id_provider").attr("value"); var IDProvider = $("input#id_provider").attr("value");
if(name) { if(name) {
setCurrentStorage(IDProvider ? new JIOStorage(name,IDProvider) : new LocalStorage(name)); setCurrentStorage(IDProvider ? new JIOStorage(name,IDProvider) : new LocalStorage(name));
window.location = "ung-mobile.html"; window.location.href = "ung-mobile.html";
} }
} }
......
...@@ -73,7 +73,7 @@ Page.prototype = { ...@@ -73,7 +73,7 @@ Page.prototype = {
doc=new JSONIllustrationDocument(); doc=new JSONIllustrationDocument();
break; break;
default://renvoie à la page d'accueil default://renvoie à la page d'accueil
window.location = "ung.html"; window.location.href = "ung.html";
return; return;
break; break;
} }
...@@ -329,7 +329,7 @@ getCurrentStorage = function() { ...@@ -329,7 +329,7 @@ getCurrentStorage = function() {
var dataStorage = JSON.parse(localStorage.getItem("currentStorage")); var dataStorage = JSON.parse(localStorage.getItem("currentStorage"));
if(!dataStorage) { if(!dataStorage) {
setCurrentStorage(new LocalStorage("ung")); setCurrentStorage(new LocalStorage("ung"));
//window.location = "login-mobile.html"; //window.location.href = "login-mobile.html";
return null; return null;
}//if it's the first connexion }//if it's the first connexion
...@@ -373,8 +373,8 @@ var JSONDocument = function(arg) { ...@@ -373,8 +373,8 @@ var JSONDocument = function(arg) {
this.lastUser=getCurrentUser().getName(); this.lastUser=getCurrentUser().getName();
this.title="Untitled"; this.title="Untitled";
this.content=""; this.content="";
this.creation=currentTime(); this.creation=getCurrentTime();
this.lastModification=currentTime(); this.lastModification=getCurrentTime();
this.state=JSONDocument.prototype.states.draft; this.state=JSONDocument.prototype.states.draft;
} }
} }
...@@ -412,7 +412,7 @@ JSONDocument.prototype.load({//add methods thanks to the UngObject.load method ...@@ -412,7 +412,7 @@ JSONDocument.prototype.load({//add methods thanks to the UngObject.load method
getLastModification:function() { getLastModification:function() {
var date = (new Date(this.lastModification)).toGMTString(); var date = (new Date(this.lastModification)).toGMTString();
var day = date.substring(0,16); var day = date.substring(0,16);
var today = (new Date(currentTime())).toGMTString().substring(0,16); var today = (new Date(getCurrentTime())).toGMTString().substring(0,16);
return (day===today) ? date.substring(17,date.length) : day; return (day===today) ? date.substring(17,date.length) : day;
}, },
setLastModification:function(date) {this.lastModification=date;}, setLastModification:function(date) {this.lastModification=date;},
...@@ -602,13 +602,13 @@ var startDocumentEdition = function(doc) { ...@@ -602,13 +602,13 @@ var startDocumentEdition = function(doc) {
getCurrentStorage().getDocument(getDocumentAddress(doc), function(data) { getCurrentStorage().getDocument(getDocumentAddress(doc), function(data) {
doc.load(data); doc.load(data);
setCurrentDocument(doc); setCurrentDocument(doc);
if(supportedDocuments[doc.getType()].editorPage) {window.location = "theme-mobile.html";} if(supportedDocuments[doc.getType()].editorPage) {window.location.href = "theme-mobile.html";}
else alert("no editor available for this document"); else alert("no editor available for this document");
}); });
} }
var stopDocumentEdition = function() { var stopDocumentEdition = function() {
saveCurrentDocument(); saveCurrentDocument();
window.location = "ung-mobile.html"; window.location.href = "ung-mobile.html";
return false; return false;
} }
...@@ -626,7 +626,7 @@ var changeLanguage = function(language) { ...@@ -626,7 +626,7 @@ var changeLanguage = function(language) {
var signOut = function() { var signOut = function() {
delete localStorage.currentStorage; delete localStorage.currentStorage;
delete localStorage.currentDocumentID; delete localStorage.currentDocumentID;
window.location = "login-mobile.html"; window.location.href = "login-mobile.html";
return false; return false;
} }
......
...@@ -222,7 +222,7 @@ errorMessage = function(message,object) { ...@@ -222,7 +222,7 @@ errorMessage = function(message,object) {
/** /**
* returns the current date (number of ms since 1/1/1970 at 12:00 AM) * returns the current date (number of ms since 1/1/1970 at 12:00 AM)
*/ */
currentTime = function() {return Date.now();} function getCurrentTime() {return Date.now();}
/** /**
* cuts a string if too long * cuts a string if too long
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment