This commit is contained in:
Devine Lu Linvega
2018-08-27 07:39:15 +12:00
parent 8fbd62d2bc
commit 8dae514ebf
12 changed files with 145 additions and 143 deletions

View File

@@ -1,6 +1,6 @@
function Theme()
{
var app = this;
let app = this;
this.el = document.createElement("style");
this.el.type = 'text/css';
@@ -17,7 +17,7 @@ function Theme()
this.load = function(t, fall_back)
{
var theme = is_json(t) ? JSON.parse(t).data : t.data;
let theme = is_json(t) ? JSON.parse(t).data : t.data;
if(!theme || !theme.background){
if(fall_back) {
@@ -27,7 +27,7 @@ function Theme()
}
}
var css = `
let css = `
:root {
--background: ${theme.background};
--f_high: ${theme.f_high};
@@ -62,11 +62,11 @@ function Theme()
e.preventDefault();
e.stopPropagation();
var file = e.dataTransfer.files[0];
let file = e.dataTransfer.files[0];
if(!file.name || !file.name.indexOf(".thm") < 0){ console.log("Theme","Not a theme"); return; }
var reader = new FileReader();
let reader = new FileReader();
reader.onload = function(e){
app.load(e.target.result);
};