diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
index cb0e1540d..1cb3213a4 100644
--- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js
+++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js
@@ -54,7 +54,8 @@ define([
'spreadsheeteditor/main/app/view/NamedRangePasteDlg',
'spreadsheeteditor/main/app/view/NameManagerDlg',
'spreadsheeteditor/main/app/view/FormatSettingsDialog',
- 'spreadsheeteditor/main/app/view/PageMarginsDialog'
+ 'spreadsheeteditor/main/app/view/PageMarginsDialog',
+ 'spreadsheeteditor/main/app/view/HeaderFooterDialog'
], function () { 'use strict';
SSE.Controllers.Toolbar = Backbone.Controller.extend(_.extend({
@@ -365,6 +366,7 @@ define([
toolbar.btnImgAlign.menu.on('item:click', _.bind(this.onImgAlignSelect, this));
toolbar.btnImgForward.on('click', this.onImgArrangeSelect.bind(this, 'forward'));
toolbar.btnImgBackward.on('click', this.onImgArrangeSelect.bind(this, 'backward'));
+ toolbar.btnEditHeader.menu.on('item:click', _.bind(this.onEditHeaderClick, this));
this.onSetupCopyStyleButton();
}
@@ -3298,6 +3300,40 @@ define([
this.toolbar.btnPrintArea.menu.items[2].setVisible(this.api.asc_CanAddPrintArea());
},
+ onEditHeaderClick: function(menu, item) {
+ var me = this;
+ if (_.isUndefined(me.fontStore)) {
+ me.fontStore = new Common.Collections.Fonts();
+ var fonts = me.toolbar.cmbFontName.store.toJSON();
+ var arr = [];
+ _.each(fonts, function(font, index){
+ if (!font.cloneid) {
+ arr.push(_.clone(font));
+ }
+ });
+ me.fontStore.add(arr);
+ }
+
+ var win = new SSE.Views.HeaderFooterDialog({
+ api: me.api,
+ fontStore: me.fontStore,
+ type: item.value,
+ handler: function(dlg, result) {
+ if (result == 'ok') {
+ var props = dlg.getSettings();
+ // if (item.value == 'header')
+ // me.api.asc_editHeader(props);
+ // else
+ // me.api.asc_editFooter(props);
+ }
+ Common.NotificationCenter.trigger('edit:complete');
+ }
+ });
+ win.show();
+
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
textEmptyImgUrl : 'You need to specify image URL.',
warnMergeLostData : 'Operation can destroy data in the selected cells. Continue?',
textWarning : 'Warning',
diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template
index d6054321a..69e985163 100644
--- a/apps/spreadsheeteditor/main/app/template/Toolbar.template
+++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template
@@ -142,6 +142,7 @@
+
diff --git a/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js
new file mode 100644
index 000000000..df546246f
--- /dev/null
+++ b/apps/spreadsheeteditor/main/app/view/HeaderFooterDialog.js
@@ -0,0 +1,348 @@
+/*
+ *
+ * (c) Copyright Ascensio System Limited 2010-2018
+ *
+ * This program is a free software product. You can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License (AGPL)
+ * version 3 as published by the Free Software Foundation. In accordance with
+ * Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
+ * that Ascensio System SIA expressly excludes the warranty of non-infringement
+ * of any third-party rights.
+ *
+ * This program is distributed WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
+ * details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
+ *
+ * You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
+ * EU, LV-1021.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of the Program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU AGPL version 3.
+ *
+ * Pursuant to Section 7(b) of the License you must retain the original Product
+ * logo when distributing the program. Pursuant to Section 7(e) we decline to
+ * grant you any rights under trademark law for use of our trademarks.
+ *
+ * All the Product's GUI elements, including illustrations and icon sets, as
+ * well as technical writing content are licensed under the terms of the
+ * Creative Commons Attribution-ShareAlike 4.0 International. See the License
+ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
+ *
+*/
+/**
+ * HeaderFooterDialog.js
+ *
+ * Created by Julia Radzhabova on 10/111/18
+ * Copyright (c) 2018 Ascensio System SIA. All rights reserved.
+ *
+ */
+
+
+define([
+ 'common/main/lib/util/utils',
+ 'common/main/lib/component/InputField',
+ 'common/main/lib/component/Window',
+ 'common/main/lib/component/ComboBoxFonts'
+], function () { 'use strict';
+
+ SSE.Views.HeaderFooterDialog = Common.UI.Window.extend(_.extend({
+ options: {
+ width: 654,
+ style: 'min-width: 350px;',
+ cls: 'modal-dlg'
+ },
+
+ initialize : function(options) {
+ _.extend(this.options, {
+ title: (this.options.type == 'header') ? this.textHeader : this.textFooter
+ }, options || {});
+
+ this.api = this.options.api;
+ this.type = this.options.type || 'header';
+ this.fontStore = this.options.fontStore;
+ this.font = {
+ size: 11,
+ name: 'Arial',
+ bold: false,
+ italic: false
+ };
+
+ this.template = [
+ '