Fix 'undefined' highlight class for admin capcode.
This commit is contained in:
parent
0fcddef30f
commit
4ee145672c
@ -3729,7 +3729,7 @@
|
|||||||
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
|
@license: https://github.com/4chan/4chan-JS/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var a, board, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, highlight, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref;
|
var a, board, capcode, capcodeClass, capcodeStart, closed, comment, container, date, dateUTC, email, emailEnd, emailStart, ext, file, fileDims, fileHTML, fileInfo, fileSize, fileThumb, filename, flag, flagCode, flagName, href, imgSrc, isClosed, isOP, isSticky, name, postID, quote, shortFilename, staticPath, sticky, subject, threadID, tripcode, uniqueID, userID, _i, _len, _ref;
|
||||||
postID = o.postID, threadID = o.threadID, board = o.board, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file;
|
postID = o.postID, threadID = o.threadID, board = o.board, name = o.name, capcode = o.capcode, tripcode = o.tripcode, uniqueID = o.uniqueID, email = o.email, subject = o.subject, flagCode = o.flagCode, flagName = o.flagName, date = o.date, dateUTC = o.dateUTC, isSticky = o.isSticky, isClosed = o.isClosed, comment = o.comment, file = o.file;
|
||||||
isOP = postID === threadID;
|
isOP = postID === threadID;
|
||||||
staticPath = '//static.4chan.org';
|
staticPath = '//static.4chan.org';
|
||||||
@ -3744,9 +3744,6 @@
|
|||||||
switch (capcode) {
|
switch (capcode) {
|
||||||
case 'admin':
|
case 'admin':
|
||||||
case 'admin_highlight':
|
case 'admin_highlight':
|
||||||
if (capcode === 'admin_highlight') {
|
|
||||||
highlight = ' highlightPost';
|
|
||||||
}
|
|
||||||
capcodeClass = " capcodeAdmin";
|
capcodeClass = " capcodeAdmin";
|
||||||
capcodeStart = " <strong class='capcode hand id_admin'" + "title='Highlight posts by the Administrator'>## Admin</strong>";
|
capcodeStart = " <strong class='capcode hand id_admin'" + "title='Highlight posts by the Administrator'>## Admin</strong>";
|
||||||
capcode = (" <img src='" + staticPath + "/image/adminicon.gif' ") + "alt='This user is the 4chan Administrator.' " + "title='This user is the 4chan Administrator.' class=identityIcon>";
|
capcode = (" <img src='" + staticPath + "/image/adminicon.gif' ") + "alt='This user is the 4chan Administrator.' " + "title='This user is the 4chan Administrator.' class=identityIcon>";
|
||||||
@ -3762,7 +3759,6 @@
|
|||||||
capcode = (" <img src='" + staticPath + "/image/developericon.gif' ") + "alt='This user is a 4chan Developer.' " + "title='This user is a 4chan Developer.' class=identityIcon>";
|
capcode = (" <img src='" + staticPath + "/image/developericon.gif' ") + "alt='This user is a 4chan Developer.' " + "title='This user is a 4chan Developer.' class=identityIcon>";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
highlight = '';
|
|
||||||
capcodeClass = '';
|
capcodeClass = '';
|
||||||
capcodeStart = '';
|
capcodeStart = '';
|
||||||
capcode = '';
|
capcode = '';
|
||||||
@ -3834,7 +3830,7 @@
|
|||||||
container = $.el('div', {
|
container = $.el('div', {
|
||||||
id: "pc" + postID,
|
id: "pc" + postID,
|
||||||
className: "postContainer " + (isOP ? 'op' : 'reply') + "Container",
|
className: "postContainer " + (isOP ? 'op' : 'reply') + "Container",
|
||||||
innerHTML: (isOP ? '' : "<div class=sideArrows id=sa" + postID + ">>></div>") + ("<div id=p" + postID + " class='post " + (isOP ? 'op' : 'reply') + highlight + "'>") + ("<div class='postInfoM mobile' id=pim" + postID + ">") + ("<span class='nameBlock" + capcodeClass + "'>") + ("<span class=name>" + name + "</span>") + tripcode + capcodeStart + capcode + userID + flag + sticky + closed + ("<br><span class=subject>" + subject + "</span>") + ("</span><span class='dateTime postNum' data-utc=" + dateUTC + ">" + date) + '<br><em>' + ("<a href=" + ("/" + board + "/res/" + threadID + "#p" + postID) + ">No.</a>") + ("<a href='" + (g.REPLY && g.THREAD_ID === threadID ? "javascript:quote(" + postID + ")" : "/" + board + "/res/" + threadID + "#q" + postID) + "'>" + postID + "</a>") + '</em></span>' + '</div>' + (isOP ? fileHTML : '') + ("<div class='postInfo desktop' id=pi" + postID + ">") + ("<input type=checkbox name=" + postID + " value=delete> ") + ("<span class=subject>" + (subject || '') + "</span> ") + ("<span class='nameBlock" + capcodeClass + "'>") + emailStart + ("<span class=name>" + name + "</span>") + tripcode + capcodeStart + emailEnd + capcode + userID + flag + sticky + closed + ' </span> ' + ("<span class=dateTime data-utc=" + dateUTC + ">" + date + "</span> ") + "<span class='postNum desktop'>" + ("<a href=" + ("/" + board + "/res/" + threadID + "#p" + postID) + " title='Highlight this post'>No.</a>") + ("<a href='" + (g.REPLY && g.THREAD_ID === threadID ? "javascript:quote(" + postID + ")" : "/" + board + "/res/" + threadID + "#q" + postID) + "' title='Quote this post'>" + postID + "</a>") + '</span>' + '</div>' + (isOP ? '' : fileHTML) + ("<blockquote class=postMessage id=m" + postID + ">" + comment + "</blockquote> ") + '</div>'
|
innerHTML: (isOP ? '' : "<div class=sideArrows id=sa" + postID + ">>></div>") + ("<div id=p" + postID + " class='post " + (isOP ? 'op' : 'reply') + (capcode === 'admin_highlight' ? ' highlightPost' : '') + "'>") + ("<div class='postInfoM mobile' id=pim" + postID + ">") + ("<span class='nameBlock" + capcodeClass + "'>") + ("<span class=name>" + name + "</span>") + tripcode + capcodeStart + capcode + userID + flag + sticky + closed + ("<br><span class=subject>" + subject + "</span>") + ("</span><span class='dateTime postNum' data-utc=" + dateUTC + ">" + date) + '<br><em>' + ("<a href=" + ("/" + board + "/res/" + threadID + "#p" + postID) + ">No.</a>") + ("<a href='" + (g.REPLY && g.THREAD_ID === threadID ? "javascript:quote(" + postID + ")" : "/" + board + "/res/" + threadID + "#q" + postID) + "'>" + postID + "</a>") + '</em></span>' + '</div>' + (isOP ? fileHTML : '') + ("<div class='postInfo desktop' id=pi" + postID + ">") + ("<input type=checkbox name=" + postID + " value=delete> ") + ("<span class=subject>" + (subject || '') + "</span> ") + ("<span class='nameBlock" + capcodeClass + "'>") + emailStart + ("<span class=name>" + name + "</span>") + tripcode + capcodeStart + emailEnd + capcode + userID + flag + sticky + closed + ' </span> ' + ("<span class=dateTime data-utc=" + dateUTC + ">" + date + "</span> ") + "<span class='postNum desktop'>" + ("<a href=" + ("/" + board + "/res/" + threadID + "#p" + postID) + " title='Highlight this post'>No.</a>") + ("<a href='" + (g.REPLY && g.THREAD_ID === threadID ? "javascript:quote(" + postID + ")" : "/" + board + "/res/" + threadID + "#q" + postID) + "' title='Quote this post'>" + postID + "</a>") + '</span>' + '</div>' + (isOP ? '' : fileHTML) + ("<blockquote class=postMessage id=m" + postID + ">" + comment + "</blockquote> ") + '</div>'
|
||||||
});
|
});
|
||||||
_ref = $$('.quotelink', container);
|
_ref = $$('.quotelink', container);
|
||||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||||
|
|||||||
@ -2965,7 +2965,6 @@ Build =
|
|||||||
|
|
||||||
switch capcode
|
switch capcode
|
||||||
when 'admin', 'admin_highlight'
|
when 'admin', 'admin_highlight'
|
||||||
highlight = ' highlightPost' if capcode is 'admin_highlight'
|
|
||||||
capcodeClass = " capcodeAdmin"
|
capcodeClass = " capcodeAdmin"
|
||||||
capcodeStart = " <strong class='capcode hand id_admin'" +
|
capcodeStart = " <strong class='capcode hand id_admin'" +
|
||||||
"title='Highlight posts by the Administrator'>## Admin</strong>"
|
"title='Highlight posts by the Administrator'>## Admin</strong>"
|
||||||
@ -2987,7 +2986,6 @@ Build =
|
|||||||
"alt='This user is a 4chan Developer.' " +
|
"alt='This user is a 4chan Developer.' " +
|
||||||
"title='This user is a 4chan Developer.' class=identityIcon>"
|
"title='This user is a 4chan Developer.' class=identityIcon>"
|
||||||
else
|
else
|
||||||
highlight = ''
|
|
||||||
capcodeClass = ''
|
capcodeClass = ''
|
||||||
capcodeStart = ''
|
capcodeStart = ''
|
||||||
capcode = ''
|
capcode = ''
|
||||||
@ -3090,7 +3088,12 @@ Build =
|
|||||||
className: "postContainer #{if isOP then 'op' else 'reply'}Container"
|
className: "postContainer #{if isOP then 'op' else 'reply'}Container"
|
||||||
innerHTML: \
|
innerHTML: \
|
||||||
(if isOP then '' else "<div class=sideArrows id=sa#{postID}>>></div>") +
|
(if isOP then '' else "<div class=sideArrows id=sa#{postID}>>></div>") +
|
||||||
"<div id=p#{postID} class='post #{if isOP then 'op' else 'reply'}#{highlight}'>" +
|
"<div id=p#{postID} class='post #{if isOP then 'op' else 'reply'}#{
|
||||||
|
if capcode is 'admin_highlight'
|
||||||
|
' highlightPost'
|
||||||
|
else
|
||||||
|
''
|
||||||
|
}'>" +
|
||||||
|
|
||||||
"<div class='postInfoM mobile' id=pim#{postID}>" +
|
"<div class='postInfoM mobile' id=pim#{postID}>" +
|
||||||
"<span class='nameBlock#{capcodeClass}'>" +
|
"<span class='nameBlock#{capcodeClass}'>" +
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user