diff --git a/src/js/colorinput.js b/src/js/colorinput.js index ebe17cdc8d31e5a9e2c573e8a61b2b18f363b58d..4aa2438276d69dfd21d06d4b4b0666526e90be97 100644 --- a/src/js/colorinput.js +++ b/src/js/colorinput.js @@ -2,11 +2,11 @@ Macro.add("colorinput", { handler: function() { if (this.args.length < 2) { var e = []; - return this.args.length < 1 && e.push("variable name"), this.args.length < 2 && e.push("default value"), this.error(`no ${ e.join(" or ") } specified`); + return this.args.length < 1 && e.push("variable name"), this.args.length < 2 && e.push("default value"), this.error("no " + e.join(" or ") + " specified"); } if ("string" != typeof this.args[0]) return this.error("variable name argument is not a string"); var varName = this.args[0].trim(); - if ("$" !== varName[0] && "_" !== varName[0]) return this.error(`variable name "${ this.args[0] }" is missing its sigil ($ or _)`); + if ("$" !== varName[0] && "_" !== varName[0]) return this.error('variable name "' + this.args[0] + '" is missing its sigil ($ or _)'); Config.debug && this.debugView.modes({ block: true }); @@ -36,18 +36,18 @@ Macro.add("colorinput", { } Engine.play(passage); if (currentPassage == passage) { - Scripting.evalJavaScript(`window.scrollTo(0, ${ currentScrollPosition });`); + Scripting.evalJavaScript("window.scrollTo(0, " + currentScrollPosition + ");"); } } } jQuery(inputElement).attr({ - id: `${this.name }-${ r}`, - name: `${this.name }-${ r}`, + id: this.name + "-" + r, + name: this.name + "-" + r, type: 'color', value: value, tabindex: 0 - }).addClass(`macro-${ this.name}`) + }).addClass("macro-" + this.name) .on("change", function() { State.setVar(varName, this.value); if (this.value != value) { // If the value has actually changed, reload the page. Note != and not !== because types might be different