Commit c4ba8882 authored by Boris Kocherov's avatar Boris Kocherov Committed by Romain Courteaud

erp5_core: support onlyoffice editor as gadget

parent 59ee7970
...@@ -102,6 +102,19 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/ ...@@ -102,6 +102,19 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
} }
); );
}); });
} else if (gadget.state.editable &&
(gadget.state.editor === 'onlyoffice')) {
queue
.push(function () {
return gadget.declareGadget(
"onlyoffice.gadget.html",
{
scope: 'editor',
sandbox: 'iframe',
element: div
}
);
});
} else if (gadget.state.editable && } else if (gadget.state.editable &&
(gadget.state.editor === 'fck_editor')) { (gadget.state.editor === 'fck_editor')) {
queue queue
...@@ -124,7 +137,7 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/ ...@@ -124,7 +137,7 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
} }
if (gadget.state.editable && if (gadget.state.editable &&
((gadget.state.editor === 'codemirror') || (gadget.state.editor === 'fck_editor'))) { (['codemirror', 'fck_editor', 'onlyoffice'].indexOf(gadget.state.editor) >= 0)) {
queue queue
.push(function () { .push(function () {
return gadget.getDeclaredGadget('editor'); return gadget.getDeclaredGadget('editor');
...@@ -150,7 +163,7 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/ ...@@ -150,7 +163,7 @@ lockGadgetInQueue, unlockGadgetInQueue, unlockGadgetInFailedQueue*/
gadget = this, gadget = this,
result; result;
if (this.state.editable && if (this.state.editable &&
((this.state.editor === 'codemirror') || (this.state.editor === 'fck_editor'))) { (['codemirror', 'fck_editor', 'onlyoffice'].indexOf(this.state.editor) >= 0)) {
return lockGadgetInQueue(gadget)() return lockGadgetInQueue(gadget)()
.push(function () { .push(function () {
return gadget.getDeclaredGadget('editor'); return gadget.getDeclaredGadget('editor');
......
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