diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f3aef3d6..d289f987e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ 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.11.1 + +**v1.11.1.0** *(2015-06-22)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.1.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.1.0/builds/4chan-X-noupdate.crx "Chromium version")] +- Based on v1.11.0.9. +- Add partial support for Midori and other browsers whose userscript engines don't implement the Greasemonkey API. Some features will not work in these browsers. + ## v1.11.0 **v1.11.0.9** *(2015-06-21)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.0.9/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.0.9/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index bd52d825e..d8f3962a6 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 8a3a66685..9d1836079 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.0.9 +// @version 1.11.1.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 624570623..20cd12e5c 100644 --- a/builds/4chan-X-beta.user.js +++ b/builds/4chan-X-beta.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X beta -// @version 1.11.0.9 +// @version 1.11.1.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -402,7 +402,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.0.9', + VERSION: '1.11.1.0', NAMESPACE: '4chan X.', boards: {} }; @@ -784,7 +784,9 @@ })); }; - $.open = GM_openInTab; + $.open = typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) { + return window.open(url, '_blank'); + }; $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; @@ -871,10 +873,55 @@ $.oldValue = {}; + if (typeof GM_getValue !== "undefined" && GM_getValue !== null) { + $.getValue = GM_getValue; + $.setValue = function(key, val) { + GM_setValue(key, val); + if (key in $.syncing) { + $.oldValue[key] = val; + return localStorage[key] = val; + } + }; + $.deleteValue = function(key) { + GM_deleteValue(key); + if (key in $.syncing) { + delete $.oldValue[key]; + return delete localStorage[key]; + } + }; + $.listValues = GM_listValues; + } else { + $.getValue = function(key) { + return localStorage[key]; + }; + $.setValue = function(key, val) { + if (key in $.syncing) { + $.oldValue[key] = val; + } + return localStorage[key] = val; + }; + $.deleteValue = function(key) { + if (key in $.syncing) { + delete $.oldValue[key]; + } + return delete localStorage[key]; + }; + $.listValues = function() { + var key, results; + results = []; + for (key in localStorage) { + if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) { + results.push(key); + } + } + return results; + }; + } + $.sync = function(key, cb) { key = g.NAMESPACE + key; $.syncing[key] = cb; - return $.oldValue[key] = GM_getValue(key); + return $.oldValue[key] = $.getValue(key); }; (function() { @@ -884,7 +931,7 @@ if (!(cb = $.syncing[key])) { return; } - newValue = GM_getValue(key); + newValue = $.getValue(key); if (newValue === $.oldValue[key]) { return; } @@ -913,12 +960,7 @@ } for (k = 0, len1 = keys.length; k < len1; k++) { key = keys[k]; - key = g.NAMESPACE + key; - GM_deleteValue(key); - if (key in $.syncing) { - delete $.oldValue[key]; - localStorage.removeItem(key); - } + $.deleteValue(g.NAMESPACE + key); } }; @@ -932,7 +974,7 @@ } return $.queueTask(function() { for (key in items) { - if (val = GM_getValue(g.NAMESPACE + key)) { + if (val = $.getValue(g.NAMESPACE + key)) { items[key] = JSON.parse(val); } } @@ -940,31 +982,19 @@ }); }; - $.set = (function() { - var set; - set = function(key, val) { - key = g.NAMESPACE + key; - val = JSON.stringify(val); - GM_setValue(key, val); - if (key in $.syncing) { - $.oldValue[key] = val; - return localStorage.setItem(key, val); + $.set = function(keys, val, cb) { + var key, value; + if (typeof keys === 'string') { + $.setValue(g.NAMESPACE + keys, JSON.stringify(val)); + } else { + for (key in keys) { + value = keys[key]; + $.setValue(g.NAMESPACE + key, JSON.stringify(value)); } - }; - return function(keys, val, cb) { - var key, value; - if (typeof keys === 'string') { - set(keys, val); - } else { - for (key in keys) { - value = keys[key]; - set(key, value); - } - cb = val; - } - return typeof cb === "function" ? cb() : void 0; - }; - })(); + cb = val; + } + return typeof cb === "function" ? cb() : void 0; + }; $.clear = function(cb) { var a, board, boards, id; @@ -1001,7 +1031,7 @@ return results; })()); try { - $["delete"](GM_listValues().map(function(key) { + $["delete"]($.listValues().map(function(key) { return key.replace(g.NAMESPACE, ''); })); } catch (_error) {} @@ -3128,7 +3158,7 @@ $.asap((function() { return $('.board > .thread > .postContainer', doc) || d.readyState !== 'loading'; }), function() { - var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, w; + var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, v; if (!Main.isThisPageLegit()) { return; } @@ -3145,8 +3175,8 @@ $.event('PostsInserted'); d.implementation.createDocument(null, null, null).appendChild(board); ref7 = $$('.navLinks'); - for (w = 0, len4 = ref7.length; w < len4; w++) { - el = ref7[w]; + for (v = 0, len4 = ref7.length; v < len4; v++) { + el = ref7[v]; $.rm(el); } if ((ref8 = $.id('search-box')) != null) { @@ -4213,7 +4243,7 @@ return Build.postFromObject(data, board.ID); }, catalogThread: function(thread) { - var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, w; + var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, v; staticPath = Build.staticPath, gifIcon = Build.gifIcon; data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)]; if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { @@ -4271,8 +4301,8 @@ $.replace(pp, cc); } ref3 = $$('br', root.lastElementChild); - for (w = 0, len4 = ref3.length; w < len4; w++) { - br = ref3[w]; + for (v = 0, len4 = ref3.length; v < len4; v++) { + br = ref3[v]; if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') { $.rm(br); } @@ -6962,7 +6992,7 @@ return status.disabled = disabled || false; }, quote: function(e) { - var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, w, y, z; + var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, v, w, y; if (e != null) { e.preventDefault(); } @@ -7002,18 +7032,18 @@ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')])); } ref3 = $$('.prettyprint', frag); - for (w = 0, len4 = ref3.length; w < len4; w++) { - node = ref3[w]; + for (v = 0, len4 = ref3.length; v < len4; v++) { + node = ref3[v]; $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')])); } ref4 = $$('.linkify[data-original]', frag); - for (y = 0, len5 = ref4.length; y < len5; y++) { - node = ref4[y]; + for (w = 0, len5 = ref4.length; w < len5; w++) { + node = ref4[w]; $.replace(node, $.tn(node.dataset.original)); } ref5 = $$('.embedder', frag); - for (z = 0, len6 = ref5.length; z < len6; z++) { - node = ref5[z]; + for (y = 0, len6 = ref5.length; y < len6; y++) { + node = ref5[y]; if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') { $.rm(node.previousSibling); } @@ -12838,7 +12868,7 @@ return new Notice('info', "The thread is " + change + ".", 30); }, parse: function(req) { - var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, scroll, thread, u, unreadCount, w; + var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, scroll, thread, u, unreadCount, v; postObjects = req.response.posts; OP = postObjects[0]; thread = ThreadUpdater.thread; @@ -12920,8 +12950,8 @@ } scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; firstPost = null; - for (w = 0, len4 = posts.length; w < len4; w++) { - post = posts[w]; + for (v = 0, len4 = posts.length; v < len4; v++) { + post = posts[v]; if (!QuoteThreading.insert(post)) { firstPost || (firstPost = post.nodes.root); $.add(ThreadUpdater.root, post.nodes.root); @@ -16463,7 +16493,7 @@ return $.on(ta, 'change', $.cb.value); }, advanced: function(section) { - var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z; + var applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, v, w, warning, withCredentials, y, z; $.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
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:
" }); @@ -16522,8 +16552,8 @@ ref2 = Redirect.archives; for (u = 0, len3 = ref2.length; u < len3; u++) { ref3 = ref2[u], name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials; - for (w = 0, len4 = boards.length; w < len4; w++) { - boardID = boards[w]; + for (v = 0, len4 = boards.length; v < len4; v++) { + boardID = boards[v]; o = archBoards[boardID] || (archBoards[boardID] = { thread: [[], []], post: [[], []], @@ -16542,8 +16572,8 @@ for (boardID in archBoards) { o = archBoards[boardID]; ref4 = ['thread', 'post', 'file']; - for (y = 0, len5 = ref4.length; y < len5; y++) { - item = ref4[y]; + for (w = 0, len5 = ref4.length; w < len5; w++) { + item = ref4[w]; i = o[item][0].length ? 1 : 0; o[item][i].push('disabled'); o[item] = o[item][0].concat(o[item][1]); @@ -16552,8 +16582,8 @@ rows = []; boardOptions = []; ref5 = Object.keys(archBoards).sort(); - for (z = 0, len6 = ref5.length; z < len6; z++) { - boardID = ref5[z]; + for (y = 0, len6 = ref5.length; y < len6; y++) { + boardID = ref5[y]; row = $.el('tr', { className: "board-" + boardID }); @@ -16565,8 +16595,8 @@ })); o = archBoards[boardID]; ref6 = ['thread', 'post', 'file']; - for (aa = 0, len7 = ref6.length; aa < len7; aa++) { - item = ref6[aa]; + for (z = 0, len7 = ref6.length; z < len7; z++) { + item = ref6[z]; $.add(row, Settings.addArchiveCell(boardID, o, item)); } rows.push(row); @@ -16963,7 +16993,7 @@ }); }, initReady: function() { - var GMver, err, i, k, len1, passLink, ref, ref1, styleSelector, v; + var err, passLink, ref, styleSelector; if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') { if (g.VIEW === 'thread') { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { @@ -17012,16 +17042,6 @@ return $.set('previousversion', g.VERSION); }); if (Conf['Show Support Message']) { - GMver = GM_info.version.split('.'); - ref1 = "1.14".split('.'); - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - v = ref1[i]; - if (v === GMver[i]) { - continue; - } - (v < GMver[i]) || new Notice('warning', "Your version of Greasemonkey is outdated (v" + GM_info.version + " instead of v1.14 minimum) and 4chan X may not operate correctly.", 30); - break; - } try { return localStorage.getItem('4chan-settings'); } catch (_error) { diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index dae68a468..d2e6f135f 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 2c2471207..69cdb552f 100644 --- a/builds/4chan-X-noupdate.user.js +++ b/builds/4chan-X-noupdate.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.11.0.9 +// @version 1.11.1.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -401,7 +401,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.0.9', + VERSION: '1.11.1.0', NAMESPACE: '4chan X.', boards: {} }; @@ -783,7 +783,9 @@ })); }; - $.open = GM_openInTab; + $.open = typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) { + return window.open(url, '_blank'); + }; $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; @@ -870,10 +872,55 @@ $.oldValue = {}; + if (typeof GM_getValue !== "undefined" && GM_getValue !== null) { + $.getValue = GM_getValue; + $.setValue = function(key, val) { + GM_setValue(key, val); + if (key in $.syncing) { + $.oldValue[key] = val; + return localStorage[key] = val; + } + }; + $.deleteValue = function(key) { + GM_deleteValue(key); + if (key in $.syncing) { + delete $.oldValue[key]; + return delete localStorage[key]; + } + }; + $.listValues = GM_listValues; + } else { + $.getValue = function(key) { + return localStorage[key]; + }; + $.setValue = function(key, val) { + if (key in $.syncing) { + $.oldValue[key] = val; + } + return localStorage[key] = val; + }; + $.deleteValue = function(key) { + if (key in $.syncing) { + delete $.oldValue[key]; + } + return delete localStorage[key]; + }; + $.listValues = function() { + var key, results; + results = []; + for (key in localStorage) { + if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) { + results.push(key); + } + } + return results; + }; + } + $.sync = function(key, cb) { key = g.NAMESPACE + key; $.syncing[key] = cb; - return $.oldValue[key] = GM_getValue(key); + return $.oldValue[key] = $.getValue(key); }; (function() { @@ -883,7 +930,7 @@ if (!(cb = $.syncing[key])) { return; } - newValue = GM_getValue(key); + newValue = $.getValue(key); if (newValue === $.oldValue[key]) { return; } @@ -912,12 +959,7 @@ } for (k = 0, len1 = keys.length; k < len1; k++) { key = keys[k]; - key = g.NAMESPACE + key; - GM_deleteValue(key); - if (key in $.syncing) { - delete $.oldValue[key]; - localStorage.removeItem(key); - } + $.deleteValue(g.NAMESPACE + key); } }; @@ -931,7 +973,7 @@ } return $.queueTask(function() { for (key in items) { - if (val = GM_getValue(g.NAMESPACE + key)) { + if (val = $.getValue(g.NAMESPACE + key)) { items[key] = JSON.parse(val); } } @@ -939,31 +981,19 @@ }); }; - $.set = (function() { - var set; - set = function(key, val) { - key = g.NAMESPACE + key; - val = JSON.stringify(val); - GM_setValue(key, val); - if (key in $.syncing) { - $.oldValue[key] = val; - return localStorage.setItem(key, val); + $.set = function(keys, val, cb) { + var key, value; + if (typeof keys === 'string') { + $.setValue(g.NAMESPACE + keys, JSON.stringify(val)); + } else { + for (key in keys) { + value = keys[key]; + $.setValue(g.NAMESPACE + key, JSON.stringify(value)); } - }; - return function(keys, val, cb) { - var key, value; - if (typeof keys === 'string') { - set(keys, val); - } else { - for (key in keys) { - value = keys[key]; - set(key, value); - } - cb = val; - } - return typeof cb === "function" ? cb() : void 0; - }; - })(); + cb = val; + } + return typeof cb === "function" ? cb() : void 0; + }; $.clear = function(cb) { var a, board, boards, id; @@ -1000,7 +1030,7 @@ return results; })()); try { - $["delete"](GM_listValues().map(function(key) { + $["delete"]($.listValues().map(function(key) { return key.replace(g.NAMESPACE, ''); })); } catch (_error) {} @@ -3127,7 +3157,7 @@ $.asap((function() { return $('.board > .thread > .postContainer', doc) || d.readyState !== 'loading'; }), function() { - var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, w; + var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, v; if (!Main.isThisPageLegit()) { return; } @@ -3144,8 +3174,8 @@ $.event('PostsInserted'); d.implementation.createDocument(null, null, null).appendChild(board); ref7 = $$('.navLinks'); - for (w = 0, len4 = ref7.length; w < len4; w++) { - el = ref7[w]; + for (v = 0, len4 = ref7.length; v < len4; v++) { + el = ref7[v]; $.rm(el); } if ((ref8 = $.id('search-box')) != null) { @@ -4212,7 +4242,7 @@ return Build.postFromObject(data, board.ID); }, catalogThread: function(thread) { - var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, w; + var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, v; staticPath = Build.staticPath, gifIcon = Build.gifIcon; data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)]; if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { @@ -4270,8 +4300,8 @@ $.replace(pp, cc); } ref3 = $$('br', root.lastElementChild); - for (w = 0, len4 = ref3.length; w < len4; w++) { - br = ref3[w]; + for (v = 0, len4 = ref3.length; v < len4; v++) { + br = ref3[v]; if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') { $.rm(br); } @@ -6961,7 +6991,7 @@ return status.disabled = disabled || false; }, quote: function(e) { - var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, w, y, z; + var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, v, w, y; if (e != null) { e.preventDefault(); } @@ -7001,18 +7031,18 @@ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')])); } ref3 = $$('.prettyprint', frag); - for (w = 0, len4 = ref3.length; w < len4; w++) { - node = ref3[w]; + for (v = 0, len4 = ref3.length; v < len4; v++) { + node = ref3[v]; $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')])); } ref4 = $$('.linkify[data-original]', frag); - for (y = 0, len5 = ref4.length; y < len5; y++) { - node = ref4[y]; + for (w = 0, len5 = ref4.length; w < len5; w++) { + node = ref4[w]; $.replace(node, $.tn(node.dataset.original)); } ref5 = $$('.embedder', frag); - for (z = 0, len6 = ref5.length; z < len6; z++) { - node = ref5[z]; + for (y = 0, len6 = ref5.length; y < len6; y++) { + node = ref5[y]; if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') { $.rm(node.previousSibling); } @@ -12837,7 +12867,7 @@ return new Notice('info', "The thread is " + change + ".", 30); }, parse: function(req) { - var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, scroll, thread, u, unreadCount, w; + var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, scroll, thread, u, unreadCount, v; postObjects = req.response.posts; OP = postObjects[0]; thread = ThreadUpdater.thread; @@ -12919,8 +12949,8 @@ } scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; firstPost = null; - for (w = 0, len4 = posts.length; w < len4; w++) { - post = posts[w]; + for (v = 0, len4 = posts.length; v < len4; v++) { + post = posts[v]; if (!QuoteThreading.insert(post)) { firstPost || (firstPost = post.nodes.root); $.add(ThreadUpdater.root, post.nodes.root); @@ -16462,7 +16492,7 @@ return $.on(ta, 'change', $.cb.value); }, advanced: function(section) { - var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z; + var applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, v, w, warning, withCredentials, y, z; $.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
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:
" }); @@ -16521,8 +16551,8 @@ ref2 = Redirect.archives; for (u = 0, len3 = ref2.length; u < len3; u++) { ref3 = ref2[u], name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials; - for (w = 0, len4 = boards.length; w < len4; w++) { - boardID = boards[w]; + for (v = 0, len4 = boards.length; v < len4; v++) { + boardID = boards[v]; o = archBoards[boardID] || (archBoards[boardID] = { thread: [[], []], post: [[], []], @@ -16541,8 +16571,8 @@ for (boardID in archBoards) { o = archBoards[boardID]; ref4 = ['thread', 'post', 'file']; - for (y = 0, len5 = ref4.length; y < len5; y++) { - item = ref4[y]; + for (w = 0, len5 = ref4.length; w < len5; w++) { + item = ref4[w]; i = o[item][0].length ? 1 : 0; o[item][i].push('disabled'); o[item] = o[item][0].concat(o[item][1]); @@ -16551,8 +16581,8 @@ rows = []; boardOptions = []; ref5 = Object.keys(archBoards).sort(); - for (z = 0, len6 = ref5.length; z < len6; z++) { - boardID = ref5[z]; + for (y = 0, len6 = ref5.length; y < len6; y++) { + boardID = ref5[y]; row = $.el('tr', { className: "board-" + boardID }); @@ -16564,8 +16594,8 @@ })); o = archBoards[boardID]; ref6 = ['thread', 'post', 'file']; - for (aa = 0, len7 = ref6.length; aa < len7; aa++) { - item = ref6[aa]; + for (z = 0, len7 = ref6.length; z < len7; z++) { + item = ref6[z]; $.add(row, Settings.addArchiveCell(boardID, o, item)); } rows.push(row); @@ -16962,7 +16992,7 @@ }); }, initReady: function() { - var GMver, err, i, k, len1, passLink, ref, ref1, styleSelector, v; + var err, passLink, ref, styleSelector; if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') { if (g.VIEW === 'thread') { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { @@ -17011,16 +17041,6 @@ return $.set('previousversion', g.VERSION); }); if (Conf['Show Support Message']) { - GMver = GM_info.version.split('.'); - ref1 = "1.14".split('.'); - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - v = ref1[i]; - if (v === GMver[i]) { - continue; - } - (v < GMver[i]) || new Notice('warning', "Your version of Greasemonkey is outdated (v" + GM_info.version + " instead of v1.14 minimum) and 4chan X may not operate correctly.", 30); - break; - } try { return localStorage.getItem('4chan-settings'); } catch (_error) { diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index c15cc2ac4..6bf973fa1 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 2334f2bfe..55116f6ab 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.11.0.9 +// @version 1.11.1.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 8fcf59c20..5efe0986e 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,7 +1,7 @@ // Generated by CoffeeScript // ==UserScript== // @name 4chan X -// @version 1.11.0.9 +// @version 1.11.1.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -402,7 +402,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.0.9', + VERSION: '1.11.1.0', NAMESPACE: '4chan X.', boards: {} }; @@ -784,7 +784,9 @@ })); }; - $.open = GM_openInTab; + $.open = typeof GM_openInTab !== "undefined" && GM_openInTab !== null ? GM_openInTab : function(url) { + return window.open(url, '_blank'); + }; $.debounce = function(wait, fn) { var args, exec, lastCall, that, timeout; @@ -871,10 +873,55 @@ $.oldValue = {}; + if (typeof GM_getValue !== "undefined" && GM_getValue !== null) { + $.getValue = GM_getValue; + $.setValue = function(key, val) { + GM_setValue(key, val); + if (key in $.syncing) { + $.oldValue[key] = val; + return localStorage[key] = val; + } + }; + $.deleteValue = function(key) { + GM_deleteValue(key); + if (key in $.syncing) { + delete $.oldValue[key]; + return delete localStorage[key]; + } + }; + $.listValues = GM_listValues; + } else { + $.getValue = function(key) { + return localStorage[key]; + }; + $.setValue = function(key, val) { + if (key in $.syncing) { + $.oldValue[key] = val; + } + return localStorage[key] = val; + }; + $.deleteValue = function(key) { + if (key in $.syncing) { + delete $.oldValue[key]; + } + return delete localStorage[key]; + }; + $.listValues = function() { + var key, results; + results = []; + for (key in localStorage) { + if (key.slice(0, g.NAMESPACE.length) === g.NAMESPACE) { + results.push(key); + } + } + return results; + }; + } + $.sync = function(key, cb) { key = g.NAMESPACE + key; $.syncing[key] = cb; - return $.oldValue[key] = GM_getValue(key); + return $.oldValue[key] = $.getValue(key); }; (function() { @@ -884,7 +931,7 @@ if (!(cb = $.syncing[key])) { return; } - newValue = GM_getValue(key); + newValue = $.getValue(key); if (newValue === $.oldValue[key]) { return; } @@ -913,12 +960,7 @@ } for (k = 0, len1 = keys.length; k < len1; k++) { key = keys[k]; - key = g.NAMESPACE + key; - GM_deleteValue(key); - if (key in $.syncing) { - delete $.oldValue[key]; - localStorage.removeItem(key); - } + $.deleteValue(g.NAMESPACE + key); } }; @@ -932,7 +974,7 @@ } return $.queueTask(function() { for (key in items) { - if (val = GM_getValue(g.NAMESPACE + key)) { + if (val = $.getValue(g.NAMESPACE + key)) { items[key] = JSON.parse(val); } } @@ -940,31 +982,19 @@ }); }; - $.set = (function() { - var set; - set = function(key, val) { - key = g.NAMESPACE + key; - val = JSON.stringify(val); - GM_setValue(key, val); - if (key in $.syncing) { - $.oldValue[key] = val; - return localStorage.setItem(key, val); + $.set = function(keys, val, cb) { + var key, value; + if (typeof keys === 'string') { + $.setValue(g.NAMESPACE + keys, JSON.stringify(val)); + } else { + for (key in keys) { + value = keys[key]; + $.setValue(g.NAMESPACE + key, JSON.stringify(value)); } - }; - return function(keys, val, cb) { - var key, value; - if (typeof keys === 'string') { - set(keys, val); - } else { - for (key in keys) { - value = keys[key]; - set(key, value); - } - cb = val; - } - return typeof cb === "function" ? cb() : void 0; - }; - })(); + cb = val; + } + return typeof cb === "function" ? cb() : void 0; + }; $.clear = function(cb) { var a, board, boards, id; @@ -1001,7 +1031,7 @@ return results; })()); try { - $["delete"](GM_listValues().map(function(key) { + $["delete"]($.listValues().map(function(key) { return key.replace(g.NAMESPACE, ''); })); } catch (_error) {} @@ -3128,7 +3158,7 @@ $.asap((function() { return $('.board > .thread > .postContainer', doc) || d.readyState !== 'loading'; }), function() { - var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, w; + var board, el, len3, len4, ref6, ref7, ref8, threadRoot, topNavPos, u, v; if (!Main.isThisPageLegit()) { return; } @@ -3145,8 +3175,8 @@ $.event('PostsInserted'); d.implementation.createDocument(null, null, null).appendChild(board); ref7 = $$('.navLinks'); - for (w = 0, len4 = ref7.length; w < len4; w++) { - el = ref7[w]; + for (v = 0, len4 = ref7.length; v < len4; v++) { + el = ref7[v]; $.rm(el); } if ((ref8 = $.id('search-box')) != null) { @@ -4213,7 +4243,7 @@ return Build.postFromObject(data, board.ID); }, catalogThread: function(thread) { - var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, w; + var br, cc, comment, data, exif, fileCount, gifIcon, href, imgClass, k, len1, len2, len3, len4, pageCount, postCount, pp, q, quote, ref, ref1, ref2, ref3, ref4, root, spoilerRange, src, staticPath, u, v; staticPath = Build.staticPath, gifIcon = Build.gifIcon; data = Index.liveThreadData[Index.liveThreadIDs.indexOf(thread.ID)]; if (data.spoiler && !Conf['Reveal Spoiler Thumbnails']) { @@ -4271,8 +4301,8 @@ $.replace(pp, cc); } ref3 = $$('br', root.lastElementChild); - for (w = 0, len4 = ref3.length; w < len4; w++) { - br = ref3[w]; + for (v = 0, len4 = ref3.length; v < len4; v++) { + br = ref3[v]; if (((ref4 = br.previousSibling) != null ? ref4.nodeName : void 0) === 'BR') { $.rm(br); } @@ -6962,7 +6992,7 @@ return status.disabled = disabled || false; }, quote: function(e) { - var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, w, y, z; + var ancestor, caretPos, com, frag, index, insideCode, k, len1, len2, len3, len4, len5, len6, node, post, q, range, ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, sel, text, thread, u, v, w, y; if (e != null) { e.preventDefault(); } @@ -7002,18 +7032,18 @@ $.replace(node, [$.tn('[spoiler]')].concat(slice.call(node.childNodes), [$.tn('[/spoiler]')])); } ref3 = $$('.prettyprint', frag); - for (w = 0, len4 = ref3.length; w < len4; w++) { - node = ref3[w]; + for (v = 0, len4 = ref3.length; v < len4; v++) { + node = ref3[v]; $.replace(node, [$.tn('[code]')].concat(slice.call(node.childNodes), [$.tn('[/code]')])); } ref4 = $$('.linkify[data-original]', frag); - for (y = 0, len5 = ref4.length; y < len5; y++) { - node = ref4[y]; + for (w = 0, len5 = ref4.length; w < len5; w++) { + node = ref4[w]; $.replace(node, $.tn(node.dataset.original)); } ref5 = $$('.embedder', frag); - for (z = 0, len6 = ref5.length; z < len6; z++) { - node = ref5[z]; + for (y = 0, len6 = ref5.length; y < len6; y++) { + node = ref5[y]; if (((ref6 = node.previousSibling) != null ? ref6.nodeValue : void 0) === ' ') { $.rm(node.previousSibling); } @@ -12838,7 +12868,7 @@ return new Notice('info', "The thread is " + change + ".", 30); }, parse: function(req) { - var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, scroll, thread, u, unreadCount, w; + var ID, OP, board, deletedFiles, deletedPosts, files, firstPost, index, ipCountEl, k, lastPost, len1, len2, len3, len4, newPosts, node, post, postObject, postObjects, posts, q, ref, ref1, ref2, ref3, ref4, ref5, scroll, thread, u, unreadCount, v; postObjects = req.response.posts; OP = postObjects[0]; thread = ThreadUpdater.thread; @@ -12920,8 +12950,8 @@ } scroll = Conf['Auto Scroll'] && ThreadUpdater.scrollBG() && ThreadUpdater.root.getBoundingClientRect().bottom - doc.clientHeight < 25; firstPost = null; - for (w = 0, len4 = posts.length; w < len4; w++) { - post = posts[w]; + for (v = 0, len4 = posts.length; v < len4; v++) { + post = posts[v]; if (!QuoteThreading.insert(post)) { firstPost || (firstPost = post.nodes.root); $.add(ThreadUpdater.root, post.nodes.root); @@ -16463,7 +16493,7 @@ return $.on(ta, 'change', $.cb.value); }, advanced: function(section) { - var aa, applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, w, warning, withCredentials, y, z; + var applyCSS, archBoards, boardID, boardOptions, boardSelect, boards, customCSS, files, i, input, inputs, interval, item, items, k, len1, len2, len3, len4, len5, len6, len7, name, o, q, ref, ref1, ref2, ref3, ref4, ref5, ref6, row, rows, software, ta, table, u, v, w, warning, withCredentials, y, z; $.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
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:
" }); @@ -16522,8 +16552,8 @@ ref2 = Redirect.archives; for (u = 0, len3 = ref2.length; u < len3; u++) { ref3 = ref2[u], name = ref3.name, boards = ref3.boards, files = ref3.files, software = ref3.software, withCredentials = ref3.withCredentials; - for (w = 0, len4 = boards.length; w < len4; w++) { - boardID = boards[w]; + for (v = 0, len4 = boards.length; v < len4; v++) { + boardID = boards[v]; o = archBoards[boardID] || (archBoards[boardID] = { thread: [[], []], post: [[], []], @@ -16542,8 +16572,8 @@ for (boardID in archBoards) { o = archBoards[boardID]; ref4 = ['thread', 'post', 'file']; - for (y = 0, len5 = ref4.length; y < len5; y++) { - item = ref4[y]; + for (w = 0, len5 = ref4.length; w < len5; w++) { + item = ref4[w]; i = o[item][0].length ? 1 : 0; o[item][i].push('disabled'); o[item] = o[item][0].concat(o[item][1]); @@ -16552,8 +16582,8 @@ rows = []; boardOptions = []; ref5 = Object.keys(archBoards).sort(); - for (z = 0, len6 = ref5.length; z < len6; z++) { - boardID = ref5[z]; + for (y = 0, len6 = ref5.length; y < len6; y++) { + boardID = ref5[y]; row = $.el('tr', { className: "board-" + boardID }); @@ -16565,8 +16595,8 @@ })); o = archBoards[boardID]; ref6 = ['thread', 'post', 'file']; - for (aa = 0, len7 = ref6.length; aa < len7; aa++) { - item = ref6[aa]; + for (z = 0, len7 = ref6.length; z < len7; z++) { + item = ref6[z]; $.add(row, Settings.addArchiveCell(boardID, o, item)); } rows.push(row); @@ -16963,7 +16993,7 @@ }); }, initReady: function() { - var GMver, err, i, k, len1, passLink, ref, ref1, styleSelector, v; + var err, passLink, ref, styleSelector; if ((ref = d.title) === '4chan - Temporarily Offline' || ref === '4chan - 404 Not Found') { if (g.VIEW === 'thread') { ThreadWatcher.set404(g.BOARD.ID, g.THREADID, function() { @@ -17012,16 +17042,6 @@ return $.set('previousversion', g.VERSION); }); if (Conf['Show Support Message']) { - GMver = GM_info.version.split('.'); - ref1 = "1.14".split('.'); - for (i = k = 0, len1 = ref1.length; k < len1; i = ++k) { - v = ref1[i]; - if (v === GMver[i]) { - continue; - } - (v < GMver[i]) || new Notice('warning', "Your version of Greasemonkey is outdated (v" + GM_info.version + " instead of v1.14 minimum) and 4chan X may not operate correctly.", 30); - break; - } try { return localStorage.getItem('4chan-settings'); } catch (_error) { diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index e00f87cde..12ea8b8b1 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 8bc05405e..1c186e982 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 f7f746085..78aebb8dd 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index e32d3e0ba..c6122e15d 100755 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "description": "Cross-browser userscript for maximum lurking on 4chan.", "meta": { "name": "4chan X", - "version": "1.11.0.9", - "date": "2015-06-22T00:44:15.370Z", + "version": "1.11.1.0", + "date": "2015-06-22T18:09:14.422Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",