Fix "post from URL"
This commit is contained in:
parent
a2cacec59a
commit
382c4f8f3c
@ -6302,7 +6302,7 @@
|
|||||||
return $.addClass(QR.nodes.el, 'dump');
|
return $.addClass(QR.nodes.el, 'dump');
|
||||||
},
|
},
|
||||||
handleBlob: function(urlBlob, header, url) {
|
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);
|
name = url.substr(url.lastIndexOf('/') + 1, url.length);
|
||||||
start = header.indexOf("Content-Type: ") + 14;
|
start = header.indexOf("Content-Type: ") + 14;
|
||||||
endsc = header.substr(start, header.length).indexOf(";");
|
endsc = header.substr(start, header.length).indexOf(";");
|
||||||
@ -6324,9 +6324,6 @@
|
|||||||
if (blob.type === null) {
|
if (blob.type === null) {
|
||||||
return QR.error("Unsupported file type.");
|
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]);
|
return QR.handleFiles([blob]);
|
||||||
},
|
},
|
||||||
handleUrl: function() {
|
handleUrl: function() {
|
||||||
|
|||||||
@ -6366,7 +6366,7 @@
|
|||||||
return $.addClass(QR.nodes.el, 'dump');
|
return $.addClass(QR.nodes.el, 'dump');
|
||||||
},
|
},
|
||||||
handleBlob: function(urlBlob, header, url) {
|
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);
|
name = url.substr(url.lastIndexOf('/') + 1, url.length);
|
||||||
start = header.indexOf("Content-Type: ") + 14;
|
start = header.indexOf("Content-Type: ") + 14;
|
||||||
endsc = header.substr(start, header.length).indexOf(";");
|
endsc = header.substr(start, header.length).indexOf(";");
|
||||||
@ -6388,9 +6388,6 @@
|
|||||||
if (blob.type === null) {
|
if (blob.type === null) {
|
||||||
return QR.error("Unsupported file type.");
|
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]);
|
return QR.handleFiles([blob]);
|
||||||
},
|
},
|
||||||
handleUrl: function() {
|
handleUrl: function() {
|
||||||
|
|||||||
@ -303,13 +303,11 @@ QR =
|
|||||||
blob.name = url.substr(url.lastIndexOf('/')+1, url.length)
|
blob.name = url.substr(url.lastIndexOf('/')+1, url.length)
|
||||||
name_start = header.indexOf('name="') + 6
|
name_start = header.indexOf('name="') + 6
|
||||||
if (name_start - 6 != -1)
|
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)
|
blob.name = header.substr(name_start, name_end)
|
||||||
|
|
||||||
return if blob.type is null
|
return if blob.type is null
|
||||||
QR.error "Unsupported file type."
|
QR.error "Unsupported file type."
|
||||||
return unless blob.type in QR.mimeTypes
|
|
||||||
QR.error "Unsupported file type."
|
|
||||||
QR.handleFiles([blob])
|
QR.handleFiles([blob])
|
||||||
|
|
||||||
handleUrl: ->
|
handleUrl: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user