Merge pull request #3422 from sebgie/issue#3177

Hide Access Token
This commit is contained in:
Hannah Wolfe 2014-07-28 09:18:42 +01:00
commit 13f34fd992
2 changed files with 9 additions and 14 deletions

View File

@ -1,11 +1,6 @@
var DebugController = Ember.Controller.extend(Ember.Evented, {
uploadButtonText: 'Import',
exportPath: function () {
return this.get('ghostPaths.url').api('db') +
'?access_token=' + this.get('session.access_token');
}.property(),
actions: {
onUpload: function (file) {
var self = this,
@ -33,15 +28,15 @@ var DebugController = Ember.Controller.extend(Ember.Evented, {
},
exportData: function () {
var self = this;
var iframe = $('#iframeDownload'),
downloadURL = this.get('ghostPaths.url').api('db') +
'?access_token=' + this.get('session.access_token');
ic.ajax.request(this.get('ghostPaths.url').api('db'), {
type: 'GET'
}).then(function () {
self.notifications.showSuccess('Data exported successfully.');
}).catch(function (response) {
self.notifications.showErrors(response);
});
if (iframe.length === 0) {
iframe = $('<iframe>', { id: 'iframeDownload' }).hide().appendTo('body');
}
iframe.attr('src', downloadURL);
},
sendTestEmail: function () {

View File

@ -19,7 +19,7 @@
<fieldset>
<div class="form-group">
<label>Export</label>
<a class="button-save" {{bind-attr href=exportPath}}>Export</a>
<a class="button-save" {{action "exportData"}}>Export</a>
<p>Export the blog settings and data.</p>
</div>
</fieldset>