Added incognito mode

This commit is contained in:
2019-01-11 14:50:06 +01:00
parent f76d9ba9cd
commit a0d644469d
10 changed files with 289 additions and 7 deletions

View File

@ -33,6 +33,10 @@ ComunicWeb.common.api = {
}
//Enable incognito mode if required
if(ComunicWeb.components.incognito.management.isEnabled())
params.incognito = true;
//Prepare data to send in request
var count = 0;
var datas = "";
@ -90,7 +94,11 @@ ComunicWeb.common.api = {
data.append('userToken2', tokens.token2);
}
}
}
//Enable incognito mode if required
if(ComunicWeb.components.incognito.management.isEnabled())
data.append("incognito", true);
//Create request
var apiXHR = new XMLHttpRequest();

View File

@ -1107,7 +1107,35 @@ var ComunicWeb = {
*/
darkTheme: {
//TODO : implement
}
},
/**
* Incognito mode component
*/
incognito: {
/**
* Keyboard catcher
*/
keyboard: {
//TODO : implement
},
/**
* Incognito management
*/
management: {
//TODO : implement
},
/**
* UI management
*/
ui: {
//TODO : implement
},
},
},
/**

View File

@ -277,6 +277,11 @@ ComunicWeb.common.page = {
//Call the method related to the page
eval(pageInfos.methodHandler + ("(additionnalData, pageTarget);"));
//Propagate information
SendEvent("openPage", {
page: pageURI
});
//Success
return true;

View File

@ -48,6 +48,16 @@ ComunicWeb.common.system = {
*/
ComunicWeb.common.langs.initLanguages();
/**
* Initialize incognito mode detection
*/
ComunicWeb.components.incognito.management.init();
/**
* Refresh dark theme mode
*/
ComunicWeb.components.darkTheme.refresh();
/**
* What to do after login refresh
*/
@ -81,11 +91,6 @@ ComunicWeb.common.system = {
}), 25000);
ComunicWeb.common.cacheManager.registerInterval(autoRefresh);
/**
* Refresh dark theme mode
*/
ComunicWeb.components.darkTheme.refresh();
//Success
return true;
},

View File

@ -682,4 +682,22 @@ function ApplySceditorStyle(textarea){
//Apply new styles to body
iframeDOM.body.className += " sceditor-iframe-body";
}
/**
* Send a new javascript event
*
* @param {String} name The name of the event to create
* @param {Object} details Information about the event to create
*/
function SendEvent(name, details){
var event = new CustomEvent(name, {
detail: details,
bubbles: true,
cancelable: false
});
document.dispatchEvent(event);
}