ONLYOFFICE / sdkjs-plugins

The add-ons for ONLYOFFICE Document Server and ONLYOFFICE Desktop Editors.
https://www.onlyoffice.com
Apache License 2.0
136 stars 134 forks source link

How can I use UICustomizer plugins? #11

Closed tsmgodoi closed 7 years ago

tsmgodoi commented 7 years ago

How can I use plugins like clippy and interface? I configured to use them but they don't load automatically.

ayuzhin commented 7 years ago

Hello @tsmgodoi To connect the customization plug-ins, you must list them in the "UIpluginsData" section of the editor's configuration.

"UIpluginsData": [
    "../../../../sdkjs-plugins/clippy/config.json"
]
tsmgodoi commented 7 years ago

Thanks @ayuzhin for the suggestion. I tried to put that on the configuration. But it seems the plugin won't load because of the following code: if (this.appOptions.canBrandingExt) this.updatePlugins(this.plugins, true); on the file apps/documenteditor/main/app/controller/Main.js.

Is there any restriction for using UI Plugins? It would be very helpful to be able to write our own UI Plugins, because we want to make custom interactions with the editor. We certainly don't want to rebrand the UI completely. One of our needs is to load the paragraph menu hidden by default, and I think one way to do that would be by using UI Plugins. The normal plugins don't run automatically, so it won't help with that. Any plans on letting us to use UI plugins on the community version? Thank you for the help and congratulations for the great software you guys are making.

ibnpetr commented 7 years ago

@tsmgodoi Thanks a lot for your interest in ONLYOFFICE plugins At this moment UI Plugins are not available in the community version. Should you have any additional questions feel free to contact ONLYOFFICE support directly to get more information.

sharq88 commented 5 years ago

@ayuzhin can you share some more info on how to use that? We're using Developer Edition, but it seems utterly difficult to figure out how to get it working. UIpluginsData is undocumented. Inserting your snippet alone doesn't work. I tried to combine with pluginsData and autoLoad but I could not get it working...

// the only non-hacking way of injecting plugins seems to be through this line: 
if (this.appOptions.canBrandingExt) this.updatePlugins(this.plugins, true);
// which is used by function
onEditorPermissions
// initiated from this callback 
this.api.asc_registerCallback('asc_onGetEditorPermissions', _.bind(this.onEditorPermissions, this));
// called by SDK
this.sendEvent('asc_onGetEditorPermissions', oResult);
AscCommon.baseEditorsApi.prototype._onEndPermissions = function()

Seems like something to do with the licence, but our licence is fine, so I'm out of ideas. :/

alexanderonlyoffice commented 5 years ago

Hello @sharq88, could you please contact us at support@onlyoffice.com, so we provide you with more detailed information. Please add a note 'for technical support' to the email.