diff --git a/CHANGELOG.md b/CHANGELOG.md index 70d981116..d456d6545 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's wor The links to individual versions below are to copies of the script with the update URL removed. If you want automatic updates, install the script from the links on the [main page](https://github.com/ccd0/4chan-x). +### v1.10.9 + +**v1.10.9.0** *(2015-04-15)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.9.0/builds/4chan-X-noupdate.crx "Chromium version")] +- Based on v1.10.8.10. +- Support reporting posts to fgts archive. +- Add capcode to archive search menu. + ### v1.10.8 **v1.10.8.10** *(2015-04-13)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.8.10/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.8.10/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 0aa8adce8..3a3eda523 100644 Binary files a/builds/4chan-X-beta.crx and b/builds/4chan-X-beta.crx differ diff --git a/builds/4chan-X-beta.meta.js b/builds/4chan-X-beta.meta.js index ae8e67bf0..426249235 100644 --- a/builds/4chan-X-beta.meta.js +++ b/builds/4chan-X-beta.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @version 1.10.8.10 +// @version 1.10.9.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X-beta.user.js b/builds/4chan-X-beta.user.js index ec3a6db7e..5f36a0de2 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X beta -// @version 1.10.8.10 +// @version 1.10.9.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -109,7 +109,7 @@ 'use strict'; (function() { - var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, + var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, slice = [].slice, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, @@ -127,6 +127,7 @@ 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'], '404 Redirect': [true, 'Redirect dead threads and images to the archives.'], + 'Archive Report': [true, 'Enable reporting posts to supported archives.'], 'Except Archives from Encryption': [false, 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'], 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], 'Time Formatting': [true, 'Localize and format timestamps.'], @@ -396,7 +397,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.8.10', + VERSION: '1.10.9.0', NAMESPACE: '4chan X.', boards: {} }; @@ -5070,18 +5071,18 @@ }, node: function() { var filter, k, key, len1, ref, ref1, result, value; - if (this.isClone || this.isFetchedQuote) { + if (this.isClone) { return; } for (key in Filter.filters) { - if ((value = Filter[key](this)) !== false) { + if ((value = Filter[key](this)) != null) { ref = Filter.filters[key]; for (k = 0, len1 = ref.length; k < len1; k++) { filter = ref[k]; if (!(result = filter(value, this.isReply))) { continue; } - if (result.hide) { + if (result.hide && !this.isFetchedQuote) { if (this.isReply) { PostHiding.hide(this, result.stub); } else if (g.VIEW === 'index') { @@ -5103,73 +5104,41 @@ } }, name: function(post) { - if ('name' in post.info) { - return post.info.name; - } - return false; + return post.info.name; }, uniqueID: function(post) { - if ('uniqueID' in post.info) { - return post.info.uniqueID; - } - return false; + return post.info.uniqueID; }, tripcode: function(post) { - if ('tripcode' in post.info) { - return post.info.tripcode; - } - return false; + return post.info.tripcode; }, capcode: function(post) { - if ('capcode' in post.info) { - return post.info.capcode; - } - return false; + return post.info.capcode; }, subject: function(post) { - if ('subject' in post.info) { - return post.info.subject || false; - } - return false; + return post.info.subject || void 0; }, comment: function(post) { - if ('comment' in post.info) { - return post.info.comment; - } - return false; + return post.info.comment; }, flag: function(post) { - if ('flag' in post.info) { - return post.info.flag; - } - return false; + return post.info.flag; }, filename: function(post) { - if (post.file) { - return post.file.name; - } - return false; + var ref; + return (ref = post.file) != null ? ref.name : void 0; }, dimensions: function(post) { - var file; - file = post.file; - if (file != null ? file.dimensions : void 0) { - return file.dimensions; - } - return false; + var ref; + return (ref = post.file) != null ? ref.dimensions : void 0; }, filesize: function(post) { - if (post.file) { - return post.file.size; - } - return false; + var ref; + return (ref = post.file) != null ? ref.size : void 0; }, MD5: function(post) { var ref; - if ((ref = post.file) != null ? ref.MD5 : void 0) { - return post.file.MD5; - } - return false; + return (ref = post.file) != null ? ref.MD5 : void 0; }, menu: { init: function() { @@ -5209,7 +5178,7 @@ open: function(post) { var value; value = Filter[type](post); - return value !== false; + return value != null; } }; }, @@ -11444,7 +11413,7 @@ }, subEntries: [] }; - ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; for (k = 0, len1 = ref1.length; k < len1; k++) { type = ref1[k]; entry.subEntries.push(this.createSubEntry(type[0], type[1])); @@ -11711,17 +11680,19 @@ el: a, order: 10, open: function(post) { - ReportLink.post = post; - return !post.isDead; + ReportLink.url = !post.isDead ? "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post : Conf['Archive Report'] ? Redirect.to('report', { + boardID: post.board.ID, + postID: post.ID + }) : void 0; + return !!ReportLink.url; } }); }, report: function() { - var id, post, set, url; - post = ReportLink.post; - url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; + var id, set, url; + url = ReportLink.url; id = Date.now(); - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=285"; + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=320"; return window.open(url, id, set); } }; @@ -13414,7 +13385,8 @@ o = { thread: {}, post: {}, - file: {} + file: {}, + report: {} }; archives = {}; ref = Redirect.archives; @@ -13424,17 +13396,19 @@ archives[name] = data; for (q = 0, len2 = boards.length; q < len2; q++) { boardID = boards[q]; - if (!(!withCredentials)) { - continue; + if (!withCredentials) { + if (!(boardID in o.thread)) { + o.thread[boardID] = data; + } + if (!(boardID in o.post || software !== 'foolfuuka')) { + o.post[boardID] = data; + } + if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { + o.file[boardID] = data; + } } - if (!(boardID in o.thread)) { - o.thread[boardID] = data; - } - if (!(boardID in o.post || software !== 'foolfuuka')) { - o.post[boardID] = data; - } - if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { - o.file[boardID] = data; + if (name === 'fgts') { + o.report[boardID] = data; } } } @@ -13509,10 +13483,20 @@ var boardID, path, type, value; boardID = arg.boardID, type = arg.type, value = arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; + if (type === 'capcode') { + value = { + 'Developer': 'dev' + }[value] || value.toLowerCase(); + } value = encodeURIComponent(value); path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value : boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; }, + report: function(archive, arg) { + var boardID, postID; + boardID = arg.boardID, postID = arg.postID; + return "https://so.fgts.jp/report/?board=" + boardID + "&no=" + postID; + }, securityCheck: function(URL) { return /^https:\/\//.test(URL) || location.protocol === 'http:' || Conf['Except Archives from Encryption']; }, @@ -15232,6 +15216,38 @@ } }; + Report = { + init: function() { + var match, postID; + if (!(Conf['Archive Report'] && /\bmode=report\b/.test(location.search))) { + return; + } + if (!(match = location.search.match(/\bno=(\d+)/))) { + return; + } + postID = +match[1]; + Redirect.init(); + if (this.archive = Redirect.to('report', { + boardID: g.BOARD.ID, + postID: postID + })) { + return $.ready(this.ready); + } + }, + ready: function() { + var link, message; + if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { + location.replace(Report.archive); + return; + } + link = $.el('a', { + href: Report.archive, + textContent: 'Report to fgts' + }); + return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + } + }; + Time = { init: function() { var ref; @@ -16100,6 +16116,7 @@ case 'a.4cdn.org': return; case 'sys.4chan.org': + Report.init(); if (g.VIEW === 'post') { PostSuccessful.init(); } diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 72343fe48..92fe3ae94 100644 Binary files a/builds/4chan-X-noupdate.crx and b/builds/4chan-X-noupdate.crx differ diff --git a/builds/4chan-X-noupdate.user.js b/builds/4chan-X-noupdate.user.js index 688559074..3d04e8eac 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.10.8.10 +// @version 1.10.9.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -108,7 +108,7 @@ 'use strict'; (function() { - var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, + var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, slice = [].slice, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, @@ -126,6 +126,7 @@ 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'], '404 Redirect': [true, 'Redirect dead threads and images to the archives.'], + 'Archive Report': [true, 'Enable reporting posts to supported archives.'], 'Except Archives from Encryption': [false, 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'], 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], 'Time Formatting': [true, 'Localize and format timestamps.'], @@ -395,7 +396,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.8.10', + VERSION: '1.10.9.0', NAMESPACE: '4chan X.', boards: {} }; @@ -5069,18 +5070,18 @@ }, node: function() { var filter, k, key, len1, ref, ref1, result, value; - if (this.isClone || this.isFetchedQuote) { + if (this.isClone) { return; } for (key in Filter.filters) { - if ((value = Filter[key](this)) !== false) { + if ((value = Filter[key](this)) != null) { ref = Filter.filters[key]; for (k = 0, len1 = ref.length; k < len1; k++) { filter = ref[k]; if (!(result = filter(value, this.isReply))) { continue; } - if (result.hide) { + if (result.hide && !this.isFetchedQuote) { if (this.isReply) { PostHiding.hide(this, result.stub); } else if (g.VIEW === 'index') { @@ -5102,73 +5103,41 @@ } }, name: function(post) { - if ('name' in post.info) { - return post.info.name; - } - return false; + return post.info.name; }, uniqueID: function(post) { - if ('uniqueID' in post.info) { - return post.info.uniqueID; - } - return false; + return post.info.uniqueID; }, tripcode: function(post) { - if ('tripcode' in post.info) { - return post.info.tripcode; - } - return false; + return post.info.tripcode; }, capcode: function(post) { - if ('capcode' in post.info) { - return post.info.capcode; - } - return false; + return post.info.capcode; }, subject: function(post) { - if ('subject' in post.info) { - return post.info.subject || false; - } - return false; + return post.info.subject || void 0; }, comment: function(post) { - if ('comment' in post.info) { - return post.info.comment; - } - return false; + return post.info.comment; }, flag: function(post) { - if ('flag' in post.info) { - return post.info.flag; - } - return false; + return post.info.flag; }, filename: function(post) { - if (post.file) { - return post.file.name; - } - return false; + var ref; + return (ref = post.file) != null ? ref.name : void 0; }, dimensions: function(post) { - var file; - file = post.file; - if (file != null ? file.dimensions : void 0) { - return file.dimensions; - } - return false; + var ref; + return (ref = post.file) != null ? ref.dimensions : void 0; }, filesize: function(post) { - if (post.file) { - return post.file.size; - } - return false; + var ref; + return (ref = post.file) != null ? ref.size : void 0; }, MD5: function(post) { var ref; - if ((ref = post.file) != null ? ref.MD5 : void 0) { - return post.file.MD5; - } - return false; + return (ref = post.file) != null ? ref.MD5 : void 0; }, menu: { init: function() { @@ -5208,7 +5177,7 @@ open: function(post) { var value; value = Filter[type](post); - return value !== false; + return value != null; } }; }, @@ -11443,7 +11412,7 @@ }, subEntries: [] }; - ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; for (k = 0, len1 = ref1.length; k < len1; k++) { type = ref1[k]; entry.subEntries.push(this.createSubEntry(type[0], type[1])); @@ -11710,17 +11679,19 @@ el: a, order: 10, open: function(post) { - ReportLink.post = post; - return !post.isDead; + ReportLink.url = !post.isDead ? "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post : Conf['Archive Report'] ? Redirect.to('report', { + boardID: post.board.ID, + postID: post.ID + }) : void 0; + return !!ReportLink.url; } }); }, report: function() { - var id, post, set, url; - post = ReportLink.post; - url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; + var id, set, url; + url = ReportLink.url; id = Date.now(); - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=285"; + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=320"; return window.open(url, id, set); } }; @@ -13413,7 +13384,8 @@ o = { thread: {}, post: {}, - file: {} + file: {}, + report: {} }; archives = {}; ref = Redirect.archives; @@ -13423,17 +13395,19 @@ archives[name] = data; for (q = 0, len2 = boards.length; q < len2; q++) { boardID = boards[q]; - if (!(!withCredentials)) { - continue; + if (!withCredentials) { + if (!(boardID in o.thread)) { + o.thread[boardID] = data; + } + if (!(boardID in o.post || software !== 'foolfuuka')) { + o.post[boardID] = data; + } + if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { + o.file[boardID] = data; + } } - if (!(boardID in o.thread)) { - o.thread[boardID] = data; - } - if (!(boardID in o.post || software !== 'foolfuuka')) { - o.post[boardID] = data; - } - if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { - o.file[boardID] = data; + if (name === 'fgts') { + o.report[boardID] = data; } } } @@ -13508,10 +13482,20 @@ var boardID, path, type, value; boardID = arg.boardID, type = arg.type, value = arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; + if (type === 'capcode') { + value = { + 'Developer': 'dev' + }[value] || value.toLowerCase(); + } value = encodeURIComponent(value); path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value : boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; }, + report: function(archive, arg) { + var boardID, postID; + boardID = arg.boardID, postID = arg.postID; + return "https://so.fgts.jp/report/?board=" + boardID + "&no=" + postID; + }, securityCheck: function(URL) { return /^https:\/\//.test(URL) || location.protocol === 'http:' || Conf['Except Archives from Encryption']; }, @@ -15231,6 +15215,38 @@ } }; + Report = { + init: function() { + var match, postID; + if (!(Conf['Archive Report'] && /\bmode=report\b/.test(location.search))) { + return; + } + if (!(match = location.search.match(/\bno=(\d+)/))) { + return; + } + postID = +match[1]; + Redirect.init(); + if (this.archive = Redirect.to('report', { + boardID: g.BOARD.ID, + postID: postID + })) { + return $.ready(this.ready); + } + }, + ready: function() { + var link, message; + if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { + location.replace(Report.archive); + return; + } + link = $.el('a', { + href: Report.archive, + textContent: 'Report to fgts' + }); + return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + } + }; + Time = { init: function() { var ref; @@ -16099,6 +16115,7 @@ case 'a.4cdn.org': return; case 'sys.4chan.org': + Report.init(); if (g.VIEW === 'post') { PostSuccessful.init(); } diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 2f7f5e1ce..52f0a850e 100644 Binary files a/builds/4chan-X.crx and b/builds/4chan-X.crx differ diff --git a/builds/4chan-X.meta.js b/builds/4chan-X.meta.js index 20a800ebf..8ba22cf75 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.10.8.10 +// @version 1.10.9.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 9f6db8a86..b0bf05124 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.10.8.10 +// @version 1.10.9.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -109,7 +109,7 @@ 'use strict'; (function() { - var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, + var $, $$, Anonymize, AntiAutoplay, ArchiveLink, Banner, Board, Build, Callbacks, Captcha, CatalogLinks, CatalogThread, Clone, Conf, Config, Connection, CrossOrigin, CustomCSS, DataBoard, DeleteLink, DownloadLink, E, Embedding, ExpandComment, ExpandThread, FappeTyme, Favicon, Fetcher, FileInfo, Filter, Flash, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, PostSuccessful, QR, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, QuoteStrikeThrough, QuoteThreading, QuoteYou, Quotify, RandomAccessList, Recursive, Redirect, RelativeDates, RemoveSpoilers, Report, ReportLink, RevealSpoilers, Sauce, Settings, ShimSet, SimpleDict, Thread, ThreadExcerpt, ThreadHiding, ThreadStats, ThreadUpdater, ThreadWatcher, Time, UI, Unread, Volume, c, d, doc, g, slice = [].slice, indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, @@ -127,6 +127,7 @@ 'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'], 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'], '404 Redirect': [true, 'Redirect dead threads and images to the archives.'], + 'Archive Report': [true, 'Enable reporting posts to supported archives.'], 'Except Archives from Encryption': [false, 'Permit loading content from, and warningless redirects to, HTTP-only archives from HTTPS pages.'], 'Keybinds': [true, 'Bind actions to keyboard shortcuts.'], 'Time Formatting': [true, 'Localize and format timestamps.'], @@ -396,7 +397,7 @@ doc = d.documentElement; g = { - VERSION: '1.10.8.10', + VERSION: '1.10.9.0', NAMESPACE: '4chan X.', boards: {} }; @@ -5070,18 +5071,18 @@ }, node: function() { var filter, k, key, len1, ref, ref1, result, value; - if (this.isClone || this.isFetchedQuote) { + if (this.isClone) { return; } for (key in Filter.filters) { - if ((value = Filter[key](this)) !== false) { + if ((value = Filter[key](this)) != null) { ref = Filter.filters[key]; for (k = 0, len1 = ref.length; k < len1; k++) { filter = ref[k]; if (!(result = filter(value, this.isReply))) { continue; } - if (result.hide) { + if (result.hide && !this.isFetchedQuote) { if (this.isReply) { PostHiding.hide(this, result.stub); } else if (g.VIEW === 'index') { @@ -5103,73 +5104,41 @@ } }, name: function(post) { - if ('name' in post.info) { - return post.info.name; - } - return false; + return post.info.name; }, uniqueID: function(post) { - if ('uniqueID' in post.info) { - return post.info.uniqueID; - } - return false; + return post.info.uniqueID; }, tripcode: function(post) { - if ('tripcode' in post.info) { - return post.info.tripcode; - } - return false; + return post.info.tripcode; }, capcode: function(post) { - if ('capcode' in post.info) { - return post.info.capcode; - } - return false; + return post.info.capcode; }, subject: function(post) { - if ('subject' in post.info) { - return post.info.subject || false; - } - return false; + return post.info.subject || void 0; }, comment: function(post) { - if ('comment' in post.info) { - return post.info.comment; - } - return false; + return post.info.comment; }, flag: function(post) { - if ('flag' in post.info) { - return post.info.flag; - } - return false; + return post.info.flag; }, filename: function(post) { - if (post.file) { - return post.file.name; - } - return false; + var ref; + return (ref = post.file) != null ? ref.name : void 0; }, dimensions: function(post) { - var file; - file = post.file; - if (file != null ? file.dimensions : void 0) { - return file.dimensions; - } - return false; + var ref; + return (ref = post.file) != null ? ref.dimensions : void 0; }, filesize: function(post) { - if (post.file) { - return post.file.size; - } - return false; + var ref; + return (ref = post.file) != null ? ref.size : void 0; }, MD5: function(post) { var ref; - if ((ref = post.file) != null ? ref.MD5 : void 0) { - return post.file.MD5; - } - return false; + return (ref = post.file) != null ? ref.MD5 : void 0; }, menu: { init: function() { @@ -5209,7 +5178,7 @@ open: function(post) { var value; value = Filter[type](post); - return value !== false; + return value != null; } }; }, @@ -11444,7 +11413,7 @@ }, subEntries: [] }; - ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; + ref1 = [['Post', 'post'], ['Name', 'name'], ['Tripcode', 'tripcode'], ['Capcode', 'capcode'], ['Subject', 'subject'], ['Filename', 'filename'], ['Image MD5', 'MD5']]; for (k = 0, len1 = ref1.length; k < len1; k++) { type = ref1[k]; entry.subEntries.push(this.createSubEntry(type[0], type[1])); @@ -11711,17 +11680,19 @@ el: a, order: 10, open: function(post) { - ReportLink.post = post; - return !post.isDead; + ReportLink.url = !post.isDead ? "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post : Conf['Archive Report'] ? Redirect.to('report', { + boardID: post.board.ID, + postID: post.ID + }) : void 0; + return !!ReportLink.url; } }); }, report: function() { - var id, post, set, url; - post = ReportLink.post; - url = "//sys.4chan.org/" + post.board + "/imgboard.php?mode=report&no=" + post; + var id, set, url; + url = ReportLink.url; id = Date.now(); - set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=285"; + set = "toolbar=0,scrollbars=0,location=0,status=1,menubar=0,resizable=1,width=685,height=320"; return window.open(url, id, set); } }; @@ -13414,7 +13385,8 @@ o = { thread: {}, post: {}, - file: {} + file: {}, + report: {} }; archives = {}; ref = Redirect.archives; @@ -13424,17 +13396,19 @@ archives[name] = data; for (q = 0, len2 = boards.length; q < len2; q++) { boardID = boards[q]; - if (!(!withCredentials)) { - continue; + if (!withCredentials) { + if (!(boardID in o.thread)) { + o.thread[boardID] = data; + } + if (!(boardID in o.post || software !== 'foolfuuka')) { + o.post[boardID] = data; + } + if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { + o.file[boardID] = data; + } } - if (!(boardID in o.thread)) { - o.thread[boardID] = data; - } - if (!(boardID in o.post || software !== 'foolfuuka')) { - o.post[boardID] = data; - } - if (!(boardID in o.file || indexOf.call(files, boardID) < 0)) { - o.file[boardID] = data; + if (name === 'fgts') { + o.report[boardID] = data; } } } @@ -13509,10 +13483,20 @@ var boardID, path, type, value; boardID = arg.boardID, type = arg.type, value = arg.value; type = type === 'name' ? 'username' : type === 'MD5' ? 'image' : type; + if (type === 'capcode') { + value = { + 'Developer': 'dev' + }[value] || value.toLowerCase(); + } value = encodeURIComponent(value); path = archive.software === 'foolfuuka' ? boardID + "/search/" + type + "/" + value : boardID + "/?task=search2&search_" + (type === 'image' ? 'media_hash' : type) + "=" + value; return "" + (Redirect.protocol(archive)) + archive.domain + "/" + path; }, + report: function(archive, arg) { + var boardID, postID; + boardID = arg.boardID, postID = arg.postID; + return "https://so.fgts.jp/report/?board=" + boardID + "&no=" + postID; + }, securityCheck: function(URL) { return /^https:\/\//.test(URL) || location.protocol === 'http:' || Conf['Except Archives from Encryption']; }, @@ -15232,6 +15216,38 @@ } }; + Report = { + init: function() { + var match, postID; + if (!(Conf['Archive Report'] && /\bmode=report\b/.test(location.search))) { + return; + } + if (!(match = location.search.match(/\bno=(\d+)/))) { + return; + } + postID = +match[1]; + Redirect.init(); + if (this.archive = Redirect.to('report', { + boardID: g.BOARD.ID, + postID: postID + })) { + return $.ready(this.ready); + } + }, + ready: function() { + var link, message; + if ((message = $('h3')) && /Report submitted!/.test(message.textContent)) { + location.replace(Report.archive); + return; + } + link = $.el('a', { + href: Report.archive, + textContent: 'Report to fgts' + }); + return $.add(d.body, [$.tn(' ['), link, $.tn(']')]); + } + }; + Time = { init: function() { var ref; @@ -16100,6 +16116,7 @@ case 'a.4cdn.org': return; case 'sys.4chan.org': + Report.init(); if (g.VIEW === 'post') { PostSuccessful.init(); } diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 128e0a82e..2e925a805 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index e5b8161a7..82b7c983d 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.xml b/builds/updates.xml index 709f70a64..6099d6aec 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index bd924b3a7..3d9ea3a79 100755 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.10.8.10", - "date": "2015-04-14T03:57:38.704Z", + "version": "1.10.9.0", + "date": "2015-04-15T09:10:25.239Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",