diff --git a/CHANGELOG.md b/CHANGELOG.md index 895efd842..f0a028dc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ ### v1.14.4 +**v1.14.4.1** *(2018-10-29)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.4.1/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.4.1/builds/4chan-X-noupdate.crx)] +- Move drawing of QR file onto Tegaki canvas into 4chan X so it is less likely to be affected by ad blocking. +- Add link to FAQ section in 'Could not open file.' error. +- Make metadata for files selected in Quick Reply available as data-type, data-height, data-width, and data-duration attributes on thumbnail. + **v1.14.4.0** *(2018-10-22)* - [[Userscript](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.4.0/builds/4chan-X-noupdate.user.js)] [[Chrome extension](https://raw.githubusercontent.com/ccd0/4chan-x/1.14.4.0/builds/4chan-X-noupdate.crx)] - Based on v1.14.3.2. - (pentargency) Add field in Advanced settings allowing user to customize filename of images pasted into Quick Reply box diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index 8eb4390ae..4e6bec871 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 d269bd9ad..1ff5ab75f 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.4.0 +// @version 1.14.4.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 43c9ff21b..1a3d643aa 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.4.0 +// @version 1.14.4.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -175,7 +175,7 @@ docSet = function() { }; g = { - VERSION: '1.14.4.0', + VERSION: '1.14.4.1', NAMESPACE: '4chan X.', boards: {} }; @@ -21622,6 +21622,7 @@ QR = (function() { } } $.on(d, 'QRGetFile', QR.getFile); + $.on(d, 'QRDrawFile', QR.drawFile); $.on(d, 'QRSetFile', QR.setFile); $.on(d, 'paste', QR.paste); $.on(d, 'dragover', QR.dragOver); @@ -21940,6 +21941,31 @@ QR = (function() { var ref; return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0); }, + drawFile: function(e) { + var el, file, isVideo, ref; + file = (ref = QR.selected) != null ? ref.file : void 0; + if (!(file && /^(image|video)\//.test(file.type))) { + return; + } + isVideo = /^video\//.test(file); + el = $.el((isVideo ? 'video' : 'img')); + $.on(el, 'error', function() { + return QR.openError(); + }); + $.on(el, (isVideo ? 'loadeddata' : 'load'), function() { + e.target.getContext('2d').drawImage(el, 0, 0); + return URL.revokeObjectURL(el.src); + }); + return el.src = URL.createObjectURL(file); + }, + openError: function() { + var div; + div = $.el('div'); + $.extend(div, { + innerHTML: "Could not open file. [More info]" + }); + return QR.error(div); + }, setFile: function(e) { var file, name, ref, source; ref = e.detail, file = ref.file, name = ref.name, source = ref.source; @@ -22856,6 +22882,9 @@ QR = (function() { }); return video.currentTime = currentTime; }); + $.on(video, 'error', function() { + return QR.openError(); + }); return video.src = URL.createObjectURL(blob); } else { blob.name = post.file.name; @@ -22977,45 +23006,46 @@ QR = (function() { })); }; cb = function(e) { - var file, isVideo; - document.removeEventListener('QRFile', cb, false); - if (!e.detail) { + var selected; + if (e) { + this.removeEventListener('QRMetadata', cb, false); + } + selected = document.getElementById('selected'); + if (!(selected != null ? selected.dataset.type : void 0)) { return error('No file to edit.'); } - if (!/^(image|video)\//.test(e.detail.type)) { + if (!/^(image|video)\//.test(selected.dataset.type)) { return error('Not an image.'); } - isVideo = /^video\//.test(e.detail.type); - file = document.createElement(isVideo ? 'video' : 'img'); - file.addEventListener('error', function() { - return error('Could not open file.', false); + if (!selected.dataset.height) { + return error('Metadata not available.'); + } + if (selected.dataset.height === 'loading') { + selected.addEventListener('QRMetadata', cb, false); + return; + } + if (Tegaki.bg) { + Tegaki.destroy(); + } + FCX.oekakiName = name; + Tegaki.open({ + onDone: FCX.oekakiCB, + onCancel: function() { + return Tegaki.bgColor = '#ffffff'; + }, + width: +selected.dataset.width, + height: +selected.dataset.height, + bgColor: 'transparent' }); - file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() { - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = name; - Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: file.naturalWidth || file.videoWidth, - height: file.naturalHeight || file.videoHeight, - bgColor: 'transparent' - }); - return Tegaki.activeCtx.drawImage(file, 0, 0); - }, false); - return file.src = URL.createObjectURL(e.detail); + return Tegaki.activeCtx.canvas.dispatchEvent(new CustomEvent('QRDrawFile', { + bubbles: true + })); }; if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) { FCX.oekakiName = name; return Tegaki.resume(); } else { - document.addEventListener('QRFile', cb, false); - return document.dispatchEvent(new CustomEvent('QRGetFile', { - bubbles: true - })); + return cb(); } }); }); @@ -23447,6 +23477,8 @@ QR = (function() { } else { this.updateFilename(); } + this.rmMetadata(); + this.nodes.el.dataset.type = this.file.type; this.nodes.el.style.backgroundImage = ''; if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { this.fileError('Unsupported file type.'); @@ -23480,7 +23512,8 @@ QR = (function() { $.off(el, event, onload); $.off(el, 'error', onerror); _this.checkDimensions(el); - return _this.setThumbnail(el); + _this.setThumbnail(el); + return $.event('QRMetadata', null, _this.nodes.el); }; })(this); onerror = (function(_this) { @@ -23488,9 +23521,12 @@ QR = (function() { $.off(el, event, onload); $.off(el, 'error', onerror); _this.fileError("Corrupt " + (isVideo ? 'video' : 'image') + " or error reading metadata.", 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#error-reading-metadata'); - return URL.revokeObjectURL(el.src); + URL.revokeObjectURL(el.src); + _this.nodes.el.removeAttribute('data-height'); + return $.event('QRMetadata', null, _this.nodes.el); }; })(this); + this.nodes.el.dataset.height = 'loading'; $.on(el, event, onload); $.on(el, 'error', onerror); return el.src = URL.createObjectURL(this.file); @@ -23500,6 +23536,8 @@ QR = (function() { var duration, height, max_height, max_width, videoHeight, videoWidth, width; if (el.tagName === 'IMG') { height = el.height, width = el.width; + this.nodes.el.dataset.height = height; + this.nodes.el.dataset.width = width; if (height > QR.max_height || width > QR.max_width) { this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)"); } @@ -23508,6 +23546,9 @@ QR = (function() { } } else { videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration; + this.nodes.el.dataset.height = videoHeight; + this.nodes.el.dataset.width = videoWidth; + this.nodes.el.dataset.duration = duration; max_height = Math.min(QR.max_height, QR.max_height_video); max_width = Math.min(QR.max_width, QR.max_width_video); if (videoHeight > max_height || videoWidth > max_width) { @@ -23574,6 +23615,7 @@ QR = (function() { delete this.filesize; this.nodes.el.removeAttribute('title'); QR.nodes.filename.removeAttribute('title'); + this.rmMetadata(); this.nodes.el.style.backgroundImage = ''; $.rmClass(this.nodes.el, 'has-file'); this.showFileData(); @@ -23584,6 +23626,15 @@ QR = (function() { return this.preventAutoPost(); }; + _Class.prototype.rmMetadata = function() { + var attr, i, len, ref; + ref = ['type', 'height', 'width', 'duration']; + for (i = 0, len = ref.length; i < len; i++) { + attr = ref[i]; + this.nodes.el.removeAttribute("data-" + attr); + } + }; + _Class.prototype.saveFilename = function() { this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); if (!QR.validExtension.test(this.filename)) { diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index bf8a43ae9..456cf911a 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 ff349c9f0..6b8e67bbe 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.4.0 +// @version 1.14.4.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -175,7 +175,7 @@ docSet = function() { }; g = { - VERSION: '1.14.4.0', + VERSION: '1.14.4.1', NAMESPACE: '4chan X.', boards: {} }; @@ -21622,6 +21622,7 @@ QR = (function() { } } $.on(d, 'QRGetFile', QR.getFile); + $.on(d, 'QRDrawFile', QR.drawFile); $.on(d, 'QRSetFile', QR.setFile); $.on(d, 'paste', QR.paste); $.on(d, 'dragover', QR.dragOver); @@ -21940,6 +21941,31 @@ QR = (function() { var ref; return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0); }, + drawFile: function(e) { + var el, file, isVideo, ref; + file = (ref = QR.selected) != null ? ref.file : void 0; + if (!(file && /^(image|video)\//.test(file.type))) { + return; + } + isVideo = /^video\//.test(file); + el = $.el((isVideo ? 'video' : 'img')); + $.on(el, 'error', function() { + return QR.openError(); + }); + $.on(el, (isVideo ? 'loadeddata' : 'load'), function() { + e.target.getContext('2d').drawImage(el, 0, 0); + return URL.revokeObjectURL(el.src); + }); + return el.src = URL.createObjectURL(file); + }, + openError: function() { + var div; + div = $.el('div'); + $.extend(div, { + innerHTML: "Could not open file. [More info]" + }); + return QR.error(div); + }, setFile: function(e) { var file, name, ref, source; ref = e.detail, file = ref.file, name = ref.name, source = ref.source; @@ -22856,6 +22882,9 @@ QR = (function() { }); return video.currentTime = currentTime; }); + $.on(video, 'error', function() { + return QR.openError(); + }); return video.src = URL.createObjectURL(blob); } else { blob.name = post.file.name; @@ -22977,45 +23006,46 @@ QR = (function() { })); }; cb = function(e) { - var file, isVideo; - document.removeEventListener('QRFile', cb, false); - if (!e.detail) { + var selected; + if (e) { + this.removeEventListener('QRMetadata', cb, false); + } + selected = document.getElementById('selected'); + if (!(selected != null ? selected.dataset.type : void 0)) { return error('No file to edit.'); } - if (!/^(image|video)\//.test(e.detail.type)) { + if (!/^(image|video)\//.test(selected.dataset.type)) { return error('Not an image.'); } - isVideo = /^video\//.test(e.detail.type); - file = document.createElement(isVideo ? 'video' : 'img'); - file.addEventListener('error', function() { - return error('Could not open file.', false); + if (!selected.dataset.height) { + return error('Metadata not available.'); + } + if (selected.dataset.height === 'loading') { + selected.addEventListener('QRMetadata', cb, false); + return; + } + if (Tegaki.bg) { + Tegaki.destroy(); + } + FCX.oekakiName = name; + Tegaki.open({ + onDone: FCX.oekakiCB, + onCancel: function() { + return Tegaki.bgColor = '#ffffff'; + }, + width: +selected.dataset.width, + height: +selected.dataset.height, + bgColor: 'transparent' }); - file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() { - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = name; - Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: file.naturalWidth || file.videoWidth, - height: file.naturalHeight || file.videoHeight, - bgColor: 'transparent' - }); - return Tegaki.activeCtx.drawImage(file, 0, 0); - }, false); - return file.src = URL.createObjectURL(e.detail); + return Tegaki.activeCtx.canvas.dispatchEvent(new CustomEvent('QRDrawFile', { + bubbles: true + })); }; if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) { FCX.oekakiName = name; return Tegaki.resume(); } else { - document.addEventListener('QRFile', cb, false); - return document.dispatchEvent(new CustomEvent('QRGetFile', { - bubbles: true - })); + return cb(); } }); }); @@ -23447,6 +23477,8 @@ QR = (function() { } else { this.updateFilename(); } + this.rmMetadata(); + this.nodes.el.dataset.type = this.file.type; this.nodes.el.style.backgroundImage = ''; if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { this.fileError('Unsupported file type.'); @@ -23480,7 +23512,8 @@ QR = (function() { $.off(el, event, onload); $.off(el, 'error', onerror); _this.checkDimensions(el); - return _this.setThumbnail(el); + _this.setThumbnail(el); + return $.event('QRMetadata', null, _this.nodes.el); }; })(this); onerror = (function(_this) { @@ -23488,9 +23521,12 @@ QR = (function() { $.off(el, event, onload); $.off(el, 'error', onerror); _this.fileError("Corrupt " + (isVideo ? 'video' : 'image') + " or error reading metadata.", 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#error-reading-metadata'); - return URL.revokeObjectURL(el.src); + URL.revokeObjectURL(el.src); + _this.nodes.el.removeAttribute('data-height'); + return $.event('QRMetadata', null, _this.nodes.el); }; })(this); + this.nodes.el.dataset.height = 'loading'; $.on(el, event, onload); $.on(el, 'error', onerror); return el.src = URL.createObjectURL(this.file); @@ -23500,6 +23536,8 @@ QR = (function() { var duration, height, max_height, max_width, videoHeight, videoWidth, width; if (el.tagName === 'IMG') { height = el.height, width = el.width; + this.nodes.el.dataset.height = height; + this.nodes.el.dataset.width = width; if (height > QR.max_height || width > QR.max_width) { this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)"); } @@ -23508,6 +23546,9 @@ QR = (function() { } } else { videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration; + this.nodes.el.dataset.height = videoHeight; + this.nodes.el.dataset.width = videoWidth; + this.nodes.el.dataset.duration = duration; max_height = Math.min(QR.max_height, QR.max_height_video); max_width = Math.min(QR.max_width, QR.max_width_video); if (videoHeight > max_height || videoWidth > max_width) { @@ -23574,6 +23615,7 @@ QR = (function() { delete this.filesize; this.nodes.el.removeAttribute('title'); QR.nodes.filename.removeAttribute('title'); + this.rmMetadata(); this.nodes.el.style.backgroundImage = ''; $.rmClass(this.nodes.el, 'has-file'); this.showFileData(); @@ -23584,6 +23626,15 @@ QR = (function() { return this.preventAutoPost(); }; + _Class.prototype.rmMetadata = function() { + var attr, i, len, ref; + ref = ['type', 'height', 'width', 'duration']; + for (i = 0, len = ref.length; i < len; i++) { + attr = ref[i]; + this.nodes.el.removeAttribute("data-" + attr); + } + }; + _Class.prototype.saveFilename = function() { this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); if (!QR.validExtension.test(this.filename)) { diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index da689d82b..37865a1df 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 376fd48bc..bc76a839c 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.4.0 +// @version 1.14.4.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index a9c8ce34d..4ff765624 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.14.4.0 +// @version 1.14.4.1 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -175,7 +175,7 @@ docSet = function() { }; g = { - VERSION: '1.14.4.0', + VERSION: '1.14.4.1', NAMESPACE: '4chan X.', boards: {} }; @@ -21622,6 +21622,7 @@ QR = (function() { } } $.on(d, 'QRGetFile', QR.getFile); + $.on(d, 'QRDrawFile', QR.drawFile); $.on(d, 'QRSetFile', QR.setFile); $.on(d, 'paste', QR.paste); $.on(d, 'dragover', QR.dragOver); @@ -21940,6 +21941,31 @@ QR = (function() { var ref; return $.event('QRFile', (ref = QR.selected) != null ? ref.file : void 0); }, + drawFile: function(e) { + var el, file, isVideo, ref; + file = (ref = QR.selected) != null ? ref.file : void 0; + if (!(file && /^(image|video)\//.test(file.type))) { + return; + } + isVideo = /^video\//.test(file); + el = $.el((isVideo ? 'video' : 'img')); + $.on(el, 'error', function() { + return QR.openError(); + }); + $.on(el, (isVideo ? 'loadeddata' : 'load'), function() { + e.target.getContext('2d').drawImage(el, 0, 0); + return URL.revokeObjectURL(el.src); + }); + return el.src = URL.createObjectURL(file); + }, + openError: function() { + var div; + div = $.el('div'); + $.extend(div, { + innerHTML: "Could not open file. [More info]" + }); + return QR.error(div); + }, setFile: function(e) { var file, name, ref, source; ref = e.detail, file = ref.file, name = ref.name, source = ref.source; @@ -22856,6 +22882,9 @@ QR = (function() { }); return video.currentTime = currentTime; }); + $.on(video, 'error', function() { + return QR.openError(); + }); return video.src = URL.createObjectURL(blob); } else { blob.name = post.file.name; @@ -22977,45 +23006,46 @@ QR = (function() { })); }; cb = function(e) { - var file, isVideo; - document.removeEventListener('QRFile', cb, false); - if (!e.detail) { + var selected; + if (e) { + this.removeEventListener('QRMetadata', cb, false); + } + selected = document.getElementById('selected'); + if (!(selected != null ? selected.dataset.type : void 0)) { return error('No file to edit.'); } - if (!/^(image|video)\//.test(e.detail.type)) { + if (!/^(image|video)\//.test(selected.dataset.type)) { return error('Not an image.'); } - isVideo = /^video\//.test(e.detail.type); - file = document.createElement(isVideo ? 'video' : 'img'); - file.addEventListener('error', function() { - return error('Could not open file.', false); + if (!selected.dataset.height) { + return error('Metadata not available.'); + } + if (selected.dataset.height === 'loading') { + selected.addEventListener('QRMetadata', cb, false); + return; + } + if (Tegaki.bg) { + Tegaki.destroy(); + } + FCX.oekakiName = name; + Tegaki.open({ + onDone: FCX.oekakiCB, + onCancel: function() { + return Tegaki.bgColor = '#ffffff'; + }, + width: +selected.dataset.width, + height: +selected.dataset.height, + bgColor: 'transparent' }); - file.addEventListener((isVideo ? 'loadeddata' : 'load'), function() { - if (Tegaki.bg) { - Tegaki.destroy(); - } - FCX.oekakiName = name; - Tegaki.open({ - onDone: FCX.oekakiCB, - onCancel: function() { - return Tegaki.bgColor = '#ffffff'; - }, - width: file.naturalWidth || file.videoWidth, - height: file.naturalHeight || file.videoHeight, - bgColor: 'transparent' - }); - return Tegaki.activeCtx.drawImage(file, 0, 0); - }, false); - return file.src = URL.createObjectURL(e.detail); + return Tegaki.activeCtx.canvas.dispatchEvent(new CustomEvent('QRDrawFile', { + bubbles: true + })); }; if (Tegaki.bg && Tegaki.onDoneCb === FCX.oekakiCB && source === FCX.oekakiLatest) { FCX.oekakiName = name; return Tegaki.resume(); } else { - document.addEventListener('QRFile', cb, false); - return document.dispatchEvent(new CustomEvent('QRGetFile', { - bubbles: true - })); + return cb(); } }); }); @@ -23447,6 +23477,8 @@ QR = (function() { } else { this.updateFilename(); } + this.rmMetadata(); + this.nodes.el.dataset.type = this.file.type; this.nodes.el.style.backgroundImage = ''; if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { this.fileError('Unsupported file type.'); @@ -23480,7 +23512,8 @@ QR = (function() { $.off(el, event, onload); $.off(el, 'error', onerror); _this.checkDimensions(el); - return _this.setThumbnail(el); + _this.setThumbnail(el); + return $.event('QRMetadata', null, _this.nodes.el); }; })(this); onerror = (function(_this) { @@ -23488,9 +23521,12 @@ QR = (function() { $.off(el, event, onload); $.off(el, 'error', onerror); _this.fileError("Corrupt " + (isVideo ? 'video' : 'image') + " or error reading metadata.", 'https://github.com/ccd0/4chan-x/wiki/Frequently-Asked-Questions#error-reading-metadata'); - return URL.revokeObjectURL(el.src); + URL.revokeObjectURL(el.src); + _this.nodes.el.removeAttribute('data-height'); + return $.event('QRMetadata', null, _this.nodes.el); }; })(this); + this.nodes.el.dataset.height = 'loading'; $.on(el, event, onload); $.on(el, 'error', onerror); return el.src = URL.createObjectURL(this.file); @@ -23500,6 +23536,8 @@ QR = (function() { var duration, height, max_height, max_width, videoHeight, videoWidth, width; if (el.tagName === 'IMG') { height = el.height, width = el.width; + this.nodes.el.dataset.height = height; + this.nodes.el.dataset.width = width; if (height > QR.max_height || width > QR.max_width) { this.fileError("Image too large (image: " + height + "x" + width + "px, max: " + QR.max_height + "x" + QR.max_width + "px)"); } @@ -23508,6 +23546,9 @@ QR = (function() { } } else { videoHeight = el.videoHeight, videoWidth = el.videoWidth, duration = el.duration; + this.nodes.el.dataset.height = videoHeight; + this.nodes.el.dataset.width = videoWidth; + this.nodes.el.dataset.duration = duration; max_height = Math.min(QR.max_height, QR.max_height_video); max_width = Math.min(QR.max_width, QR.max_width_video); if (videoHeight > max_height || videoWidth > max_width) { @@ -23574,6 +23615,7 @@ QR = (function() { delete this.filesize; this.nodes.el.removeAttribute('title'); QR.nodes.filename.removeAttribute('title'); + this.rmMetadata(); this.nodes.el.style.backgroundImage = ''; $.rmClass(this.nodes.el, 'has-file'); this.showFileData(); @@ -23584,6 +23626,15 @@ QR = (function() { return this.preventAutoPost(); }; + _Class.prototype.rmMetadata = function() { + var attr, i, len, ref; + ref = ['type', 'height', 'width', 'duration']; + for (i = 0, len = ref.length; i < len; i++) { + attr = ref[i]; + this.nodes.el.removeAttribute("data-" + attr); + } + }; + _Class.prototype.saveFilename = function() { this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); if (!QR.validExtension.test(this.filename)) { diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index 8a4f1302f..a0006eaa1 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 14645d9ba..a4f611c61 100644 --- a/builds/updates-beta.json +++ b/builds/updates-beta.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.4.0", + "version": "1.14.4.1", "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 d91b4f155..c2c630d9d 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 b49fb1e6e..b4c8278d8 100644 --- a/builds/updates.json +++ b/builds/updates.json @@ -3,7 +3,7 @@ "4chan-x@4chan-x.net": { "updates": [ { - "version": "1.14.4.0", + "version": "1.14.4.1", "update_link": "https://www.4chan-x.net/builds/4chan-X.crx" } ] diff --git a/builds/updates.xml b/builds/updates.xml index 4d03e7086..73821c485 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/version.json b/version.json index ad9d40e81..529124609 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "version": "1.14.4.0", - "date": "2018-10-22T21:48:18.656Z" + "version": "1.14.4.1", + "date": "2018-10-29T07:37:33.590Z" } \ No newline at end of file