summaryrefslogtreecommitdiff
path: root/js/tool.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-05-10 21:47:27 -0400
committerJules Laplace <jules@okfoc.us>2016-05-10 21:47:27 -0400
commit13d700004227922fb99bbef3587ff1b546741ec0 (patch)
tree1c3c644481353db4036fd535e2f51b21a360f5fa /js/tool.js
parenta885f8dd16bfc3c1e04f0fffa68661bfe5301673 (diff)
moving nopaint stuff into main codebase
Diffstat (limited to 'js/tool.js')
-rw-r--r--js/tool.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/js/tool.js b/js/tool.js
index e75bf8d..0ad23b9 100644
--- a/js/tool.js
+++ b/js/tool.js
@@ -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()
}
})