post.id -> post.ID, post.threadId -> post.threadID

This commit is contained in:
Nicolas Stepien 2012-06-17 22:05:45 +02:00
parent eefcf6b096
commit 1a078f6a0e
2 changed files with 22 additions and 22 deletions

View File

@ -613,7 +613,7 @@
if (post.isInlined) { if (post.isInlined) {
return; return;
} }
isOP = post.id === post.threadId; isOP = post.ID === post.threadID;
root = post.root; root = post.root;
for (key in Filter.filters) { for (key in Filter.filters) {
value = Filter[key](post); value = Filter[key](post);
@ -787,7 +787,7 @@
} }
post = { post = {
blockquote: node, blockquote: node,
threadId: threadID, threadID: threadID,
quotes: quotes, quotes: quotes,
backlinks: [] backlinks: []
}; };
@ -1007,7 +1007,7 @@
$.addClass(side, 'hide_reply_button'); $.addClass(side, 'hide_reply_button');
side.innerHTML = '<a href="javascript:;"><span>[ - ]</span></a>'; side.innerHTML = '<a href="javascript:;"><span>[ - ]</span></a>';
$.on(side.firstChild, 'click', ReplyHiding.toggle); $.on(side.firstChild, 'click', ReplyHiding.toggle);
if (post.id in g.hiddenReplies) { if (post.ID in g.hiddenReplies) {
return ReplyHiding.hide(post.root); return ReplyHiding.hide(post.root);
} }
}, },
@ -3361,9 +3361,9 @@
} }
} }
a = $.el('a', { a = $.el('a', {
href: "#p" + post.id, href: "#p" + post.ID,
className: post.el.hidden ? 'filtered backlink' : 'backlink', className: post.el.hidden ? 'filtered backlink' : 'backlink',
textContent: QuoteBacklink.funk(post.id) textContent: QuoteBacklink.funk(post.ID)
}); });
for (qid in quotes) { for (qid in quotes) {
if (!(el = $.id("pi" + qid)) || !Conf['OP Backlinks'] && /\bop\b/.test(el.parentNode.className)) { if (!(el = $.id("pi" + qid)) || !Conf['OP Backlinks'] && /\bop\b/.test(el.parentNode.className)) {
@ -3376,7 +3376,7 @@
if (Conf['Quote Inline']) { if (Conf['Quote Inline']) {
$.on(link, 'click', QuoteInline.toggle); $.on(link, 'click', QuoteInline.toggle);
} else { } else {
link.setAttribute('onclick', "replyhl('" + post.id + "');"); link.setAttribute('onclick', "replyhl('" + post.ID + "');");
} }
if (!(container = $.id("blc" + qid))) { if (!(container = $.id("blc" + qid))) {
container = $.el('span', { container = $.el('span', {
@ -3610,7 +3610,7 @@
_ref = post.quotes; _ref = post.quotes;
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 (quote.hash.slice(2) === post.threadId) { if (quote.hash.slice(2) === post.threadID) {
$.add(quote, $.tn('\u00A0(OP)')); $.add(quote, $.tn('\u00A0(OP)'));
} }
} }
@ -3633,7 +3633,7 @@
continue; continue;
} }
path = quote.pathname.split('/'); path = quote.pathname.split('/');
if (path[1] === g.BOARD && path[3] !== post.threadId) { if (path[1] === g.BOARD && path[3] !== post.threadID) {
$.add(quote, $.tn('\u00A0(Cross-thread)')); $.add(quote, $.tn('\u00A0(Cross-thread)'));
} }
} }
@ -3834,7 +3834,7 @@
foresee: [], foresee: [],
node: function(post) { node: function(post) {
var count, el, index; var count, el, index;
if ((index = Unread.foresee.indexOf(post.id)) !== -1) { if ((index = Unread.foresee.indexOf(post.ID)) !== -1) {
Unread.foresee.splice(index, 1); Unread.foresee.splice(index, 1);
return; return;
} }
@ -4580,8 +4580,8 @@
root: node, root: node,
el: el, el: el,
"class": el.className, "class": el.className,
id: el.id.match(/\d+$/)[0], ID: el.id.match(/\d+$/)[0],
threadId: g.THREAD_ID || $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0], threadID: g.THREAD_ID || $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0],
isArchived: /\barchivedPost\b/.test(parentClass), isArchived: /\barchivedPost\b/.test(parentClass),
isInlined: /\binline\b/.test(parentClass), isInlined: /\binline\b/.test(parentClass),
isCrosspost: /\bcrosspost\b/.test(parentClass), isCrosspost: /\bcrosspost\b/.test(parentClass),

View File

@ -490,7 +490,7 @@ Filter =
node: (post) -> node: (post) ->
return if post.isInlined return if post.isInlined
isOP = post.id is post.threadId isOP = post.ID is post.threadID
{root} = post {root} = post
for key of Filter.filters for key of Filter.filters
value = Filter[key] post value = Filter[key] post
@ -613,7 +613,7 @@ ExpandComment =
quote.href = "res/#{href}" # Fix pathnames quote.href = "res/#{href}" # Fix pathnames
post = post =
blockquote: node blockquote: node
threadId: threadID threadID: threadID
quotes: quotes quotes: quotes
backlinks: [] backlinks: []
if Conf['Resurrect Quotes'] if Conf['Resurrect Quotes']
@ -769,7 +769,7 @@ ReplyHiding =
side.innerHTML = '<a href="javascript:;"><span>[ - ]</span></a>' side.innerHTML = '<a href="javascript:;"><span>[ - ]</span></a>'
$.on side.firstChild, 'click', ReplyHiding.toggle $.on side.firstChild, 'click', ReplyHiding.toggle
if post.id of g.hiddenReplies if post.ID of g.hiddenReplies
ReplyHiding.hide post.root ReplyHiding.hide post.root
toggle: -> toggle: ->
@ -2623,9 +2623,9 @@ QuoteBacklink =
# Duplicate quotes get overwritten. # Duplicate quotes get overwritten.
quotes[qid] = true quotes[qid] = true
a = $.el 'a', a = $.el 'a',
href: "#p#{post.id}" href: "#p#{post.ID}"
className: if post.el.hidden then 'filtered backlink' else 'backlink' className: if post.el.hidden then 'filtered backlink' else 'backlink'
textContent: QuoteBacklink.funk post.id textContent: QuoteBacklink.funk post.ID
for qid of quotes for qid of quotes
# Don't backlink the OP. # Don't backlink the OP.
continue if !(el = $.id "pi#{qid}") or !Conf['OP Backlinks'] and /\bop\b/.test el.parentNode.className continue if !(el = $.id "pi#{qid}") or !Conf['OP Backlinks'] and /\bop\b/.test el.parentNode.className
@ -2635,7 +2635,7 @@ QuoteBacklink =
if Conf['Quote Inline'] if Conf['Quote Inline']
$.on link, 'click', QuoteInline.toggle $.on link, 'click', QuoteInline.toggle
else else
link.setAttribute 'onclick', "replyhl('#{post.id}');" link.setAttribute 'onclick', "replyhl('#{post.ID}');"
unless container = $.id "blc#{qid}" unless container = $.id "blc#{qid}"
container = $.el 'span', container = $.el 'span',
className: 'container' className: 'container'
@ -2801,7 +2801,7 @@ QuoteOP =
node: (post) -> node: (post) ->
return if post.isInlined and not post.isCrosspost return if post.isInlined and not post.isCrosspost
for quote in post.quotes for quote in post.quotes
if quote.hash[2..] is post.threadId if quote.hash[2..] is post.threadID
# \u00A0 is nbsp # \u00A0 is nbsp
$.add quote, $.tn '\u00A0(OP)' $.add quote, $.tn '\u00A0(OP)'
return return
@ -2817,7 +2817,7 @@ QuoteCT =
continue continue
path = quote.pathname.split '/' path = quote.pathname.split '/'
# If quote leads to a different thread id and is located on the same board. # If quote leads to a different thread id and is located on the same board.
if path[1] is g.BOARD and path[3] isnt post.threadId if path[1] is g.BOARD and path[3] isnt post.threadID
# \u00A0 is nbsp # \u00A0 is nbsp
$.add quote, $.tn '\u00A0(Cross-thread)' $.add quote, $.tn '\u00A0(Cross-thread)'
return return
@ -2986,7 +2986,7 @@ Unread =
foresee: [] foresee: []
node: (post) -> node: (post) ->
if (index = Unread.foresee.indexOf post.id) isnt -1 if (index = Unread.foresee.indexOf post.ID) isnt -1
Unread.foresee.splice index, 1 Unread.foresee.splice index, 1
return return
{el} = post {el} = post
@ -3553,8 +3553,8 @@ Main =
root: node root: node
el: el el: el
class: el.className class: el.className
id: el.id.match(/\d+$/)[0] ID: el.id.match(/\d+$/)[0]
threadId: g.THREAD_ID or $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0] threadID: g.THREAD_ID or $.x('ancestor::div[parent::div[@class="board"]]', node).id.match(/\d+$/)[0]
isArchived: /\barchivedPost\b/.test parentClass isArchived: /\barchivedPost\b/.test parentClass
isInlined: /\binline\b/.test parentClass isInlined: /\binline\b/.test parentClass
isCrosspost: /\bcrosspost\b/.test parentClass isCrosspost: /\bcrosspost\b/.test parentClass