diff --git a/CHANGELOG.md b/CHANGELOG.md index 1386e33f8..9a83b064a 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ 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.5 + +**v1.11.5.0** *(2015-07-14)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.5.0/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.5.0/builds/4chan-X-noupdate.crx "Chromium version")] +- Based on v1.11.4.1. +- When posting a reply with a file on /f/, add a link to it in the comment. + ### v1.11.4 **v1.11.4.1** *(2015-07-13)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.4.1/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.4.1/builds/4chan-X-noupdate.crx "Chromium version")] diff --git a/builds/4chan-X-beta.crx b/builds/4chan-X-beta.crx index f9bbe60ab..3339143fe 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 a63d82b0b..4a54ac5f8 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.4.1 +// @version 1.11.5.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 cfbceb8f3..42f58a493 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.4.1 +// @version 1.11.5.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -411,7 +411,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.4.1', + VERSION: '1.11.5.0', NAMESPACE: '4chan X.', boards: {} }; @@ -9360,11 +9360,9 @@ if (!this.file) { return; } - this.file.newName = this.filename.replace(/[\/\\]/g, '-'); - if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) { - this.file.newName += '.jpg'; - } - return this.updateFilename(); + this.saveFilename(); + this.updateFilename(); + return this.updateFlashURL(); case 'name': return QR.persona.set(this); } @@ -9466,11 +9464,13 @@ } QR.captcha.onPostChange(); URL.revokeObjectURL(this.URL); + this.saveFilename(); if (this === QR.selected) { this.showFileData(); } else { this.updateFilename(); } + this.updateFlashURL(); this.nodes.el.style.backgroundImage = null; if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { return this.fileError('Unsupported file type.'); @@ -9602,12 +9602,20 @@ this.nodes.label.hidden = true; } this.showFileData(); + this.updateFlashURL(); URL.revokeObjectURL(this.URL); return this.dismissErrors(function(error) { return $.hasClass(error, 'file-error'); }); }; + _Class.prototype.saveFilename = function() { + this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); + if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) { + return this.file.newName += '.jpg'; + } + }; + _Class.prototype.updateFilename = function() { var long; long = this.filename + " (" + this.filesize + ")"; @@ -9629,6 +9637,36 @@ } }; + _Class.prototype.updateFlashURL = function() { + var oldURL, ref, url; + if (g.BOARD.ID !== 'f') { + return; + } + if (this.thread === 'new' || !this.file) { + url = ''; + } else { + url = this.file.newName; + if ((ref = $.engine) === 'blink' || ref === 'webkit') { + url = url.replace(/"/g, '%22'); + } + url = url.replace(/[\t\n\f\r \xa0\u200B\u2029\u3000]+/g, ' ').replace(/(^ | $)/g, '').replace(/\.[0-9A-Za-z]+$/, ''); + url = "https://i.4cdn.org/f/" + (encodeURIComponent(E(url))) + ".swf\n"; + } + oldURL = this.flashURL || ''; + if (url !== oldURL) { + this.com || (this.com = ''); + if (this.com.slice(0, oldURL.length) === oldURL) { + this.com = this.com.slice(oldURL.length); + } + this.com = (url + this.com) || null; + if (this === QR.selected) { + QR.nodes.com.value = this.com; + QR.characterCount(); + } + return this.flashURL = url; + } + }; + _Class.prototype.pasteText = function(file) { var reader; this.pasting = true; @@ -11809,7 +11847,7 @@ } }, { key: 'TwitchTV', - regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/([^#\&\?]*)/, + regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/, httpOnly: true, style: "border: none; width: 640px; height: 360px;", el: function(a) { diff --git a/builds/4chan-X-noupdate.crx b/builds/4chan-X-noupdate.crx index abb2661ae..6833519a7 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 f8b6c69e3..d51fc4e93 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.4.1 +// @version 1.11.5.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -410,7 +410,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.4.1', + VERSION: '1.11.5.0', NAMESPACE: '4chan X.', boards: {} }; @@ -9359,11 +9359,9 @@ if (!this.file) { return; } - this.file.newName = this.filename.replace(/[\/\\]/g, '-'); - if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) { - this.file.newName += '.jpg'; - } - return this.updateFilename(); + this.saveFilename(); + this.updateFilename(); + return this.updateFlashURL(); case 'name': return QR.persona.set(this); } @@ -9465,11 +9463,13 @@ } QR.captcha.onPostChange(); URL.revokeObjectURL(this.URL); + this.saveFilename(); if (this === QR.selected) { this.showFileData(); } else { this.updateFilename(); } + this.updateFlashURL(); this.nodes.el.style.backgroundImage = null; if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { return this.fileError('Unsupported file type.'); @@ -9601,12 +9601,20 @@ this.nodes.label.hidden = true; } this.showFileData(); + this.updateFlashURL(); URL.revokeObjectURL(this.URL); return this.dismissErrors(function(error) { return $.hasClass(error, 'file-error'); }); }; + _Class.prototype.saveFilename = function() { + this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); + if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) { + return this.file.newName += '.jpg'; + } + }; + _Class.prototype.updateFilename = function() { var long; long = this.filename + " (" + this.filesize + ")"; @@ -9628,6 +9636,36 @@ } }; + _Class.prototype.updateFlashURL = function() { + var oldURL, ref, url; + if (g.BOARD.ID !== 'f') { + return; + } + if (this.thread === 'new' || !this.file) { + url = ''; + } else { + url = this.file.newName; + if ((ref = $.engine) === 'blink' || ref === 'webkit') { + url = url.replace(/"/g, '%22'); + } + url = url.replace(/[\t\n\f\r \xa0\u200B\u2029\u3000]+/g, ' ').replace(/(^ | $)/g, '').replace(/\.[0-9A-Za-z]+$/, ''); + url = "https://i.4cdn.org/f/" + (encodeURIComponent(E(url))) + ".swf\n"; + } + oldURL = this.flashURL || ''; + if (url !== oldURL) { + this.com || (this.com = ''); + if (this.com.slice(0, oldURL.length) === oldURL) { + this.com = this.com.slice(oldURL.length); + } + this.com = (url + this.com) || null; + if (this === QR.selected) { + QR.nodes.com.value = this.com; + QR.characterCount(); + } + return this.flashURL = url; + } + }; + _Class.prototype.pasteText = function(file) { var reader; this.pasting = true; @@ -11808,7 +11846,7 @@ } }, { key: 'TwitchTV', - regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/([^#\&\?]*)/, + regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/, httpOnly: true, style: "border: none; width: 640px; height: 360px;", el: function(a) { diff --git a/builds/4chan-X.crx b/builds/4chan-X.crx index 600976979..e48698f6d 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 470343c4a..f59769069 100644 --- a/builds/4chan-X.meta.js +++ b/builds/4chan-X.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan X -// @version 1.11.4.1 +// @version 1.11.5.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 970da1e11..706ad879d 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.4.1 +// @version 1.11.5.0 // @minGMVer 1.14 // @minFFVer 26 // @namespace 4chan-X @@ -411,7 +411,7 @@ doc = d.documentElement; g = { - VERSION: '1.11.4.1', + VERSION: '1.11.5.0', NAMESPACE: '4chan X.', boards: {} }; @@ -9360,11 +9360,9 @@ if (!this.file) { return; } - this.file.newName = this.filename.replace(/[\/\\]/g, '-'); - if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) { - this.file.newName += '.jpg'; - } - return this.updateFilename(); + this.saveFilename(); + this.updateFilename(); + return this.updateFlashURL(); case 'name': return QR.persona.set(this); } @@ -9466,11 +9464,13 @@ } QR.captcha.onPostChange(); URL.revokeObjectURL(this.URL); + this.saveFilename(); if (this === QR.selected) { this.showFileData(); } else { this.updateFilename(); } + this.updateFlashURL(); this.nodes.el.style.backgroundImage = null; if (ref = this.file.type, indexOf.call(QR.mimeTypes, ref) < 0) { return this.fileError('Unsupported file type.'); @@ -9602,12 +9602,20 @@ this.nodes.label.hidden = true; } this.showFileData(); + this.updateFlashURL(); URL.revokeObjectURL(this.URL); return this.dismissErrors(function(error) { return $.hasClass(error, 'file-error'); }); }; + _Class.prototype.saveFilename = function() { + this.file.newName = (this.filename || '').replace(/[\/\\]/g, '-'); + if (!/\.(jpe?g|png|gif|pdf|swf|webm)$/i.test(this.filename)) { + return this.file.newName += '.jpg'; + } + }; + _Class.prototype.updateFilename = function() { var long; long = this.filename + " (" + this.filesize + ")"; @@ -9629,6 +9637,36 @@ } }; + _Class.prototype.updateFlashURL = function() { + var oldURL, ref, url; + if (g.BOARD.ID !== 'f') { + return; + } + if (this.thread === 'new' || !this.file) { + url = ''; + } else { + url = this.file.newName; + if ((ref = $.engine) === 'blink' || ref === 'webkit') { + url = url.replace(/"/g, '%22'); + } + url = url.replace(/[\t\n\f\r \xa0\u200B\u2029\u3000]+/g, ' ').replace(/(^ | $)/g, '').replace(/\.[0-9A-Za-z]+$/, ''); + url = "https://i.4cdn.org/f/" + (encodeURIComponent(E(url))) + ".swf\n"; + } + oldURL = this.flashURL || ''; + if (url !== oldURL) { + this.com || (this.com = ''); + if (this.com.slice(0, oldURL.length) === oldURL) { + this.com = this.com.slice(oldURL.length); + } + this.com = (url + this.com) || null; + if (this === QR.selected) { + QR.nodes.com.value = this.com; + QR.characterCount(); + } + return this.flashURL = url; + } + }; + _Class.prototype.pasteText = function(file) { var reader; this.pasting = true; @@ -11809,7 +11847,7 @@ } }, { key: 'TwitchTV', - regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/([^#\&\?]*)/, + regExp: /^\w+:\/\/(?:www\.)?twitch\.tv\/(\w[^#\&\?]*)/, httpOnly: true, style: "border: none; width: 640px; height: 360px;", el: function(a) { diff --git a/builds/4chan-X.zip b/builds/4chan-X.zip index c1de84ff9..01b455a43 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 43a91470e..45170e1e8 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 96672e721..f9fc1b61b 100644 --- a/builds/updates.xml +++ b/builds/updates.xml @@ -1,7 +1,7 @@ - + diff --git a/package.json b/package.json index 02b068c74..4e9f9374b 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.4.1", - "date": "2015-07-13T07:14:35.225Z", + "version": "1.11.5.0", + "date": "2015-07-15T04:28:57.955Z", "repo": "https://github.com/ccd0/4chan-x/", "page": "https://github.com/ccd0/4chan-x", "downloads": "https://ccd0.github.io/4chan-x/builds/",