A bit of random cleaning.

This commit is contained in:
Nicolas Stepien 2012-02-04 20:06:51 +01:00
parent 547afd0143
commit 5bfb3d4c18
2 changed files with 17 additions and 23 deletions

View File

@ -2756,8 +2756,8 @@
quoteBacklink = {
init: function() {
var format;
format = conf['backlink'].replace(/%id/, "' + id + '");
quoteBacklink.funk = Function('id', "return'" + format + "'");
format = conf['backlink'].replace(/%id/g, "' + id + '");
quoteBacklink.funk = Function('id', "return '" + format + "'");
return g.callbacks.push(function(root) {
var a, container, el, id, link, qid, quote, quotes, _i, _len, _ref, _results;
if (/\binline\b/.test(root.className)) return;
@ -2765,7 +2765,7 @@
_ref = $$('.quotelink', root);
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
quote = _ref[_i];
if (qid = quote.hash.slice(1)) quotes[qid] = quote;
if (qid = quote.hash.slice(1)) quotes[qid] = true;
}
id = $('input', root).name;
a = $.el('a', {
@ -2775,8 +2775,9 @@
});
_results = [];
for (qid in quotes) {
if (!(el = $.id(qid))) continue;
if (el.className === 'op' && !conf['OP Backlinks']) continue;
if (!(el = $.id(qid)) || el.className === 'op' && !conf['OP Backlinks']) {
continue;
}
link = a.cloneNode(true);
if (conf['Quote Preview']) {
$.on(link, 'mouseover', quotePreview.mouseover);
@ -3178,15 +3179,11 @@
empty: 'data:image/gif;base64,R0lGODlhEAAQAJEAAAAAAP///9vb2////yH5BAEAAAMALAAAAAAQABAAAAIvnI+pq+D9DBAUoFkPFnbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
dead: 'data:image/gif;base64,R0lGODlhEAAQAKECAAAAAP8AAP///////yH5BAEKAAIALAAAAAAQABAAAAIvlI+pq+D9DAgUoFkPDlbs7lFZKIJOJJ3MyraoB14jFpOcVMpzrnF3OKlZYsMWowAAOw==',
update: function() {
var clone, favicon, l;
var favicon, l;
l = unread.replies.length;
favicon = $('link[rel="shortcut icon"]', d.head);
favicon.href = g.dead ? l ? this.unreadDead : this.dead : l ? this.unread : this["default"];
if (engine !== 'webkit') {
clone = favicon.cloneNode(true);
favicon.href = null;
return $.replace(favicon, clone);
}
if (engine !== 'webkit') return $.add(d.head, $.rm(favicon));
}
};

View File

@ -2157,26 +2157,25 @@ titlePost =
quoteBacklink =
init: ->
format = conf['backlink'].replace /%id/, "' + id + '"
quoteBacklink.funk = Function 'id', "return'#{format}'"
format = conf['backlink'].replace /%id/g, "' + id + '"
quoteBacklink.funk = Function 'id', "return '#{format}'"
g.callbacks.push (root) ->
return if /\binline\b/.test root.className
quotes = {}
for quote in $$ '.quotelink', root
#don't process >>>/b/
# Don't process >>>/b/.
if qid = quote.hash[1..]
#duplicate quotes get overwritten
quotes[qid] = quote
# op or reply
# Duplicate quotes get overwritten.
quotes[qid] = true
# OP or reply id.
id = $('input', root).name
a = $.el 'a',
href: "##{id}"
className: if root.hidden then 'filtered backlink' else 'backlink'
textContent: quoteBacklink.funk id
for qid of quotes
continue unless el = $.id qid
#don't backlink the op
continue if el.className is 'op' and !conf['OP Backlinks']
# Don't backlink the OP.
continue if !(el = $.id qid) or el.className is 'op' and !conf['OP Backlinks']
link = a.cloneNode true
if conf['Quote Preview']
$.on link, 'mouseover', quotePreview.mouseover
@ -2472,9 +2471,7 @@ Favicon =
#`favicon.href = href` isn't enough on Opera
#Opera won't always update the favicon if the href do not change
if engine isnt 'webkit'
clone = favicon.cloneNode true
favicon.href = null
$.replace favicon, clone
$.add d.head, $.rm favicon
redirect =
init: ->