@ -1,3 +1,18 @@
(function () {
try {
var req = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
var theme = req.theme;
var os = req.themeOS;
window.CryptPad_theme = theme || os;
if ((theme || os) === 'dark') {
var s = document.createElement('style');
s.innerHTML = 'body { background: black; }';
document.body.appendChild(s);
}
console.error(theme, os);
} catch (e) { console.error(e); }
})();
require(['/customize/loading.js'], function (Loading) {
Loading();
});
@ -1,13 +1,3 @@
if (!window.cryptpadStore) { return; }
var theme = window.cryptpadStore.store['colortheme'];
var os = window.cryptpadStore.store['colortheme_default'];
// This is stage 1, it can be changed but you must bump the version of the project.
// Note: This must only be loaded from inside of a sandbox-iframe.
define([
@ -11,10 +11,13 @@ define([
common.initIframe = function (waitFor, isRt, pathname) {
var requireConfig = RequireConfig();
var lang = Messages._languageUsed;
var themeKey = 'CRYPTPAD_STORE|colortheme';
var req = {
cfg: requireConfig,
req: [ '/common/loading.js' ],
pfx: window.location.origin,
theme: localStorage[themeKey],
themeOS: localStorage[themeKey+'_default'],
lang: lang
};
window.rc = requireConfig;