Merge branch 'master' into Fx10

This commit is contained in:
Nicolas Stepien 2011-12-14 15:17:14 +01:00
commit 44c8f7c2a0
3 changed files with 18 additions and 21 deletions

View File

@ -753,7 +753,7 @@
return 5; return 5;
} }
})(); })();
table = $.x("following::br[@clear][1]/preceding::table[" + num + "]", a); table = $.x("following::br[@clear]/preceding::table[" + num + "]", a);
while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) { while ((prev = table.previousSibling) && (prev.nodeName === 'TABLE')) {
$.rm(prev); $.rm(prev);
} }
@ -1604,7 +1604,7 @@
$('iframe[name=iframe]').src = 'about:blank'; $('iframe[name=iframe]').src = 'about:blank';
fileCount = $('#files', qr.el).childElementCount; fileCount = $('#files', qr.el).childElementCount;
tc = data.textContent; tc = data.textContent;
if (tc !== "Post successful!" && !/uploaded!$/.test(tc)) { if (!/successful!|uploaded!$/.test(tc)) {
if (tc === void 0) { if (tc === void 0) {
data.textContent = "Connection error with sys.4chan.org."; data.textContent = "Connection error with sys.4chan.org.";
} }
@ -1682,7 +1682,7 @@
text = ">>" + id + "\n"; text = ">>" + id + "\n";
selection = window.getSelection(); selection = window.getSelection();
if (s = selection.toString()) { if (s = selection.toString()) {
selectionID = (_ref = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)) != null ? _ref.name : void 0; selectionID = (_ref = $.x('ancestor-or-self::blockquote/preceding-sibling::input', selection.anchorNode)) != null ? _ref.name : void 0;
if (selectionID === id) { if (selectionID === id) {
s = s.replace(/\n/g, '\n>'); s = s.replace(/\n/g, '\n>');
text += ">" + s + "\n"; text += ">" + s + "\n";
@ -2423,8 +2423,7 @@
_ref = $$('.quotelink', root); _ref = $$('.quotelink', root);
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i]; quote = _ref[_i];
if (!(qid = quote.hash.slice(1))) continue; if (qid = quote.hash.slice(1)) quotes[qid] = quote;
quotes[qid] = quote;
} }
id = $('input', root).name; id = $('input', root).name;
a = $.el('a', { a = $.el('a', {
@ -3157,10 +3156,10 @@
if (conf['Quick Reply']) qr.init(); if (conf['Quick Reply']) qr.init();
if (conf['Thread Watcher']) watcher.init(); if (conf['Thread Watcher']) watcher.init();
if (conf['Keybinds']) keybinds.init(); if (conf['Keybinds']) keybinds.init();
if (conf['Reply Navigation'] || conf['Index Navigation']) nav.init();
if (g.REPLY) { if (g.REPLY) {
if (conf['Thread Updater']) updater.init(); if (conf['Thread Updater']) updater.init();
if (conf['Thread Stats']) threadStats.init(); if (conf['Thread Stats']) threadStats.init();
if (conf['Reply Navigation']) nav.init();
if (conf['Post in Title']) titlePost.init(); if (conf['Post in Title']) titlePost.init();
if (conf['Unread Count']) unread.init(); if (conf['Unread Count']) unread.init();
if (conf['Quick Reply'] && conf['Persistent QR'] && canPost) { if (conf['Quick Reply'] && conf['Persistent QR'] && canPost) {
@ -3171,7 +3170,6 @@
if (conf['Thread Hiding']) threadHiding.init(); if (conf['Thread Hiding']) threadHiding.init();
if (conf['Thread Expansion']) expandThread.init(); if (conf['Thread Expansion']) expandThread.init();
if (conf['Comment Expansion']) expandComment.init(); if (conf['Comment Expansion']) expandComment.init();
if (conf['Index Navigation']) nav.init();
} }
nodes = $$('.op, a + table'); nodes = $$('.op, a + table');
_ref = g.callbacks; _ref = g.callbacks;

View File

@ -1,4 +1,6 @@
master master
- mayhem
fix selection to quote when selecting started from the end of a line on Firefox
2.23.4 2.23.4
- mayhem - mayhem

View File

@ -538,7 +538,7 @@ expandThread =
when 'b' then 3 when 'b' then 3
when 't' then 1 when 't' then 1
else 5 else 5
table = $.x "following::br[@clear][1]/preceding::table[#{num}]", a table = $.x "following::br[@clear]/preceding::table[#{num}]", a
while (prev = table.previousSibling) and (prev.nodeName is 'TABLE') while (prev = table.previousSibling) and (prev.nodeName is 'TABLE')
$.rm prev $.rm prev
for backlink in $$ '.op a.backlink' for backlink in $$ '.op a.backlink'
@ -1246,7 +1246,7 @@ qr =
fileCount = $('#files', qr.el).childElementCount fileCount = $('#files', qr.el).childElementCount
tc = data.textContent tc = data.textContent
if tc isnt "Post successful!" and not /uploaded!$/.test tc # error message unless /successful!|uploaded!$/.test tc # error message, not a successful post
if tc is undefined if tc is undefined
data.textContent = "Connection error with sys.4chan.org." data.textContent = "Connection error with sys.4chan.org."
$.extend $('#error', qr.el), data $.extend $('#error', qr.el), data
@ -1321,7 +1321,7 @@ qr =
selection = window.getSelection() selection = window.getSelection()
if s = selection.toString() if s = selection.toString()
selectionID = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)?.name selectionID = $.x('ancestor-or-self::blockquote/preceding-sibling::input', selection.anchorNode)?.name
if selectionID is id if selectionID is id
s = s.replace /\n/g, '\n>' s = s.replace /\n/g, '\n>'
text += ">#{s}\n" text += ">#{s}\n"
@ -1927,9 +1927,9 @@ quoteBacklink =
quotes = {} quotes = {}
for quote in $$ '.quotelink', root for quote in $$ '.quotelink', root
#don't process >>>/b/ #don't process >>>/b/
continue unless qid = quote.hash[1..] if qid = quote.hash[1..]
#duplicate quotes get overwritten #duplicate quotes get overwritten
quotes[qid] = quote quotes[qid] = quote
# op or reply # op or reply
id = $('input', root).name id = $('input', root).name
a = $.el 'a', a = $.el 'a',
@ -2009,7 +2009,7 @@ quoteInline =
body = $.el 'body', body = $.el 'body',
innerHTML: req.responseText innerHTML: req.responseText
if id == threadID #OP if id is threadID #OP
op = threading.op $('body > form', body).firstChild op = threading.op $('body > form', body).firstChild
html = op.innerHTML html = op.innerHTML
else else
@ -2074,7 +2074,7 @@ quotePreview =
body = $.el 'body', body = $.el 'body',
innerHTML: req.responseText innerHTML: req.responseText
if id == threadID #OP if id is threadID #OP
op = threading.op $('body > form', body).firstChild op = threading.op $('body > form', body).firstChild
html = op.innerHTML html = op.innerHTML
else else
@ -2509,6 +2509,9 @@ Main =
if conf['Keybinds'] if conf['Keybinds']
keybinds.init() keybinds.init()
if conf['Reply Navigation'] or conf['Index Navigation']
nav.init()
if g.REPLY if g.REPLY
if conf['Thread Updater'] if conf['Thread Updater']
updater.init() updater.init()
@ -2516,9 +2519,6 @@ Main =
if conf['Thread Stats'] if conf['Thread Stats']
threadStats.init() threadStats.init()
if conf['Reply Navigation']
nav.init()
if conf['Post in Title'] if conf['Post in Title']
titlePost.init() titlePost.init()
@ -2540,9 +2540,6 @@ Main =
if conf['Comment Expansion'] if conf['Comment Expansion']
expandComment.init() expandComment.init()
if conf['Index Navigation']
nav.init()
nodes = $$ '.op, a + table' nodes = $$ '.op, a + table'
for callback in g.callbacks for callback in g.callbacks