diff --git a/4chan_x.js b/4chan_x.js
index 9642f7ab5..4046e8ddf 100644
--- a/4chan_x.js
+++ b/4chan_x.js
@@ -59,7 +59,7 @@
*/
(function() {
- var $, $$, Favicon, NAMESPACE, Recaptcha, anonymize, config, d, expandComment, expandThread, g, imageHover, imgExpand, imgGif, imgPreloading, keybinds, localize, log, main, nav, nodeInserted, options, qr, quoteBacklink, quoteInline, quotePreview, redirect, replyHiding, reportButton, 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, quoteInline, quoteOP, 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) {
@@ -91,7 +91,8 @@
quote: {
'Quote Backlinks': [false, 'Add quote backlinks'],
'Quote Inline': [false, 'Show quoted post inline on quote click'],
- 'Quote Preview': [false, 'Show quote content on hover']
+ 'Quote Preview': [false, 'Show quote content on hover'],
+ 'Indicate OP quote': [true, 'Add \'(OP)\' to OP quotes']
},
hide: {
'Reply Hiding': [true, 'Hide single replies'],
@@ -947,7 +948,7 @@
title = conf[name][1];
checked = $.config(name) ? "checked" : "";
li = $.el('li', {
- innerHTML: ""
+ innerHTML: ""
});
_results.push($.append(id, li));
}
@@ -1890,6 +1891,25 @@
return qp.innerHTML = html;
}
};
+ quoteOP = {
+ init: function() {
+ return g.callbacks.push(quoteOP.node);
+ },
+ node: function(root) {
+ var quote, tid, _i, _len, _ref, _results;
+ if (root.className === 'inline') {
+ return;
+ }
+ tid = g.THREAD_ID || $.x('ancestor::div[@class="thread"]/div', this).id;
+ _ref = $$('a.quotelink', root);
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ quote = _ref[_i];
+ _results.push(quote.hash.slice(1) === tid ? quote.textContent += ' (OP)' : void 0);
+ }
+ return _results;
+ }
+ };
reportButton = {
init: function() {
return g.callbacks.push(reportButton.cb.node);
@@ -2351,6 +2371,9 @@
if ($.config('Quote Preview')) {
quotePreview.init();
}
+ if ($.config('Indicate OP quote')) {
+ quoteOP.init();
+ }
if ($.config('Thread Watcher')) {
watcher.init();
}
diff --git a/script.coffee b/script.coffee
index dc17fd857..2269727ec 100644
--- a/script.coffee
+++ b/script.coffee
@@ -32,6 +32,7 @@ config =
'Quote Backlinks': [false, 'Add quote backlinks']
'Quote Inline': [false, 'Show quoted post inline on quote click']
'Quote Preview': [false, 'Show quote content on hover']
+ 'Indicate OP quote': [true, 'Add \'(OP)\' to OP quotes']
hide:
'Reply Hiding': [true, 'Hide single replies']
'Thread Hiding': [true, 'Hide entire threads']
@@ -733,7 +734,7 @@ options =
title = conf[name][1]
checked = if $.config name then "checked" else ""
li = $.el 'li',
- innerHTML: ""
+ innerHTML: ""
$.append id, li
flavors: ->
@@ -1494,6 +1495,16 @@ quotePreview =
break
qp.innerHTML = html
+quoteOP =
+ init: ->
+ g.callbacks.push quoteOP.node
+ node: (root) ->
+ return if root.className is 'inline'
+ tid = g.THREAD_ID or $.x('ancestor::div[@class="thread"]/div', this).id
+ for quote in $$ 'a.quotelink', root
+ if quote.hash[1..] is tid
+ quote.textContent += ' (OP)'
+
reportButton =
init: ->
g.callbacks.push reportButton.cb.node
@@ -1825,6 +1836,9 @@ main =
if $.config 'Quote Preview'
quotePreview.init()
+ if $.config 'Indicate OP quote'
+ quoteOP.init()
+
if $.config 'Thread Watcher'
watcher.init()