diff --git a/CHANGELOG.md b/CHANGELOG.md
index b416d24be..b0f6c6d6c 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,19 @@ 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.5
+
+**v1.10.5.0** *(2015-03-15)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.5.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.5.0/builds/4chan-X-noupdate.crx "Chromium version")]
+- Based on v1.10.4.6.
+- (vampiricwulf) Activate native extension's Flash embedding on /f/ (option: `Enable Native Flash Embedding`).
+- `Sauce`, `File Info Formatting`, and searching the filename in the archive now work in /f/ threads.
+- Sauce links now support the `%IMG` parameter, which searches the full image for GIF, JPEG, and PNG file types, and the thumbnail for PDF and WEBM.
+- SWFchan (`http://eye.swfchan.com/search/?q=%name;types:swf`) has been added to the default sauce links, and Yandex (`https://www.yandex.com/images/search?rpt=imageview&img_url=%IMG`) has been added to the default sauce link examples.
+- You no longer need to make a post for 4chan X to remember changes to the name field. The options field is no longer remembered (use `Advanced` > `Quick Reply Personas` if you want certain options like `sage` by default).
+- `Desktop Notifications` is now on by default.
+- The `Captcha Warning Notifications` option has been removed. Captcha errors will always show a normal error notice.
+- Various bugfixes.
+
### v1.10.4
**v1.10.4.6** *(2015-03-15)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.6/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.4.6/builds/4chan-X-noupdate.crx "Chromium version")]
diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx
index 527f1c4f8..1c250b5af 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 f508d7b5f..717f46af5 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.4.6
+// @version 1.10.5.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 f65ca8958..2c0c653fc 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.4.6
+// @version 1.10.5.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, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, 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, 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,
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; },
@@ -125,7 +125,7 @@
'External Catalog': [false, 'Link to external catalog instead of the internal one.'],
'Catalog Links': [false, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'],
'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'],
- 'Desktop Notifications': [false, 'Enables desktop notifications across various 4chan X features.'],
+ 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'],
'404 Redirect': [true, 'Redirect dead threads and images to the 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.'],
@@ -146,7 +146,8 @@
'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'],
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'],
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'],
- 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.']
+ 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'],
+ 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.']
},
'Linkification': {
'Linkify': [true, 'Convert text into links where applicable.'],
@@ -231,7 +232,6 @@
'Cooldown': [true, 'Indicate the remaining time before posting again.', 1],
'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled.', 1],
- 'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.', 1],
'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1],
'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1],
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1]
@@ -291,7 +291,7 @@
filesize: '',
MD5: ''
},
- sauces: "https://www.google.com/searchbyimage?image_url=%TURL\nhttp://iqdb.org/?url=%TURL\n#//tineye.com/search?url=%TURL\n#//saucenao.com/search.php?url=%TURL\n#http://3d.iqdb.org/?url=%TURL\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#//imgur.com/upload?url=%URL;text:Upload to imgur\n# \"View Same\" in archives:\n#https://archive.moe/_/search/image/%MD5/;text:View same on archive.moe\n#https://archive.moe/%board/search/image/%MD5/;text:View same on archive.moe/%board/;boards:a,biz,c,co,diy,gd,h,i,jp,k,m,mlp,po,qa,s4s,sci,tg,u,v,vg,vp,vr,wsg\n#https://rbt.asia/%board/image/%MD5;text:View same on RBT /%board/;boards:cgl,g,mu,qa,w\n# Search with full image only for image file types:\n#https://www.google.com/searchbyimage?image_url=%URL;types:gif,jpg,png\n#https://www.google.com/searchbyimage?image_url=%TURL;types:webm,pdf",
+ sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\nhttp://eye.swfchan.com/search/?q=%name;types:swf\n#//tineye.com/search?url=%IMG\n#https://www.yandex.com/images/search?rpt=imageview&img_url=%IMG\n#//saucenao.com/search.php?url=%IMG\n#http://3d.iqdb.org/?url=%IMG\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#//imgur.com/upload?url=%URL;types:gif,jpg,png,pdf;text:Upload to imgur\n# \"View Same\" in archives:\n#https://archive.moe/_/search/image/%MD5/;text:View same on archive.moe\n#https://archive.moe/%board/search/image/%MD5/;text:View same on archive.moe/%board/;boards:a,biz,c,co,diy,gd,h,i,jp,k,m,mlp,po,qa,s4s,sci,tg,u,v,vg,vp,vr,wsg\n#https://rbt.asia/%board/image/%MD5;text:View same on RBT /%board/;boards:cgl,g,mu,qa,w",
FappeT: {
werk: false
},
@@ -395,7 +395,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.4.6',
+ VERSION: '1.10.5.0',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -1346,19 +1346,22 @@
};
Post.prototype.parseFile = function() {
- var anchor, fileEl, fileText, nameNode, size, thumb, unit;
- if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
+ var fileEl, fileText, info, link, ref, size, thumb, unit;
+ if (!((fileEl = $('.file', this.nodes.post)) && !$('.fileDeletedRes', fileEl))) {
return;
}
- anchor = thumb.parentNode;
fileText = fileEl.firstElementChild;
+ link = $('a', fileText);
+ info = link.nextSibling.textContent;
this.file = {
text: fileText,
- thumb: thumb,
- URL: anchor.href,
- size: thumb.alt.match(/[\d.]+\s\w+/)[0],
- MD5: thumb.dataset.md5,
- isSpoiler: $.hasClass(anchor, 'imgspoiler')
+ link: link,
+ URL: link.href,
+ name: fileText.title || link.title || link.textContent,
+ size: info.match(/[\d.]+\s\w+/)[0],
+ isImage: /(jpg|png|gif)$/i.test(link.href),
+ isVideo: /webm$/i.test(link.href),
+ dimensions: (ref = info.match(/\d+x\d+/)) != null ? ref[0] : void 0
};
size = +this.file.size.match(/[\d.]+/)[0];
unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
@@ -1366,14 +1369,14 @@
size *= 1024;
}
this.file.sizeInBytes = size;
- this.file.thumbURL = location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
- this.file.isImage = /(jpg|png|gif)$/i.test(this.file.URL);
- this.file.isVideo = /webm$/i.test(this.file.URL);
- nameNode = $('a', fileText);
- if (this.file.isImage || this.file.isVideo) {
- this.file.dimensions = nameNode.nextSibling.textContent.match(/\d+x\d+/)[0];
+ if ((thumb = $('img[data-md5]', fileEl))) {
+ return $.extend(this.file, {
+ thumb: thumb,
+ thumbURL: location.protocol + "//i.4cdn.org/" + this.board + "/" + (link.href.match(/(\d+)\./)[1]) + "s.jpg",
+ MD5: thumb.dataset.md5,
+ isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler')
+ });
}
- return this.file.name = fileText.title || nameNode.title || nameNode.textContent;
};
Post.prototype.kill = function(file) {
@@ -1554,7 +1557,7 @@
if (this.file.videoThumb) {
this.file.thumb.muted = true;
}
- if (contractThumb) {
+ if (this.file.thumb && contractThumb) {
ImageExpand.contract(this);
}
}
@@ -2696,10 +2699,14 @@
})();
a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID;
if (m = t.match(/-(index|catalog)/)) {
- a.dataset.only = m[1];
- a.href = CatalogLinks[m[1]](boardID);
- if (m[1] === 'catalog') {
- $.addClass(a, 'catalog');
+ if (!(boardID === 'f' && m[1] === 'catalog')) {
+ a.dataset.only = m[1];
+ a.href = CatalogLinks[m[1]](boardID);
+ if (m[1] === 'catalog') {
+ $.addClass(a, 'catalog');
+ }
+ } else {
+ return a.firstChild;
}
}
if (/-archive/.test(t)) {
@@ -5255,7 +5262,7 @@
dimensions: function(post) {
var file;
file = post.file;
- if (file && (file.isImage || file.isVideo)) {
+ if (file != null ? file.dimensions : void 0) {
return file.dimensions;
}
return false;
@@ -5267,7 +5274,8 @@
return false;
},
MD5: function(post) {
- if (post.file) {
+ var ref;
+ if ((ref = post.file) != null ? ref.MD5 : void 0) {
return post.file.MD5;
}
return false;
@@ -6997,8 +7005,8 @@
QR.setCustomCooldown(enabled);
return $.set('customCooldownEnabled', enabled);
},
- error: function(err) {
- var el;
+ error: function(err, focusOverride) {
+ var el, notice, notif;
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -7008,27 +7016,32 @@
}
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
QR.captcha.setup(true);
- QR.captcha.notify(el);
- } else {
- QR.notify(el);
}
- if (d.hidden && !QR.cooldown.auto) {
- return alert(el.textContent);
- }
- },
- notify: function(el) {
- var notice, notif;
notice = new Notice('warning', el);
- if (!(Header.areNotificationsEnabled && d.hidden)) {
- return QR.notifications.push(notice);
- } else {
+ QR.notifications.push(notice);
+ if (!Header.areNotificationsEnabled) {
+ if (d.hidden && !QR.cooldown.auto) {
+ return alert(el.textContent);
+ }
+ } else if (d.hidden || !(focusOverride || d.hasFocus())) {
notif = new Notification(el.textContent, {
body: el.textContent,
icon: Favicon.logo
});
- return notif.onclick = function() {
+ notif.onclick = function() {
return window.focus();
};
+ if (typeof chrome !== "undefined" && chrome !== null) {
+ notif.onclose = function() {
+ return notice.close();
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ notif.onclose = null;
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ }
}
},
notifications: [],
@@ -7588,7 +7601,6 @@
if (Conf['Posting Success Notifications']) {
QR.notifications.push(new Notice('success', h1.textContent, 5));
}
- QR.persona.set(post);
ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref1[0], threadID = ref1[1], postID = ref1[2];
postID = +postID;
threadID = +threadID || postID;
@@ -7796,7 +7808,6 @@
}
delete this.nodes.iframe;
delete this.occupied;
- this.unflag();
return this.beforeSetup();
},
sync: function(captchas) {
@@ -7864,17 +7875,6 @@
}
return QR.error("Captcha Error: " + message);
},
- notify: function(el) {
- if (Conf['Captcha Warning Notifications'] && !d.hidden) {
- return QR.notify(el);
- } else {
- $.addClass(this.nodes.input, 'error');
- return $.one(this.nodes.input, 'keydown', this.unflag.bind(this));
- }
- },
- unflag: function() {
- return $.rmClass(this.nodes.input, 'error');
- },
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
@@ -8185,9 +8185,6 @@
return QR.submit();
}
},
- notify: function(el) {
- return QR.notify(el);
- },
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
@@ -8502,8 +8499,7 @@
var persona;
persona = arg['QR.persona'];
persona = {
- name: post.name,
- email: /^sage$/.test(post.email) ? persona.email : post.email
+ name: post.name
};
return $.set('QR.persona', persona);
});
@@ -8560,7 +8556,7 @@
QR.persona.get((function(_this) {
return function(persona) {
_this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
- _this.email = 'email' in QR.persona.always ? QR.persona.always.email : prev && !/^sage$/.test(prev.email) ? prev.email : persona.email;
+ _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
_this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
if (QR.selected === _this) {
return _this.load();
@@ -8680,6 +8676,8 @@
this.file.newName += '.jpg';
}
return this.updateFilename();
+ case 'name':
+ return QR.persona.set(this);
}
};
@@ -8743,7 +8741,7 @@
};
})(this));
$.on(rmAll, 'click', QR.post.rmErrored);
- return QR.error(div);
+ return QR.error(div, true);
};
_Class.prototype.fileError = function(message) {
@@ -9009,7 +9007,7 @@
FappeTyme = {
init: function() {
var el, k, lc, len1, ref, ref1, type;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
return;
}
this.nodes = {};
@@ -9100,7 +9098,8 @@
});
},
node: function() {
- if (!this.file) {
+ var ref;
+ if (!((ref = this.file) != null ? ref.thumb : void 0)) {
return;
}
if (Gallery.nodes) {
@@ -9112,7 +9111,7 @@
}
},
build: function(image) {
- var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, thumb, value;
+ var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, ref3, thumb, value;
if (Conf['Fullscreen Gallery']) {
$.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
@@ -9179,7 +9178,7 @@
for (q = 0, len2 = ref2.length; q < len2; q++) {
file = ref2[q];
post = Get.postFromNode(file);
- if (!post.file) {
+ if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
continue;
}
Gallery.generateThumb(post);
@@ -9209,7 +9208,7 @@
if (post.isClone || post.isHidden) {
return;
}
- if (!(post.file && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
+ if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
return;
}
if (Gallery.fullIDs[post.fullID]) {
@@ -10429,8 +10428,8 @@
});
},
node: function() {
- var ref, thumb;
- if (this.isClone || !((ref = this.file) != null ? ref.isSpoiler : void 0)) {
+ var thumb;
+ if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
return;
}
thumb = this.file.thumb;
@@ -10471,7 +10470,10 @@
});
},
createSauceLink: function(link, post) {
- var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, ref3;
+ var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip;
+ if (!(link = link.trim())) {
+ return null;
+ }
parts = {};
ref = link.split(/;(?=(?:text|boards|types):)/);
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
@@ -10484,18 +10486,25 @@
}
}
parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
+ ext = post.file.URL.match(/[^.]*$/)[0];
+ skip = false;
for (key in parts) {
- parts[key] = parts[key].replace(/%(T?URL|MD5|board|name|%|semi)/g, function(parameter) {
+ parts[key] = parts[key].replace(/%(T?URL|IMG|MD5|board|name|%|semi)/g, function(parameter) {
var type;
type = {
'%TURL': post.file.thumbURL,
'%URL': post.file.URL,
+ '%IMG': ext === 'gif' || ext === 'jpg' || ext === 'png' ? post.file.URL : post.file.thumbURL,
'%MD5': post.file.MD5,
'%board': post.board.ID,
'%name': post.file.name,
'%%': '%',
'%semi': ';'
}[parameter];
+ if (type == null) {
+ skip = true;
+ return '';
+ }
if (key === 'url' && parameter !== '%%' && parameter !== '%semi') {
if (/^javascript:/i.test(parts['url'])) {
type = JSON.stringify(type);
@@ -10505,8 +10514,10 @@
return type;
});
}
- ext = ((ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? ref2[1] : void 0) || '';
- if (!(!parts['boards'] || (ref3 = post.board.ID, indexOf.call(parts['boards'].split(','), ref3) >= 0))) {
+ if (skip) {
+ return null;
+ }
+ if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
return null;
}
if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
@@ -11878,9 +11889,6 @@
var fileCount, postCount;
postCount = 0;
fileCount = 0;
- if (this.board.ID === 'f') {
- fileCount++;
- }
this.posts.forEach(function(post) {
postCount++;
if (post.file) {
@@ -12046,9 +12054,6 @@
ThreadUpdater.outdateCount = 0;
ThreadUpdater.postIDs = [];
ThreadUpdater.fileIDs = [];
- if (this.board.ID === 'f') {
- ThreadUpdater.fileIDs.push(this.ID);
- }
this.posts.forEach(function(post) {
ThreadUpdater.postIDs.push(post.ID);
if (post.file) {
@@ -13922,7 +13927,7 @@
if (board == null) {
board = g.BOARD.ID;
}
- if (Conf['JSON Navigation']) {
+ if (Conf['JSON Navigation'] && board !== 'f') {
if (g.BOARD.ID === board && g.VIEW === 'index') {
return '#index';
} else {
@@ -14240,13 +14245,17 @@
});
},
node: function() {
+ var info;
if (!this.file || this.isClone) {
return;
}
- $.extend(this.file.text, {
- innerHTML: ""
+ this.file.link.hidden = true;
+ this.file.link.previousSibling.nodeValue = this.file.link.nextSibling.nodeValue = '';
+ info = $.el('span', {
+ className: 'file-info'
});
- return FileInfo.format(Conf['fileInfo'], this, this.file.text.firstElementChild);
+ $.after(this.file.link.nextSibling, info);
+ return FileInfo.format(Conf['fileInfo'], this, info);
},
format: function(formatString, post, outputNode) {
var output;
@@ -14266,7 +14275,7 @@
formatters: {
t: function() {
return {
- innerHTML: E(this.file.URL.match(/\d+\..+$/)[0])
+ innerHTML: E(this.file.URL.match(/[^/]*$/)[0])
};
},
T: function() {
@@ -14347,6 +14356,17 @@
}
};
+ Flash = {
+ init: function() {
+ if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
+ return $.ready(Flash.initReady);
+ }
+ },
+ initReady: function() {
+ return $.globalEval('if (JSON.parse(localStorage["4chan-settings"] || "{}").disableAll) SWFEmbed.init();');
+ }
+ };
+
Fourchan = {
init: function() {
var ref;
@@ -14354,7 +14374,20 @@
return;
}
if (g.BOARD.ID === 'g') {
- $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: prettyPrintOne(e.detail)\n }));\n}, false);');
+ $.on(window, 'prettyprint:cb', function(e) {
+ var post, pre;
+ if (!(post = g.posts[e.detail.ID])) {
+ return;
+ }
+ if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
+ return;
+ }
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ pre.innerHTML = e.detail.html;
+ return $.addClass(pre, 'prettyprinted');
+ }
+ });
+ $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
Post.callbacks.push({
name: 'Parse /g/ code',
cb: this.code
@@ -14376,21 +14409,21 @@
});
},
code: function() {
- var apply, k, len1, pre, ref;
+ var i, k, len1, pre, ref;
if (this.isClone) {
return;
}
- apply = function(e) {
- pre.innerHTML = e.detail;
- return $.addClass(pre, 'prettyprinted');
- };
- $.on(window, 'prettyprint:cb', apply);
- ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- pre = ref[k];
- $.event('prettyprint', pre.innerHTML, window);
+ ref = $$('.prettyprint', this.nodes.comment);
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ pre = ref[i];
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ $.event('prettyprint', {
+ ID: this.fullID,
+ i: i,
+ html: pre.innerHTML
+ }, window);
+ }
}
- $.off(window, 'prettyprint:cb', apply);
},
math: function() {
if ((this.isClone && doc.contains(this.origin.nodes.root)) || !$('.math', this.nodes.comment)) {
@@ -14524,7 +14557,7 @@
return;
}
}
- if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
threadRoot = Nav.getThread();
if (op = $('.op', threadRoot)) {
thread = Get.postFromNode(op).thread;
@@ -14622,7 +14655,7 @@
ThreadUpdater.update();
break;
case 'index':
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
Index.update();
@@ -14656,19 +14689,19 @@
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
return;
}
FappeTyme.toggle('fappe');
break;
case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
return;
}
FappeTyme.toggle('werk');
break;
case Conf['Front page']:
- if (Conf['JSON Navigation'] && g.VIEW === 'index') {
+ if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
Index.userPageNav(1);
} else {
window.location = "/" + g.BOARD + "/";
@@ -14678,7 +14711,7 @@
$.open("/" + g.BOARD + "/");
break;
case Conf['Next page']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
if (Conf['JSON Navigation']) {
@@ -14693,7 +14726,7 @@
}
break;
case Conf['Previous page']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
if (Conf['JSON Navigation']) {
@@ -14708,7 +14741,7 @@
}
break;
case Conf['Search form']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box');
@@ -14716,28 +14749,31 @@
searchInput.focus();
break;
case Conf['Paged mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
break;
case Conf['Infinite scrolling mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
break;
case Conf['All pages mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
break;
case Conf['Open catalog']:
+ if (g.BOARD.ID === 'f') {
+ return;
+ }
window.location = CatalogLinks.catalog();
break;
case Conf['Cycle sort type']:
- if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD !== 'f')) {
+ if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
Index.cycleSortType();
@@ -15701,7 +15737,7 @@
sauce: function(section) {
var ta;
$.extend(section, {
- innerHTML: "
Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%MD5: MD5 hash.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;.
"
+ innerHTML: "Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.%MD5: MD5 hash.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;.
"
});
$('.warning', section).hidden = Conf['Sauce'];
ta = $('textarea', section);
@@ -15713,7 +15749,7 @@
advanced: function(section) {
var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z;
$.extend(section, {
- innerHTML: ""
+ innerHTML: ""
});
ref = $$('.warning', section);
for (k = 0, len1 = ref.length; k < len1; k++) {
@@ -15985,7 +16021,7 @@
Main = {
init: function() {
- var db, flatten, k, len1, pathname, ref, ref1, type;
+ var db, flatten, k, len1, pathname, ref, ref1, ref2, type;
if (location.hostname === 'www.google.com') {
type = location.pathname === '/recaptcha/api/fallback' ? 'noscript' : 'v2';
return $.ready(function() {
@@ -16012,6 +16048,12 @@
return 'index';
}
})();
+ if (g.VIEW === 'catalog' && g.BOARD.ID === 'f') {
+ return;
+ }
+ if (g.VIEW === 'archive' && ((ref1 = g.BOARD.ID) === 'b' || ref1 === 'f')) {
+ return;
+ }
if (g.VIEW === 'thread') {
g.THREADID = +pathname[3];
}
@@ -16029,9 +16071,9 @@
}
};
flatten(null, Config);
- ref1 = DataBoard.keys;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- db = ref1[k];
+ ref2 = DataBoard.keys;
+ for (k = 0, len1 = ref2.length; k < len1; k++) {
+ db = ref2[k];
Conf[db] = {
boards: {}
};
@@ -18156,9 +18198,6 @@
" width: 100%;\n" +
" margin: 1px 0 0;\n" +
"}\n" +
-".captcha-input.error:focus {\n" +
-" border-color: rgb(255,0,0) !important;\n" +
-"}\n" +
"#qr-captcha-iframe {\n" +
" display: none;\n" +
"}\n" +
@@ -19330,7 +19369,7 @@
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}",
- features: [['Polyfill', Polyfill], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner]]
+ features: [['Polyfill', Polyfill], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
};
Main.init();
diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx
index 8fb01a831..daad0647d 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 8981deae5..1ff022f84 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.4.6
+// @version 1.10.5.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, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, 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, 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,
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; },
@@ -124,7 +124,7 @@
'External Catalog': [false, 'Link to external catalog instead of the internal one.'],
'Catalog Links': [false, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'],
'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'],
- 'Desktop Notifications': [false, 'Enables desktop notifications across various 4chan X features.'],
+ 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'],
'404 Redirect': [true, 'Redirect dead threads and images to the 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.'],
@@ -145,7 +145,8 @@
'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'],
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'],
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'],
- 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.']
+ 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'],
+ 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.']
},
'Linkification': {
'Linkify': [true, 'Convert text into links where applicable.'],
@@ -230,7 +231,6 @@
'Cooldown': [true, 'Indicate the remaining time before posting again.', 1],
'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled.', 1],
- 'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.', 1],
'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1],
'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1],
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1]
@@ -290,7 +290,7 @@
filesize: '',
MD5: ''
},
- sauces: "https://www.google.com/searchbyimage?image_url=%TURL\nhttp://iqdb.org/?url=%TURL\n#//tineye.com/search?url=%TURL\n#//saucenao.com/search.php?url=%TURL\n#http://3d.iqdb.org/?url=%TURL\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#//imgur.com/upload?url=%URL;text:Upload to imgur\n# \"View Same\" in archives:\n#https://archive.moe/_/search/image/%MD5/;text:View same on archive.moe\n#https://archive.moe/%board/search/image/%MD5/;text:View same on archive.moe/%board/;boards:a,biz,c,co,diy,gd,h,i,jp,k,m,mlp,po,qa,s4s,sci,tg,u,v,vg,vp,vr,wsg\n#https://rbt.asia/%board/image/%MD5;text:View same on RBT /%board/;boards:cgl,g,mu,qa,w\n# Search with full image only for image file types:\n#https://www.google.com/searchbyimage?image_url=%URL;types:gif,jpg,png\n#https://www.google.com/searchbyimage?image_url=%TURL;types:webm,pdf",
+ sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\nhttp://eye.swfchan.com/search/?q=%name;types:swf\n#//tineye.com/search?url=%IMG\n#https://www.yandex.com/images/search?rpt=imageview&img_url=%IMG\n#//saucenao.com/search.php?url=%IMG\n#http://3d.iqdb.org/?url=%IMG\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#//imgur.com/upload?url=%URL;types:gif,jpg,png,pdf;text:Upload to imgur\n# \"View Same\" in archives:\n#https://archive.moe/_/search/image/%MD5/;text:View same on archive.moe\n#https://archive.moe/%board/search/image/%MD5/;text:View same on archive.moe/%board/;boards:a,biz,c,co,diy,gd,h,i,jp,k,m,mlp,po,qa,s4s,sci,tg,u,v,vg,vp,vr,wsg\n#https://rbt.asia/%board/image/%MD5;text:View same on RBT /%board/;boards:cgl,g,mu,qa,w",
FappeT: {
werk: false
},
@@ -394,7 +394,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.4.6',
+ VERSION: '1.10.5.0',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -1345,19 +1345,22 @@
};
Post.prototype.parseFile = function() {
- var anchor, fileEl, fileText, nameNode, size, thumb, unit;
- if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
+ var fileEl, fileText, info, link, ref, size, thumb, unit;
+ if (!((fileEl = $('.file', this.nodes.post)) && !$('.fileDeletedRes', fileEl))) {
return;
}
- anchor = thumb.parentNode;
fileText = fileEl.firstElementChild;
+ link = $('a', fileText);
+ info = link.nextSibling.textContent;
this.file = {
text: fileText,
- thumb: thumb,
- URL: anchor.href,
- size: thumb.alt.match(/[\d.]+\s\w+/)[0],
- MD5: thumb.dataset.md5,
- isSpoiler: $.hasClass(anchor, 'imgspoiler')
+ link: link,
+ URL: link.href,
+ name: fileText.title || link.title || link.textContent,
+ size: info.match(/[\d.]+\s\w+/)[0],
+ isImage: /(jpg|png|gif)$/i.test(link.href),
+ isVideo: /webm$/i.test(link.href),
+ dimensions: (ref = info.match(/\d+x\d+/)) != null ? ref[0] : void 0
};
size = +this.file.size.match(/[\d.]+/)[0];
unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
@@ -1365,14 +1368,14 @@
size *= 1024;
}
this.file.sizeInBytes = size;
- this.file.thumbURL = location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
- this.file.isImage = /(jpg|png|gif)$/i.test(this.file.URL);
- this.file.isVideo = /webm$/i.test(this.file.URL);
- nameNode = $('a', fileText);
- if (this.file.isImage || this.file.isVideo) {
- this.file.dimensions = nameNode.nextSibling.textContent.match(/\d+x\d+/)[0];
+ if ((thumb = $('img[data-md5]', fileEl))) {
+ return $.extend(this.file, {
+ thumb: thumb,
+ thumbURL: location.protocol + "//i.4cdn.org/" + this.board + "/" + (link.href.match(/(\d+)\./)[1]) + "s.jpg",
+ MD5: thumb.dataset.md5,
+ isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler')
+ });
}
- return this.file.name = fileText.title || nameNode.title || nameNode.textContent;
};
Post.prototype.kill = function(file) {
@@ -1553,7 +1556,7 @@
if (this.file.videoThumb) {
this.file.thumb.muted = true;
}
- if (contractThumb) {
+ if (this.file.thumb && contractThumb) {
ImageExpand.contract(this);
}
}
@@ -2695,10 +2698,14 @@
})();
a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID;
if (m = t.match(/-(index|catalog)/)) {
- a.dataset.only = m[1];
- a.href = CatalogLinks[m[1]](boardID);
- if (m[1] === 'catalog') {
- $.addClass(a, 'catalog');
+ if (!(boardID === 'f' && m[1] === 'catalog')) {
+ a.dataset.only = m[1];
+ a.href = CatalogLinks[m[1]](boardID);
+ if (m[1] === 'catalog') {
+ $.addClass(a, 'catalog');
+ }
+ } else {
+ return a.firstChild;
}
}
if (/-archive/.test(t)) {
@@ -5254,7 +5261,7 @@
dimensions: function(post) {
var file;
file = post.file;
- if (file && (file.isImage || file.isVideo)) {
+ if (file != null ? file.dimensions : void 0) {
return file.dimensions;
}
return false;
@@ -5266,7 +5273,8 @@
return false;
},
MD5: function(post) {
- if (post.file) {
+ var ref;
+ if ((ref = post.file) != null ? ref.MD5 : void 0) {
return post.file.MD5;
}
return false;
@@ -6996,8 +7004,8 @@
QR.setCustomCooldown(enabled);
return $.set('customCooldownEnabled', enabled);
},
- error: function(err) {
- var el;
+ error: function(err, focusOverride) {
+ var el, notice, notif;
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -7007,27 +7015,32 @@
}
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
QR.captcha.setup(true);
- QR.captcha.notify(el);
- } else {
- QR.notify(el);
}
- if (d.hidden && !QR.cooldown.auto) {
- return alert(el.textContent);
- }
- },
- notify: function(el) {
- var notice, notif;
notice = new Notice('warning', el);
- if (!(Header.areNotificationsEnabled && d.hidden)) {
- return QR.notifications.push(notice);
- } else {
+ QR.notifications.push(notice);
+ if (!Header.areNotificationsEnabled) {
+ if (d.hidden && !QR.cooldown.auto) {
+ return alert(el.textContent);
+ }
+ } else if (d.hidden || !(focusOverride || d.hasFocus())) {
notif = new Notification(el.textContent, {
body: el.textContent,
icon: Favicon.logo
});
- return notif.onclick = function() {
+ notif.onclick = function() {
return window.focus();
};
+ if (typeof chrome !== "undefined" && chrome !== null) {
+ notif.onclose = function() {
+ return notice.close();
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ notif.onclose = null;
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ }
}
},
notifications: [],
@@ -7587,7 +7600,6 @@
if (Conf['Posting Success Notifications']) {
QR.notifications.push(new Notice('success', h1.textContent, 5));
}
- QR.persona.set(post);
ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref1[0], threadID = ref1[1], postID = ref1[2];
postID = +postID;
threadID = +threadID || postID;
@@ -7795,7 +7807,6 @@
}
delete this.nodes.iframe;
delete this.occupied;
- this.unflag();
return this.beforeSetup();
},
sync: function(captchas) {
@@ -7863,17 +7874,6 @@
}
return QR.error("Captcha Error: " + message);
},
- notify: function(el) {
- if (Conf['Captcha Warning Notifications'] && !d.hidden) {
- return QR.notify(el);
- } else {
- $.addClass(this.nodes.input, 'error');
- return $.one(this.nodes.input, 'keydown', this.unflag.bind(this));
- }
- },
- unflag: function() {
- return $.rmClass(this.nodes.input, 'error');
- },
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
@@ -8184,9 +8184,6 @@
return QR.submit();
}
},
- notify: function(el) {
- return QR.notify(el);
- },
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
@@ -8501,8 +8498,7 @@
var persona;
persona = arg['QR.persona'];
persona = {
- name: post.name,
- email: /^sage$/.test(post.email) ? persona.email : post.email
+ name: post.name
};
return $.set('QR.persona', persona);
});
@@ -8559,7 +8555,7 @@
QR.persona.get((function(_this) {
return function(persona) {
_this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
- _this.email = 'email' in QR.persona.always ? QR.persona.always.email : prev && !/^sage$/.test(prev.email) ? prev.email : persona.email;
+ _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
_this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
if (QR.selected === _this) {
return _this.load();
@@ -8679,6 +8675,8 @@
this.file.newName += '.jpg';
}
return this.updateFilename();
+ case 'name':
+ return QR.persona.set(this);
}
};
@@ -8742,7 +8740,7 @@
};
})(this));
$.on(rmAll, 'click', QR.post.rmErrored);
- return QR.error(div);
+ return QR.error(div, true);
};
_Class.prototype.fileError = function(message) {
@@ -9008,7 +9006,7 @@
FappeTyme = {
init: function() {
var el, k, lc, len1, ref, ref1, type;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
return;
}
this.nodes = {};
@@ -9099,7 +9097,8 @@
});
},
node: function() {
- if (!this.file) {
+ var ref;
+ if (!((ref = this.file) != null ? ref.thumb : void 0)) {
return;
}
if (Gallery.nodes) {
@@ -9111,7 +9110,7 @@
}
},
build: function(image) {
- var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, thumb, value;
+ var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, ref3, thumb, value;
if (Conf['Fullscreen Gallery']) {
$.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
@@ -9178,7 +9177,7 @@
for (q = 0, len2 = ref2.length; q < len2; q++) {
file = ref2[q];
post = Get.postFromNode(file);
- if (!post.file) {
+ if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
continue;
}
Gallery.generateThumb(post);
@@ -9208,7 +9207,7 @@
if (post.isClone || post.isHidden) {
return;
}
- if (!(post.file && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
+ if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
return;
}
if (Gallery.fullIDs[post.fullID]) {
@@ -10428,8 +10427,8 @@
});
},
node: function() {
- var ref, thumb;
- if (this.isClone || !((ref = this.file) != null ? ref.isSpoiler : void 0)) {
+ var thumb;
+ if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
return;
}
thumb = this.file.thumb;
@@ -10470,7 +10469,10 @@
});
},
createSauceLink: function(link, post) {
- var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, ref3;
+ var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip;
+ if (!(link = link.trim())) {
+ return null;
+ }
parts = {};
ref = link.split(/;(?=(?:text|boards|types):)/);
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
@@ -10483,18 +10485,25 @@
}
}
parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
+ ext = post.file.URL.match(/[^.]*$/)[0];
+ skip = false;
for (key in parts) {
- parts[key] = parts[key].replace(/%(T?URL|MD5|board|name|%|semi)/g, function(parameter) {
+ parts[key] = parts[key].replace(/%(T?URL|IMG|MD5|board|name|%|semi)/g, function(parameter) {
var type;
type = {
'%TURL': post.file.thumbURL,
'%URL': post.file.URL,
+ '%IMG': ext === 'gif' || ext === 'jpg' || ext === 'png' ? post.file.URL : post.file.thumbURL,
'%MD5': post.file.MD5,
'%board': post.board.ID,
'%name': post.file.name,
'%%': '%',
'%semi': ';'
}[parameter];
+ if (type == null) {
+ skip = true;
+ return '';
+ }
if (key === 'url' && parameter !== '%%' && parameter !== '%semi') {
if (/^javascript:/i.test(parts['url'])) {
type = JSON.stringify(type);
@@ -10504,8 +10513,10 @@
return type;
});
}
- ext = ((ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? ref2[1] : void 0) || '';
- if (!(!parts['boards'] || (ref3 = post.board.ID, indexOf.call(parts['boards'].split(','), ref3) >= 0))) {
+ if (skip) {
+ return null;
+ }
+ if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
return null;
}
if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
@@ -11877,9 +11888,6 @@
var fileCount, postCount;
postCount = 0;
fileCount = 0;
- if (this.board.ID === 'f') {
- fileCount++;
- }
this.posts.forEach(function(post) {
postCount++;
if (post.file) {
@@ -12045,9 +12053,6 @@
ThreadUpdater.outdateCount = 0;
ThreadUpdater.postIDs = [];
ThreadUpdater.fileIDs = [];
- if (this.board.ID === 'f') {
- ThreadUpdater.fileIDs.push(this.ID);
- }
this.posts.forEach(function(post) {
ThreadUpdater.postIDs.push(post.ID);
if (post.file) {
@@ -13921,7 +13926,7 @@
if (board == null) {
board = g.BOARD.ID;
}
- if (Conf['JSON Navigation']) {
+ if (Conf['JSON Navigation'] && board !== 'f') {
if (g.BOARD.ID === board && g.VIEW === 'index') {
return '#index';
} else {
@@ -14239,13 +14244,17 @@
});
},
node: function() {
+ var info;
if (!this.file || this.isClone) {
return;
}
- $.extend(this.file.text, {
- innerHTML: ""
+ this.file.link.hidden = true;
+ this.file.link.previousSibling.nodeValue = this.file.link.nextSibling.nodeValue = '';
+ info = $.el('span', {
+ className: 'file-info'
});
- return FileInfo.format(Conf['fileInfo'], this, this.file.text.firstElementChild);
+ $.after(this.file.link.nextSibling, info);
+ return FileInfo.format(Conf['fileInfo'], this, info);
},
format: function(formatString, post, outputNode) {
var output;
@@ -14265,7 +14274,7 @@
formatters: {
t: function() {
return {
- innerHTML: E(this.file.URL.match(/\d+\..+$/)[0])
+ innerHTML: E(this.file.URL.match(/[^/]*$/)[0])
};
},
T: function() {
@@ -14346,6 +14355,17 @@
}
};
+ Flash = {
+ init: function() {
+ if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
+ return $.ready(Flash.initReady);
+ }
+ },
+ initReady: function() {
+ return $.globalEval('if (JSON.parse(localStorage["4chan-settings"] || "{}").disableAll) SWFEmbed.init();');
+ }
+ };
+
Fourchan = {
init: function() {
var ref;
@@ -14353,7 +14373,20 @@
return;
}
if (g.BOARD.ID === 'g') {
- $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: prettyPrintOne(e.detail)\n }));\n}, false);');
+ $.on(window, 'prettyprint:cb', function(e) {
+ var post, pre;
+ if (!(post = g.posts[e.detail.ID])) {
+ return;
+ }
+ if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
+ return;
+ }
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ pre.innerHTML = e.detail.html;
+ return $.addClass(pre, 'prettyprinted');
+ }
+ });
+ $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
Post.callbacks.push({
name: 'Parse /g/ code',
cb: this.code
@@ -14375,21 +14408,21 @@
});
},
code: function() {
- var apply, k, len1, pre, ref;
+ var i, k, len1, pre, ref;
if (this.isClone) {
return;
}
- apply = function(e) {
- pre.innerHTML = e.detail;
- return $.addClass(pre, 'prettyprinted');
- };
- $.on(window, 'prettyprint:cb', apply);
- ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- pre = ref[k];
- $.event('prettyprint', pre.innerHTML, window);
+ ref = $$('.prettyprint', this.nodes.comment);
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ pre = ref[i];
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ $.event('prettyprint', {
+ ID: this.fullID,
+ i: i,
+ html: pre.innerHTML
+ }, window);
+ }
}
- $.off(window, 'prettyprint:cb', apply);
},
math: function() {
if ((this.isClone && doc.contains(this.origin.nodes.root)) || !$('.math', this.nodes.comment)) {
@@ -14523,7 +14556,7 @@
return;
}
}
- if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
threadRoot = Nav.getThread();
if (op = $('.op', threadRoot)) {
thread = Get.postFromNode(op).thread;
@@ -14621,7 +14654,7 @@
ThreadUpdater.update();
break;
case 'index':
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
Index.update();
@@ -14655,19 +14688,19 @@
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
return;
}
FappeTyme.toggle('fappe');
break;
case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
return;
}
FappeTyme.toggle('werk');
break;
case Conf['Front page']:
- if (Conf['JSON Navigation'] && g.VIEW === 'index') {
+ if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
Index.userPageNav(1);
} else {
window.location = "/" + g.BOARD + "/";
@@ -14677,7 +14710,7 @@
$.open("/" + g.BOARD + "/");
break;
case Conf['Next page']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
if (Conf['JSON Navigation']) {
@@ -14692,7 +14725,7 @@
}
break;
case Conf['Previous page']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
if (Conf['JSON Navigation']) {
@@ -14707,7 +14740,7 @@
}
break;
case Conf['Search form']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box');
@@ -14715,28 +14748,31 @@
searchInput.focus();
break;
case Conf['Paged mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
break;
case Conf['Infinite scrolling mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
break;
case Conf['All pages mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
break;
case Conf['Open catalog']:
+ if (g.BOARD.ID === 'f') {
+ return;
+ }
window.location = CatalogLinks.catalog();
break;
case Conf['Cycle sort type']:
- if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD !== 'f')) {
+ if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
Index.cycleSortType();
@@ -15700,7 +15736,7 @@
sauce: function(section) {
var ta;
$.extend(section, {
- innerHTML: "Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%MD5: MD5 hash.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;.
"
+ innerHTML: "Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.%MD5: MD5 hash.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;.
"
});
$('.warning', section).hidden = Conf['Sauce'];
ta = $('textarea', section);
@@ -15712,7 +15748,7 @@
advanced: function(section) {
var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z;
$.extend(section, {
- innerHTML: ""
+ innerHTML: ""
});
ref = $$('.warning', section);
for (k = 0, len1 = ref.length; k < len1; k++) {
@@ -15984,7 +16020,7 @@
Main = {
init: function() {
- var db, flatten, k, len1, pathname, ref, ref1, type;
+ var db, flatten, k, len1, pathname, ref, ref1, ref2, type;
if (location.hostname === 'www.google.com') {
type = location.pathname === '/recaptcha/api/fallback' ? 'noscript' : 'v2';
return $.ready(function() {
@@ -16011,6 +16047,12 @@
return 'index';
}
})();
+ if (g.VIEW === 'catalog' && g.BOARD.ID === 'f') {
+ return;
+ }
+ if (g.VIEW === 'archive' && ((ref1 = g.BOARD.ID) === 'b' || ref1 === 'f')) {
+ return;
+ }
if (g.VIEW === 'thread') {
g.THREADID = +pathname[3];
}
@@ -16028,9 +16070,9 @@
}
};
flatten(null, Config);
- ref1 = DataBoard.keys;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- db = ref1[k];
+ ref2 = DataBoard.keys;
+ for (k = 0, len1 = ref2.length; k < len1; k++) {
+ db = ref2[k];
Conf[db] = {
boards: {}
};
@@ -18155,9 +18197,6 @@
" width: 100%;\n" +
" margin: 1px 0 0;\n" +
"}\n" +
-".captcha-input.error:focus {\n" +
-" border-color: rgb(255,0,0) !important;\n" +
-"}\n" +
"#qr-captcha-iframe {\n" +
" display: none;\n" +
"}\n" +
@@ -19329,7 +19368,7 @@
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}",
- features: [['Polyfill', Polyfill], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner]]
+ features: [['Polyfill', Polyfill], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
};
Main.init();
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index 354d6d521..cfdbbfb5f 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 de474a162..1eca62781 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.10.4.6
+// @version 1.10.5.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index 5beef193c..4b5055787 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.4.6
+// @version 1.10.5.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, Fourchan, Gallery, Get, Header, IDColor, IDHighlight, ImageCommon, ImageExpand, ImageHover, ImageLoader, Index, Keybinds, Linkify, Main, MarkNewIPs, Menu, Metadata, Nav, Notice, PSAHiding, Polyfill, Post, PostHiding, 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, 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,
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; },
@@ -125,7 +125,7 @@
'External Catalog': [false, 'Link to external catalog instead of the internal one.'],
'Catalog Links': [false, 'Add toggle link in header menu to turn Navigation links into links to each board\'s catalog.'],
'Announcement Hiding': [true, 'Add button to hide 4chan announcements.'],
- 'Desktop Notifications': [false, 'Enables desktop notifications across various 4chan X features.'],
+ 'Desktop Notifications': [true, 'Enables desktop notifications across various 4chan X features.'],
'404 Redirect': [true, 'Redirect dead threads and images to the 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.'],
@@ -146,7 +146,8 @@
'Show Support Message': [true, 'Warn if your browser or configuration is unsupported and may cause 4chan X to not operate correctly.'],
'Normalize URL': [true, 'Rewrite the URL of the current page, removing stubs and changing /res/ to /thread/.'],
'Disable Autoplaying Sounds': [false, 'Prevent sounds on the page from autoplaying.'],
- 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.']
+ 'Disable Native Extension': [true, '4chan X is NOT designed to work with the native extension.'],
+ 'Enable Native Flash Embedding': [true, 'Activate the native extension\'s Flash embedding if the native extension is disabled.']
},
'Linkification': {
'Linkify': [true, 'Convert text into links where applicable.'],
@@ -231,7 +232,6 @@
'Cooldown': [true, 'Indicate the remaining time before posting again.', 1],
'Posting Success Notifications': [true, 'Show notifications on successful post creation or file uploading.', 1],
'Force Noscript Captcha': [false, 'Use the non-Javascript fallback captcha in the QR even if Javascript is enabled.', 1],
- 'Captcha Warning Notifications': [true, 'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.', 1],
'Auto-load captcha': [false, 'Automatically load the captcha in the QR even if your post is empty.', 1],
'Post on Captcha Completion': [false, 'Submit the post immediately when the captcha is completed.', 1],
'Bottom QR Link': [true, 'Places a link on the bottom of threads to open the QR.', 1]
@@ -291,7 +291,7 @@
filesize: '',
MD5: ''
},
- sauces: "https://www.google.com/searchbyimage?image_url=%TURL\nhttp://iqdb.org/?url=%TURL\n#//tineye.com/search?url=%TURL\n#//saucenao.com/search.php?url=%TURL\n#http://3d.iqdb.org/?url=%TURL\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#//imgur.com/upload?url=%URL;text:Upload to imgur\n# \"View Same\" in archives:\n#https://archive.moe/_/search/image/%MD5/;text:View same on archive.moe\n#https://archive.moe/%board/search/image/%MD5/;text:View same on archive.moe/%board/;boards:a,biz,c,co,diy,gd,h,i,jp,k,m,mlp,po,qa,s4s,sci,tg,u,v,vg,vp,vr,wsg\n#https://rbt.asia/%board/image/%MD5;text:View same on RBT /%board/;boards:cgl,g,mu,qa,w\n# Search with full image only for image file types:\n#https://www.google.com/searchbyimage?image_url=%URL;types:gif,jpg,png\n#https://www.google.com/searchbyimage?image_url=%TURL;types:webm,pdf",
+ sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\nhttp://eye.swfchan.com/search/?q=%name;types:swf\n#//tineye.com/search?url=%IMG\n#https://www.yandex.com/images/search?rpt=imageview&img_url=%IMG\n#//saucenao.com/search.php?url=%IMG\n#http://3d.iqdb.org/?url=%IMG\n#http://regex.info/exif.cgi?imgurl=%URL\n# uploaders:\n#//imgur.com/upload?url=%URL;types:gif,jpg,png,pdf;text:Upload to imgur\n# \"View Same\" in archives:\n#https://archive.moe/_/search/image/%MD5/;text:View same on archive.moe\n#https://archive.moe/%board/search/image/%MD5/;text:View same on archive.moe/%board/;boards:a,biz,c,co,diy,gd,h,i,jp,k,m,mlp,po,qa,s4s,sci,tg,u,v,vg,vp,vr,wsg\n#https://rbt.asia/%board/image/%MD5;text:View same on RBT /%board/;boards:cgl,g,mu,qa,w",
FappeT: {
werk: false
},
@@ -395,7 +395,7 @@
doc = d.documentElement;
g = {
- VERSION: '1.10.4.6',
+ VERSION: '1.10.5.0',
NAMESPACE: '4chan X.',
NAME: '4chan X',
FAQ: 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions',
@@ -1346,19 +1346,22 @@
};
Post.prototype.parseFile = function() {
- var anchor, fileEl, fileText, nameNode, size, thumb, unit;
- if (!((fileEl = $('.file', this.nodes.post)) && (thumb = $('img[data-md5]', fileEl)))) {
+ var fileEl, fileText, info, link, ref, size, thumb, unit;
+ if (!((fileEl = $('.file', this.nodes.post)) && !$('.fileDeletedRes', fileEl))) {
return;
}
- anchor = thumb.parentNode;
fileText = fileEl.firstElementChild;
+ link = $('a', fileText);
+ info = link.nextSibling.textContent;
this.file = {
text: fileText,
- thumb: thumb,
- URL: anchor.href,
- size: thumb.alt.match(/[\d.]+\s\w+/)[0],
- MD5: thumb.dataset.md5,
- isSpoiler: $.hasClass(anchor, 'imgspoiler')
+ link: link,
+ URL: link.href,
+ name: fileText.title || link.title || link.textContent,
+ size: info.match(/[\d.]+\s\w+/)[0],
+ isImage: /(jpg|png|gif)$/i.test(link.href),
+ isVideo: /webm$/i.test(link.href),
+ dimensions: (ref = info.match(/\d+x\d+/)) != null ? ref[0] : void 0
};
size = +this.file.size.match(/[\d.]+/)[0];
unit = ['B', 'KB', 'MB', 'GB'].indexOf(this.file.size.match(/\w+$/)[0]);
@@ -1366,14 +1369,14 @@
size *= 1024;
}
this.file.sizeInBytes = size;
- this.file.thumbURL = location.protocol + "//i.4cdn.org/" + this.board + "/" + (this.file.URL.match(/(\d+)\./)[1]) + "s.jpg";
- this.file.isImage = /(jpg|png|gif)$/i.test(this.file.URL);
- this.file.isVideo = /webm$/i.test(this.file.URL);
- nameNode = $('a', fileText);
- if (this.file.isImage || this.file.isVideo) {
- this.file.dimensions = nameNode.nextSibling.textContent.match(/\d+x\d+/)[0];
+ if ((thumb = $('img[data-md5]', fileEl))) {
+ return $.extend(this.file, {
+ thumb: thumb,
+ thumbURL: location.protocol + "//i.4cdn.org/" + this.board + "/" + (link.href.match(/(\d+)\./)[1]) + "s.jpg",
+ MD5: thumb.dataset.md5,
+ isSpoiler: $.hasClass(thumb.parentNode, 'imgspoiler')
+ });
}
- return this.file.name = fileText.title || nameNode.title || nameNode.textContent;
};
Post.prototype.kill = function(file) {
@@ -1554,7 +1557,7 @@
if (this.file.videoThumb) {
this.file.thumb.muted = true;
}
- if (contractThumb) {
+ if (this.file.thumb && contractThumb) {
ImageExpand.contract(this);
}
}
@@ -2696,10 +2699,14 @@
})();
a.textContent = /-title/.test(t) || /-replace/.test(t) && boardID === g.BOARD.ID ? a.title || a.textContent : /-full/.test(t) ? ("/" + boardID + "/") + (a.title ? " - " + a.title : '') : text || boardID;
if (m = t.match(/-(index|catalog)/)) {
- a.dataset.only = m[1];
- a.href = CatalogLinks[m[1]](boardID);
- if (m[1] === 'catalog') {
- $.addClass(a, 'catalog');
+ if (!(boardID === 'f' && m[1] === 'catalog')) {
+ a.dataset.only = m[1];
+ a.href = CatalogLinks[m[1]](boardID);
+ if (m[1] === 'catalog') {
+ $.addClass(a, 'catalog');
+ }
+ } else {
+ return a.firstChild;
}
}
if (/-archive/.test(t)) {
@@ -5255,7 +5262,7 @@
dimensions: function(post) {
var file;
file = post.file;
- if (file && (file.isImage || file.isVideo)) {
+ if (file != null ? file.dimensions : void 0) {
return file.dimensions;
}
return false;
@@ -5267,7 +5274,8 @@
return false;
},
MD5: function(post) {
- if (post.file) {
+ var ref;
+ if ((ref = post.file) != null ? ref.MD5 : void 0) {
return post.file.MD5;
}
return false;
@@ -6997,8 +7005,8 @@
QR.setCustomCooldown(enabled);
return $.set('customCooldownEnabled', enabled);
},
- error: function(err) {
- var el;
+ error: function(err, focusOverride) {
+ var el, notice, notif;
QR.open();
if (typeof err === 'string') {
el = $.tn(err);
@@ -7008,27 +7016,32 @@
}
if (QR.captcha.isEnabled && /captcha|verification/i.test(el.textContent)) {
QR.captcha.setup(true);
- QR.captcha.notify(el);
- } else {
- QR.notify(el);
}
- if (d.hidden && !QR.cooldown.auto) {
- return alert(el.textContent);
- }
- },
- notify: function(el) {
- var notice, notif;
notice = new Notice('warning', el);
- if (!(Header.areNotificationsEnabled && d.hidden)) {
- return QR.notifications.push(notice);
- } else {
+ QR.notifications.push(notice);
+ if (!Header.areNotificationsEnabled) {
+ if (d.hidden && !QR.cooldown.auto) {
+ return alert(el.textContent);
+ }
+ } else if (d.hidden || !(focusOverride || d.hasFocus())) {
notif = new Notification(el.textContent, {
body: el.textContent,
icon: Favicon.logo
});
- return notif.onclick = function() {
+ notif.onclick = function() {
return window.focus();
};
+ if (typeof chrome !== "undefined" && chrome !== null) {
+ notif.onclose = function() {
+ return notice.close();
+ };
+ return notif.onshow = function() {
+ return setTimeout(function() {
+ notif.onclose = null;
+ return notif.close();
+ }, 7 * $.SECOND);
+ };
+ }
}
},
notifications: [],
@@ -7588,7 +7601,6 @@
if (Conf['Posting Success Notifications']) {
QR.notifications.push(new Notice('success', h1.textContent, 5));
}
- QR.persona.set(post);
ref1 = h1.nextSibling.textContent.match(/thread:(\d+),no:(\d+)/), _ = ref1[0], threadID = ref1[1], postID = ref1[2];
postID = +postID;
threadID = +threadID || postID;
@@ -7796,7 +7808,6 @@
}
delete this.nodes.iframe;
delete this.occupied;
- this.unflag();
return this.beforeSetup();
},
sync: function(captchas) {
@@ -7864,17 +7875,6 @@
}
return QR.error("Captcha Error: " + message);
},
- notify: function(el) {
- if (Conf['Captcha Warning Notifications'] && !d.hidden) {
- return QR.notify(el);
- } else {
- $.addClass(this.nodes.input, 'error');
- return $.one(this.nodes.input, 'keydown', this.unflag.bind(this));
- }
- },
- unflag: function() {
- return $.rmClass(this.nodes.input, 'error');
- },
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
@@ -8185,9 +8185,6 @@
return QR.submit();
}
},
- notify: function(el) {
- return QR.notify(el);
- },
clear: function() {
var captcha, i, k, len1, now, ref;
if (!this.captchas.length) {
@@ -8502,8 +8499,7 @@
var persona;
persona = arg['QR.persona'];
persona = {
- name: post.name,
- email: /^sage$/.test(post.email) ? persona.email : post.email
+ name: post.name
};
return $.set('QR.persona', persona);
});
@@ -8560,7 +8556,7 @@
QR.persona.get((function(_this) {
return function(persona) {
_this.name = 'name' in QR.persona.always ? QR.persona.always.name : prev ? prev.name : persona.name;
- _this.email = 'email' in QR.persona.always ? QR.persona.always.email : prev && !/^sage$/.test(prev.email) ? prev.email : persona.email;
+ _this.email = 'email' in QR.persona.always ? QR.persona.always.email : '';
_this.sub = 'sub' in QR.persona.always ? QR.persona.always.sub : '';
if (QR.selected === _this) {
return _this.load();
@@ -8680,6 +8676,8 @@
this.file.newName += '.jpg';
}
return this.updateFilename();
+ case 'name':
+ return QR.persona.set(this);
}
};
@@ -8743,7 +8741,7 @@
};
})(this));
$.on(rmAll, 'click', QR.post.rmErrored);
- return QR.error(div);
+ return QR.error(div, true);
};
_Class.prototype.fileError = function(message) {
@@ -9009,7 +9007,7 @@
FappeTyme = {
init: function() {
var el, k, lc, len1, ref, ref1, type;
- if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!((Conf['Fappe Tyme'] || Conf['Werk Tyme']) && ((ref = g.VIEW) === 'index' || ref === 'thread'))) {
return;
}
this.nodes = {};
@@ -9100,7 +9098,8 @@
});
},
node: function() {
- if (!this.file) {
+ var ref;
+ if (!((ref = this.file) != null ? ref.thumb : void 0)) {
return;
}
if (Gallery.nodes) {
@@ -9112,7 +9111,7 @@
}
},
build: function(image) {
- var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, thumb, value;
+ var candidate, cb, dialog, entry, file, k, key, len1, len2, menuButton, nodes, post, q, ref, ref1, ref2, ref3, thumb, value;
if (Conf['Fullscreen Gallery']) {
$.one(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', function() {
return $.on(d, 'fullscreenchange mozfullscreenchange webkitfullscreenchange', cb.close);
@@ -9179,7 +9178,7 @@
for (q = 0, len2 = ref2.length; q < len2; q++) {
file = ref2[q];
post = Get.postFromNode(file);
- if (!post.file) {
+ if (!((ref3 = post.file) != null ? ref3.thumb : void 0)) {
continue;
}
Gallery.generateThumb(post);
@@ -9209,7 +9208,7 @@
if (post.isClone || post.isHidden) {
return;
}
- if (!(post.file && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
+ if (!(post.file && post.file.thumb && (post.file.isImage || post.file.isVideo || Conf['PDF in Gallery']))) {
return;
}
if (Gallery.fullIDs[post.fullID]) {
@@ -10429,8 +10428,8 @@
});
},
node: function() {
- var ref, thumb;
- if (this.isClone || !((ref = this.file) != null ? ref.isSpoiler : void 0)) {
+ var thumb;
+ if (!(!this.isClone && this.file && this.file.thumb && this.file.isSpoiler)) {
return;
}
thumb = this.file.thumb;
@@ -10471,7 +10470,10 @@
});
},
createSauceLink: function(link, post) {
- var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, ref3;
+ var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip;
+ if (!(link = link.trim())) {
+ return null;
+ }
parts = {};
ref = link.split(/;(?=(?:text|boards|types):)/);
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
@@ -10484,18 +10486,25 @@
}
}
parts['text'] || (parts['text'] = ((ref1 = parts['url'].match(/(\w+)\.\w+\//)) != null ? ref1[1] : void 0) || '?');
+ ext = post.file.URL.match(/[^.]*$/)[0];
+ skip = false;
for (key in parts) {
- parts[key] = parts[key].replace(/%(T?URL|MD5|board|name|%|semi)/g, function(parameter) {
+ parts[key] = parts[key].replace(/%(T?URL|IMG|MD5|board|name|%|semi)/g, function(parameter) {
var type;
type = {
'%TURL': post.file.thumbURL,
'%URL': post.file.URL,
+ '%IMG': ext === 'gif' || ext === 'jpg' || ext === 'png' ? post.file.URL : post.file.thumbURL,
'%MD5': post.file.MD5,
'%board': post.board.ID,
'%name': post.file.name,
'%%': '%',
'%semi': ';'
}[parameter];
+ if (type == null) {
+ skip = true;
+ return '';
+ }
if (key === 'url' && parameter !== '%%' && parameter !== '%semi') {
if (/^javascript:/i.test(parts['url'])) {
type = JSON.stringify(type);
@@ -10505,8 +10514,10 @@
return type;
});
}
- ext = ((ref2 = post.file.URL.match(/\.([^\.]*)$/)) != null ? ref2[1] : void 0) || '';
- if (!(!parts['boards'] || (ref3 = post.board.ID, indexOf.call(parts['boards'].split(','), ref3) >= 0))) {
+ if (skip) {
+ return null;
+ }
+ if (!(!parts['boards'] || (ref2 = post.board.ID, indexOf.call(parts['boards'].split(','), ref2) >= 0))) {
return null;
}
if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
@@ -11878,9 +11889,6 @@
var fileCount, postCount;
postCount = 0;
fileCount = 0;
- if (this.board.ID === 'f') {
- fileCount++;
- }
this.posts.forEach(function(post) {
postCount++;
if (post.file) {
@@ -12046,9 +12054,6 @@
ThreadUpdater.outdateCount = 0;
ThreadUpdater.postIDs = [];
ThreadUpdater.fileIDs = [];
- if (this.board.ID === 'f') {
- ThreadUpdater.fileIDs.push(this.ID);
- }
this.posts.forEach(function(post) {
ThreadUpdater.postIDs.push(post.ID);
if (post.file) {
@@ -13922,7 +13927,7 @@
if (board == null) {
board = g.BOARD.ID;
}
- if (Conf['JSON Navigation']) {
+ if (Conf['JSON Navigation'] && board !== 'f') {
if (g.BOARD.ID === board && g.VIEW === 'index') {
return '#index';
} else {
@@ -14240,13 +14245,17 @@
});
},
node: function() {
+ var info;
if (!this.file || this.isClone) {
return;
}
- $.extend(this.file.text, {
- innerHTML: ""
+ this.file.link.hidden = true;
+ this.file.link.previousSibling.nodeValue = this.file.link.nextSibling.nodeValue = '';
+ info = $.el('span', {
+ className: 'file-info'
});
- return FileInfo.format(Conf['fileInfo'], this, this.file.text.firstElementChild);
+ $.after(this.file.link.nextSibling, info);
+ return FileInfo.format(Conf['fileInfo'], this, info);
},
format: function(formatString, post, outputNode) {
var output;
@@ -14266,7 +14275,7 @@
formatters: {
t: function() {
return {
- innerHTML: E(this.file.URL.match(/\d+\..+$/)[0])
+ innerHTML: E(this.file.URL.match(/[^/]*$/)[0])
};
},
T: function() {
@@ -14347,6 +14356,17 @@
}
};
+ Flash = {
+ init: function() {
+ if (g.BOARD.ID === 'f' && Conf['Enable Native Flash Embedding']) {
+ return $.ready(Flash.initReady);
+ }
+ },
+ initReady: function() {
+ return $.globalEval('if (JSON.parse(localStorage["4chan-settings"] || "{}").disableAll) SWFEmbed.init();');
+ }
+ };
+
Fourchan = {
init: function() {
var ref;
@@ -14354,7 +14374,20 @@
return;
}
if (g.BOARD.ID === 'g') {
- $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: prettyPrintOne(e.detail)\n }));\n}, false);');
+ $.on(window, 'prettyprint:cb', function(e) {
+ var post, pre;
+ if (!(post = g.posts[e.detail.ID])) {
+ return;
+ }
+ if (!(pre = $$('.prettyprint', post.nodes.comment)[e.detail.i])) {
+ return;
+ }
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ pre.innerHTML = e.detail.html;
+ return $.addClass(pre, 'prettyprinted');
+ }
+ });
+ $.globalEval('window.addEventListener(\'prettyprint\', function(e) {\n window.dispatchEvent(new CustomEvent(\'prettyprint:cb\', {\n detail: {\n ID: e.detail.ID,\n i: e.detail.i,\n html: prettyPrintOne(e.detail.html)\n }\n }));\n}, false);');
Post.callbacks.push({
name: 'Parse /g/ code',
cb: this.code
@@ -14376,21 +14409,21 @@
});
},
code: function() {
- var apply, k, len1, pre, ref;
+ var i, k, len1, pre, ref;
if (this.isClone) {
return;
}
- apply = function(e) {
- pre.innerHTML = e.detail;
- return $.addClass(pre, 'prettyprinted');
- };
- $.on(window, 'prettyprint:cb', apply);
- ref = $$('.prettyprint:not(.prettyprinted)', this.nodes.comment);
- for (k = 0, len1 = ref.length; k < len1; k++) {
- pre = ref[k];
- $.event('prettyprint', pre.innerHTML, window);
+ ref = $$('.prettyprint', this.nodes.comment);
+ for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
+ pre = ref[i];
+ if (!$.hasClass(pre, 'prettyprinted')) {
+ $.event('prettyprint', {
+ ID: this.fullID,
+ i: i,
+ html: pre.innerHTML
+ }, window);
+ }
}
- $.off(window, 'prettyprint:cb', apply);
},
math: function() {
if ((this.isClone && doc.contains(this.origin.nodes.root)) || !$('.math', this.nodes.comment)) {
@@ -14524,7 +14557,7 @@
return;
}
}
- if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog')) {
+ if (!(((ref1 = g.VIEW) !== 'index' && ref1 !== 'thread') || g.VIEW === 'index' && Conf['JSON Navigation'] && Conf['Index Mode'] === 'catalog' || g.VIEW === 'index' && g.BOARD.ID === 'f')) {
threadRoot = Nav.getThread();
if (op = $('.op', threadRoot)) {
thread = Get.postFromNode(op).thread;
@@ -14622,7 +14655,7 @@
ThreadUpdater.update();
break;
case 'index':
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
Index.update();
@@ -14656,19 +14689,19 @@
Gallery.cb.toggle();
break;
case Conf['fappeTyme']:
- if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Fappe Tyme'] && ((ref2 = g.VIEW) === 'index' || ref2 === 'thread'))) {
return;
}
FappeTyme.toggle('fappe');
break;
case Conf['werkTyme']:
- if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread') && g.BOARD.ID !== 'f')) {
+ if (!(Conf['Werk Tyme'] && ((ref3 = g.VIEW) === 'index' || ref3 === 'thread'))) {
return;
}
FappeTyme.toggle('werk');
break;
case Conf['Front page']:
- if (Conf['JSON Navigation'] && g.VIEW === 'index') {
+ if (Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f') {
Index.userPageNav(1);
} else {
window.location = "/" + g.BOARD + "/";
@@ -14678,7 +14711,7 @@
$.open("/" + g.BOARD + "/");
break;
case Conf['Next page']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
if (Conf['JSON Navigation']) {
@@ -14693,7 +14726,7 @@
}
break;
case Conf['Previous page']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
if (Conf['JSON Navigation']) {
@@ -14708,7 +14741,7 @@
}
break;
case Conf['Search form']:
- if (g.VIEW !== 'index') {
+ if (!(g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
searchInput = Conf['JSON Navigation'] ? Index.searchInput : $.id('search-box');
@@ -14716,28 +14749,31 @@
searchInput.focus();
break;
case Conf['Paged mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#paged' : "/" + g.BOARD + "/#paged";
break;
case Conf['Infinite scrolling mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#infinite' : "/" + g.BOARD + "/#infinite";
break;
case Conf['All pages mode']:
- if (!Conf['JSON Navigation']) {
+ if (!(Conf['JSON Navigation'] && g.BOARD.ID !== 'f')) {
return;
}
window.location = g.VIEW === 'index' ? '#all-pages' : "/" + g.BOARD + "/#all-pages";
break;
case Conf['Open catalog']:
+ if (g.BOARD.ID === 'f') {
+ return;
+ }
window.location = CatalogLinks.catalog();
break;
case Conf['Cycle sort type']:
- if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD !== 'f')) {
+ if (!(Conf['JSON Navigation'] && g.VIEW === 'index' && g.BOARD.ID !== 'f')) {
return;
}
Index.cycleSortType();
@@ -15701,7 +15737,7 @@
sauce: function(section) {
var ta;
$.extend(section, {
- innerHTML: "Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%MD5: MD5 hash.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;.
"
+ innerHTML: "Sauce is disabled.
Lines starting with a # will be ignored.
You can specify a display text by appending ;text:[text] to the URL.
You can specify the applicable boards by appending ;boards:[board1],[board2].
You can specify the applicable file types by appending ;types:[extension1],[extension2].
These parameters will be replaced by their corresponding values:%TURL: Thumbnail URL.%URL: Full image URL.%IMG: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.%MD5: MD5 hash.%name: Original file name.%board: Current board.%%, %semi: Literal % and ;.
"
});
$('.warning', section).hidden = Conf['Sauce'];
ta = $('textarea', section);
@@ -15713,7 +15749,7 @@
advanced: function(section) {
var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z;
$.extend(section, {
- innerHTML: ""
+ innerHTML: ""
});
ref = $$('.warning', section);
for (k = 0, len1 = ref.length; k < len1; k++) {
@@ -15985,7 +16021,7 @@
Main = {
init: function() {
- var db, flatten, k, len1, pathname, ref, ref1, type;
+ var db, flatten, k, len1, pathname, ref, ref1, ref2, type;
if (location.hostname === 'www.google.com') {
type = location.pathname === '/recaptcha/api/fallback' ? 'noscript' : 'v2';
return $.ready(function() {
@@ -16012,6 +16048,12 @@
return 'index';
}
})();
+ if (g.VIEW === 'catalog' && g.BOARD.ID === 'f') {
+ return;
+ }
+ if (g.VIEW === 'archive' && ((ref1 = g.BOARD.ID) === 'b' || ref1 === 'f')) {
+ return;
+ }
if (g.VIEW === 'thread') {
g.THREADID = +pathname[3];
}
@@ -16029,9 +16071,9 @@
}
};
flatten(null, Config);
- ref1 = DataBoard.keys;
- for (k = 0, len1 = ref1.length; k < len1; k++) {
- db = ref1[k];
+ ref2 = DataBoard.keys;
+ for (k = 0, len1 = ref2.length; k < len1; k++) {
+ db = ref2[k];
Conf[db] = {
boards: {}
};
@@ -18156,9 +18198,6 @@
" width: 100%;\n" +
" margin: 1px 0 0;\n" +
"}\n" +
-".captcha-input.error:focus {\n" +
-" border-color: rgb(255,0,0) !important;\n" +
-"}\n" +
"#qr-captcha-iframe {\n" +
" display: none;\n" +
"}\n" +
@@ -19330,7 +19369,7 @@
" font-family: sans-serif !important;\n" +
" text-shadow: 1px 1px 1px rgba(0,74,153,0.6);\n" +
"}",
- features: [['Polyfill', Polyfill], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner]]
+ features: [['Polyfill', Polyfill], ['Redirect', Redirect], ['Header', Header], ['Catalog Links', CatalogLinks], ['Settings', Settings], ['Index Generator', Index], ['Disable Autoplay', AntiAutoplay], ['Announcement Hiding', PSAHiding], ['Fourchan thingies', Fourchan], ['Color User IDs', IDColor], ['Highlight by User ID', IDHighlight], ['Custom CSS', CustomCSS], ['Linkify', Linkify], ['Reveal Spoilers', RemoveSpoilers], ['Resurrect Quotes', Quotify], ['Filter', Filter], ['Thread Hiding Buttons', ThreadHiding], ['Reply Hiding Buttons', PostHiding], ['Recursive', Recursive], ['Strike-through Quotes', QuoteStrikeThrough], ['Quick Reply', QR], ['Menu', Menu], ['Index Generator (Menu)', Index.menu], ['Report Link', ReportLink], ['Thread Hiding (Menu)', ThreadHiding.menu], ['Reply Hiding (Menu)', PostHiding.menu], ['Delete Link', DeleteLink], ['Filter (Menu)', Filter.menu], ['Download Link', DownloadLink], ['Archive Link', ArchiveLink], ['Quote Inlining', QuoteInline], ['Quote Previewing', QuotePreview], ['Quote Backlinks', QuoteBacklink], ['Mark Quotes of You', QuoteYou], ['Mark OP Quotes', QuoteOP], ['Mark Cross-thread Quotes', QuoteCT], ['Anonymize', Anonymize], ['Time Formatting', Time], ['Relative Post Dates', RelativeDates], ['File Info Formatting', FileInfo], ['Fappe Tyme', FappeTyme], ['Gallery', Gallery], ['Gallery (menu)', Gallery.menu], ['Sauce', Sauce], ['Image Expansion', ImageExpand], ['Image Expansion (Menu)', ImageExpand.menu], ['Reveal Spoiler Thumbnails', RevealSpoilers], ['Image Loading', ImageLoader], ['Image Hover', ImageHover], ['Volume Control', Volume], ['WEBM Metadata', Metadata], ['Comment Expansion', ExpandComment], ['Thread Expansion', ExpandThread], ['Thread Excerpt', ThreadExcerpt], ['Favicon', Favicon], ['Unread', Unread], ['Quote Threading', QuoteThreading], ['Thread Stats', ThreadStats], ['Thread Updater', ThreadUpdater], ['Thread Watcher', ThreadWatcher], ['Thread Watcher (Menu)', ThreadWatcher.menu], ['Mark New IPs', MarkNewIPs], ['Index Navigation', Nav], ['Keybinds', Keybinds], ['Banner', Banner], ['Flash Features', Flash]]
};
Main.init();
diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip
index 7ead84da5..2b8700c86 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 44f70cba0..011b211fe 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 ea4b68d2c..cc60b2b57 100644
--- a/builds/updates.xml
+++ b/builds/updates.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/package.json b/package.json
index 9852ee9e4..260044418 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.4.6",
- "date": "2015-03-15T07:03:19.956Z",
+ "version": "1.10.5.0",
+ "date": "2015-03-15T19:30:08.316Z",
"repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/",