diff --git a/4chan_x.user.js b/4chan_x.user.js
index fa5130a62..2751dde7e 100644
--- a/4chan_x.user.js
+++ b/4chan_x.user.js
@@ -105,7 +105,7 @@
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
},
Posting: {
- 'Auto Noko': [true, 'Redirect to your post'],
+ 'Auto Noko': [true, 'Redirect to your thread'],
'Cooldown': [true, 'Prevent `flood detected` errors'],
'Quick Reply': [true, 'Reply without leaving the page'],
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.'],
@@ -891,7 +891,11 @@
thread = nav.getThread();
switch (key) {
case conf.close:
- if (o = $('#overlay')) $.rm(o);
+ if (o = $.id('overlay')) {
+ $.rm(o);
+ } else if (qr.el) {
+ qr.close();
+ }
break;
case conf.spoiler:
ta = e.target;
@@ -1193,15 +1197,25 @@
g.callbacks.push(function(root) {
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
});
- if (conf['Persistent QR']) return qr.dialog();
+ if (conf['Persistent QR']) {
+ qr.dialog();
+ return $.id('autohide').click();
+ }
},
open: function() {
+ var input;
if (qr.el) {
- return qr.el.hidden = false;
+ qr.el.hidden = false;
+ input = $.id('autohide');
+ input.checked = false;
+ return qr.hide.call(input);
} else {
return qr.dialog();
}
},
+ hide: function() {
+ return qr.el.lastChild.hidden = this.checked;
+ },
close: function() {
return qr.el.hidden = true;
},
@@ -1223,7 +1237,23 @@
return ta.selectionEnd = ta.selectionStart = caretPos + text.length;
},
dialog: function() {
- qr.el = ui.dialog('qr', 'top:0;right:0;', '
');
+ qr.el = ui.dialog('qr', 'top:0;right:0;', '\
+\
+\
+\
+\
+ \
+ \
+
');
+ $.on($('#autohide', qr.el), 'click', qr.hide);
$.on($('.close', qr.el), 'click', qr.close);
return $.add(d.body, qr.el);
}
diff --git a/script.coffee b/script.coffee
index 22e2399c3..7789c398f 100644
--- a/script.coffee
+++ b/script.coffee
@@ -32,7 +32,7 @@ config =
'Auto Watch': [true, 'Automatically watch threads that you start']
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
Posting:
- 'Auto Noko': [true, 'Redirect to your post']
+ 'Auto Noko': [true, 'Redirect to your thread']
'Cooldown': [true, 'Prevent `flood detected` errors']
'Quick Reply': [true, 'Reply without leaving the page']
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.']
@@ -650,9 +650,10 @@ keybinds =
thread = nav.getThread()
switch key
when conf.close
- if o = $ '#overlay'
+ if o = $.id 'overlay'
$.rm o
- # else close QR
+ else if qr.el
+ qr.close()
when conf.spoiler
ta = e.target
return unless ta.nodeName is 'TEXTAREA'
@@ -870,13 +871,20 @@ qr =
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
if conf['Persistent QR']
qr.dialog()
+ $.id('autohide').click()
open: ->
if qr.el
qr.el.hidden = false
+ input = $.id 'autohide'
+ input.checked = false
+ qr.hide.call input
else
qr.dialog()
+ hide: ->
+ qr.el.lastChild.hidden = this.checked
+
close: ->
qr.el.hidden = true
@@ -901,8 +909,24 @@ qr =
ta.selectionEnd = ta.selectionStart = caretPos + text.length
dialog: ->
- qr.el = ui.dialog 'qr', 'top:0;right:0;', ''
- $.on $('.close', qr.el), 'click', qr.close
+ qr.el = ui.dialog 'qr', 'top:0;right:0;', '
+
+
+
+
+
+
+
'
+ $.on $('#autohide', qr.el), 'click', qr.hide
+ $.on $('.close', qr.el), 'click', qr.close
$.add d.body, qr.el
options =