summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorSheogorath2018-01-20 15:08:31 +0100
committerSheogorath2018-01-20 15:16:53 +0100
commita7935a595a6d482aaefb5a3c9fa0600adf2d2c5b (patch)
tree15ff230007e15a6d1b08ba1c26b4a161a91252f8 /public
parent40d1d757048b1eb51e45d4d29ad987739b478881 (diff)
Allow more detailed configuration of upload mime types
Fixes #637 Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to 'public')
-rw-r--r--public/js/lib/common/constant.ejs4
-rw-r--r--public/vendor/inlineAttachment/inline-attachment.js13
2 files changed, 7 insertions, 10 deletions
diff --git a/public/js/lib/common/constant.ejs b/public/js/lib/common/constant.ejs
index e4a1cf0a..c0963635 100644
--- a/public/js/lib/common/constant.ejs
+++ b/public/js/lib/common/constant.ejs
@@ -3,6 +3,8 @@ window.urlpath = '<%- urlpath %>'
window.debug = <%- debug %>
window.version = '<%- version %>'
+window.allowedUploadMimeTypes = <%- JSON.stringify(allowedUploadMimeTypes) %>
+
window.GOOGLE_API_KEY = '<%- GOOGLE_API_KEY %>'
window.GOOGLE_CLIENT_ID = '<%- GOOGLE_CLIENT_ID %>'
-window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>' \ No newline at end of file
+window.DROPBOX_APP_KEY = '<%- DROPBOX_APP_KEY %>'
diff --git a/public/vendor/inlineAttachment/inline-attachment.js b/public/vendor/inlineAttachment/inline-attachment.js
index 0ffd3f9f..d9503d62 100644
--- a/public/vendor/inlineAttachment/inline-attachment.js
+++ b/public/vendor/inlineAttachment/inline-attachment.js
@@ -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);
-}; \ No newline at end of file
+};