diff options
Diffstat (limited to 'js/tool.js')
| -rw-r--r-- | js/tool.js | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -114,14 +114,11 @@ var RadioGroup = Tool.extend({ } }) - - - var Checkbox = Tool.extend({ init: function (el){ this.__init(el) var name = this.name.replace(/^[x_] /,"") - var state = localStorage.getItem("ascii." + name) || this.name[0] == "x" + var state = localStorage.getItem("ascii.tools." + name) == "true" || this.name[0] == "x" this.name = name this.update(state) }, @@ -153,14 +150,18 @@ var BlurredTool = Tool.extend({ }) var HiddenCheckbox = BlurredCheckbox.extend({ + on: "o", + off: ".", init: function (el){ this.el = el this.lex = new Lex (el) - this.name = el.innerHTML - var state = this.name[0] == "o" + this.name = this.el.id + var state = localStorage.getItem("ascii.tools." + name) == "true" || this.el.innerHTML[0] == this.on this.update(state) }, update: function(state){ - this.el.innerHTML = state ? "o" : "." + this.el.innerHTML = state ? this.on : this.off + if (this.memorable) { localStorage.setItem("ascii.tools." + this.name, !! state) } + console.trace() } }) |
