Merge pull request #412 from xwiki-labs/downloadFiles

Download files
This commit is contained in:
ansuz
2019-08-08 15:35:09 +02:00
committed by GitHub
14 changed files with 123 additions and 118 deletions

View File

@@ -39,7 +39,8 @@ define([
};
module.getContentExtension = function (mode) {
return (Modes.extensionOf(mode) || '.txt').slice(1);
var ext = Modes.extensionOf(mode);
return ext !== undefined ? ext : '.txt';
};
module.fileExporter = function (content) {
return new Blob([ content ], { type: 'text/plain;charset=utf-8' });