diff --git a/CHANGELOG.md b/CHANGELOG.md index a0ac75b52..ef71f6451 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ 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.4 + +**v1.11.4.0** *(2015-07-12)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.4.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.4.0/builds/4chan-X-noupdate.crx "Chromium version")] +- Based on v1.11.3.4. +- Show files in replies on /f/. +- Remove code that disabled the updater if you were offline since detection was too unreliable. + ### v1.11.3 **v1.11.3.4** *(2015-07-12)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.3.4/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.3.4/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index fab2ae68c..259c39b96 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 a29684f38..603435c2b 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.3.4 +// @version 1.11.4.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 0603b99e8..c775ce718 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.3.4 +// @version 1.11.4.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -394,7 +394,6 @@ 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], 'Scroll BG': [false, 'Auto-scroll background tabs.'], 'Auto Update': [true, 'Automatically fetch new posts.'], - 'Ignore Offline Status': [true, 'Update even if your browser reports you are offline.'], 'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.'] }, 'Interval': 30 @@ -412,7 +411,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.3.4', + VERSION: '1.11.4.0', NAMESPACE: '4chan X.', boards: {} }; @@ -1104,13 +1103,17 @@ return this[name] = cb; }; - Callbacks.prototype.execute = function(node) { + Callbacks.prototype.execute = function(node, keys) { var err, errors, k, len1, name, ref; - ref = this.keys; - for (k = 0, len1 = ref.length; k < len1; k++) { - name = ref[k]; + if (keys == null) { + keys = this.keys; + } + for (k = 0, len1 = keys.length; k < len1; k++) { + name = keys[k]; try { - this[name].call(node); + if ((ref = this[name]) != null) { + ref.call(node); + } } catch (_error) { err = _error; if (!errors) { @@ -9736,10 +9739,7 @@ }); }, node: function() { - if (this.file) { - return; - } - return $.addClass(this.nodes.root, "noFile"); + return this.nodes.root.classList.toggle('noFile', !this.file); }, catalogNode: function() { var file, filename; @@ -12830,10 +12830,12 @@ ThreadUpdater.cb.interval.call($.el('input', { value: Conf['Interval'] })); - $.on(window, 'online offline', ThreadUpdater.cb.online); $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - return ThreadUpdater.setInterval(); + ThreadUpdater.setInterval(); + if (this.board.ID === 'f') { + return ThreadUpdater.update(); + } }, /* @@ -12842,20 +12844,6 @@ */ beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', cb: { - online: function() { - if (ThreadUpdater.thread.isDead) { - return; - } - if (navigator.onLine) { - ThreadUpdater.set('status', ''); - } else { - ThreadUpdater.set('status', 'Offline', 'warning'); - } - if (Conf['Auto Update'] && !Conf['Ignore Offline Status']) { - ThreadUpdater.outdateCount = 0; - return ThreadUpdater.setInterval(); - } - }, checkpost: function(e) { if (e.detail.threadID !== ThreadUpdater.thread.ID) { return; @@ -12973,13 +12961,6 @@ ThreadUpdater.set('timer', 'Update'); return; } - if (!navigator.onLine) { - ThreadUpdater.set('status', 'Offline', 'warning'); - if (!Conf['Ignore Offline Status']) { - ThreadUpdater.set('timer', ''); - return; - } - } interval = ThreadUpdater.interval; if (Conf['Optional Increase']) { limit = d.hidden ? 10 : 5; @@ -13073,6 +13054,12 @@ if (postObject.fsize) { files.push(ID); } + if (board.ID === 'f' && postObject.fsize && (post = thread.posts[ID]) && !post.file) { + node = Build.postFromObject(postObject, board.ID); + $.after(post.nodes.info, $('.file', node)); + post.parseFile(); + Post.callbacks.execute(post, ['Filter', 'File Info Formatting', 'Fappe Tyme', 'Sauce']); + } if (ID <= lastPost) { continue; } diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index abcf96bf9..7ca8a5b93 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 3ed3a26da..f934f22e7 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.3.4 +// @version 1.11.4.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -393,7 +393,6 @@ 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], 'Scroll BG': [false, 'Auto-scroll background tabs.'], 'Auto Update': [true, 'Automatically fetch new posts.'], - 'Ignore Offline Status': [true, 'Update even if your browser reports you are offline.'], 'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.'] }, 'Interval': 30 @@ -411,7 +410,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.3.4', + VERSION: '1.11.4.0', NAMESPACE: '4chan X.', boards: {} }; @@ -1103,13 +1102,17 @@ return this[name] = cb; }; - Callbacks.prototype.execute = function(node) { + Callbacks.prototype.execute = function(node, keys) { var err, errors, k, len1, name, ref; - ref = this.keys; - for (k = 0, len1 = ref.length; k < len1; k++) { - name = ref[k]; + if (keys == null) { + keys = this.keys; + } + for (k = 0, len1 = keys.length; k < len1; k++) { + name = keys[k]; try { - this[name].call(node); + if ((ref = this[name]) != null) { + ref.call(node); + } } catch (_error) { err = _error; if (!errors) { @@ -9735,10 +9738,7 @@ }); }, node: function() { - if (this.file) { - return; - } - return $.addClass(this.nodes.root, "noFile"); + return this.nodes.root.classList.toggle('noFile', !this.file); }, catalogNode: function() { var file, filename; @@ -12829,10 +12829,12 @@ ThreadUpdater.cb.interval.call($.el('input', { value: Conf['Interval'] })); - $.on(window, 'online offline', ThreadUpdater.cb.online); $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - return ThreadUpdater.setInterval(); + ThreadUpdater.setInterval(); + if (this.board.ID === 'f') { + return ThreadUpdater.update(); + } }, /* @@ -12841,20 +12843,6 @@ */ beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', cb: { - online: function() { - if (ThreadUpdater.thread.isDead) { - return; - } - if (navigator.onLine) { - ThreadUpdater.set('status', ''); - } else { - ThreadUpdater.set('status', 'Offline', 'warning'); - } - if (Conf['Auto Update'] && !Conf['Ignore Offline Status']) { - ThreadUpdater.outdateCount = 0; - return ThreadUpdater.setInterval(); - } - }, checkpost: function(e) { if (e.detail.threadID !== ThreadUpdater.thread.ID) { return; @@ -12972,13 +12960,6 @@ ThreadUpdater.set('timer', 'Update'); return; } - if (!navigator.onLine) { - ThreadUpdater.set('status', 'Offline', 'warning'); - if (!Conf['Ignore Offline Status']) { - ThreadUpdater.set('timer', ''); - return; - } - } interval = ThreadUpdater.interval; if (Conf['Optional Increase']) { limit = d.hidden ? 10 : 5; @@ -13072,6 +13053,12 @@ if (postObject.fsize) { files.push(ID); } + if (board.ID === 'f' && postObject.fsize && (post = thread.posts[ID]) && !post.file) { + node = Build.postFromObject(postObject, board.ID); + $.after(post.nodes.info, $('.file', node)); + post.parseFile(); + Post.callbacks.execute(post, ['Filter', 'File Info Formatting', 'Fappe Tyme', 'Sauce']); + } if (ID <= lastPost) { continue; } diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 2cde0e4b7..06d37251b 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 fb96dac17..64cb38bc6 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.11.3.4 +// @version 1.11.4.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5b1ad8c47..325cac0e2 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.3.4 +// @version 1.11.4.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -394,7 +394,6 @@ 'Bottom Scroll': [false, 'Always scroll to the bottom, not the first new post. Useful for event threads.'], 'Scroll BG': [false, 'Auto-scroll background tabs.'], 'Auto Update': [true, 'Automatically fetch new posts.'], - 'Ignore Offline Status': [true, 'Update even if your browser reports you are offline.'], 'Optional Increase': [false, 'Increase the intervals between updates on threads without new posts.'] }, 'Interval': 30 @@ -412,7 +411,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.3.4', + VERSION: '1.11.4.0', NAMESPACE: '4chan X.', boards: {} }; @@ -1104,13 +1103,17 @@ return this[name] = cb; }; - Callbacks.prototype.execute = function(node) { + Callbacks.prototype.execute = function(node, keys) { var err, errors, k, len1, name, ref; - ref = this.keys; - for (k = 0, len1 = ref.length; k < len1; k++) { - name = ref[k]; + if (keys == null) { + keys = this.keys; + } + for (k = 0, len1 = keys.length; k < len1; k++) { + name = keys[k]; try { - this[name].call(node); + if ((ref = this[name]) != null) { + ref.call(node); + } } catch (_error) { err = _error; if (!errors) { @@ -9736,10 +9739,7 @@ }); }, node: function() { - if (this.file) { - return; - } - return $.addClass(this.nodes.root, "noFile"); + return this.nodes.root.classList.toggle('noFile', !this.file); }, catalogNode: function() { var file, filename; @@ -12830,10 +12830,12 @@ ThreadUpdater.cb.interval.call($.el('input', { value: Conf['Interval'] })); - $.on(window, 'online offline', ThreadUpdater.cb.online); $.on(d, 'QRPostSuccessful', ThreadUpdater.cb.checkpost); $.on(d, 'visibilitychange', ThreadUpdater.cb.visibility); - return ThreadUpdater.setInterval(); + ThreadUpdater.setInterval(); + if (this.board.ID === 'f') { + return ThreadUpdater.update(); + } }, /* @@ -12842,20 +12844,6 @@ */ beep: 'data:audio/wav;base64,UklGRjQDAABXQVZFZm10IBAAAAABAAEAgD4AAIA+AAABAAgAc21wbDwAAABBAAADAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkYXRhzAIAAGMms8em0tleMV4zIpLVo8nhfSlcPR102Ki+5JspVEkdVtKzs+K1NEhUIT7DwKrcy0g6WygsrM2k1NpiLl0zIY/WpMrjgCdbPhxw2Kq+5Z4qUkkdU9K1s+K5NkVTITzBwqnczko3WikrqM+l1NxlLF0zIIvXpsnjgydZPhxs2ay95aIrUEkdUdC3suK8N0NUIjq+xKrcz002WioppdGm091pK1w0IIjYp8jkhydXPxxq2K295aUrTkoeTs65suK+OUFUIzi7xqrb0VA0WSoootKm0t5tKlo1H4TYqMfkiydWQBxm16+85actTEseS8y7seHAPD9TIza5yKra01QyWSson9On0d5wKVk2H4DYqcfkjidUQB1j1rG75KsvSkseScu8seDCPz1TJDW2yara1FYxWSwnm9Sn0N9zKVg2H33ZqsXkkihSQR1g1bK65K0wSEsfR8i+seDEQTxUJTOzy6rY1VowWC0mmNWoz993KVc3H3rYq8TklSlRQh1d1LS647AyR0wgRMbAsN/GRDpTJTKwzKrX1l4vVy4lldWpzt97KVY4IXbUr8LZljVPRCxhw7W3z6ZISkw1VK+4sMWvXEhSPk6buay9sm5JVkZNiLWqtrJ+TldNTnquqbCwilZXU1BwpKirrpNgWFhTaZmnpquZbFlbVmWOpaOonHZcXlljhaGhpZ1+YWBdYn2cn6GdhmdhYGN3lp2enIttY2Jjco+bnJuOdGZlZXCImJqakHpoZ2Zug5WYmZJ/bGlobX6RlpeSg3BqaW16jZSVkoZ0bGtteImSk5KIeG5tbnaFkJKRinxxbm91gY2QkIt/c3BwdH6Kj4+LgnZxcXR8iI2OjIR5c3J0e4WLjYuFe3VzdHmCioyLhn52dHR5gIiKioeAeHV1eH+GiYqHgXp2dnh9hIiJh4J8eHd4fIKHiIeDfXl4eHyBhoeHhH96eHmA', cb: { - online: function() { - if (ThreadUpdater.thread.isDead) { - return; - } - if (navigator.onLine) { - ThreadUpdater.set('status', ''); - } else { - ThreadUpdater.set('status', 'Offline', 'warning'); - } - if (Conf['Auto Update'] && !Conf['Ignore Offline Status']) { - ThreadUpdater.outdateCount = 0; - return ThreadUpdater.setInterval(); - } - }, checkpost: function(e) { if (e.detail.threadID !== ThreadUpdater.thread.ID) { return; @@ -12973,13 +12961,6 @@ ThreadUpdater.set('timer', 'Update'); return; } - if (!navigator.onLine) { - ThreadUpdater.set('status', 'Offline', 'warning'); - if (!Conf['Ignore Offline Status']) { - ThreadUpdater.set('timer', ''); - return; - } - } interval = ThreadUpdater.interval; if (Conf['Optional Increase']) { limit = d.hidden ? 10 : 5; @@ -13073,6 +13054,12 @@ if (postObject.fsize) { files.push(ID); } + if (board.ID === 'f' && postObject.fsize && (post = thread.posts[ID]) && !post.file) { + node = Build.postFromObject(postObject, board.ID); + $.after(post.nodes.info, $('.file', node)); + post.parseFile(); + Post.callbacks.execute(post, ['Filter', 'File Info Formatting', 'Fappe Tyme', 'Sauce']); + } if (ID <= lastPost) { continue; } diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 3ac1b3a4f..ae5a434a8 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 aa5c22cf6..52f361f6b 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 cbb0d57c3..a9fe83793 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 3cc379f1e..7601270d3 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.3.4", - "date": "2015-07-12T20:27:50.237Z", + "version": "1.11.4.0", + "date": "2015-07-12T23:46:54.884Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",