diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index b23472ad8..086bc553e 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -8202,6 +8202,7 @@ }; QR = { + mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', ''], init: function() { var con, sc; this.db = new DataBoard('yourPosts'); @@ -8662,7 +8663,7 @@ } }, 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;', "
\uf00d
+
No selected fileSpoiler\uf0c1Post from URL+Dump\uf00dRemove File
") }; @@ -8696,16 +8697,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 ef7f557c3..b00ceb1f8 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8236,6 +8236,7 @@ }; QR = { + mimeTypes: ['image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/x-shockwave-flash', ''], init: function() { var con, sc; this.db = new DataBoard('yourPosts'); @@ -8692,7 +8693,7 @@ } }, 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;', "
\uf00d
+
No selected fileSpoiler\uf0c1Post from URL+Dump\uf00dRemove File
") }; @@ -8726,16 +8727,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 3753fd1e4..643e5271c 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: -> @db = new DataBoard 'yourPosts' @posts = [] @@ -428,18 +431,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]'