diff --git a/desktop/sources/scripts/generator.js b/desktop/sources/scripts/generator.js index a35cc4a..e8e39aa 100644 --- a/desktop/sources/scripts/generator.js +++ b/desktop/sources/scripts/generator.js @@ -85,7 +85,6 @@ function Generator(layer,style) s += `${this.render(prev,seg,mirror)}` prev = seg.vertices ? seg.vertices[seg.vertices.length-1] : null } - return s; } diff --git a/desktop/sources/scripts/guide.js b/desktop/sources/scripts/guide.js index db9c372..2d49254 100644 --- a/desktop/sources/scripts/guide.js +++ b/desktop/sources/scripts/guide.js @@ -85,7 +85,7 @@ function Guide() { if(!this.show_extras){ return; } - let cursor = {x:parseInt(dotgrid.cursor.pos.x/dotgrid.grid_width),y:parseInt(dotgrid.cursor.pos.y/dotgrid.grid_width)} + const cursor = {x:parseInt(dotgrid.cursor.pos.x/dotgrid.grid_width),y:parseInt(dotgrid.cursor.pos.y/dotgrid.grid_width)} for (let x = dotgrid.grid_x-1; x >= 0; x--) { for (let y = dotgrid.grid_y; y >= 0; y--) { diff --git a/desktop/sources/scripts/interface.js b/desktop/sources/scripts/interface.js index 5c2c235..7782cf2 100644 --- a/desktop/sources/scripts/interface.js +++ b/desktop/sources/scripts/interface.js @@ -47,9 +47,9 @@ function Interface() } for(const type in options){ - let tools = options[type]; + const tools = options[type]; for(const name in tools){ - let tool = tools[name]; + const tool = tools[name]; html += ` 2){ multi_vertices = true; break; } diff --git a/desktop/sources/scripts/lib/theme.js b/desktop/sources/scripts/lib/theme.js index 0999b50..01aafe3 100644 --- a/desktop/sources/scripts/lib/theme.js +++ b/desktop/sources/scripts/lib/theme.js @@ -2,7 +2,7 @@ function Theme(default_theme = {background: "#222", f_high: "#fff", f_med: "#ccc", f_low: "#999", f_inv: "#fff", b_high: "#888", b_med: "#666", b_low: "#444", b_inv: "#000" }) { - let themer = this; + const themer = this; this.el = document.createElement("style") this.el.type = 'text/css' @@ -26,7 +26,7 @@ function Theme(default_theme = {background: "#222", f_high: "#fff", f_med: "#ccc this.start = function() { console.log("Theme","Starting..") - let storage = is_json(localStorage.theme) ? JSON.parse(localStorage.theme) : this.collection.default; + const storage = is_json(localStorage.theme) ? JSON.parse(localStorage.theme) : this.collection.default; this.load(!storage.background ? this.collection.default : storage) } @@ -67,8 +67,6 @@ function Theme(default_theme = {background: "#222", f_high: "#fff", f_med: "#ccc this.parse = function(any) { - let theme; - if(any && any.background){ return any; } else if(any && any.data){ return any.data; } else if(any && is_json(any)){ return JSON.parse(any); } @@ -79,7 +77,7 @@ function Theme(default_theme = {background: "#222", f_high: "#fff", f_med: "#ccc this.extract = function(text) { - let svg = new DOMParser().parseFromString(text,"text/xml") + const svg = new DOMParser().parseFromString(text,"text/xml") try{ return { @@ -135,12 +133,12 @@ function Theme(default_theme = {background: "#222", f_high: "#fff", f_med: "#ccc e.preventDefault(); e.stopPropagation(); - let file = e.dataTransfer.files[0]; + const file = e.dataTransfer.files[0]; if(!file || !file.name){ console.warn("Theme","Unnamed file."); return; } if(file.name.indexOf(".thm") < 0 && file.name.indexOf(".svg") < 0){ console.warn("Theme","Skipped, not a theme"); return; } - let reader = new FileReader(); + const reader = new FileReader(); reader.onload = function(e){ themer.load(themer.parse(e.target.result)); }; diff --git a/desktop/sources/scripts/picker.js b/desktop/sources/scripts/picker.js index 1140aec..638a23c 100644 --- a/desktop/sources/scripts/picker.js +++ b/desktop/sources/scripts/picker.js @@ -33,7 +33,7 @@ function Picker() if(!this.is_active){ return; } if(!is_color(this.input.value)){ return; } - let hex = `#${this.input.value}`; + const hex = `#${this.input.value}`; document.getElementById("option_color").children[0].style.fill = hex; document.getElementById("option_color").children[0].style.stroke = hex; @@ -59,7 +59,7 @@ function Picker() { if(!is_color(this.input.value)){ return; } - let hex = `#${this.input.value}`; + const hex = `#${this.input.value}`; dotgrid.tool.style().color = hex; dotgrid.tool.style().fill = dotgrid.tool.style().fill != "none" ? hex : "none"; @@ -95,13 +95,13 @@ function Picker() return false } - let re = /[0-9A-Fa-f]/g; + const re = /[0-9A-Fa-f]/g; return re.test(val) } function is_color_char(val) { - let re = /[0-9A-Fa-f]/g; + const re = /[0-9A-Fa-f]/g; return re.test(val) }