diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa7c9474..45defa552 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ ### v1.14.5 +**v1.14.5.8** *(2019-01-24)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.8/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.8/builds/4chan-X-noupdate.crx)] +- Restore updating faster than 30 seconds after 4chan change. +- Fix false detection of posts added by updater on Tinyboard as own posts. +- Support recognizing quotelinks to pages with extensions other than .html. +- Add FLAC and M4A to embeddable audio types. #2202 +- Fix issue from v1.14.5.6 causing display of 'NaN seconds' before index is loaded. + **v1.14.5.7** *(2019-01-06)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.7/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.5.7/builds/4chan-X-noupdate.crx)] - Work when site uses extensions for pages other than .html diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 79a19ec70..e352061ab 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 a0c36daca..49dc6fcab 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.14.5.7 +// @version 1.14.5.8 // @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 508fec35d..0c9d23b6f 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.14.5.7 +// @version 1.14.5.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.7', + VERSION: '1.14.5.8', NAMESPACE: '4chan X.', boards: {} }; @@ -4603,7 +4603,7 @@ $ = (function() { pageXHR = XMLHttpRequest; } return function(url, options, extra) { - var err, event, form, j, len, r, ref, ref1, type, upCallbacks, whenModified; + var err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; if (options == null) { options = {}; } @@ -4617,19 +4617,29 @@ $ = (function() { } } url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'); - if ($.engine === 'blink' && whenModified) { - url += "?s=" + whenModified; + if (whenModified) { + params = []; + if ($.engine === 'blink') { + params.push("s=" + whenModified); + } + if (Site.software === 'yotsuba') { + params.push("t=" + (Date.now())); + } + url0 = url; + if (params.length) { + url += '?' + params.join('&'); + } } r = new pageXHR(); type || (type = form && 'post' || 'get'); try { r.open(type, url, true); if (whenModified) { - if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) { - r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]); + if (((ref = lastModified[whenModified]) != null ? ref[url0] : void 0) != null) { + r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url0]); } $.on(r, 'load', function() { - return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified'); + return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url0] = r.getResponseHeader('Last-Modified'); }); } $.extend(r, options); @@ -7382,8 +7392,8 @@ SW = {}; postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]' }, regexp: { - quotelink: /\/([^\/]+)\/res\/(\d+)\.html#(\d+)$/, - quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)\.html#(\d+)"/g + quotelink: /\/([^\/]+)\/res\/(\d+)\.\w+#(\d+)$/, + quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)\.\w+#(\d+)"/g }, bgColoredEl: function() { return $.el('div', { @@ -10356,7 +10366,7 @@ Index = (function() { return d.title = d.title.replace(/\ -\ Page\ \d+/, ''); }); $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() { - var board, el, len3, m, ref9, topNavPos; + var board, el, len3, m, ref9, timeEl, topNavPos; Build.hat = $('.board > .thread > img:first-child'); if (Build.hat) { g.BOARD.threads.forEach(function(thread) { @@ -10384,7 +10394,10 @@ Index = (function() { topNavPos = $.id('delform').previousElementSibling; $.before(topNavPos, $.el('hr')); $.before(topNavPos, Index.navLinks); - return RelativeDates.update($('#index-last-refresh time', Index.navLinks)); + timeEl = $('#index-last-refresh time', Index.navLinks); + if (timeEl.dataset.utc) { + return RelativeDates.update(timeEl); + } }); return Main.ready(function() { var pagelist; @@ -15481,7 +15494,7 @@ Embedding = (function() { ordered_types: [ { key: 'audio', - regExp: /^[^?#]+\.(?:mp3|oga|wav)(?:[?#]|$)/i, + regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, style: '', el: function(a) { return $.el('audio', { @@ -18943,12 +18956,18 @@ Tinyboard = (function() { if (g.VIEW === 'thread') { return Main.ready(function() { return $.global(function() { - var boardID, ref, threadID; + var boardID, form, ref, threadID; ref = document.currentScript.dataset, boardID = ref.boardID, threadID = ref.threadID; threadID = +threadID; - return window.$(document).on('new_post', function(e, post) { - var detail, event, postID; - postID = +post.id.match(/\d*$/)[0]; + form = document.querySelector('form[name="post"]'); + return window.$(document).ajaxComplete(function(event, request, settings) { + var detail, postID, ref1; + if (settings.url !== form.action) { + return; + } + if (!(postID = +((ref1 = request.responseJSON) != null ? ref1.id : void 0))) { + return; + } detail = { boardID: boardID, threadID: threadID, diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 3ca4b2009..b561556f5 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 cf668926b..479fbfd89 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.14.5.7 +// @version 1.14.5.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.7', + VERSION: '1.14.5.8', NAMESPACE: '4chan X.', boards: {} }; @@ -4603,7 +4603,7 @@ $ = (function() { pageXHR = XMLHttpRequest; } return function(url, options, extra) { - var err, event, form, j, len, r, ref, ref1, type, upCallbacks, whenModified; + var err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; if (options == null) { options = {}; } @@ -4617,19 +4617,29 @@ $ = (function() { } } url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'); - if ($.engine === 'blink' && whenModified) { - url += "?s=" + whenModified; + if (whenModified) { + params = []; + if ($.engine === 'blink') { + params.push("s=" + whenModified); + } + if (Site.software === 'yotsuba') { + params.push("t=" + (Date.now())); + } + url0 = url; + if (params.length) { + url += '?' + params.join('&'); + } } r = new pageXHR(); type || (type = form && 'post' || 'get'); try { r.open(type, url, true); if (whenModified) { - if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) { - r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]); + if (((ref = lastModified[whenModified]) != null ? ref[url0] : void 0) != null) { + r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url0]); } $.on(r, 'load', function() { - return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified'); + return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url0] = r.getResponseHeader('Last-Modified'); }); } $.extend(r, options); @@ -7382,8 +7392,8 @@ SW = {}; postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]' }, regexp: { - quotelink: /\/([^\/]+)\/res\/(\d+)\.html#(\d+)$/, - quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)\.html#(\d+)"/g + quotelink: /\/([^\/]+)\/res\/(\d+)\.\w+#(\d+)$/, + quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)\.\w+#(\d+)"/g }, bgColoredEl: function() { return $.el('div', { @@ -10356,7 +10366,7 @@ Index = (function() { return d.title = d.title.replace(/\ -\ Page\ \d+/, ''); }); $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() { - var board, el, len3, m, ref9, topNavPos; + var board, el, len3, m, ref9, timeEl, topNavPos; Build.hat = $('.board > .thread > img:first-child'); if (Build.hat) { g.BOARD.threads.forEach(function(thread) { @@ -10384,7 +10394,10 @@ Index = (function() { topNavPos = $.id('delform').previousElementSibling; $.before(topNavPos, $.el('hr')); $.before(topNavPos, Index.navLinks); - return RelativeDates.update($('#index-last-refresh time', Index.navLinks)); + timeEl = $('#index-last-refresh time', Index.navLinks); + if (timeEl.dataset.utc) { + return RelativeDates.update(timeEl); + } }); return Main.ready(function() { var pagelist; @@ -15481,7 +15494,7 @@ Embedding = (function() { ordered_types: [ { key: 'audio', - regExp: /^[^?#]+\.(?:mp3|oga|wav)(?:[?#]|$)/i, + regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, style: '', el: function(a) { return $.el('audio', { @@ -18943,12 +18956,18 @@ Tinyboard = (function() { if (g.VIEW === 'thread') { return Main.ready(function() { return $.global(function() { - var boardID, ref, threadID; + var boardID, form, ref, threadID; ref = document.currentScript.dataset, boardID = ref.boardID, threadID = ref.threadID; threadID = +threadID; - return window.$(document).on('new_post', function(e, post) { - var detail, event, postID; - postID = +post.id.match(/\d*$/)[0]; + form = document.querySelector('form[name="post"]'); + return window.$(document).ajaxComplete(function(event, request, settings) { + var detail, postID, ref1; + if (settings.url !== form.action) { + return; + } + if (!(postID = +((ref1 = request.responseJSON) != null ? ref1.id : void 0))) { + return; + } detail = { boardID: boardID, threadID: threadID, diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 97e21315c..24bdd4e82 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 4b859b93c..46f9928b4 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.5.7 +// @version 1.14.5.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 608408c38..b2d6f4294 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.5.7 +// @version 1.14.5.8 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -198,7 +198,7 @@ docSet = function() { }; g = { - VERSION: '1.14.5.7', + VERSION: '1.14.5.8', NAMESPACE: '4chan X.', boards: {} }; @@ -4603,7 +4603,7 @@ $ = (function() { pageXHR = XMLHttpRequest; } return function(url, options, extra) { - var err, event, form, j, len, r, ref, ref1, type, upCallbacks, whenModified; + var err, event, form, j, len, params, r, ref, ref1, type, upCallbacks, url0, whenModified; if (options == null) { options = {}; } @@ -4617,19 +4617,29 @@ $ = (function() { } } url = url.replace(/^((?:https?:)?\/\/(?:\w+\.)?4c(?:ha|d)n\.org)\/adv\//, '$1//adv/'); - if ($.engine === 'blink' && whenModified) { - url += "?s=" + whenModified; + if (whenModified) { + params = []; + if ($.engine === 'blink') { + params.push("s=" + whenModified); + } + if (Site.software === 'yotsuba') { + params.push("t=" + (Date.now())); + } + url0 = url; + if (params.length) { + url += '?' + params.join('&'); + } } r = new pageXHR(); type || (type = form && 'post' || 'get'); try { r.open(type, url, true); if (whenModified) { - if (((ref = lastModified[whenModified]) != null ? ref[url] : void 0) != null) { - r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url]); + if (((ref = lastModified[whenModified]) != null ? ref[url0] : void 0) != null) { + r.setRequestHeader('If-Modified-Since', lastModified[whenModified][url0]); } $.on(r, 'load', function() { - return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url] = r.getResponseHeader('Last-Modified'); + return (lastModified[whenModified] || (lastModified[whenModified] = {}))[url0] = r.getResponseHeader('Last-Modified'); }); } $.extend(r, options); @@ -7382,8 +7392,8 @@ SW = {}; postContainer: 'div[starts-with(@id,"reply_") or starts-with(@id,"thread_")]' }, regexp: { - quotelink: /\/([^\/]+)\/res\/(\d+)\.html#(\d+)$/, - quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)\.html#(\d+)"/g + quotelink: /\/([^\/]+)\/res\/(\d+)\.\w+#(\d+)$/, + quotelinkHTML: /]*\bhref="[^"]*\/([^\/]+)\/res\/(\d+)\.\w+#(\d+)"/g }, bgColoredEl: function() { return $.el('div', { @@ -10356,7 +10366,7 @@ Index = (function() { return d.title = d.title.replace(/\ -\ Page\ \d+/, ''); }); $.onExists(doc, '.board > .thread > .postContainer, .board + *', function() { - var board, el, len3, m, ref9, topNavPos; + var board, el, len3, m, ref9, timeEl, topNavPos; Build.hat = $('.board > .thread > img:first-child'); if (Build.hat) { g.BOARD.threads.forEach(function(thread) { @@ -10384,7 +10394,10 @@ Index = (function() { topNavPos = $.id('delform').previousElementSibling; $.before(topNavPos, $.el('hr')); $.before(topNavPos, Index.navLinks); - return RelativeDates.update($('#index-last-refresh time', Index.navLinks)); + timeEl = $('#index-last-refresh time', Index.navLinks); + if (timeEl.dataset.utc) { + return RelativeDates.update(timeEl); + } }); return Main.ready(function() { var pagelist; @@ -15481,7 +15494,7 @@ Embedding = (function() { ordered_types: [ { key: 'audio', - regExp: /^[^?#]+\.(?:mp3|oga|wav)(?:[?#]|$)/i, + regExp: /^[^?#]+\.(?:mp3|m4a|oga|wav|flac)(?:[?#]|$)/i, style: '', el: function(a) { return $.el('audio', { @@ -18943,12 +18956,18 @@ Tinyboard = (function() { if (g.VIEW === 'thread') { return Main.ready(function() { return $.global(function() { - var boardID, ref, threadID; + var boardID, form, ref, threadID; ref = document.currentScript.dataset, boardID = ref.boardID, threadID = ref.threadID; threadID = +threadID; - return window.$(document).on('new_post', function(e, post) { - var detail, event, postID; - postID = +post.id.match(/\d*$/)[0]; + form = document.querySelector('form[name="post"]'); + return window.$(document).ajaxComplete(function(event, request, settings) { + var detail, postID, ref1; + if (settings.url !== form.action) { + return; + } + if (!(postID = +((ref1 = request.responseJSON) != null ? ref1.id : void 0))) { + return; + } detail = { boardID: boardID, threadID: threadID, diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index fe5b01706..0ce87be03 100644 Binary files a/builds/4chan-X.zip and b/builds/4chan-X.zip differ diff --git a/builds/updates-beta.json b/builds/updates-beta.json index cc9dc8e1c..c79e48c0f 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.5.7", + "version": "1.14.5.8", "update_link": "https://www.4chan-x.net/builds/4chan-X-beta.crx" } ] diff --git a/builds/updates-beta.xml b/builds/updates-beta.xml index 318a22018..7328992aa 100644 --- a/builds/updates-beta.xml +++ b/builds/updates-beta.xml @@ -1,7 +1,7 @@ - + diff --git a/builds/updates.json b/builds/updates.json index e8c3408db..c58d172aa 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.5.7", + "version": "1.14.5.8", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index a476bda14..b3acf44a3 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index 616ec8a94..eb943e145 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.5.7", - "date": "2019-01-06T10:39:52.004Z" + "version": "1.14.5.8", + "date": "2019-01-24T22:03:35.429Z" } \ No newline at end of file