Tag:
%gLiteral %: %%
"
});
ref = $$('.warning', section);
for (j = 0, len = ref.length; j < len; j++) {
@@ -11695,7 +11694,7 @@ ImageCommon = (function() {
_this.href = URL.createObjectURL(blob);
return _this.click();
} else {
- return new Notice('error', "Could not download " + _this.href, 30);
+ return new Notice('warning', "Could not download " + _this.href, 30);
}
};
})(this));
@@ -11875,12 +11874,12 @@ ImageExpand = (function() {
}
if (doc.contains(el)) {
if (bottom <= 0) {
- window.scroll(0, scrollY + d.body.clientHeight - oldHeight);
+ window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight);
} else {
Header.scrollToIfNeeded(post.nodes.root);
}
if (window.scrollX > 0) {
- window.scroll(0, window.scrollY);
+ window.scrollBy(-window.scrollX, 0);
}
}
$.off(el, 'error', ImageExpand.error);
@@ -11973,7 +11972,7 @@ ImageExpand = (function() {
file.isExpanded = true;
delete file.isExpanding;
if (doc.contains(post.nodes.root) && bottom <= 0) {
- window.scroll(window.scrollX, scrollY + d.body.clientHeight - oldHeight);
+ window.scrollBy(0, scrollY - window.scrollY + d.body.clientHeight - oldHeight);
}
if (file.scrollIntoView) {
delete file.scrollIntoView;
@@ -12925,18 +12924,14 @@ Embedding = (function() {
ref = Embedding.ordered_types;
for (j = 0, len = ref.length; j < len; j++) {
type = ref[j];
- if (!(match = type.regExp.exec(href))) {
- continue;
+ if ((match = type.regExp.exec(href))) {
+ return {
+ key: type.key,
+ uid: match[1],
+ options: match[2],
+ link: link
+ };
}
- if (type.dummy) {
- return;
- }
- return {
- key: type.key,
- uid: match[1],
- options: match[2],
- link: link
- };
}
},
embed: function(data) {
@@ -13129,7 +13124,7 @@ Embedding = (function() {
ordered_types: [
{
key: 'audio',
- regExp: /\.(?:mp3|oga|wav)(?:\?|$)/i,
+ regExp: /^[^?#]+\.(?:mp3|oga|wav)(?:[?#]|$)/i,
style: '',
el: function(a) {
return $.el('audio', {
@@ -13138,6 +13133,51 @@ Embedding = (function() {
src: a.dataset.href
});
}
+ }, {
+ key: 'image',
+ regExp: /^[^?#]+\.(?:gif|png|jpg|jpeg|bmp)(?:[?#]|$)/i,
+ style: '',
+ el: function(a) {
+ return $.el('div', {
+ innerHTML: "

"
+ });
+ }
+ }, {
+ key: 'video',
+ regExp: /^[^?#]+\.(?:og[gv]|webm|mp4)(?:[?#]|$)/i,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ var el;
+ el = $.el('video', {
+ hidden: true,
+ controls: true,
+ preload: 'auto',
+ src: a.dataset.href,
+ loop: /^https?:\/\/i\.4cdn\.org\//.test(a.dataset.href)
+ });
+ $.on(el, 'loadedmetadata', function() {
+ if (el.videoHeight === 0 && el.parentNode) {
+ return $.replace(el, Embedding.types.audio.el(a));
+ } else {
+ return el.hidden = false;
+ }
+ });
+ return el;
+ }
+ }, {
+ key: 'Clyp',
+ regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
+ style: '',
+ el: function(a) {
+ var el, type;
+ el = $.el('audio', {
+ controls: true,
+ preload: 'auto'
+ });
+ type = el.canPlayType('audio/ogg') ? 'ogg' : 'mp3';
+ el.src = "https://clyp.it/" + a.dataset.uid + "." + type;
+ return el;
+ }
}, {
key: 'Dailymotion',
regExp: /^\w+:\/\/(?:(?:www\.)?dailymotion\.com\/(?:embed\/)?video|dai\.ly)\/([A-Za-z0-9]+)[^?]*(.*)/,
@@ -13158,6 +13198,15 @@ Embedding = (function() {
return _.title;
}
}
+ }, {
+ key: 'Gfycat',
+ regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
+ el: function(a) {
+ var div;
+ return div = $.el('iframe', {
+ src: "//gfycat.com/iframe/" + a.dataset.uid
+ });
+ }
}, {
key: 'Gist',
regExp: /^\w+:\/\/gist\.github\.com\/[\w\-]+\/(\w+)/,
@@ -13185,15 +13234,6 @@ Embedding = (function() {
}
}
}
- }, {
- key: 'image',
- regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i,
- style: '',
- el: function(a) {
- return $.el('div', {
- innerHTML: "

"
- });
- }
}, {
key: 'InstallGentoo',
regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/,
@@ -13202,14 +13242,6 @@ Embedding = (function() {
src: "https://paste.installgentoo.com/view/embed/" + a.dataset.uid
});
}
- }, {
- key: 'Twitter',
- regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
- el: function(a) {
- return $.el('iframe', {
- src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
- });
- }
}, {
key: 'LiveLeak',
regExp: /^\w+:\/\/(?:\w+\.)?liveleak\.com\/.*\?.*i=(\w+)/,
@@ -13223,22 +13255,97 @@ Embedding = (function() {
return el;
}
}, {
- key: 'Pastebin',
- regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
- httpOnly: true,
+ key: 'Loopvid',
+ regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|pc|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
+ style: 'max-width: 80vw; max-height: 80vh;',
el: function(a) {
- var div;
- return div = $.el('iframe', {
- src: "http://pastebin.com/embed_iframe.php?i=" + a.dataset.uid
+ var _, base, el, host, j, k, len, len1, name, names, ref, ref1, type, types, url;
+ el = $.el('video', {
+ controls: true,
+ preload: 'auto',
+ loop: true
+ });
+ ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
+ types = (function() {
+ switch (host) {
+ case 'gd':
+ case 'wu':
+ case 'fc':
+ return [''];
+ case 'gc':
+ return ['giant', 'fat', 'zippy'];
+ default:
+ return ['.webm', '.mp4'];
+ }
+ })();
+ ref1 = names.split(',');
+ for (j = 0, len = ref1.length; j < len; j++) {
+ name = ref1[j];
+ for (k = 0, len1 = types.length; k < len1; k++) {
+ type = types[k];
+ base = "" + name + type;
+ url = (function() {
+ switch (host) {
+ case 'pf':
+ return "https://web.archive.org/web/2/http://a.pomf.se/" + base;
+ case 'kd':
+ return "http://kastden.org/loopvid/" + base;
+ case 'lv':
+ return "http://kastden.org/_loopvid_media/lv/" + base;
+ case 'gd':
+ return "https://docs.google.com/uc?export=download&id=" + base;
+ case 'gh':
+ return "https://googledrive.com/host/" + base;
+ case 'db':
+ return "https://dl.dropboxusercontent.com/u/" + base;
+ case 'dx':
+ return "https://dl.dropboxusercontent.com/" + base;
+ case 'nn':
+ return "http://naenara.eu/loopvids/" + base;
+ case 'cp':
+ return "https://copy.com/" + base;
+ case 'wu':
+ return "http://webmup.com/" + base + "/vid.webm";
+ case 'ig':
+ return "https://i.imgur.com/" + base;
+ case 'ky':
+ return "https://kiyo.me/" + base;
+ case 'mf':
+ return "https://d.maxfile.ro/" + base;
+ case 'pc':
+ return "http://a.pomf.cat/" + base;
+ case 'fc':
+ return "//i.4cdn.org/" + base + ".webm";
+ case 'gc':
+ return "https://" + type + ".gfycat.com/" + name + ".webm";
+ }
+ })();
+ $.add(el, $.el('source', {
+ src: url
+ }));
+ }
+ }
+ return el;
+ }
+ }, {
+ key: 'Openings.moe',
+ regExp: /^\w+:\/\/openings.moe\/\?video=([^&=]+\.webm)/,
+ style: 'max-width: 80vw; max-height: 80vh;',
+ el: function(a) {
+ return $.el('video', {
+ controls: true,
+ preload: 'auto',
+ src: "//openings.moe/video/" + a.dataset.uid,
+ loop: true
});
}
}, {
- key: 'Gfycat',
- regExp: /^\w+:\/\/(?:www\.)?gfycat\.com\/(?:iframe\/)?(\w+)/,
+ key: 'Pastebin',
+ regExp: /^\w+:\/\/(?:\w+\.)?pastebin\.com\/(?!u\/)(?:[\w\.]+\?i\=)?(\w+)/,
el: function(a) {
var div;
return div = $.el('iframe', {
- src: "//gfycat.com/iframe/" + a.dataset.uid
+ src: "//pastebin.com/embed_iframe.php?i=" + a.dataset.uid
});
}
}, {
@@ -13261,6 +13368,7 @@ Embedding = (function() {
}, {
key: 'StrawPoll',
regExp: /^\w+:\/\/(?:www\.)?strawpoll\.me\/(?:embed_\d+\/)?(\d+(?:\/r)?)/,
+ httpOnly: true,
style: 'border: 0; width: 600px; height: 406px;',
el: function(a) {
return $.el('iframe', {
@@ -13283,6 +13391,14 @@ Embedding = (function() {
el.setAttribute("allowfullscreen", "true");
return el;
}
+ }, {
+ key: 'Twitter',
+ regExp: /^\w+:\/\/(?:www\.)?twitter\.com\/(\w+\/status\/\d+)/,
+ el: function(a) {
+ return $.el('iframe', {
+ src: "https://twitframe.com/show?url=https://twitter.com/" + a.dataset.uid
+ });
+ }
}, {
key: 'Vocaroo',
regExp: /^\w+:\/\/(?:www\.)?vocaroo\.com\/i\/(\w+)/,
@@ -13364,123 +13480,6 @@ Embedding = (function() {
return 'Not Found';
}
}
- }, {
- key: 'Loopvid',
- regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/#?((?:pf|kd|lv|gd|gh|db|dx|nn|cp|wu|ig|ky|mf|pc|gc)\/[\w\-\/]+(,[\w\-\/]+)*|fc\/\w+\/\d+)/,
- style: 'max-width: 80vw; max-height: 80vh;',
- el: function(a) {
- var _, base, el, host, j, k, len, len1, name, names, ref, ref1, type, types, url;
- el = $.el('video', {
- controls: true,
- preload: 'auto',
- loop: true
- });
- ref = a.dataset.uid.match(/(\w+)\/(.*)/), _ = ref[0], host = ref[1], names = ref[2];
- types = (function() {
- switch (host) {
- case 'gd':
- case 'wu':
- case 'fc':
- return [''];
- case 'gc':
- return ['giant', 'fat', 'zippy'];
- default:
- return ['.webm', '.mp4'];
- }
- })();
- ref1 = names.split(',');
- for (j = 0, len = ref1.length; j < len; j++) {
- name = ref1[j];
- for (k = 0, len1 = types.length; k < len1; k++) {
- type = types[k];
- base = "" + name + type;
- url = (function() {
- switch (host) {
- case 'pf':
- return "https://web.archive.org/web/2/http://a.pomf.se/" + base;
- case 'kd':
- return "http://kastden.org/loopvid/" + base;
- case 'lv':
- return "http://kastden.org/_loopvid_media/lv/" + base;
- case 'gd':
- return "https://docs.google.com/uc?export=download&id=" + base;
- case 'gh':
- return "https://googledrive.com/host/" + base;
- case 'db':
- return "https://dl.dropboxusercontent.com/u/" + base;
- case 'dx':
- return "https://dl.dropboxusercontent.com/" + base;
- case 'nn':
- return "http://naenara.eu/loopvids/" + base;
- case 'cp':
- return "https://copy.com/" + base;
- case 'wu':
- return "http://webmup.com/" + base + "/vid.webm";
- case 'ig':
- return "https://i.imgur.com/" + base;
- case 'ky':
- return "https://kiyo.me/" + base;
- case 'mf':
- return "https://d.maxfile.ro/" + base;
- case 'pc':
- return "http://a.pomf.cat/" + base;
- case 'fc':
- return "//i.4cdn.org/" + base + ".webm";
- case 'gc':
- return "https://" + type + ".gfycat.com/" + name + ".webm";
- }
- })();
- $.add(el, $.el('source', {
- src: url
- }));
- }
- }
- return el;
- }
- }, {
- key: 'Clyp',
- regExp: /^\w+:\/\/(?:www\.)?clyp\.it\/(\w+)/,
- style: '',
- el: function(a) {
- var el, type;
- el = $.el('audio', {
- controls: true,
- preload: 'auto'
- });
- type = el.canPlayType('audio/ogg') ? 'ogg' : 'mp3';
- el.src = "https://clyp.it/" + a.dataset.uid + "." + type;
- return el;
- }
- }, {
- key: 'Loopvid-dummy',
- regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\//,
- dummy: true
- }, {
- key: 'MediaFire-dummy',
- regExp: /^\w+:\/\/(?:www\.)?mediafire.com\//,
- dummy: true
- }, {
- key: 'video',
- regExp: /\.(?:og[gv]|webm|mp4)(?:\?|$)/i,
- style: 'max-width: 80vw; max-height: 80vh;',
- el: function(a) {
- var el;
- el = $.el('video', {
- hidden: true,
- controls: true,
- preload: 'auto',
- src: a.dataset.href,
- loop: /^https?:\/\/i\.4cdn\.org\//.test(a.dataset.href)
- });
- $.on(el, 'loadedmetadata', function() {
- if (el.videoHeight === 0 && el.parentNode) {
- return $.replace(el, Embedding.types.audio.el(a));
- } else {
- return el.hidden = false;
- }
- });
- return el;
- }
}
]
};
@@ -14777,7 +14776,7 @@ FileInfo = (function() {
return $.prepend(this.file.text, info);
},
format: function(formatString, post, outputNode) {
- var output;
+ var a, i, len, output, ref;
output = [];
formatString.replace(/%(.)|[^%]+/g, function(s, c) {
output.push(c in FileInfo.formatters ? FileInfo.formatters[c].call(post) : {
@@ -14785,9 +14784,14 @@ FileInfo = (function() {
});
return '';
});
- return $.extend(outputNode, {
+ $.extend(outputNode, {
innerHTML: E.cat(output)
});
+ ref = $$('.download-button', outputNode);
+ for (i = 0, len = ref.length; i < len; i++) {
+ a = ref[i];
+ $.on(a, 'click', ImageCommon.download);
+ }
},
formatters: {
t: function() {
@@ -14829,6 +14833,11 @@ FileInfo = (function() {
innerHTML: E(this.file.name)
};
},
+ d: function() {
+ return {
+ innerHTML: "
"
+ };
+ },
p: function() {
return {
innerHTML: ((this.file.isSpoiler) ? "Spoiler, " : "")
@@ -16456,7 +16465,8 @@ ReplyPruning = (function() {
}
},
update: function() {
- var boardTop, frag, hidden2, oldPos, post, posts;
+ var boardTop, frag, hidden1, hidden2, oldPos, post, posts;
+ hidden1 = ReplyPruning.hidden;
hidden2 = ReplyPruning.active ? Math.max(ReplyPruning.total - +Conf["Max Replies"], 0) : 0;
oldPos = d.body.clientHeight - window.scrollY;
posts = ReplyPruning.thread.posts;
@@ -16488,8 +16498,8 @@ ReplyPruning = (function() {
}
ReplyPruning.summary.textContent = ReplyPruning.active ? Build.summaryText('+', ReplyPruning.hidden, ReplyPruning.hiddenFiles) : Build.summaryText('-', ReplyPruning.total, ReplyPruning.totalFiles);
ReplyPruning.summary.hidden = ReplyPruning.total <= +Conf["Max Replies"];
- if ((boardTop = Header.getTopOf($('.board'))) < 0) {
- return window.scroll(window.scrollX, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop));
+ if (hidden1 !== hidden2 && (boardTop = Header.getTopOf($('.board'))) < 0) {
+ return window.scrollBy(0, Math.max(d.body.clientHeight - oldPos, window.scrollY + boardTop) - window.scrollY);
}
}
};
diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx
index 791da6c68..560188846 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 fd10c851a..e1ddd3905 100644
--- a/builds/4chan-X.meta.js
+++ b/builds/4chan-X.meta.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.11.32.5
+// @version 1.11.33.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js
index a3ccc514b..9395baed7 100644
--- a/builds/4chan-X.user.js
+++ b/builds/4chan-X.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name 4chan X
-// @version 1.11.32.5
+// @version 1.11.33.0
// @minGMVer 1.14
// @minFFVer 26
// @namespace 4chan-X
@@ -134,7 +134,7 @@ docSet = function() {
};
g = {
- VERSION: '1.11.32.5',
+ VERSION: '1.11.33.0',
NAMESPACE: '4chan X.',
boards: {}
};
@@ -7429,11 +7429,10 @@ Build = (function() {
});
},
shortFilename: function(filename) {
- var ext, threshold;
- threshold = 30;
+ var ext;
ext = filename.match(/\.?[^\.]*$/)[0];
- if (filename.length - ext.length > threshold) {
- return filename.slice(0, threshold - 5) + "(...)" + ext;
+ if (filename.length - ext.length > 30) {
+ return (filename.match(/(?:[\uD800-\uDBFF][\uDC00-\uDFFF]|[^]){0,25}/)[0]) + "(...)" + ext;
} else {
return filename;
}
@@ -10225,7 +10224,7 @@ Settings = (function() {
advanced: function(section) {
var applyCSS, archBoards, archive, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, j, k, l, len, len1, len2, len3, len4, len5, len6, m, n, name, o, q, r, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, uid, warning, withCredentials;
$.extend(section, {
- innerHTML: "