diff --git a/apps/api/documents/api.js b/apps/api/documents/api.js index 75e0a46246..3517b72879 100644 --- a/apps/api/documents/api.js +++ b/apps/api/documents/api.js @@ -257,7 +257,8 @@ submitForm: { visible: true/false (default: true) resultMessage: 'text'/''/null/undefined // if '' - don't show a message after submitting form, null/undefined - show the default message - } + }, + wordHeadingsColor: '#00ff00' // set color for default heading styles in document editor }, coEditing: { mode: 'fast', // , 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true. 'fast' - default for editor @@ -1207,6 +1208,10 @@ params += "&indexPostfix=_loader"; } } + if (config.editorConfig && config.editorConfig.customization && config.editorConfig.customization.wordHeadingsColor && typeof config.editorConfig.customization.wordHeadingsColor === 'string') { + params += "&headingsColor=" + config.editorConfig.customization.wordHeadingsColor.replace(/#/, ''); + } + return params; } diff --git a/apps/documenteditor/main/app/controller/Viewport.js b/apps/documenteditor/main/app/controller/Viewport.js index 103f8fca59..f7db78787c 100644 --- a/apps/documenteditor/main/app/controller/Viewport.js +++ b/apps/documenteditor/main/app/controller/Viewport.js @@ -128,10 +128,13 @@ define([ // Create and render main view this.viewport = this.createView('Viewport').render(); - this.api = new Asc.asc_docs_api({ - 'id-view' : 'editor_sdk', - 'translate': this.getApplication().getController('Main').translationTable - }); + var config = { + 'id-view' : 'editor_sdk', + 'translate': this.getApplication().getController('Main').translationTable + }, + hcolor = (/(?:&|^)headingsColor=([^&]+)&?/i).exec(window.location.search.substring(1)); + hcolor && (config['headings-color'] = '#' + hcolor[1]); + this.api = new Asc.asc_docs_api(config); this.header = this.createView('Common.Views.Header', { headerCaption: 'Document Editor', diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 42f0012e15..f8182e2000 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -461,6 +461,8 @@ class MainController extends Component { 'mobile' : true, 'translate': _translate }; + let hcolor = (/(?:&|^)headingsColor=([^&]+)&?/i).exec(window.location.search.substring(1)); + hcolor && (config['headings-color'] = '#' + hcolor[1]); this.api = isPDF ? new Asc.PDFEditorApi(config) : new Asc.asc_docs_api(config); Common.Notifications.trigger('engineCreated', this.api);