From 0d34429ee07e634f760cda41681db2940af55059 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 2 Apr 2014 17:33:12 -0700 Subject: [PATCH 1/2] fix uploading swfs on /f/ Conflicts: LICENSE builds/4chan-X.user.js builds/crx/script.js --- builds/4chan-X.user.js | 3 +++ builds/crx/script.js | 3 +++ src/Posting/QR.coffee | 1 + 3 files changed, 7 insertions(+) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 5da9402c1..bf0efbde9 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6362,6 +6362,9 @@ }, checkDimensions: function(file, isSingle, max) { var img; + if (file.type === 'application/x-shockwave-flash') { + return QR.handleFile(file, isSingle, max); + } img = new Image(); img.onload = (function(_this) { return function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index 9b63ae070..ecb3f514f 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6418,6 +6418,9 @@ }, checkDimensions: function(file, isSingle, max) { var img; + if (file.type === 'application/x-shockwave-flash') { + return QR.handleFile(file, isSingle, max); + } img = new Image(); img.onload = (function(_this) { return function() { diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index 40bc1d30e..fad8f05e7 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -372,6 +372,7 @@ QR = $.addClass QR.nodes.el, 'dump' unless isSingle checkDimensions: (file, isSingle, max) -> + return QR.handleFile(file, isSingle, max) if file.type is 'application/x-shockwave-flash' img = new Image() img.onload = => {height, width} = img From 9c117983081590a94676b0ab002e00a282d4c444 Mon Sep 17 00:00:00 2001 From: Brandon Date: Wed, 2 Apr 2014 17:53:39 -0700 Subject: [PATCH 2/2] move that where it belongs Conflicts: builds/4chan-X.user.js builds/crx/script.js --- builds/4chan-X.user.js | 9 +++++---- builds/crx/script.js | 9 +++++---- src/Posting/QR.coffee | 6 ++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index bf0efbde9..6555eda1d 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6354,7 +6354,11 @@ QR.cleanNotifications(); for (_i = 0, _len = files.length; _i < _len; _i++) { file = files[_i]; - QR.checkDimensions(file, isSingle, max); + if (file.type === 'application/x-shockwave-flash') { + QR.handleFile(file, isSingle, max); + } else { + QR.checkDimensions(file, isSingle, max); + } } if (!isSingle) { return $.addClass(QR.nodes.el, 'dump'); @@ -6362,9 +6366,6 @@ }, checkDimensions: function(file, isSingle, max) { var img; - if (file.type === 'application/x-shockwave-flash') { - return QR.handleFile(file, isSingle, max); - } img = new Image(); img.onload = (function(_this) { return function() { diff --git a/builds/crx/script.js b/builds/crx/script.js index ecb3f514f..24382926d 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6410,7 +6410,11 @@ QR.cleanNotifications(); for (_i = 0, _len = files.length; _i < _len; _i++) { file = files[_i]; - QR.checkDimensions(file, isSingle, max); + if (file.type === 'application/x-shockwave-flash') { + QR.handleFile(file, isSingle, max); + } else { + QR.checkDimensions(file, isSingle, max); + } } if (!isSingle) { return $.addClass(QR.nodes.el, 'dump'); @@ -6418,9 +6422,6 @@ }, checkDimensions: function(file, isSingle, max) { var img; - if (file.type === 'application/x-shockwave-flash') { - return QR.handleFile(file, isSingle, max); - } img = new Image(); img.onload = (function(_this) { return function() { diff --git a/src/Posting/QR.coffee b/src/Posting/QR.coffee index fad8f05e7..7c80fcb59 100644 --- a/src/Posting/QR.coffee +++ b/src/Posting/QR.coffee @@ -368,11 +368,13 @@ QR = isSingle = files.length is 1 QR.cleanNotifications() for file in files - QR.checkDimensions file, isSingle, max + if file.type is 'application/x-shockwave-flash' + QR.handleFile(file, isSingle, max) + else + QR.checkDimensions file, isSingle, max $.addClass QR.nodes.el, 'dump' unless isSingle checkDimensions: (file, isSingle, max) -> - return QR.handleFile(file, isSingle, max) if file.type is 'application/x-shockwave-flash' img = new Image() img.onload = => {height, width} = img