Fix "post from URL"

This commit is contained in:
Zixaphir 2014-04-06 20:40:54 -07:00
parent a2cacec59a
commit 382c4f8f3c
3 changed files with 3 additions and 11 deletions

View File

@ -6302,7 +6302,7 @@
return $.addClass(QR.nodes.el, 'dump');
},
handleBlob: function(urlBlob, header, url) {
var blob, end, endnl, endsc, mime, name, name_end, name_start, start, _ref;
var blob, end, endnl, endsc, mime, name, name_end, name_start, start;
name = url.substr(url.lastIndexOf('/') + 1, url.length);
start = header.indexOf("Content-Type: ") + 14;
endsc = header.substr(start, header.length).indexOf(";");
@ -6324,9 +6324,6 @@
if (blob.type === null) {
return QR.error("Unsupported file type.");
}
if (_ref = blob.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
return QR.error("Unsupported file type.");
}
return QR.handleFiles([blob]);
},
handleUrl: function() {

View File

@ -6366,7 +6366,7 @@
return $.addClass(QR.nodes.el, 'dump');
},
handleBlob: function(urlBlob, header, url) {
var blob, end, endnl, endsc, mime, name, name_end, name_start, start, _ref;
var blob, end, endnl, endsc, mime, name, name_end, name_start, start;
name = url.substr(url.lastIndexOf('/') + 1, url.length);
start = header.indexOf("Content-Type: ") + 14;
endsc = header.substr(start, header.length).indexOf(";");
@ -6388,9 +6388,6 @@
if (blob.type === null) {
return QR.error("Unsupported file type.");
}
if (_ref = blob.type, __indexOf.call(QR.mimeTypes, _ref) < 0) {
return QR.error("Unsupported file type.");
}
return QR.handleFiles([blob]);
},
handleUrl: function() {

View File

@ -303,13 +303,11 @@ QR =
blob.name = url.substr(url.lastIndexOf('/')+1, url.length)
name_start = header.indexOf('name="') + 6
if (name_start - 6 != -1)
name_end = header.substr(name_start, header.length).indexOf('"')
name_end = header.substr(name_start, header.length).indexOf('"')
blob.name = header.substr(name_start, name_end)
return if blob.type is null
QR.error "Unsupported file type."
return unless blob.type in QR.mimeTypes
QR.error "Unsupported file type."
QR.handleFiles([blob])
handleUrl: ->