mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Allow more detailed configuration of upload mime types
Fixes #637 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
This commit is contained in:
parent
40d1d75704
commit
a7935a595a
4 changed files with 29 additions and 11 deletions
|
@ -141,12 +141,7 @@
|
|||
/**
|
||||
* Allowed MIME types
|
||||
*/
|
||||
allowedTypes: [
|
||||
'image/jpeg',
|
||||
'image/png',
|
||||
'image/jpg',
|
||||
'image/gif'
|
||||
],
|
||||
allowedTypes: window.allowedUploadMimeTypes,
|
||||
|
||||
/**
|
||||
* Text which will be inserted when dropping or pasting a file.
|
||||
|
@ -304,7 +299,7 @@
|
|||
if (this.settings.onFileUploadResponse.call(this, xhr) !== false) {
|
||||
var result = JSON.parse(xhr.responseText),
|
||||
filename = result[this.settings.jsonFieldName];
|
||||
|
||||
|
||||
if (result && filename) {
|
||||
var replacements = [];
|
||||
var string = this.settings.progressText.replace(this.filenameTag, id);
|
||||
|
@ -415,7 +410,7 @@
|
|||
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
|
||||
//
|
||||
// The goals of this function are twofold:
|
||||
//
|
||||
//
|
||||
// * Provide a way to generate a string guaranteed to be unique when compared
|
||||
// to other strings generated by this function.
|
||||
// * Make the string complex enough that it is highly unlikely to be
|
||||
|
@ -432,4 +427,4 @@ var ID = function () {
|
|||
// Convert it to base 36 (numbers + letters), and grab the first 9 characters
|
||||
// after the decimal.
|
||||
return '_' + Math.random().toString(36).substr(2, 9);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue