Commit 0523a1f6 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_officejs: can configure ckeditor

parent 98076a1b
......@@ -10,37 +10,41 @@
.ready(function (g) {
return g.getElement()
.push(function (element) {
var textarea = element.querySelector('textarea');
g.props.element = element;
g.props.ckeditor = CKEDITOR.replace(
textarea,
{
removeButtons: 'NewPage,Preview,Cut,Paste,Copy,PasteText,' +
'PasteFromWord,Flash,Iframe,Form,Checkbox,Radio,TextField,' +
'Textarea,Select,Button,ImageButton,HiddenField,Maximize',
removePlugins: '',
disableNativeSpellChecker: false,
extraAllowedContent: "details section article"
}
);
g.props.ckeditor.addCommand('saveRJS', {
readOnly: 1,
exec: function () {
return g.submitContent();
}
});
g.props.ckeditor.ui.addButton('Save', {
label: "Save",
command: 'saveRJS',
toolbar: 'document,1'
});
g.props.ckeditor.on('instanceReady', function (event) {
event.editor.execCommand('maximize');
});
});
})
.declareAcquiredMethod("submitContent", "triggerSubmit")
.declareMethod('render', function (options) {
var config = options.config || {
removeButtons: 'NewPage,Preview,Cut,Paste,Copy,PasteText,' +
'PasteFromWord,Flash,Iframe,Form,Checkbox,Radio,TextField,' +
'Textarea,Select,Button,ImageButton,HiddenField,Maximize',
removePlugins: '',
disableNativeSpellChecker: false,
extraAllowedContent: "details section article"
},
textarea = this.props.element.querySelector('textarea');
this.props.ckeditor = CKEDITOR.replace(
textarea,
config
);
this.props.ckeditor.addCommand('saveRJS', {
readOnly: 1,
exec: function () {
return g.submitContent();
}
});
this.props.ckeditor.ui.addButton('Save', {
label: "Save",
command: 'saveRJS',
toolbar: 'document,1'
});
this.props.ckeditor.on('instanceReady', function (event) {
event.editor.execCommand('maximize');
});
this.props.key = options.key || "text_content";
this.props.ckeditor.setData(options.value || "");
return {};
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.4005.3918.16742</string> </value>
<value> <string>959.34902.60336.59852</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1474449146.05</float>
<float>1495445241.18</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment