Merge branch 'dapsi-demo-update' into exportSheet

pull/1/head
yflory 3 years ago
commit 24fa6a4fb6

@ -513,7 +513,8 @@ define([
options: types, // Entries displayed in the menu options: types, // Entries displayed in the menu
isSelect: true, isSelect: true,
initialValue: '.ics', initialValue: '.ics',
common: common common: common,
buttonCls: 'btn',
}; };
var $select = UIElements.createDropdown(dropdownConfig); var $select = UIElements.createDropdown(dropdownConfig);
UI.prompt(Messages.exportPrompt, UI.prompt(Messages.exportPrompt,

@ -82,7 +82,11 @@ var factory = function () {
plainText.innerText = e.srcElement.result; plainText.innerText = e.srcElement.result;
cb(void 0, plainText); cb(void 0, plainText);
}); });
try {
reader.readAsText(content); reader.readAsText(content);
} catch (err) {
cb(err);
}
}, },
image: function (metadata, url, content, cfg, cb) { image: function (metadata, url, content, cfg, cb) {
var img = document.createElement('img'); var img = document.createElement('img');

@ -16,4 +16,8 @@
iframe[name="frameEditor"] { iframe[name="frameEditor"] {
display: none; display: none;
} }
input[type="file"] {
padding: 5px !important;
margin-bottom: 5px;
}
} }

@ -325,8 +325,10 @@ define([
type: 'file' type: 'file'
}); });
APP.$rightside.append([hint, picker]); APP.$rightside.append([hint, picker]);
Messages.convert_unsupported = "UNSUPPORTED FILE TYPE :("; // XXX
$(picker).on('change', function () { $(picker).on('change', function () {
APP.$rightside.find('button, div.notice').remove();
var file = picker.files[0]; var file = picker.files[0];
var name = file && file.name; var name = file && file.name;
var reader = new FileReader(); var reader = new FileReader();
@ -345,6 +347,9 @@ define([
}).appendTo(APP.$rightside); }).appendTo(APP.$rightside);
}); });
} else {
var notice = h('div.notice', Messages.convert_unsupported);
APP.$rightside.append(notice);
} }
}; };
if (ext === 'bin') { if (ext === 'bin') {

Loading…
Cancel
Save