diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-05-05 03:45:55 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-05-05 03:45:55 -0400 |
| commit | fb250c3b677095bf65553ab998e98e8cb6e459b8 (patch) | |
| tree | 89b68167093d38e2315afb8c99371265a8ae463b /js/ui | |
| parent | 0e4af74255a161ecaeb31cd831c33d9698ca1e9e (diff) | |
import webcam via postmessage
Diffstat (limited to 'js/ui')
| -rw-r--r-- | js/ui/controls.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/js/ui/controls.js b/js/ui/controls.js index fa2a240..734472d 100644 --- a/js/ui/controls.js +++ b/js/ui/controls.js @@ -93,7 +93,15 @@ var controls = (function(){ controls.webcam = new Tool (webcam_el) controls.webcam.load = function(){ + this.loaded = true webcam_close.addEventListener("click", function(){ controls.webcam.blur() }) + window.addEventListener("message", function(e){ + if (e.origin !== window.location.origin) return + controls.webcam.blur() + controls.circle.focus() + import_textarea.value = e.data + clipboard.import_colorcode() + }) } controls.webcam.use = function(){ if (! this.loaded) { |
