diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index b95a2ab15..055d303ea 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -984,33 +984,30 @@ }; Post.prototype.parseQuotes = function() { - var hash, pathname, quotelink, quotes, _i, _len, _ref; + var quotelink, _i, _len, _ref; - quotes = {}; + this.quotes = []; _ref = $$('.quotelink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quotelink = _ref[_i]; - hash = quotelink.hash; - if (!hash) { - continue; - } - pathname = quotelink.pathname; - if (/catalog$/.test(pathname)) { - continue; - } - if (quotelink.hostname !== 'boards.4chan.org') { - continue; - } - this.nodes.quotelinks.push(quotelink); - if (!this.isReply && $.hasClass(quotelink.parentNode.parentNode, 'capcodeReplies')) { - continue; - } - quotes["" + (pathname.split('/')[1]) + "." + hash.slice(2)] = true; + this.parseQuote(quotelink); } - if (this.isClone) { + }; + + Post.prototype.parseQuote = function(quotelink) { + var fullID, match; + + if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) { return; } - return this.quotes = Object.keys(quotes); + this.nodes.quotelinks.push(quotelink); + if (this.isClone || !this.isReply && $.hasClass(quotelink.parentNode.parentNode, 'capcodeReplies')) { + return; + } + fullID = "" + match[1] + "." + match[2]; + if (this.quotes.indexOf(fullID) === -1) { + return this.quotes.push(fullID); + } }; Post.prototype.parseFile = function(that) { diff --git a/builds/crx/script.js b/builds/crx/script.js index b84693fc8..16b927adf 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -990,33 +990,30 @@ }; Post.prototype.parseQuotes = function() { - var hash, pathname, quotelink, quotes, _i, _len, _ref; + var quotelink, _i, _len, _ref; - quotes = {}; + this.quotes = []; _ref = $$('.quotelink', this.nodes.comment); for (_i = 0, _len = _ref.length; _i < _len; _i++) { quotelink = _ref[_i]; - hash = quotelink.hash; - if (!hash) { - continue; - } - pathname = quotelink.pathname; - if (/catalog$/.test(pathname)) { - continue; - } - if (quotelink.hostname !== 'boards.4chan.org') { - continue; - } - this.nodes.quotelinks.push(quotelink); - if (!this.isReply && $.hasClass(quotelink.parentNode.parentNode, 'capcodeReplies')) { - continue; - } - quotes["" + (pathname.split('/')[1]) + "." + hash.slice(2)] = true; + this.parseQuote(quotelink); } - if (this.isClone) { + }; + + Post.prototype.parseQuote = function(quotelink) { + var fullID, match; + + if (!(match = quotelink.href.match(/boards\.4chan\.org\/([^\/]+)\/res\/\d+#p(\d+)$/))) { return; } - return this.quotes = Object.keys(quotes); + this.nodes.quotelinks.push(quotelink); + if (this.isClone || !this.isReply && $.hasClass(quotelink.parentNode.parentNode, 'capcodeReplies')) { + return; + } + fullID = "" + match[1] + "." + match[2]; + if (this.quotes.indexOf(fullID) === -1) { + return this.quotes.push(fullID); + } }; Post.prototype.parseFile = function(that) { diff --git a/html/Monitoring/ThreadStats.html b/html/Monitoring/ThreadStats.html deleted file mode 100644 index f6d932e43..000000000 --- a/html/Monitoring/ThreadStats.html +++ /dev/null @@ -1,3 +0,0 @@ -
- ... / ... / ... -
diff --git a/html/Posting/QR.html b/html/Posting/QR.html deleted file mode 100644 index b34fb36b3..000000000 --- a/html/Posting/QR.html +++ /dev/null @@ -1,38 +0,0 @@ -
- - - - × -
-
-
- - - - -
-
-
- + -
-
- - -
-
- - - - No selected file - - - × - -
- -
- - - diff --git a/src/General/lib/post.class b/src/General/lib/post.class index d823a8f93..a90cf6ce9 100644 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -83,29 +83,34 @@ class Post @info.comment = text.join('').trim().replace /\s+$/gm, '' parseQuotes: -> - quotes = {} + @quotes = [] for quotelink in $$ '.quotelink', @nodes.comment - # Don't add board links. (>>>/b/) - {hash} = quotelink - continue unless hash + @parseQuote quotelink + return + + parseQuote: (quotelink) -> + # Only add quotes that link to posts on an imageboard. + # Don't add: + # - board links. (>>>/b/) + # - catalog links. (>>>/b/catalog or >>>/b/search) + # - rules links. (>>>/a/rules) + # - text-board quotelinks. (>>>/img/1234) + return unless match = quotelink.href.match /// + boards\.4chan\.org/ + ([^/]+) # boardID + /res/\d+#p + (\d+) # postID + $ + /// - # Don't add catalog links. (>>>/b/catalog or >>>/b/search) - {pathname} = quotelink - continue if /catalog$/.test pathname + @nodes.quotelinks.push quotelink - # Don't add rules links. (>>>/a/rules) - # Don't add text-board quotelinks. (>>>/img/1234) - continue if quotelink.hostname isnt 'boards.4chan.org' - - @nodes.quotelinks.push quotelink - - # Don't count capcode replies as quotes in OPs. (Admin/Mod/Dev Replies: ...) - continue if !@isReply and $.hasClass quotelink.parentNode.parentNode, 'capcodeReplies' - - # Basically, only add quotes that link to posts on an imageboard. - quotes["#{pathname.split('/')[1]}.#{hash[2..]}"] = true - return if @isClone - @quotes = Object.keys quotes + # Don't count capcode replies as quotes in OPs. (Admin/Mod/Dev Replies: ...) + return if @isClone or !@isReply and $.hasClass quotelink.parentNode.parentNode, 'capcodeReplies' + + # ES6 Set when? + fullID = "#{match[1]}.#{match[2]}" + @quotes.push fullID if @quotes.indexOf(fullID) is -1 parseFile: (that) -> return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl