summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-05-05 03:37:44 -0400
committerJules Laplace <jules@okfoc.us>2015-05-05 03:37:44 -0400
commit0e4af74255a161ecaeb31cd831c33d9698ca1e9e (patch)
tree5c7defa37c2ecff3edb22810b8537ed297fdd84c /js
parent1908b82d0bfa01267e623636b5bd0aca82a6ce82 (diff)
show/hide webcam
Diffstat (limited to 'js')
-rw-r--r--js/ui/controls.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/ui/controls.js b/js/ui/controls.js
index 982871a..fa2a240 100644
--- a/js/ui/controls.js
+++ b/js/ui/controls.js
@@ -90,6 +90,22 @@ var controls = (function(){
controls.clear.use = function(){
canvas.erase()
}
+
+ controls.webcam = new Tool (webcam_el)
+ controls.webcam.load = function(){
+ webcam_close.addEventListener("click", function(){ controls.webcam.blur() })
+ }
+ controls.webcam.use = function(){
+ if (! this.loaded) {
+ this.load()
+ }
+ webcam_iframe.src = "webcam.html"
+ webcam_rapper.style.display = "block"
+ }
+ controls.webcam.done = function(){
+ webcam_iframe.src = ""
+ webcam_rapper.style.display = "none"
+ }
controls.grid = new Checkbox (grid_el)
controls.grid.use = function(){
@@ -196,6 +212,7 @@ var controls = (function(){
controls.select,
controls.clear,
controls.grid,
+ controls.webcam,
controls.fg,
controls.bg,
controls.char,