Created
August 20, 2013 15:01
-
-
Save etdsoft/6282552 to your computer and use it in GitHub Desktop.
Prompt for a file name when an image is pasted into the browser window (Chrome only)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... line 368 | |
$('#fileupload').fileupload({ | |
dropZone: $('#dropzone'), | |
headers: { | |
'X-CSRF-Token': csrf_token | |
}, | |
destroy: function (e, data) { | |
data.headers = $(this).data('fileupload').options.headers; | |
$.blueimpUI.fileupload.prototype.options.destroy.call(this, e, data); | |
}, | |
paste: function(e, data) { | |
$.each(data.files, function(index, file) { | |
if (!(file.name != null)) { | |
return file.name = prompt('Please provide a filename for the pasted image', 'screenshot-XX.png') || 'unnamed'; | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment