Merge pull request #86 from MayhemYDG/master

Userstyling at ease
This commit is contained in:
James Campos 2011-05-12 22:26:09 -07:00
commit c68c7fcb29
2 changed files with 19 additions and 15 deletions

View File

@ -58,7 +58,7 @@
*/
(function() {
var $, $$, Favicon, NAMESPACE, Recaptcha, anonymize, config, d, expandComment, expandThread, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, localize, log, main, nav, nodeInserted, options, qr, quickReport, quoteBacklink, quotePreview, redirect, replyHiding, sauce, threadHiding, threading, titlePost, ui, unread, updater, watcher, _config, _ref;
var $, $$, Favicon, NAMESPACE, Recaptcha, anonymize, config, d, expandComment, expandThread, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, localize, log, main, nav, nodeInserted, options, qr, quoteBacklink, quotePreview, redirect, replyHiding, reportButton, sauce, threadHiding, threading, titlePost, ui, unread, updater, watcher, _config, _ref;
var __slice = Array.prototype.slice;
if (typeof console !== "undefined" && console !== null) {
log = function(arg) {
@ -83,10 +83,10 @@
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.'],
'Post in Title': [true, 'Show the op\'s post in the tab title'],
'Quick Reply': [true, 'Reply without leaving the page'],
'Quick Report': [true, 'Add quick report buttons'],
'Quote Backlinks': [false, 'Add quote backlinks'],
'Quote Preview': [false, 'Show quote content on hover'],
'Reply Hiding': [true, 'Hide single replies'],
'Report Button': [true, 'Add Report Button buttons'],
'Sauce': [true, 'Add sauce to images'],
'Show Stubs': [true, 'Of hidden threads / replies'],
'Thread Expansion': [true, 'View all replies'],
@ -607,6 +607,7 @@
if (!(dd = $('td.doubledash', root))) {
return;
}
dd.className = 'replyhider';
a = $.el('a', {
textContent: '[ - ]'
});
@ -1788,23 +1789,24 @@
return qp.innerHTML = html;
}
};
quickReport = {
reportButton = {
init: function() {
return g.callbacks.push(quickReport.cb.node);
return g.callbacks.push(reportButton.cb.node);
},
cb: {
node: function(root) {
var a, span;
span = $('span[id^=no]', root);
a = $.el('a', {
className: 'reportbutton',
innerHTML: '[ ! ]'
});
$.bind(a, 'click', quickReport.cb.report);
$.bind(a, 'click', reportButton.cb.report);
$.after(span, a);
return $.after(span, $.tn(' '));
},
report: function(e) {
return quickReport.report(this);
return reportButton.report(this);
}
},
report: function(target) {
@ -2255,8 +2257,8 @@
if ($.config('Quick Reply')) {
qr.init();
}
if ($.config('Quick Report')) {
quickReport.init();
if ($.config('Report Button')) {
reportButton.init();
}
if ($.config('Quote Backlinks')) {
quoteBacklink.init();

View File

@ -27,10 +27,10 @@ config =
'Persistent QR': [false, 'Quick reply won\'t disappear after posting. Only in replies.']
'Post in Title': [true, 'Show the op\'s post in the tab title']
'Quick Reply': [true, 'Reply without leaving the page']
'Quick Report': [true, 'Add quick report buttons']
'Quote Backlinks': [false, 'Add quote backlinks']
'Quote Preview': [false, 'Show quote content on hover']
'Reply Hiding': [true, 'Hide single replies']
'Report Button': [true, 'Add Report Button buttons']
'Sauce': [true, 'Add sauce to images']
'Show Stubs': [true, 'Of hidden threads / replies']
'Thread Expansion': [true, 'View all replies']
@ -430,6 +430,7 @@ replyHiding =
node: (root) ->
return unless dd = $ 'td.doubledash', root
dd.className = 'replyhider'
a = $.el 'a',
textContent: '[ - ]'
$.bind a, 'click', replyHiding.cb.hide
@ -1418,19 +1419,20 @@ quotePreview =
break
qp.innerHTML = html
quickReport =
reportButton =
init: ->
g.callbacks.push quickReport.cb.node
g.callbacks.push reportButton.cb.node
cb:
node: (root) ->
span = $ 'span[id^=no]', root
a = $.el 'a',
className: 'reportbutton'
innerHTML: '[ ! ]'
$.bind a, 'click', quickReport.cb.report
$.bind a, 'click', reportButton.cb.report
$.after span, a
$.after span, $.tn(' ')
report: (e) ->
quickReport.report this
reportButton.report this
report: (target) ->
input = $.x('preceding-sibling::input[1]', target)
input.click()
@ -1759,8 +1761,8 @@ main =
if $.config 'Quick Reply'
qr.init()
if $.config 'Quick Report'
quickReport.init()
if $.config 'Report Button'
reportButton.init()
if $.config 'Quote Backlinks'
quoteBacklink.init()