From 49a844125ccfc31a52e30180ba700ab5808e6093 Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 8 Feb 2021 11:55:22 +0100 Subject: [PATCH] Clean Dark theme code --- www/common/LessLoader.js | 6 +++--- www/common/boot2.js | 12 ------------ www/common/loading.js | 1 - www/settings/inner.js | 2 +- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/www/common/LessLoader.js b/www/common/LessLoader.js index db7a4688a..60d21fdad 100644 --- a/www/common/LessLoader.js +++ b/www/common/LessLoader.js @@ -119,13 +119,13 @@ define([ }); var doXHR = lessEngine.FileManager.prototype.doXHR; lessEngine.FileManager.prototype.doXHR = function (url, type, callback, errback) { - console.error(url, COLORTHEME); // XXX + //console.error(url, COLORTHEME); var col = false; var _url = url; if (url === COLORTHEME) { col = true; url = getColorthemeURL(); - console.warn(url); + //console.warn(url); } url = fixURL(url); var cached = tempCache[_url]; @@ -137,7 +137,7 @@ define([ cached = tempCache[_url] = { queue: [ callback ], res: undefined }; return doXHR(url, type, function (text, lastModified) { if (col) { - console.warn(text, lastModified); + //console.warn(text, lastModified); if (getColortheme() === "custom") { // XXX COLOR: append custom theme here var custom = [ diff --git a/www/common/boot2.js b/www/common/boot2.js index ebbd53e12..ada5b794c 100644 --- a/www/common/boot2.js +++ b/www/common/boot2.js @@ -14,7 +14,6 @@ try { var os = isDarkOS() ? 'dark' : 'light'; var key = 'CRYPTPAD_STORE|colortheme'; window.CryptPad_theme = localStorage[key] || os; - console.error(localStorage[key], os); if (!localStorage[key]) { // We're using OS theme, check if we need to change if (os !== localStorage[key+'_default']) { @@ -28,17 +27,6 @@ try { s.innerHTML = 'body { background: black; }'; document.body.appendChild(s); } - //localStorage[key] = theme; - // If the wrong theme is built, flush it - /* XXX flush cache when change - if (theme !== built) { - console.warn('New theme, flush cache'); - Object.keys(localStorage).forEach(function (k) { - if (k.indexOf('CRYPTPAD_CACHE|') !== 0 && k.indexOf('LESS_CACHE') !== 0) { return; } - delete localStorage[k]; - }); - } - */ } catch (e) { console.error(e); } })(); diff --git a/www/common/loading.js b/www/common/loading.js index 98003daba..7d0ca4c07 100644 --- a/www/common/loading.js +++ b/www/common/loading.js @@ -9,7 +9,6 @@ try { s.innerHTML = 'body { background: black; }'; document.body.appendChild(s); } - console.error(theme, os); } catch (e) { console.error(e); } })(); diff --git a/www/settings/inner.js b/www/settings/inner.js index e913d8f9b..94f913e6e 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -423,7 +423,7 @@ define([ makeBlock('colortheme', function (cb) { var theme = window.cryptpadStore.store['colortheme'] || 'default'; var os = window.cryptpadStore.store['colortheme_default'] || 'light'; - var values = ['default', 'light', 'dark', 'custom']; + var values = ['default', 'light', 'dark'/*, 'custom'*/]; var defaultTheme = Messages['settings_colortheme_'+os]; var opts = h('div.cp-settings-radio-container', [