summaryrefslogtreecommitdiff
path: root/js/record.concat.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/record.concat.js')
-rw-r--r--js/record.concat.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/js/record.concat.js b/js/record.concat.js
index f4d06f4..fe35688 100644
--- a/js/record.concat.js
+++ b/js/record.concat.js
@@ -944,6 +944,7 @@ function GifEncoder(){
el.innerHTML = UI_TEMPLATE
document.body.appendChild(el)
bind()
+ activate()
}
function bind(){
curtain = $("curtain")
@@ -962,8 +963,25 @@ function GifEncoder(){
h_el.addEventListener("change", box_position, false)
x_el.addEventListener("change", box_position, false)
y_el.addEventListener("change", box_position, false)
+ window.addEventListener("keydown", keydown, false)
+ }
+ var listening = false
+ function activate(){
+ listening = true
outline.style.display = "none"
controls.style.display = "block"
+ curtain.style.display = "block"
+ }
+ function deactivate(){
+ listening = false
+ outline.style.display = "none"
+ controls.style.display = "none"
+ curtain.style.display = "none"
+ }
+ function keydown(e){
+ if (e.keyCode == 27) { // esc
+ ! activated ? activate : deactivate
+ }
}
function defer(callback){
var timeout = null
@@ -973,6 +991,7 @@ function GifEncoder(){
}
}
function box_start(e){
+ if (! listening) return
e.stopPropagation()
x = e.pageX
y = e.pageY
@@ -1024,6 +1043,7 @@ function GifEncoder(){
function unclickable(id){ $(id).style.pointerEvents = "none" }
function px(n){ return (~~n) + "px" }
function record(e){
+ if (! listening) return
e.stopPropagation()
count = _int("framecount")
delay = _float("framedelay") * 1000