Release 4chan X v1.10.12.0.

This commit is contained in:
ccd0 2015-05-04 20:31:17 -07:00
parent 24a7311a7a
commit 245548b1bc
13 changed files with 231 additions and 111 deletions

View File

@ -2,6 +2,15 @@ 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.12
**v1.10.12.0** *(2015-05-04)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.12.0/builds/4chan-X-noupdate.crx "Chromium version")]
- Based on v1.10.11.12.
- Fix files dropped on captcha causing navigation to the file.
- Fix size of report window when Javascript is disabled.
- QR character count now handles surrogate pairs correctly and turns red when the limit of 2000 is reached.
- Add `;sandbox` option to sauce links to open links without scripts or popups. Re-add swfchan.
### v1.10.11
**v1.10.11.12** *(2015-05-03)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.11.12/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.10.11.12/builds/4chan-X-noupdate.crx "Chromium version")]

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X beta
// @version 1.10.11.12
// @version 1.10.12.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X beta
// @version 1.10.11.12
// @version 1.10.12.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -292,7 +292,7 @@
filesize: '',
MD5: ''
},
sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\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,fit,gd,h,i,jp,k,m,mlp,po,qa,r9k,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",
sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\nhttp://eye.swfchan.com/search/?q=%name;types:swf;sandbox\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,fit,gd,h,i,jp,k,m,mlp,po,qa,r9k,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
},
@ -396,7 +396,7 @@
doc = d.documentElement;
g = {
VERSION: '1.10.11.12',
VERSION: '1.10.12.0',
NAMESPACE: '4chan X.',
boards: {}
};
@ -430,6 +430,10 @@
return html;
};
E.url = function(content) {
return "data:text/html;charset=utf-8,<!doctype html>" + (encodeURIComponent(content.innerHTML));
};
$ = function(selector, root) {
if (root == null) {
root = d.body;
@ -6710,7 +6714,6 @@
if (g.VIEW === 'archive') {
return;
}
$.globalEval('document.documentElement.classList.add("js-enabled");');
noscript = Conf['Force Noscript Captcha'] || !$.hasClass(doc, 'js-enabled');
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
$.on(d, '4chanXInitFinished', this.initReady);
@ -6783,6 +6786,8 @@
$.on(d, 'dragover', QR.dragOver);
$.on(d, 'drop', QR.dropFile);
$.on(d, 'dragstart dragend', QR.drag);
$.on(d, 'dragenter', QR.dragEnter);
$.on(d, 'dragleave', QR.dragLeave);
$.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
$.on(d, 'ThreadUpdate', QR.statusCheck);
if (!Conf['Persistent QR']) {
@ -7063,10 +7068,10 @@
characterCount: function() {
var count, counter;
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
counter.textContent = count;
counter.hidden = count < 1000;
return (count > 1500 ? $.addClass : $.rmClass)(counter, 'warning');
return (count > 2000 ? $.addClass : $.rmClass)(counter, 'warning');
},
getFile: function() {
var ref;
@ -7092,6 +7097,8 @@
return e.dataTransfer.dropEffect = 'copy';
},
dropFile: function(e) {
delete QR.dragTarget;
$.rmClass(doc, 'dragging');
if (!e.dataTransfer.files.length) {
return;
}
@ -7099,6 +7106,16 @@
QR.open();
return QR.handleFiles(e.dataTransfer.files);
},
dragEnter: function(e) {
QR.dragTarget = e.target;
return $.addClass(doc, 'dragging');
},
dragLeave: function(e) {
if (QR.dragTarget === e.target) {
delete QR.dragTarget;
return $.rmClass(doc, 'dragging');
}
},
paste: function(e) {
var blob, files, item, k, len1, ref;
if (!e.clipboardData.items) {
@ -10590,19 +10607,24 @@
cb: this.node
});
},
sandbox: function(url) {
return E.url({
innerHTML: "<html><head><title>[sb] " + E(url) + "</title><style>iframe {width: 100vw;height: 100vh;border: 0;}body {margin: 0;overflow: hidden;}</style></head><body><iframe sandbox=\"allow-forms\" src=\"" + E(url) + "\"></iframe></body></html>"
});
},
createSauceLink: function(link, post) {
var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip;
var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip, url;
if (!(link = link.trim())) {
return null;
}
parts = {};
ref = link.split(/;(?=(?:text|boards|types):)/);
ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
part = ref[i];
if (i === 0) {
parts['url'] = part;
} else {
m = part.match(/^(\w*):(.*)$/);
m = part.match(/^(\w*):?(.*)$/);
parts[m[1]] = m[2];
}
}
@ -10644,8 +10666,12 @@
if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
return null;
}
url = parts['url'];
if (parts['sandbox'] != null) {
url = Sauce.sandbox(url);
}
a = Sauce.link.cloneNode(true);
a.href = parts['url'];
a.href = url;
a.textContent = parts['text'];
if (/^javascript:/i.test(parts['url'])) {
a.removeAttribute('target');
@ -11082,7 +11108,7 @@
content = {
innerHTML: "<html><head><title>" + E(a.dataset.uid) + "</title></head><body><script src=\"https://gist.github.com/" + E(a.dataset.uid) + ".js\"></script></body></html>"
};
el.src = "data:text/html;charset=utf-8,<!doctype html>" + (encodeURIComponent(content.innerHTML));
el.src = E.url(content);
return el;
},
title: {
@ -15383,6 +15409,7 @@
};
Report = {
css: ':root:not(.js-enabled) #g-recaptcha {\n height: auto;\n}',
init: function() {
var match;
if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) {
@ -15392,21 +15419,28 @@
return $.ready(this.ready);
},
ready: function() {
new MutationObserver(Report.resize).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
$.addStyle(Report.css);
if (Conf['Archive Report']) {
return Report.archive();
Report.archive();
}
if ($.hasClass(doc, 'js-enabled')) {
return new MutationObserver(function() {
return Report.fit('.gc-bubbleDefault');
}).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
} else {
return Report.fit('body');
}
},
resize: function() {
var bubble, dy;
if (!(bubble = $('.gc-bubbleDefault'))) {
fit: function(selector) {
var dy, el;
if (!(el = $(selector, doc))) {
return;
}
dy = bubble.getBoundingClientRect().bottom - doc.clientHeight;
dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
if (dy > 0) {
return window.resizeBy(0, dy);
}
@ -15944,7 +15978,7 @@
sauce: function(section) {
var ta;
$.extend(section, {
innerHTML: "<div class=\"warning\"><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div><div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li><li><code>%%</code>, <code>%semi</code>: Literal <code>%</code> and <code>;</code>.</li></ul><textarea name=\"sauces\" class=\"field\" spellcheck=\"false\"></textarea>"
innerHTML: "<div class=\"warning\"><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div><div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div><div>You can open links with scripts and popups disabled by appending <code>;sandbox</code>.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li><li><code>%%</code>, <code>%semi</code>: Literal <code>%</code> and <code>;</code>.</li></ul><textarea name=\"sauces\" class=\"field\" spellcheck=\"false\"></textarea>"
});
$('.warning', section).hidden = Conf['Sauce'];
ta = $('textarea', section);
@ -16316,7 +16350,10 @@
});
},
initFeatures: function() {
var err, feature, k, len1, name, pathname, ref, ref1;
var err, feature, k, len1, name, pathname, ref, ref1, ref2;
if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org') {
$.globalEval('document.documentElement.classList.add("js-enabled");');
}
switch (location.hostname) {
case 'a.4cdn.org':
return;
@ -16330,8 +16367,8 @@
$.asap((function() {
return d.readyState !== 'loading';
}), function() {
var URL, pathname, ref, video;
if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
var URL, pathname, ref1, video;
if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
URL = Redirect.to('file', {
@ -16360,9 +16397,9 @@
history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
}
}
ref = Main.features;
for (k = 0, len1 = ref.length; k < len1; k++) {
ref1 = ref[k], name = ref1[0], feature = ref1[1];
ref1 = Main.features;
for (k = 0, len1 = ref1.length; k < len1; k++) {
ref2 = ref1[k], name = ref2[0], feature = ref2[1];
try {
feature.init();
} catch (_error) {
@ -18351,13 +18388,6 @@
" float: right;\n" +
" padding: 0 3px;\n" +
"}\n" +
"#qr .warning {\n" +
" min-height: 1.6em;\n" +
" vertical-align: middle;\n" +
" padding: 0 1px;\n" +
" border-width: 1px;\n" +
" border-style: solid;\n" +
"}\n" +
".qr-link-container {\n" +
" text-align: center;\n" +
"}\n" +
@ -18467,6 +18497,10 @@
".goog-bubble-content iframe {\n" +
" position: static !important;\n" +
"}\n" +
"/* Prevent dragging files into captcha */\n" +
":root.dragging iframe {\n" +
" pointer-events: none;\n" +
"}\n" +
"/* File Input, Submit Button */\n" +
"#file-n-submit {\n" +
" display: -webkit-flex;\n" +
@ -18671,6 +18705,9 @@
" right: 1px;\n" +
" pointer-events: none;\n" +
"}\n" +
"#char-count.warning {\n" +
" color: red;\n" +
"}\n" +
"/* Menu */\n" +
".menu-button:not(.fa-bars) {\n" +
" display: inline-block;\n" +

Binary file not shown.

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
// @version 1.10.11.12
// @version 1.10.12.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -291,7 +291,7 @@
filesize: '',
MD5: ''
},
sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\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,fit,gd,h,i,jp,k,m,mlp,po,qa,r9k,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",
sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\nhttp://eye.swfchan.com/search/?q=%name;types:swf;sandbox\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,fit,gd,h,i,jp,k,m,mlp,po,qa,r9k,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.11.12',
VERSION: '1.10.12.0',
NAMESPACE: '4chan X.',
boards: {}
};
@ -429,6 +429,10 @@
return html;
};
E.url = function(content) {
return "data:text/html;charset=utf-8,<!doctype html>" + (encodeURIComponent(content.innerHTML));
};
$ = function(selector, root) {
if (root == null) {
root = d.body;
@ -6709,7 +6713,6 @@
if (g.VIEW === 'archive') {
return;
}
$.globalEval('document.documentElement.classList.add("js-enabled");');
noscript = Conf['Force Noscript Captcha'] || !$.hasClass(doc, 'js-enabled');
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
$.on(d, '4chanXInitFinished', this.initReady);
@ -6782,6 +6785,8 @@
$.on(d, 'dragover', QR.dragOver);
$.on(d, 'drop', QR.dropFile);
$.on(d, 'dragstart dragend', QR.drag);
$.on(d, 'dragenter', QR.dragEnter);
$.on(d, 'dragleave', QR.dragLeave);
$.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
$.on(d, 'ThreadUpdate', QR.statusCheck);
if (!Conf['Persistent QR']) {
@ -7062,10 +7067,10 @@
characterCount: function() {
var count, counter;
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
counter.textContent = count;
counter.hidden = count < 1000;
return (count > 1500 ? $.addClass : $.rmClass)(counter, 'warning');
return (count > 2000 ? $.addClass : $.rmClass)(counter, 'warning');
},
getFile: function() {
var ref;
@ -7091,6 +7096,8 @@
return e.dataTransfer.dropEffect = 'copy';
},
dropFile: function(e) {
delete QR.dragTarget;
$.rmClass(doc, 'dragging');
if (!e.dataTransfer.files.length) {
return;
}
@ -7098,6 +7105,16 @@
QR.open();
return QR.handleFiles(e.dataTransfer.files);
},
dragEnter: function(e) {
QR.dragTarget = e.target;
return $.addClass(doc, 'dragging');
},
dragLeave: function(e) {
if (QR.dragTarget === e.target) {
delete QR.dragTarget;
return $.rmClass(doc, 'dragging');
}
},
paste: function(e) {
var blob, files, item, k, len1, ref;
if (!e.clipboardData.items) {
@ -10589,19 +10606,24 @@
cb: this.node
});
},
sandbox: function(url) {
return E.url({
innerHTML: "<html><head><title>[sb] " + E(url) + "</title><style>iframe {width: 100vw;height: 100vh;border: 0;}body {margin: 0;overflow: hidden;}</style></head><body><iframe sandbox=\"allow-forms\" src=\"" + E(url) + "\"></iframe></body></html>"
});
},
createSauceLink: function(link, post) {
var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip;
var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip, url;
if (!(link = link.trim())) {
return null;
}
parts = {};
ref = link.split(/;(?=(?:text|boards|types):)/);
ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
part = ref[i];
if (i === 0) {
parts['url'] = part;
} else {
m = part.match(/^(\w*):(.*)$/);
m = part.match(/^(\w*):?(.*)$/);
parts[m[1]] = m[2];
}
}
@ -10643,8 +10665,12 @@
if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
return null;
}
url = parts['url'];
if (parts['sandbox'] != null) {
url = Sauce.sandbox(url);
}
a = Sauce.link.cloneNode(true);
a.href = parts['url'];
a.href = url;
a.textContent = parts['text'];
if (/^javascript:/i.test(parts['url'])) {
a.removeAttribute('target');
@ -11081,7 +11107,7 @@
content = {
innerHTML: "<html><head><title>" + E(a.dataset.uid) + "</title></head><body><script src=\"https://gist.github.com/" + E(a.dataset.uid) + ".js\"></script></body></html>"
};
el.src = "data:text/html;charset=utf-8,<!doctype html>" + (encodeURIComponent(content.innerHTML));
el.src = E.url(content);
return el;
},
title: {
@ -15382,6 +15408,7 @@
};
Report = {
css: ':root:not(.js-enabled) #g-recaptcha {\n height: auto;\n}',
init: function() {
var match;
if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) {
@ -15391,21 +15418,28 @@
return $.ready(this.ready);
},
ready: function() {
new MutationObserver(Report.resize).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
$.addStyle(Report.css);
if (Conf['Archive Report']) {
return Report.archive();
Report.archive();
}
if ($.hasClass(doc, 'js-enabled')) {
return new MutationObserver(function() {
return Report.fit('.gc-bubbleDefault');
}).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
} else {
return Report.fit('body');
}
},
resize: function() {
var bubble, dy;
if (!(bubble = $('.gc-bubbleDefault'))) {
fit: function(selector) {
var dy, el;
if (!(el = $(selector, doc))) {
return;
}
dy = bubble.getBoundingClientRect().bottom - doc.clientHeight;
dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
if (dy > 0) {
return window.resizeBy(0, dy);
}
@ -15943,7 +15977,7 @@
sauce: function(section) {
var ta;
$.extend(section, {
innerHTML: "<div class=\"warning\"><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div><div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li><li><code>%%</code>, <code>%semi</code>: Literal <code>%</code> and <code>;</code>.</li></ul><textarea name=\"sauces\" class=\"field\" spellcheck=\"false\"></textarea>"
innerHTML: "<div class=\"warning\"><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div><div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div><div>You can open links with scripts and popups disabled by appending <code>;sandbox</code>.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li><li><code>%%</code>, <code>%semi</code>: Literal <code>%</code> and <code>;</code>.</li></ul><textarea name=\"sauces\" class=\"field\" spellcheck=\"false\"></textarea>"
});
$('.warning', section).hidden = Conf['Sauce'];
ta = $('textarea', section);
@ -16315,7 +16349,10 @@
});
},
initFeatures: function() {
var err, feature, k, len1, name, pathname, ref, ref1;
var err, feature, k, len1, name, pathname, ref, ref1, ref2;
if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org') {
$.globalEval('document.documentElement.classList.add("js-enabled");');
}
switch (location.hostname) {
case 'a.4cdn.org':
return;
@ -16329,8 +16366,8 @@
$.asap((function() {
return d.readyState !== 'loading';
}), function() {
var URL, pathname, ref, video;
if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
var URL, pathname, ref1, video;
if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
URL = Redirect.to('file', {
@ -16359,9 +16396,9 @@
history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
}
}
ref = Main.features;
for (k = 0, len1 = ref.length; k < len1; k++) {
ref1 = ref[k], name = ref1[0], feature = ref1[1];
ref1 = Main.features;
for (k = 0, len1 = ref1.length; k < len1; k++) {
ref2 = ref1[k], name = ref2[0], feature = ref2[1];
try {
feature.init();
} catch (_error) {
@ -18350,13 +18387,6 @@
" float: right;\n" +
" padding: 0 3px;\n" +
"}\n" +
"#qr .warning {\n" +
" min-height: 1.6em;\n" +
" vertical-align: middle;\n" +
" padding: 0 1px;\n" +
" border-width: 1px;\n" +
" border-style: solid;\n" +
"}\n" +
".qr-link-container {\n" +
" text-align: center;\n" +
"}\n" +
@ -18466,6 +18496,10 @@
".goog-bubble-content iframe {\n" +
" position: static !important;\n" +
"}\n" +
"/* Prevent dragging files into captcha */\n" +
":root.dragging iframe {\n" +
" pointer-events: none;\n" +
"}\n" +
"/* File Input, Submit Button */\n" +
"#file-n-submit {\n" +
" display: -webkit-flex;\n" +
@ -18670,6 +18704,9 @@
" right: 1px;\n" +
" pointer-events: none;\n" +
"}\n" +
"#char-count.warning {\n" +
" color: red;\n" +
"}\n" +
"/* Menu */\n" +
".menu-button:not(.fa-bars) {\n" +
" display: inline-block;\n" +

Binary file not shown.

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
// @version 1.10.11.12
// @version 1.10.12.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X

View File

@ -1,7 +1,7 @@
// Generated by CoffeeScript
// ==UserScript==
// @name 4chan X
// @version 1.10.11.12
// @version 1.10.12.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@ -292,7 +292,7 @@
filesize: '',
MD5: ''
},
sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\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,fit,gd,h,i,jp,k,m,mlp,po,qa,r9k,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",
sauces: "https://www.google.com/searchbyimage?image_url=%IMG\nhttp://iqdb.org/?url=%IMG\nhttp://eye.swfchan.com/search/?q=%name;types:swf;sandbox\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,fit,gd,h,i,jp,k,m,mlp,po,qa,r9k,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
},
@ -396,7 +396,7 @@
doc = d.documentElement;
g = {
VERSION: '1.10.11.12',
VERSION: '1.10.12.0',
NAMESPACE: '4chan X.',
boards: {}
};
@ -430,6 +430,10 @@
return html;
};
E.url = function(content) {
return "data:text/html;charset=utf-8,<!doctype html>" + (encodeURIComponent(content.innerHTML));
};
$ = function(selector, root) {
if (root == null) {
root = d.body;
@ -6710,7 +6714,6 @@
if (g.VIEW === 'archive') {
return;
}
$.globalEval('document.documentElement.classList.add("js-enabled");');
noscript = Conf['Force Noscript Captcha'] || !$.hasClass(doc, 'js-enabled');
this.captcha = Captcha[noscript ? 'noscript' : 'v2'];
$.on(d, '4chanXInitFinished', this.initReady);
@ -6783,6 +6786,8 @@
$.on(d, 'dragover', QR.dragOver);
$.on(d, 'drop', QR.dropFile);
$.on(d, 'dragstart dragend', QR.drag);
$.on(d, 'dragenter', QR.dragEnter);
$.on(d, 'dragleave', QR.dragLeave);
$.on(d, 'IndexRefresh', QR.generatePostableThreadsList);
$.on(d, 'ThreadUpdate', QR.statusCheck);
if (!Conf['Persistent QR']) {
@ -7063,10 +7068,10 @@
characterCount: function() {
var count, counter;
counter = QR.nodes.charCount;
count = QR.nodes.com.textLength;
count = QR.nodes.com.value.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
counter.textContent = count;
counter.hidden = count < 1000;
return (count > 1500 ? $.addClass : $.rmClass)(counter, 'warning');
return (count > 2000 ? $.addClass : $.rmClass)(counter, 'warning');
},
getFile: function() {
var ref;
@ -7092,6 +7097,8 @@
return e.dataTransfer.dropEffect = 'copy';
},
dropFile: function(e) {
delete QR.dragTarget;
$.rmClass(doc, 'dragging');
if (!e.dataTransfer.files.length) {
return;
}
@ -7099,6 +7106,16 @@
QR.open();
return QR.handleFiles(e.dataTransfer.files);
},
dragEnter: function(e) {
QR.dragTarget = e.target;
return $.addClass(doc, 'dragging');
},
dragLeave: function(e) {
if (QR.dragTarget === e.target) {
delete QR.dragTarget;
return $.rmClass(doc, 'dragging');
}
},
paste: function(e) {
var blob, files, item, k, len1, ref;
if (!e.clipboardData.items) {
@ -10590,19 +10607,24 @@
cb: this.node
});
},
sandbox: function(url) {
return E.url({
innerHTML: "<html><head><title>[sb] " + E(url) + "</title><style>iframe {width: 100vw;height: 100vh;border: 0;}body {margin: 0;overflow: hidden;}</style></head><body><iframe sandbox=\"allow-forms\" src=\"" + E(url) + "\"></iframe></body></html>"
});
},
createSauceLink: function(link, post) {
var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip;
var a, ext, i, k, key, len1, m, part, parts, ref, ref1, ref2, skip, url;
if (!(link = link.trim())) {
return null;
}
parts = {};
ref = link.split(/;(?=(?:text|boards|types):)/);
ref = link.split(/;(?=(?:text|boards|types|sandbox):?)/);
for (i = k = 0, len1 = ref.length; k < len1; i = ++k) {
part = ref[i];
if (i === 0) {
parts['url'] = part;
} else {
m = part.match(/^(\w*):(.*)$/);
m = part.match(/^(\w*):?(.*)$/);
parts[m[1]] = m[2];
}
}
@ -10644,8 +10666,12 @@
if (!(!parts['types'] || indexOf.call(parts['types'].split(','), ext) >= 0)) {
return null;
}
url = parts['url'];
if (parts['sandbox'] != null) {
url = Sauce.sandbox(url);
}
a = Sauce.link.cloneNode(true);
a.href = parts['url'];
a.href = url;
a.textContent = parts['text'];
if (/^javascript:/i.test(parts['url'])) {
a.removeAttribute('target');
@ -11082,7 +11108,7 @@
content = {
innerHTML: "<html><head><title>" + E(a.dataset.uid) + "</title></head><body><script src=\"https://gist.github.com/" + E(a.dataset.uid) + ".js\"></script></body></html>"
};
el.src = "data:text/html;charset=utf-8,<!doctype html>" + (encodeURIComponent(content.innerHTML));
el.src = E.url(content);
return el;
},
title: {
@ -15383,6 +15409,7 @@
};
Report = {
css: ':root:not(.js-enabled) #g-recaptcha {\n height: auto;\n}',
init: function() {
var match;
if (!(/\bmode=report\b/.test(location.search) && (match = location.search.match(/\bno=(\d+)/)))) {
@ -15392,21 +15419,28 @@
return $.ready(this.ready);
},
ready: function() {
new MutationObserver(Report.resize).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
$.addStyle(Report.css);
if (Conf['Archive Report']) {
return Report.archive();
Report.archive();
}
if ($.hasClass(doc, 'js-enabled')) {
return new MutationObserver(function() {
return Report.fit('.gc-bubbleDefault');
}).observe(d.body, {
childList: true,
attributes: true,
subtree: true
});
} else {
return Report.fit('body');
}
},
resize: function() {
var bubble, dy;
if (!(bubble = $('.gc-bubbleDefault'))) {
fit: function(selector) {
var dy, el;
if (!(el = $(selector, doc))) {
return;
}
dy = bubble.getBoundingClientRect().bottom - doc.clientHeight;
dy = el.getBoundingClientRect().bottom - doc.clientHeight + 8;
if (dy > 0) {
return window.resizeBy(0, dy);
}
@ -15944,7 +15978,7 @@
sauce: function(section) {
var ta;
$.extend(section, {
innerHTML: "<div class=\"warning\"><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div><div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li><li><code>%%</code>, <code>%semi</code>: Literal <code>%</code> and <code>;</code>.</li></ul><textarea name=\"sauces\" class=\"field\" spellcheck=\"false\"></textarea>"
innerHTML: "<div class=\"warning\"><code>Sauce</code> is disabled.</div><div>Lines starting with a <code>#</code> will be ignored.</div><div>You can specify a display text by appending <code>;text:[text]</code> to the URL.</div><div>You can specify the applicable boards by appending <code>;boards:[board1],[board2]</code>.</div><div>You can specify the applicable file types by appending <code>;types:[extension1],[extension2]</code>.</div><div>You can open links with scripts and popups disabled by appending <code>;sandbox</code>.</div><ul>These parameters will be replaced by their corresponding values:<li><code>%TURL</code>: Thumbnail URL.</li><li><code>%URL</code>: Full image URL.</li><li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li><li><code>%MD5</code>: MD5 hash.</li><li><code>%name</code>: Original file name.</li><li><code>%board</code>: Current board.</li><li><code>%%</code>, <code>%semi</code>: Literal <code>%</code> and <code>;</code>.</li></ul><textarea name=\"sauces\" class=\"field\" spellcheck=\"false\"></textarea>"
});
$('.warning', section).hidden = Conf['Sauce'];
ta = $('textarea', section);
@ -16316,7 +16350,10 @@
});
},
initFeatures: function() {
var err, feature, k, len1, name, pathname, ref, ref1;
var err, feature, k, len1, name, pathname, ref, ref1, ref2;
if ((ref = location.hostname) === 'boards.4chan.org' || ref === 'sys.4chan.org') {
$.globalEval('document.documentElement.classList.add("js-enabled");');
}
switch (location.hostname) {
case 'a.4cdn.org':
return;
@ -16330,8 +16367,8 @@
$.asap((function() {
return d.readyState !== 'loading';
}), function() {
var URL, pathname, ref, video;
if (Conf['404 Redirect'] && ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found')) {
var URL, pathname, ref1, video;
if (Conf['404 Redirect'] && ((ref1 = d.title) === '4chan - Temporarily Offline' || ref1 === '4chan - 404 Not Found')) {
Redirect.init();
pathname = location.pathname.split('/');
URL = Redirect.to('file', {
@ -16360,9 +16397,9 @@
history.replaceState(null, '', pathname.slice(0, 4).join('/') + location.hash);
}
}
ref = Main.features;
for (k = 0, len1 = ref.length; k < len1; k++) {
ref1 = ref[k], name = ref1[0], feature = ref1[1];
ref1 = Main.features;
for (k = 0, len1 = ref1.length; k < len1; k++) {
ref2 = ref1[k], name = ref2[0], feature = ref2[1];
try {
feature.init();
} catch (_error) {
@ -18351,13 +18388,6 @@
" float: right;\n" +
" padding: 0 3px;\n" +
"}\n" +
"#qr .warning {\n" +
" min-height: 1.6em;\n" +
" vertical-align: middle;\n" +
" padding: 0 1px;\n" +
" border-width: 1px;\n" +
" border-style: solid;\n" +
"}\n" +
".qr-link-container {\n" +
" text-align: center;\n" +
"}\n" +
@ -18467,6 +18497,10 @@
".goog-bubble-content iframe {\n" +
" position: static !important;\n" +
"}\n" +
"/* Prevent dragging files into captcha */\n" +
":root.dragging iframe {\n" +
" pointer-events: none;\n" +
"}\n" +
"/* File Input, Submit Button */\n" +
"#file-n-submit {\n" +
" display: -webkit-flex;\n" +
@ -18671,6 +18705,9 @@
" right: 1px;\n" +
" pointer-events: none;\n" +
"}\n" +
"#char-count.warning {\n" +
" color: red;\n" +
"}\n" +
"/* Menu */\n" +
".menu-button:not(.fa-bars) {\n" +
" display: inline-block;\n" +

Binary file not shown.

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.11.12' />
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X-beta.crx' version='1.10.12.0' />
</app>
</gupdate>

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='lacclbnghgdicfifcamcmcnilckjamag'>
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.11.12' />
<updatecheck codebase='https://ccd0.github.io/4chan-x/builds/4chan-X.crx' version='1.10.12.0' />
</app>
</gupdate>

View File

@ -3,8 +3,8 @@
"description": "Cross-browser userscript for maximum lurking on 4chan.",
"meta": {
"name": "4chan X",
"version": "1.10.11.12",
"date": "2015-05-03T22:48:31.015Z",
"version": "1.10.12.0",
"date": "2015-05-05T03:30:07.989Z",
"repo": "https://github.com/ccd0/4chan-x/",
"page": "https://github.com/ccd0/4chan-x",
"downloads": "https://ccd0.github.io/4chan-x/builds/",