From a11fd67ec93a861740b370064f93d46bf0c34442 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Mon, 23 Jun 2014 22:12:22 +0100 Subject: [PATCH] Add fileStorage config to frontend closes #2956 - adds fileStorage to config passed to ember, and then grabs it in the relevant places. --- core/client/components/gh-markdown.js | 2 +- core/client/components/gh-upload-modal.js | 3 +-- core/client/initializers/ghost-config.js | 1 + core/server/controllers/admin.js | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/client/components/gh-markdown.js b/core/client/components/gh-markdown.js index c507cfc913..239e186d9c 100644 --- a/core/client/components/gh-markdown.js +++ b/core/client/components/gh-markdown.js @@ -22,7 +22,7 @@ var Markdown = Ember.Component.extend({ uploader.call(dropzones, { editor: true, - filestorage: false + fileStorage: this.get('config.fileStorage') }); dropzones.on('uploadstart', _.bind(this.sendAction, this, 'uploadStarted')); diff --git a/core/client/components/gh-upload-modal.js b/core/client/components/gh-upload-modal.js index 33242ec040..d2c929a218 100644 --- a/core/client/components/gh-upload-modal.js +++ b/core/client/components/gh-upload-modal.js @@ -6,8 +6,7 @@ var UploadModal = ModalDialog.extend({ didInsertElement: function () { this._super(); - var filestorage = $('#general').data('filestorage'); - upload.call(this.$('.js-drop-zone'), {fileStorage: filestorage}); + upload.call(this.$('.js-drop-zone'), {fileStorage: this.get('config.fileStorage')}); }, confirm: { reject: { diff --git a/core/client/initializers/ghost-config.js b/core/client/initializers/ghost-config.js index a11f688c0c..e6a47bc2ba 100644 --- a/core/client/initializers/ghost-config.js +++ b/core/client/initializers/ghost-config.js @@ -6,6 +6,7 @@ var ConfigInitializer = { application.inject('route', 'config', 'ghost:config'); application.inject('controller', 'config', 'ghost:config'); + application.inject('component', 'config', 'ghost:config'); } }; diff --git a/core/server/controllers/admin.js b/core/server/controllers/admin.js index 2f2a87cd8e..7642abcc77 100644 --- a/core/server/controllers/admin.js +++ b/core/server/controllers/admin.js @@ -47,6 +47,7 @@ adminControllers = { var userData, // config we need on the frontend frontConfig = { + fileStorage: config().fileStorage, apps: config().apps };