diff --git a/CHANGELOG.md b/CHANGELOG.md index ec73eead8..f8fb899cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ Sometimes the changelog has notes (not comprehensive) acknowledging people's work. This does not mean the changes are their fault, only that their code was used. All changes to the script are chosen by and the fault of the maintainer (ccd0). +### v1.11.33 + +**v1.11.33.0** *(2016-05-08)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.33.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.33.0/builds/4chan-X-noupdate.crx "Chromium version")] +- Based on v1.11.32.5. +- Add new option `%d` to `File Info Formatting` to add a one-click download button. +- Add openings.moe embedding, and update embedding in general. +- Work around issue causing scrolling to the top of the page on thread updates / expanding all images for Chrome Dev + Tampermonkey users. +- Minor bugfixes. + ### v1.11.32 **v1.11.32.5** *(2016-05-07)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.32.5/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.32.5/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index c5402be52..189a8cc38 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 c08f9564b..9ce4a869d 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.11.32.5 +// @version 1.11.33.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 712af2713..81d58d5d1 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X beta -// @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: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
" + innerHTML: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
" }); 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-noupdate.crx b/builds/4chan-X-noupdate.crx index d0071387b..7fbc35c3b 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 14715b86c..bfb8bcf6b 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.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: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
" + innerHTML: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
" }); 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: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
" + innerHTML: "
Archiver
404 Redirect is disabled.
Thread redirectionPost fetchingFile redirection
Captcha Language
Choose from list of language codes. Leave blank to autoselect.
Custom Board Navigation
New lines will be converted into spaces.

In the following examples for /g/, g can be changed to a different board ID (a, b, etc...), the current board (current), or the Twitter link (@).
Board link: g
Archive link: g-archive
Internal archive link: g-expired
Title link: g-title
Board link (Replace with title when on that board): g-replace
Full text link: g-full
Custom text link: g-text:"Install Gentoo"
Index-only link: g-index
Catalog-only link: g-catalog
Index mode: g-mode:"infinite scrolling"
Index sort: g-sort:"creation date"
External link: external-text:"Google","http://www.google.com"
Combinations are possible: g-index-text:"Technology Index"
Full board list toggle: toggle-all

[ toggle-all ] [current-title] [g-title / a-title / jp-title] [x / wsg / h] [t-text:"Piracy"]
will give you
[ + ] [Technology] [Technology / Anime & Manga / Otaku Culture] [x / wsg / h] [Piracy]
if you are on /g/.
Time Formatting is disabled.
:
Supported format specifiers:
Day: %a, %A, %d, %e
Month: %m, %b, %B
Year: %y, %Y
Hour: %k, %H, %l, %I, %p, %P
Minute: %M
Second: %S
Literal %: %%
Quote Backlinks formatting is disabled.
:
File Info Formatting is disabled.
:
Link: %l (truncated), %L (untruncated), %T (4chan filename)
Filename: %n (truncated), %N (untruncated), %t (4chan filename)
Download button: %d
Spoiler indicator: %p
Size: %B (Bytes), %K (KB), %M (MB), %s (4chan default)
Resolution: %r (Displays 'PDF' for PDF files)
Tag: %g
Literal %: %%
Quick Reply Personas

One item per line.
Items will be added in the relevant input's auto-completion list.
Password items will always be used, since there is no password input.
Lines starting with a # will be ignored.

Unread Favicon is disabled.
Thread Updater is disabled.
Interval: seconds
Custom Cooldown Time
Seconds:
" }); 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.zip b/builds/4chan-X.zip index 171af5f70..1aad29cd7 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 d94e44c68..91fcb8ef2 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 2986ebcd2..87cb737cf 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index ac090e31e..d2ba2ba21 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.11.32.5", - "date": "2016-05-07T18:50:32.271Z" + "version": "1.11.33.0", + "date": "2016-05-08T03:53:06.405Z" } \ No newline at end of file