mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-19 04:15:17 +00:00
Added login tokens storage controller
This commit is contained in:
@ -83,7 +83,9 @@ ComunicWeb.common.error.pageNotFound = function(additionnalData, targetElement){
|
||||
//Show template element
|
||||
var templateURI = "common/errors/error.tpl";
|
||||
var dataTemplate = {
|
||||
|
||||
error_code: "404",
|
||||
error_title: "Page not found",
|
||||
error_message: "The requested page ("+location.href+") was not found on this website. Please check your request..."
|
||||
};
|
||||
ComunicWeb.common.page.getAndShowTemplate(targetElement, dataTemplate, templateURI, (function(){}), true);
|
||||
|
||||
|
@ -176,5 +176,17 @@ var ComunicWeb = {
|
||||
* Get log content in a string
|
||||
*/
|
||||
getLogContent: function(){},
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* User functions
|
||||
*/
|
||||
user:{
|
||||
/**
|
||||
* Login tokens storage controller
|
||||
*/
|
||||
loginTokens: {
|
||||
//TODO: implement
|
||||
},
|
||||
},
|
||||
}
|
@ -143,7 +143,17 @@ ComunicWeb.common.page = {
|
||||
|
||||
//Define how to apply the template
|
||||
var afterDownloadTemplateContent = function(templateContent){
|
||||
targetElem.innerHTML = (templateContent);
|
||||
|
||||
//Apply data templates
|
||||
for(elemName in dataTemplate){
|
||||
//We change the template content while it still exists
|
||||
while(templateContent.indexOf("{"+elemName+"}") != -1){
|
||||
templateContent = templateContent.replace("{"+elemName+"}", dataTemplate[elemName]);
|
||||
}
|
||||
}
|
||||
|
||||
//Apply template source
|
||||
targetElem.innerHTML = templateContent;
|
||||
}
|
||||
|
||||
//Perform request
|
||||
|
Reference in New Issue
Block a user