diff --git a/CHANGELOG.md b/CHANGELOG.md index a1f76bf41..af993ca32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ### v1.12.1 +**v1.12.1.1** *(2016-07-07)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.1.1/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.1.1/builds/4chan-X-noupdate.crx)] +- Merge v1.12.0.8: Restore `Restart when Opened` option. + **v1.12.1.0** *(2016-07-06)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.1.0/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.12.1.0/builds/4chan-X-noupdate.crx)] - Based on v1.12.0.7. - Replace `Toggleable Thread Watcher` setting with `Persistent Thread Watcher` setting (off by default). With `Persistent Thread Watcher` on, the thread watcher is shown by default, but can still be hidden. diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 822b3eb9e..6b365439a 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 fce86826c..73e74aa47 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.12.1.0 +// @version 1.12.1.1 // @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 7dc5acd4d..d0ee2df75 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.12.1.0 +// @version 1.12.1.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -136,7 +136,7 @@ docSet = function() { }; g = { - VERSION: '1.12.1.0', + VERSION: '1.12.1.1', NAMESPACE: '4chan X.', boards: {} }; @@ -244,6 +244,7 @@ Config = (function() { 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], 'Autoplay': [true, 'Videos begin playing immediately when opened.'], + 'Restart when Opened': [false, 'Restart GIFs and WebMs when you hover over or expand them.'], 'Show Controls': [true, 'Show controls on videos expanded inline.'], 'Click Passthrough': [false, 'Clicks on videos trigger your browser\'s default behavior. Videos can be contracted with button / dragging to the left.', 1], 'Allow Sound': [true, 'Open videos with the sound unmuted.'], @@ -11688,6 +11689,17 @@ ImageCommon = (function() { $.off(video, 'volumechange', Volume.change); return video.muted = true; }, + rewind: function(el) { + if (el.nodeName === 'VIDEO') { + if (el.readyState >= el.HAVE_METADATA) { + return el.currentTime = 0; + } + } else if (/\.gif$/.test(el.src)) { + return $.queueTask(function() { + return el.src = el.src; + }); + } + }, pushCache: function(el) { ImageCommon.cache = el; return $.on(el, 'error', ImageCommon.cacheError); @@ -12008,6 +12020,9 @@ ImageExpand = (function() { $.off(el, eventName, cb); } } + if (Conf['Restart when Opened']) { + ImageCommon.rewind(file.thumb); + } delete file.fullImage; return $.queueTask(function() { if (file.isExpanding || file.isExpanded) { @@ -12034,6 +12049,9 @@ ImageExpand = (function() { } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) { el = file.fullImage = ImageCommon.popCache(); $.on(el, 'error', ImageExpand.error); + if (Conf['Restart when Opened'] && el.id !== 'ihover') { + ImageCommon.rewind(el); + } el.removeAttribute('id'); } else { el = file.fullImage = $.el((isVideo ? 'video' : 'img')); @@ -12277,6 +12295,10 @@ ImageHover = (function() { $.on(el, 'error', error); el.src = file.url; } + if (Conf['Restart when Opened']) { + ImageCommon.rewind(el); + ImageCommon.rewind(this); + } el.id = 'ihover'; $.add(Header.hover, el); if (isVideo) { diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index 4917de7ac..2fa8d786b 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 2ab4c94f3..106320f17 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.12.1.0 +// @version 1.12.1.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -136,7 +136,7 @@ docSet = function() { }; g = { - VERSION: '1.12.1.0', + VERSION: '1.12.1.1', NAMESPACE: '4chan X.', boards: {} }; @@ -244,6 +244,7 @@ Config = (function() { 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], 'Autoplay': [true, 'Videos begin playing immediately when opened.'], + 'Restart when Opened': [false, 'Restart GIFs and WebMs when you hover over or expand them.'], 'Show Controls': [true, 'Show controls on videos expanded inline.'], 'Click Passthrough': [false, 'Clicks on videos trigger your browser\'s default behavior. Videos can be contracted with button / dragging to the left.', 1], 'Allow Sound': [true, 'Open videos with the sound unmuted.'], @@ -11688,6 +11689,17 @@ ImageCommon = (function() { $.off(video, 'volumechange', Volume.change); return video.muted = true; }, + rewind: function(el) { + if (el.nodeName === 'VIDEO') { + if (el.readyState >= el.HAVE_METADATA) { + return el.currentTime = 0; + } + } else if (/\.gif$/.test(el.src)) { + return $.queueTask(function() { + return el.src = el.src; + }); + } + }, pushCache: function(el) { ImageCommon.cache = el; return $.on(el, 'error', ImageCommon.cacheError); @@ -12008,6 +12020,9 @@ ImageExpand = (function() { $.off(el, eventName, cb); } } + if (Conf['Restart when Opened']) { + ImageCommon.rewind(file.thumb); + } delete file.fullImage; return $.queueTask(function() { if (file.isExpanding || file.isExpanded) { @@ -12034,6 +12049,9 @@ ImageExpand = (function() { } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) { el = file.fullImage = ImageCommon.popCache(); $.on(el, 'error', ImageExpand.error); + if (Conf['Restart when Opened'] && el.id !== 'ihover') { + ImageCommon.rewind(el); + } el.removeAttribute('id'); } else { el = file.fullImage = $.el((isVideo ? 'video' : 'img')); @@ -12277,6 +12295,10 @@ ImageHover = (function() { $.on(el, 'error', error); el.src = file.url; } + if (Conf['Restart when Opened']) { + ImageCommon.rewind(el); + ImageCommon.rewind(this); + } el.id = 'ihover'; $.add(Header.hover, el); if (isVideo) { diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 4d4a8c2f9..7012d3e1f 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 bcec2aef7..0a57aafe1 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.12.1.0 +// @version 1.12.1.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 9759f7334..cc9a1bb15 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.12.1.0 +// @version 1.12.1.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -136,7 +136,7 @@ docSet = function() { }; g = { - VERSION: '1.12.1.0', + VERSION: '1.12.1.1', NAMESPACE: '4chan X.', boards: {} }; @@ -244,6 +244,7 @@ Config = (function() { 'Fappe Tyme': [true, 'Hide posts without images when header menu item is checked. *hint* *hint*'], 'Werk Tyme': [true, 'Hide all post images when header menu item is checked.'], 'Autoplay': [true, 'Videos begin playing immediately when opened.'], + 'Restart when Opened': [false, 'Restart GIFs and WebMs when you hover over or expand them.'], 'Show Controls': [true, 'Show controls on videos expanded inline.'], 'Click Passthrough': [false, 'Clicks on videos trigger your browser\'s default behavior. Videos can be contracted with button / dragging to the left.', 1], 'Allow Sound': [true, 'Open videos with the sound unmuted.'], @@ -11688,6 +11689,17 @@ ImageCommon = (function() { $.off(video, 'volumechange', Volume.change); return video.muted = true; }, + rewind: function(el) { + if (el.nodeName === 'VIDEO') { + if (el.readyState >= el.HAVE_METADATA) { + return el.currentTime = 0; + } + } else if (/\.gif$/.test(el.src)) { + return $.queueTask(function() { + return el.src = el.src; + }); + } + }, pushCache: function(el) { ImageCommon.cache = el; return $.on(el, 'error', ImageCommon.cacheError); @@ -12008,6 +12020,9 @@ ImageExpand = (function() { $.off(el, eventName, cb); } } + if (Conf['Restart when Opened']) { + ImageCommon.rewind(file.thumb); + } delete file.fullImage; return $.queueTask(function() { if (file.isExpanding || file.isExpanded) { @@ -12034,6 +12049,9 @@ ImageExpand = (function() { } else if (((ref = ImageCommon.cache) != null ? ref.dataset.fullID : void 0) === post.fullID) { el = file.fullImage = ImageCommon.popCache(); $.on(el, 'error', ImageExpand.error); + if (Conf['Restart when Opened'] && el.id !== 'ihover') { + ImageCommon.rewind(el); + } el.removeAttribute('id'); } else { el = file.fullImage = $.el((isVideo ? 'video' : 'img')); @@ -12277,6 +12295,10 @@ ImageHover = (function() { $.on(el, 'error', error); el.src = file.url; } + if (Conf['Restart when Opened']) { + ImageCommon.rewind(el); + ImageCommon.rewind(this); + } el.id = 'ihover'; $.add(Header.hover, el); if (isVideo) { diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index eb7b60581..98a057ffc 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 03a42fdeb..510785439 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 1ad29f7d3..aa34e779c 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index edee7f668..e13c6040d 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.12.1.0", - "date": "2016-07-06T22:24:00.988Z" + "version": "1.12.1.1", + "date": "2016-07-07T00:33:54.869Z" } \ No newline at end of file