|
|
@ -494,27 +494,29 @@ define([
|
|
|
|
|
|
|
|
|
|
|
|
CodeMirror.configureTheme();
|
|
|
|
CodeMirror.configureTheme();
|
|
|
|
|
|
|
|
|
|
|
|
var fileDialogCfg = {
|
|
|
|
if (!readOnly) {
|
|
|
|
onSelect: function (data) {
|
|
|
|
var fileDialogCfg = {
|
|
|
|
if (data.type === 'file') {
|
|
|
|
onSelect: function (data) {
|
|
|
|
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
|
|
|
|
if (data.type === 'file') {
|
|
|
|
editor.replaceSelection(mt);
|
|
|
|
var mt = '<media-tag src="' + data.src + '" data-crypto-key="cryptpad:' + data.key + '"></media-tag>';
|
|
|
|
return;
|
|
|
|
editor.replaceSelection(mt);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
common.initFilePicker(fileDialogCfg);
|
|
|
|
|
|
|
|
APP.$mediaTagButton = $('<button>', {
|
|
|
|
|
|
|
|
title: Messages.filePickerButton,
|
|
|
|
|
|
|
|
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
|
|
|
|
|
|
|
style: 'font-size: 17px'
|
|
|
|
|
|
|
|
}).click(function () {
|
|
|
|
|
|
|
|
var pickerCfg = {
|
|
|
|
|
|
|
|
types: ['file'],
|
|
|
|
|
|
|
|
where: ['root']
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
common.openFilePicker(pickerCfg);
|
|
|
|
common.initFilePicker(fileDialogCfg);
|
|
|
|
}).appendTo($rightside);
|
|
|
|
APP.$mediaTagButton = $('<button>', {
|
|
|
|
|
|
|
|
title: Messages.filePickerButton,
|
|
|
|
|
|
|
|
'class': 'cp-toolbar-rightside-button fa fa-picture-o',
|
|
|
|
|
|
|
|
style: 'font-size: 17px'
|
|
|
|
|
|
|
|
}).click(function () {
|
|
|
|
|
|
|
|
var pickerCfg = {
|
|
|
|
|
|
|
|
types: ['file'],
|
|
|
|
|
|
|
|
where: ['root']
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
common.openFilePicker(pickerCfg);
|
|
|
|
|
|
|
|
}).appendTo($rightside);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
metadataMgr.onChange(function () {
|
|
|
|
metadataMgr.onChange(function () {
|
|
|
|
var md = metadataMgr.getMetadata();
|
|
|
|
var md = metadataMgr.getMetadata();
|
|
|
|