Clean Dark theme code

This commit is contained in:
yflory 2021-02-08 11:55:22 +01:00
parent 4ce311216f
commit 49a844125c
4 changed files with 4 additions and 17 deletions

View file

@ -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 = [

View file

@ -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); }
})();

View file

@ -9,7 +9,6 @@ try {
s.innerHTML = 'body { background: black; }';
document.body.appendChild(s);
}
console.error(theme, os);
} catch (e) { console.error(e); }
})();

View file

@ -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', [