1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Export to HTML all content from shared spaces

This commit is contained in:
HarveyKandola 2018-07-29 12:36:48 -04:00
parent def01b6265
commit b7fa4e1a1a
2 changed files with 21 additions and 2 deletions

View file

@ -12,11 +12,14 @@
import $ from 'jquery';
import { computed } from '@ember/object';
import { inject as service } from '@ember/service';
import Controller from '@ember/controller';
import Notifier from '../../../mixins/notifier';
import TooltipMixin from '../../../mixins/tooltip';
import Controller from '@ember/controller';
export default Controller.extend(TooltipMixin, {
export default Controller.extend(TooltipMixin, Notifier, {
folderService: service('folder'),
browserSvc: service('browser'),
documentSvc: service('document'),
dropdown: null,
init() {
@ -70,6 +73,21 @@ export default Controller.extend(TooltipMixin, {
this.set('folders', nonPrivateFolders);
});
});
},
onExport() {
this.showWait();
let spec = {
spaceId: '',
data: _.pluck(this.get('folders'), 'id'),
filterType: 'space',
};
this.get('documentSvc').export(spec).then((htmlExport) => {
this.get('browserSvc').downloadFile(htmlExport, 'documize.html');
this.showDone();
});
}
}
});