diff --git a/LICENSE b/LICENSE index d6bf70856..58027d2f7 100755 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ /* -* 4chan X - Version 1.3.7 - 2014-02-16 +* 4chan X - Version 1.3.7 - 2014-02-20 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 11f188ac5..9d4a431a0 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -24,7 +24,7 @@ // ==/UserScript== /* -* 4chan X - Version 1.3.7 - 2014-02-16 +* 4chan X - Version 1.3.7 - 2014-02-20 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -5580,6 +5580,7 @@ }; QR = { + mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', ''], init: function() { var sc; if (!Conf['Quick Reply']) { @@ -6047,7 +6048,7 @@ return list.value = g.VIEW === 'thread' ? g.THREADID : 'new'; }, dialog: function() { - var check, dialog, elm, event, i, items, key, mimeTypes, name, node, nodes, save, value, _ref; + var dialog, elm, event, i, items, key, name, node, nodes, save, value, _ref; QR.nodes = nodes = { el: dialog = UI.dialog('qr', 'top:0;right:0;', "
×
+
No selected file
") }; @@ -6081,16 +6082,6 @@ value = _ref[key]; nodes[key] = $(value, dialog); } - check = { - jpg: 'image/jpeg', - pdf: 'application/pdf', - swf: 'application/x-shockwave-flash' - }; - mimeTypes = $('ul.rules > li').textContent.trim().match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) { - return check[type] || ("image/" + type); - }); - QR.mimeTypes = mimeTypes.split(', '); - QR.mimeTypes.push(''); nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value; QR.spoiler = !!$('input[name=spoiler]'); if (QR.spoiler) { diff --git a/builds/crx/script.js b/builds/crx/script.js index 2106eb18c..bf5fbaa7f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript /* -* 4chan X - Version 1.3.7 - 2014-02-16 +* 4chan X - Version 1.3.7 - 2014-02-20 * * Licensed under the MIT license. * https://github.com/Spittie/4chan-x/blob/master/LICENSE @@ -5614,6 +5614,7 @@ }; QR = { + mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', ''], init: function() { var sc; if (!Conf['Quick Reply']) { @@ -6077,7 +6078,7 @@ return list.value = g.VIEW === 'thread' ? g.THREADID : 'new'; }, dialog: function() { - var check, dialog, elm, event, i, items, key, mimeTypes, name, node, nodes, save, value, _ref; + var dialog, elm, event, i, items, key, name, node, nodes, save, value, _ref; QR.nodes = nodes = { el: dialog = UI.dialog('qr', 'top:0;right:0;', "
×
+
No selected file
") }; @@ -6111,16 +6112,6 @@ value = _ref[key]; nodes[key] = $(value, dialog); } - check = { - jpg: 'image/jpeg', - pdf: 'application/pdf', - swf: 'application/x-shockwave-flash' - }; - mimeTypes = $('ul.rules > li').textContent.trim().match(/: (.+)/)[1].toLowerCase().replace(/\w+/g, function(type) { - return check[type] || ("image/" + type); - }); - QR.mimeTypes = mimeTypes.split(', '); - QR.mimeTypes.push(''); nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value; QR.spoiler = !!$('input[name=spoiler]'); if (QR.spoiler) { diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index c75298dc3..1a043b04f 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -1,4 +1,7 @@ QR = + # Add empty mimeType to avoid errors with URLs selected in Window's file dialog. + mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', ''] + init: -> return if !Conf['Quick Reply'] @@ -430,18 +433,6 @@ QR = fileInput: '[type=file]' } - check = - jpg: 'image/jpeg' - pdf: 'application/pdf' - swf: 'application/x-shockwave-flash' - - # Allow only this board's supported files. - mimeTypes = $('ul.rules > li').textContent.trim().match(/: (.+)/)[1].toLowerCase().replace /\w+/g, (type) -> - check[type] or "image/#{type}" - - QR.mimeTypes = mimeTypes.split ', ' - # Add empty mimeType to avoid errors with URLs selected in Window's file dialog. - QR.mimeTypes.push '' nodes.fileInput.max = $('input[name=MAX_FILE_SIZE]').value QR.spoiler = !!$ 'input[name=spoiler]'