summaryrefslogtreecommitdiff
path: root/js/ui
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2015-05-01 02:14:59 -0400
committerJulie Lala <jules@okfoc.us>2015-05-01 02:14:59 -0400
commit41c77a3357596c566d5b89283980e8d06f84c778 (patch)
tree7f6c54c0c08eafbd097c12000f6b5453b86e18fb /js/ui
parent8b83fb2bafcf11b1981535f6dbc364db15153d87 (diff)
save custom brushes
Diffstat (limited to 'js/ui')
-rw-r--r--js/ui/controls.js5
-rw-r--r--js/ui/custom.js24
2 files changed, 29 insertions, 0 deletions
diff --git a/js/ui/controls.js b/js/ui/controls.js
index 661f881..9ea58f5 100644
--- a/js/ui/controls.js
+++ b/js/ui/controls.js
@@ -254,6 +254,11 @@ var controls = (function(){
controls.canvas_height.build()
canvas.resize(canvas.w, h)
}
+
+ add_custom_el.addEventListener("click", function(){
+ custom.clone()
+ })
+
}
function int_key (f) {
diff --git a/js/ui/custom.js b/js/ui/custom.js
new file mode 100644
index 0000000..a758d48
--- /dev/null
+++ b/js/ui/custom.js
@@ -0,0 +1,24 @@
+var custom = (function(){
+
+ var exports = {}
+
+ exports.clone = function (){
+ var new_brush = brush.clone()
+ var rapper = document.createElement("div")
+ rapper.className = "custom"
+ new_brush.append(rapper)
+ custom_rapper.appendChild(rapper)
+ // store in localstorage?
+ rapper.addEventListener("click", function(){
+ // load this brush
+ exports.load(new_brush)
+ })
+ }
+
+ exports.load = function(new_brush){
+ brush.assign( new_brush )
+ }
+
+ return exports
+
+})()