One keybind, auto-hide and persistent QR.
This commit is contained in:
parent
6d2f082be3
commit
6b237dfa2f
@ -105,7 +105,7 @@
|
|||||||
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
||||||
},
|
},
|
||||||
Posting: {
|
Posting: {
|
||||||
'Auto Noko': [true, 'Redirect to your post'],
|
'Auto Noko': [true, 'Redirect to your thread'],
|
||||||
'Cooldown': [true, 'Prevent `flood detected` errors'],
|
'Cooldown': [true, 'Prevent `flood detected` errors'],
|
||||||
'Quick Reply': [true, 'Reply without leaving the page'],
|
'Quick Reply': [true, 'Reply without leaving the page'],
|
||||||
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.'],
|
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.'],
|
||||||
@ -891,7 +891,11 @@
|
|||||||
thread = nav.getThread();
|
thread = nav.getThread();
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case conf.close:
|
case conf.close:
|
||||||
if (o = $('#overlay')) $.rm(o);
|
if (o = $.id('overlay')) {
|
||||||
|
$.rm(o);
|
||||||
|
} else if (qr.el) {
|
||||||
|
qr.close();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case conf.spoiler:
|
case conf.spoiler:
|
||||||
ta = e.target;
|
ta = e.target;
|
||||||
@ -1193,15 +1197,25 @@
|
|||||||
g.callbacks.push(function(root) {
|
g.callbacks.push(function(root) {
|
||||||
return $.on($('.quotejs + .quotejs', root), 'click', qr.quote);
|
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() {
|
open: function() {
|
||||||
|
var input;
|
||||||
if (qr.el) {
|
if (qr.el) {
|
||||||
return qr.el.hidden = false;
|
qr.el.hidden = false;
|
||||||
|
input = $.id('autohide');
|
||||||
|
input.checked = false;
|
||||||
|
return qr.hide.call(input);
|
||||||
} else {
|
} else {
|
||||||
return qr.dialog();
|
return qr.dialog();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
hide: function() {
|
||||||
|
return qr.el.lastChild.hidden = this.checked;
|
||||||
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
return qr.el.hidden = true;
|
return qr.el.hidden = true;
|
||||||
},
|
},
|
||||||
@ -1223,7 +1237,23 @@
|
|||||||
return ta.selectionEnd = ta.selectionStart = caretPos + text.length;
|
return ta.selectionEnd = ta.selectionStart = caretPos + text.length;
|
||||||
},
|
},
|
||||||
dialog: function() {
|
dialog: function() {
|
||||||
qr.el = ui.dialog('qr', 'top:0;right:0;', '<div class=move><a class=close>⨯</a></div><textarea></textarea>');
|
qr.el = ui.dialog('qr', 'top:0;right:0;', '\
|
||||||
|
<style>\
|
||||||
|
#qr > .move {\
|
||||||
|
min-width: 300px;\
|
||||||
|
text-align: right;\
|
||||||
|
}\
|
||||||
|
</style>\
|
||||||
|
\
|
||||||
|
<div class=move>\
|
||||||
|
<input type=checkbox name=autohide id=autohide title=Auto-hide>\
|
||||||
|
<a class=close>⨯</a>\
|
||||||
|
</div>\
|
||||||
|
<div>\
|
||||||
|
<input name=name><input name=email><input name=subject>\
|
||||||
|
<textarea></textarea>\
|
||||||
|
</div>');
|
||||||
|
$.on($('#autohide', qr.el), 'click', qr.hide);
|
||||||
$.on($('.close', qr.el), 'click', qr.close);
|
$.on($('.close', qr.el), 'click', qr.close);
|
||||||
return $.add(d.body, qr.el);
|
return $.add(d.body, qr.el);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,7 +32,7 @@ config =
|
|||||||
'Auto Watch': [true, 'Automatically watch threads that you start']
|
'Auto Watch': [true, 'Automatically watch threads that you start']
|
||||||
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
'Auto Watch Reply': [false, 'Automatically watch threads that you reply to']
|
||||||
Posting:
|
Posting:
|
||||||
'Auto Noko': [true, 'Redirect to your post']
|
'Auto Noko': [true, 'Redirect to your thread']
|
||||||
'Cooldown': [true, 'Prevent `flood detected` errors']
|
'Cooldown': [true, 'Prevent `flood detected` errors']
|
||||||
'Quick Reply': [true, 'Reply without leaving the page']
|
'Quick Reply': [true, 'Reply without leaving the page']
|
||||||
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.']
|
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.']
|
||||||
@ -650,9 +650,10 @@ keybinds =
|
|||||||
thread = nav.getThread()
|
thread = nav.getThread()
|
||||||
switch key
|
switch key
|
||||||
when conf.close
|
when conf.close
|
||||||
if o = $ '#overlay'
|
if o = $.id 'overlay'
|
||||||
$.rm o
|
$.rm o
|
||||||
# else close QR
|
else if qr.el
|
||||||
|
qr.close()
|
||||||
when conf.spoiler
|
when conf.spoiler
|
||||||
ta = e.target
|
ta = e.target
|
||||||
return unless ta.nodeName is 'TEXTAREA'
|
return unless ta.nodeName is 'TEXTAREA'
|
||||||
@ -870,13 +871,20 @@ qr =
|
|||||||
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
|
$.on $('.quotejs + .quotejs', root), 'click', qr.quote
|
||||||
if conf['Persistent QR']
|
if conf['Persistent QR']
|
||||||
qr.dialog()
|
qr.dialog()
|
||||||
|
$.id('autohide').click()
|
||||||
|
|
||||||
open: ->
|
open: ->
|
||||||
if qr.el
|
if qr.el
|
||||||
qr.el.hidden = false
|
qr.el.hidden = false
|
||||||
|
input = $.id 'autohide'
|
||||||
|
input.checked = false
|
||||||
|
qr.hide.call input
|
||||||
else
|
else
|
||||||
qr.dialog()
|
qr.dialog()
|
||||||
|
|
||||||
|
hide: ->
|
||||||
|
qr.el.lastChild.hidden = this.checked
|
||||||
|
|
||||||
close: ->
|
close: ->
|
||||||
qr.el.hidden = true
|
qr.el.hidden = true
|
||||||
|
|
||||||
@ -901,8 +909,24 @@ qr =
|
|||||||
ta.selectionEnd = ta.selectionStart = caretPos + text.length
|
ta.selectionEnd = ta.selectionStart = caretPos + text.length
|
||||||
|
|
||||||
dialog: ->
|
dialog: ->
|
||||||
qr.el = ui.dialog 'qr', 'top:0;right:0;', '<div class=move><a class=close>⨯</a></div><textarea></textarea>'
|
qr.el = ui.dialog 'qr', 'top:0;right:0;', '
|
||||||
$.on $('.close', qr.el), 'click', qr.close
|
<style>
|
||||||
|
#qr > .move {
|
||||||
|
min-width: 300px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class=move>
|
||||||
|
<input type=checkbox name=autohide id=autohide title=Auto-hide>
|
||||||
|
<a class=close>⨯</a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input name=name><input name=email><input name=subject>
|
||||||
|
<textarea></textarea>
|
||||||
|
</div>'
|
||||||
|
$.on $('#autohide', qr.el), 'click', qr.hide
|
||||||
|
$.on $('.close', qr.el), 'click', qr.close
|
||||||
$.add d.body, qr.el
|
$.add d.body, qr.el
|
||||||
|
|
||||||
options =
|
options =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user