QR fixes.
This commit is contained in:
parent
59f5adaf7d
commit
0313b094ce
@ -1360,7 +1360,7 @@
|
|||||||
return $.on(d, 'dragstart dragend', QR.drag);
|
return $.on(d, 'dragstart dragend', QR.drag);
|
||||||
},
|
},
|
||||||
node: function(post) {
|
node: function(post) {
|
||||||
return $.on($('.quotejs + .quotejs', post.el), 'click', QR.quote);
|
return $.on($('.postInfo > .postNum > a:last-child', post.el), 'click', QR.quote);
|
||||||
},
|
},
|
||||||
open: function() {
|
open: function() {
|
||||||
if (QR.el) {
|
if (QR.el) {
|
||||||
@ -1479,12 +1479,12 @@
|
|||||||
}
|
}
|
||||||
QR.open();
|
QR.open();
|
||||||
if (!g.REPLY) {
|
if (!g.REPLY) {
|
||||||
$('select', QR.el).value = $.x('ancestor::div[@class="thread"]', this).firstChild.id;
|
$('select', QR.el).value = $.x('ancestor::div[@class="thread"]', this).id.slice(1);
|
||||||
}
|
}
|
||||||
id = this.previousElementSibling.hash.slice(1);
|
id = this.hash.slice(2);
|
||||||
text = ">>" + id + "\n";
|
text = ">>" + id + "\n";
|
||||||
sel = window.getSelection();
|
sel = window.getSelection();
|
||||||
if ((s = sel.toString()) && id === ((_ref = $.x('ancestor-or-self::blockquote/preceding-sibling::input', sel.anchorNode)) != null ? _ref.name : void 0)) {
|
if ((s = sel.toString()) && id === ((_ref = $.x('ancestor-or-self::blockquote', sel.anchorNode)) != null ? _ref.id.slice(1) : void 0)) {
|
||||||
s = s.replace(/\n/g, '\n>');
|
s = s.replace(/\n/g, '\n>');
|
||||||
text += ">" + s + "\n";
|
text += ">" + s + "\n";
|
||||||
}
|
}
|
||||||
@ -1814,7 +1814,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
dialog: function() {
|
dialog: function() {
|
||||||
var e, fileInput, mimeTypes, name, spoiler, ta, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
|
var e, fileInput, id, mimeTypes, name, spoiler, ta, thread, threads, _i, _j, _len, _len1, _ref, _ref1;
|
||||||
QR.el = UI.dialog('qr', 'top:0;right:0;', '\
|
QR.el = UI.dialog('qr', 'top:0;right:0;', '\
|
||||||
<div class=move>\
|
<div class=move>\
|
||||||
Quick Reply <input type=checkbox id=autohide title=Auto-hide>\
|
Quick Reply <input type=checkbox id=autohide title=Auto-hide>\
|
||||||
@ -1856,10 +1856,11 @@
|
|||||||
spoiler.hidden = !QR.spoiler;
|
spoiler.hidden = !QR.spoiler;
|
||||||
if (!g.REPLY) {
|
if (!g.REPLY) {
|
||||||
threads = '<option value=new>New thread</option>';
|
threads = '<option value=new>New thread</option>';
|
||||||
_ref = $$('.op');
|
_ref = $$('.thread');
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
thread = _ref[_i];
|
thread = _ref[_i];
|
||||||
threads += "<option value=" + thread.id + ">Thread " + thread.id + "</option>";
|
id = thread.id.slice(1);
|
||||||
|
threads += "<option value=" + id + ">Thread " + id + "</option>";
|
||||||
}
|
}
|
||||||
$.prepend($('.move > span', QR.el), $.el('select', {
|
$.prepend($('.move > span', QR.el), $.el('select', {
|
||||||
innerHTML: threads,
|
innerHTML: threads,
|
||||||
|
|||||||
@ -1030,7 +1030,7 @@ QR =
|
|||||||
$.on d, 'dragstart dragend', QR.drag
|
$.on d, 'dragstart dragend', QR.drag
|
||||||
|
|
||||||
node: (post) ->
|
node: (post) ->
|
||||||
$.on $('.quotejs + .quotejs', post.el), 'click', QR.quote
|
$.on $('.postInfo > .postNum > a:last-child', post.el), 'click', QR.quote
|
||||||
|
|
||||||
open: ->
|
open: ->
|
||||||
if QR.el
|
if QR.el
|
||||||
@ -1113,14 +1113,14 @@ QR =
|
|||||||
e?.preventDefault()
|
e?.preventDefault()
|
||||||
QR.open()
|
QR.open()
|
||||||
unless g.REPLY
|
unless g.REPLY
|
||||||
$('select', QR.el).value = $.x('ancestor::div[@class="thread"]', @).firstChild.id
|
$('select', QR.el).value = $.x('ancestor::div[@class="thread"]', @).id[1..]
|
||||||
|
|
||||||
# Make sure we get the correct number, even with XXX censors
|
# Make sure we get the correct number, even with XXX censors
|
||||||
id = @previousElementSibling.hash[1..]
|
id = @hash[2..]
|
||||||
text = ">>#{id}\n"
|
text = ">>#{id}\n"
|
||||||
|
|
||||||
sel = window.getSelection()
|
sel = window.getSelection()
|
||||||
if (s = sel.toString()) and id is $.x('ancestor-or-self::blockquote/preceding-sibling::input', sel.anchorNode)?.name
|
if (s = sel.toString()) and id is $.x('ancestor-or-self::blockquote', sel.anchorNode)?.id[1..]
|
||||||
s = s.replace /\n/g, '\n>'
|
s = s.replace /\n/g, '\n>'
|
||||||
text += ">#{s}\n"
|
text += ">#{s}\n"
|
||||||
|
|
||||||
@ -1425,8 +1425,9 @@ QR =
|
|||||||
unless g.REPLY
|
unless g.REPLY
|
||||||
# Make a list with visible threads and an option to create a new one.
|
# Make a list with visible threads and an option to create a new one.
|
||||||
threads = '<option value=new>New thread</option>'
|
threads = '<option value=new>New thread</option>'
|
||||||
for thread in $$ '.op'
|
for thread in $$ '.thread'
|
||||||
threads += "<option value=#{thread.id}>Thread #{thread.id}</option>"
|
id = thread.id[1..]
|
||||||
|
threads += "<option value=#{id}>Thread #{id}</option>"
|
||||||
$.prepend $('.move > span', QR.el), $.el 'select'
|
$.prepend $('.move > span', QR.el), $.el 'select'
|
||||||
innerHTML: threads
|
innerHTML: threads
|
||||||
title: 'Create a new thread / Reply to a thread'
|
title: 'Create a new thread / Reply to a thread'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user