\ No newline at end of file
diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template
index 9bb562b76..0b8287bc6 100644
--- a/apps/presentationeditor/main/app/template/Toolbar.template
+++ b/apps/presentationeditor/main/app/template/Toolbar.template
@@ -121,6 +121,12 @@
+
+
+
+
+
+
diff --git a/apps/presentationeditor/main/app/view/ChartSettings.js b/apps/presentationeditor/main/app/view/ChartSettings.js
index 4dca67511..f742fb087 100644
--- a/apps/presentationeditor/main/app/view/ChartSettings.js
+++ b/apps/presentationeditor/main/app/view/ChartSettings.js
@@ -150,7 +150,7 @@ define([
if (this._isChartStylesChanged) {
if (rec)
- this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec()[0],true);
+ this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true);
else
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true);
}
diff --git a/apps/presentationeditor/main/app/view/DateTimeDialog.js b/apps/presentationeditor/main/app/view/DateTimeDialog.js
new file mode 100644
index 000000000..367b9a45c
--- /dev/null
+++ b/apps/presentationeditor/main/app/view/DateTimeDialog.js
@@ -0,0 +1,257 @@
+/*
+ *
+ * (c) Copyright Ascensio System SIA 2010-2019
+ *
+ * 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 20A-12 Ernesta Birznieka-Upisha
+ * street, Riga, Latvia, EU, LV-1050.
+ *
+ * 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
+ *
+ */
+/**
+ * DateTimeDialog.js
+ *
+ * Created by Julia Radzhabova on 26.06.2019
+ * Copyright (c) 2019 Ascensio System SIA. All rights reserved.
+ *
+ */
+
+define([
+ 'common/main/lib/component/Window',
+ 'common/main/lib/component/ComboBox',
+ 'common/main/lib/component/ListView'
+], function () {
+ 'use strict';
+
+ PE.Views.DateTimeDialog = Common.UI.Window.extend(_.extend({
+ options: {
+ width: 350,
+ style: 'min-width: 230px;',
+ cls: 'modal-dlg'
+ },
+
+ initialize : function (options) {
+ var t = this,
+ _options = {};
+
+ _.extend(this.options, {
+ title: this.txtTitle
+ }, options || {});
+
+ this.template = [
+ '
',
+ '
',
+ '',
+ '
',
+ '',
+ '
',
+ '',
+ '
',
+ '',
+ '
',
+ '',
+ '',
+ '
',
+ '
',
+ ''
+ ].join('');
+
+ this.options.tpl = _.template(this.template)(this.options);
+ this.api = this.options.api;
+ this.lang = this.options.lang;
+ this.handler = this.options.handler;
+
+ Common.UI.Window.prototype.initialize.call(this, this.options);
+ },
+ render: function () {
+ Common.UI.Window.prototype.render.call(this);
+
+ var data = [{ value: 0x042C }, { value: 0x0402 }, { value: 0x0405 }, { value: 0x0407 }, {value: 0x0807}, { value: 0x0408 }, { value: 0x0C09 }, { value: 0x0809 }, { value: 0x0409 }, { value: 0x0C0A }, { value: 0x080A },
+ { value: 0x040B }, { value: 0x040C }, { value: 0x0410 }, { value: 0x0411 }, { value: 0x0412 }, { value: 0x0426 }, { value: 0x0413 }, { value: 0x0415 }, { value: 0x0416 },
+ { value: 0x0816 }, { value: 0x0419 }, { value: 0x041B }, { value: 0x0424 }, { value: 0x081D }, { value: 0x041D }, { value: 0x041F }, { value: 0x0422 }, { value: 0x042A }, { value: 0x0804 }];
+ data.forEach(function(item) {
+ var langinfo = Common.util.LanguageInfo.getLocalLanguageName(item.value);
+ item.displayValue = langinfo[1];
+ item.langName = langinfo[0];
+ });
+
+ this.cmbLang = new Common.UI.ComboBox({
+ el : $('#datetime-dlg-lang'),
+ menuStyle : 'min-width: 100%; max-height: 185px;',
+ cls : 'input-group-nr',
+ editable : false,
+ data : data
+ });
+ this.cmbLang.setValue(0x0409);
+ this.cmbLang.on('selected', _.bind(function(combo, record) {
+ this.updateFormats(record.value);
+ }, this));
+
+ this.chUpdate = new Common.UI.CheckBox({
+ el: $('#datetime-dlg-update'),
+ labelText: this.textUpdate
+ });
+ this.chUpdate.on('change', _.bind(function(field, newValue, oldValue, eOpts){
+ this.onSelectFormat(this.listFormats, null, this.listFormats.getSelectedRec());
+ }, this));
+
+ this.listFormats = new Common.UI.ListView({
+ el: $('#datetime-dlg-format'),
+ store: new Common.UI.DataViewStore(),
+ scrollAlwaysVisible: true
+ });
+
+ this.listFormats.on('item:select', _.bind(this.onSelectFormat, this));
+ this.listFormats.on('item:dblclick', _.bind(this.onDblClickFormat, this));
+ this.listFormats.on('entervalue', _.bind(this.onPrimary, this));
+ this.listFormats.$el.find('.listview').focus();
+
+ this.btnDefault = new Common.UI.Button({
+ el: $('#datetime-dlg-default')
+ });
+ this.btnDefault.on('click', _.bind(function(btn, e) {
+ var rec = this.listFormats.getSelectedRec();
+ Common.UI.warning({
+ msg: Common.Utils.String.format(this.confirmDefault, Common.util.LanguageInfo.getLocalLanguageName(this.cmbLang.getValue())[1], rec ? rec.get('value') : ''),
+ buttons: ['yes', 'no'],
+ primary: 'yes',
+ callback: _.bind(function(btn) {
+ if (btn == 'yes') {
+ this.defaultFormats[this.cmbLang.getValue()] = rec ? rec.get('format') : '';
+ this.api.asc_setDefaultDateTimeFormat(this.defaultFormats);
+ var arr = [];
+ for (var name in this.defaultFormats) {
+ if (name) {
+ arr.push(name + ' ' + this.defaultFormats[name]);
+ }
+ }
+ var value = arr.join(';');
+ Common.localStorage.setItem("pe-settings-datetime-default", value);
+ Common.Utils.InternalSettings.set("pe-settings-datetime-default", value);
+ }
+ }, this)
+ });
+ }, this));
+
+ this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
+ this.afterRender();
+ },
+
+ afterRender: function() {
+ var me = this,
+ value = Common.Utils.InternalSettings.get("pe-settings-datetime-default"),
+ arr = (value) ? value.split(';') : [];
+ this.defaultFormats = [];
+ arr.forEach(function(item){
+ var pair = item.split(' ');
+ me.defaultFormats[parseInt(pair[0])] = pair[1];
+ });
+
+ this._setDefaults();
+ },
+
+ _setDefaults: function () {
+ this.props = new AscCommonSlide.CAscDateTime();
+ if (this.lang) {
+ var item = this.cmbLang.store.findWhere({value: this.lang});
+ item = item ? item.get('value') : 0x0409;
+ this.cmbLang.setValue(item)
+ }
+ this.updateFormats(this.cmbLang.getValue());
+ },
+
+ getSettings: function () {
+ return this.props;
+ },
+
+ updateFormats: function(lang) {
+ this.props.put_Lang(lang);
+ var data = this.props.get_DateTimeExamples(),
+ arr = [];
+ var store = this.listFormats.store;
+ for (var name in data) {
+ if (data[name]) {
+ var rec = new Common.UI.DataViewModel();
+ rec.set({
+ format: name,
+ value: data[name]
+ });
+ arr.push(rec);
+ }
+ }
+ store.reset(arr);
+ var format = this.defaultFormats[lang];
+ format ? this.listFormats.selectRecord(store.findWhere({format: format})) : this.listFormats.selectByIndex(0);
+ var rec = this.listFormats.getSelectedRec();
+ this.listFormats.scrollToRecord(rec);
+ this.onSelectFormat(this.listFormats, null, rec);
+ },
+
+ onSelectFormat: function(lisvView, itemView, record) {
+ if (!record) return;
+ if (this.chUpdate.getValue()=='checked') {
+ this.props.put_DateTime(record.get('format'));
+ } else {
+ this.props.put_DateTime(null);
+ this.props.put_CustomDateTime(record.get('value'));
+ }
+ },
+
+ onBtnClick: function(event) {
+ this._handleInput(event.currentTarget.attributes['result'].value);
+ },
+
+ onDblClickFormat: function () {
+ this._handleInput('ok');
+ },
+
+ onPrimary: function(event) {
+ this._handleInput('ok');
+ return false;
+ },
+
+ _handleInput: function(state) {
+ if (this.options.handler) {
+ this.options.handler.call(this, state, this.getSettings());
+ }
+
+ this.close();
+ },
+
+ //
+ cancelButtonText: 'Cancel',
+ okButtonText: 'OK',
+ txtTitle: 'Date & Time',
+ textLang: 'Language',
+ textFormat: 'Formats',
+ textUpdate: 'Update automatically',
+ textDefault: 'Set as default',
+ confirmDefault: 'Set default format for {0}: "{1}"'
+
+ }, PE.Views.DateTimeDialog || {}));
+});
\ No newline at end of file
diff --git a/apps/presentationeditor/main/app/view/HeaderFooterDialog.js b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js
new file mode 100644
index 000000000..3e0ca4041
--- /dev/null
+++ b/apps/presentationeditor/main/app/view/HeaderFooterDialog.js
@@ -0,0 +1,329 @@
+/*
+ *
+ * (c) Copyright Ascensio System SIA 2010-2019
+ *
+ * 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 20A-12 Ernesta Birznieka-Upisha
+ * street, Riga, Latvia, EU, LV-1050.
+ *
+ * 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 09.07.2019
+ * Copyright (c) 2019 Ascensio System SIA. All rights reserved.
+ *
+ */
+define(['text!presentationeditor/main/app/template/HeaderFooterDialog.template',
+ 'common/main/lib/util/utils',
+ 'common/main/lib/component/RadioBox',
+ 'common/main/lib/component/InputField',
+ 'common/main/lib/view/AdvancedSettingsWindow'
+], function (template) { 'use strict';
+
+ PE.Views.HeaderFooterDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
+ options: {
+ contentWidth: 360,
+ height: 340
+ },
+
+ initialize : function(options) {
+ var me = this;
+
+ _.extend(this.options, {
+ title: this.textTitle,
+ template: _.template(
+ [
+ '
',
+ '
',
+ '
',
+ template,
+ '
',
+ '
',
+ '',
+ '
',
+ '',
+ '
',
+ '',
+ '
',
+ '
',
+ '
',
+ '',
+ ''
+ ].join('')
+ )({
+ scope: this
+ })
+ }, options);
+
+ this.lang = options.lang;
+ this.handler = options.handler;
+ this.hfProps = options.props;
+ this.api = options.api;
+ this.dateControls = [];
+
+ Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
+ },
+
+ render: function() {
+ Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
+ var me = this;
+
+ this.chDateTime = new Common.UI.CheckBox({
+ el: $('#hf-dlg-chb-datetime'),
+ labelText: this.textDateTime
+ });
+ this.chDateTime.on('change', _.bind(this.setType, this, 'date'));
+
+ this.chSlide = new Common.UI.CheckBox({
+ el: $('#hf-dlg-chb-slide'),
+ labelText: this.textSlideNum
+ });
+ this.chSlide.on('change', _.bind(this.setType, this, 'slide'));
+
+ this.chFooter = new Common.UI.CheckBox({
+ el: $('#hf-dlg-chb-text'),
+ labelText: this.textFooter
+ });
+ this.chFooter.on('change', _.bind(this.setType, this, 'footer'));
+
+ this.inputFooter = new Common.UI.InputField({
+ el : $('#hf-dlg-text'),
+ validateOnBlur: false,
+ style : 'width: 100%;'
+ });
+
+ var data = [{ value: 0x042C }, { value: 0x0402 }, { value: 0x0405 }, { value: 0x0407 }, {value: 0x0807}, { value: 0x0408 }, { value: 0x0C09 }, { value: 0x0809 }, { value: 0x0409 }, { value: 0x0C0A }, { value: 0x080A },
+ { value: 0x040B }, { value: 0x040C }, { value: 0x0410 }, { value: 0x0411 }, { value: 0x0412 }, { value: 0x0426 }, { value: 0x0413 }, { value: 0x0415 }, { value: 0x0416 },
+ { value: 0x0816 }, { value: 0x0419 }, { value: 0x041B }, { value: 0x0424 }, { value: 0x081D }, { value: 0x041D }, { value: 0x041F }, { value: 0x0422 }, { value: 0x042A }, { value: 0x0804 }];
+ data.forEach(function(item) {
+ var langinfo = Common.util.LanguageInfo.getLocalLanguageName(item.value);
+ item.displayValue = langinfo[1];
+ item.langName = langinfo[0];
+ });
+
+ this.cmbLang = new Common.UI.ComboBox({
+ el : $('#hf-dlg-combo-lang'),
+ menuStyle : 'min-width: 100%; max-height: 185px;',
+ cls : 'input-group-nr',
+ editable : false,
+ data : data
+ });
+ this.cmbLang.setValue(0x0409);
+ this.cmbLang.on('selected', _.bind(function(combo, record) {
+ this.updateFormats(record.value);
+ }, this));
+ this.dateControls.push(this.cmbLang);
+
+ this.cmbFormat = new Common.UI.ComboBox({
+ el : $('#hf-dlg-combo-format'),
+ menuStyle : 'min-width: 100%; max-height: 185px;',
+ cls : 'input-group-nr',
+ editable : false,
+ data : []
+ });
+ this.dateControls.push(this.cmbFormat);
+
+ this.chUpdate = new Common.UI.CheckBox({
+ el: $('#hf-dlg-chb-update'),
+ labelText: this.textUpdate,
+ value: 'checked'
+ });
+ this.dateControls.push(this.chUpdate);
+
+ this.chNotTitle = new Common.UI.CheckBox({
+ el: $('#hf-dlg-chb-not-title'),
+ labelText: this.textNotTitle
+ });
+
+ this.afterRender();
+ },
+
+ afterRender: function() {
+ var me = this,
+ value = Common.Utils.InternalSettings.get("pe-settings-datetime-default"),
+ arr = (value) ? value.split(';') : [];
+ this.defaultFormats = [];
+ arr.forEach(function(item){
+ var pair = item.split(' ');
+ me.defaultFormats[parseInt(pair[0])] = pair[1];
+ });
+
+ this._setDefaults(this.hfProps);
+ },
+
+ setType: function(type, field, newValue) {
+ newValue = (newValue=='checked');
+ if (type == 'date') {
+ _.each(this.dateControls, function(item) {
+ item.setDisabled(!newValue);
+ });
+ this.props.put_ShowDateTime(newValue);
+ } else if (type == 'slide') {
+ this.props.put_ShowSlideNum(newValue);
+ } else if (type == 'footer') {
+ this.inputFooter.setDisabled(!newValue);
+ this.props.put_ShowFooter(newValue);
+ }
+ this.props.updateView();
+ },
+
+ updateFormats: function(lang, format) {
+ var props = new AscCommonSlide.CAscDateTime();
+ props.put_Lang(lang);
+ var data = props.get_DateTimeExamples(),
+ arr = [];
+ for (var name in data) {
+ if (data[name]) {
+ arr.push({
+ value: name,
+ displayValue: data[name]
+ });
+ }
+ }
+ this.cmbFormat.setData(arr);
+ format = format || this.defaultFormats[lang];
+ this.cmbFormat.setValue(format ? format : arr[0].value);
+ },
+
+ onSelectFormat: function(format) {
+ format = format || this.cmbFormat.getValue();
+ if (this.chUpdate.getValue()=='checked') {
+ this.props.get_DateTime().put_DateTime(format);
+ } else {
+ this.props.get_DateTime().put_DateTime(null);
+ this.props.get_DateTime().put_CustomDateTime(format);
+ }
+ },
+
+ _setDefaults: function (props) {
+ if (props) {
+ var slideprops = props.get_Slide() || new AscCommonSlide.CAscHFProps();
+
+ var val = slideprops.get_ShowDateTime();
+ this.chDateTime.setValue(val, true);
+ _.each(this.dateControls, function(item) {
+ item.setDisabled(!val);
+ });
+
+ var format,
+ datetime = slideprops.get_DateTime(),
+ item = this.cmbLang.store.findWhere({value: datetime.get_Lang() || this.lang});
+ this._originalLang = item ? item.get('value') : 0x0409;
+ this.cmbLang.setValue(this._originalLang);
+
+ if (val) {
+ format = datetime.get_DateTime();
+ this.chUpdate.setValue(!!format, true);
+ !format && (format = datetime.get_CustomDateTime());
+ }
+ this.updateFormats(this.cmbLang.getValue(), format);
+
+ val = slideprops.get_ShowSlideNum();
+ this.chSlide.setValue(val, true);
+
+ val = slideprops.get_ShowFooter();
+ this.chFooter.setValue(val, true);
+ this.inputFooter.setDisabled(!val);
+ val && this.inputFooter.setValue(slideprops.get_Footer() || '');
+
+ val = slideprops.get_ShowOnTitleSlide();
+ this.chNotTitle.setValue(!val, true);
+
+ this.props = slideprops;
+ } else
+ this.props = new AscCommonSlide.CAscHFProps();
+
+ this.props.put_DivId('hf-dlg-canvas-preview');
+ this.props.put_Api(this.api);
+ this.props.updateView();
+ },
+
+ getSettings: function () {
+ var props = this.props;
+ if (props.get_ShowDateTime()) {
+ !props.get_DateTime() && props.put_DateTime(new AscCommonSlide.CAscDateTime());
+ props.get_DateTime().put_Lang(this.cmbLang.getValue());
+ this.onSelectFormat();
+ }
+ if (props.get_ShowFooter()) {
+ props.put_Footer(this.inputFooter.getValue());
+ }
+ props.put_ShowOnTitleSlide(this.chNotTitle.getValue()!='checked');
+
+ this.hfProps.put_Slide(this.props);
+ return this.hfProps;
+ },
+
+ onDlgBtnClick: function(event) {
+ this._handleInput(event.currentTarget.attributes['result'].value);
+ },
+
+ onPrimary: function() {
+ this._handleInput('ok');
+ return false;
+ },
+
+ _handleInput: function(state) {
+ if (this.handler) {
+ if (state == 'ok') {
+ if (this.cmbLang.getValue() !== this._originalLang) {
+ Common.UI.warning({
+ title: this.notcriticalErrorTitle,
+ maxwidth: 600,
+ msg : this.diffLanguage
+ });
+ return;
+ }
+ }
+
+ this.handler.call(this, state, this.getSettings());
+ }
+ this.close();
+ },
+
+ textTitle: 'Header/Footer Settings',
+ cancelButtonText: 'Cancel',
+ applyAllText: 'Apply to all',
+ applyText: 'Apply',
+ textLang: 'Language',
+ textFormat: 'Formats',
+ textUpdate: 'Update automatically',
+ textDateTime: 'Date and time',
+ textSlideNum: 'Slide number',
+ textFooter: 'Text in footer',
+ textNotTitle: 'Don\'t show on title slide',
+ textPreview: 'Preview',
+ diffLanguage: 'You can’t use a date format in a different language than the slide master.\nTo change the master, click \'Apply to all\' instead of \'Apply\'',
+ notcriticalErrorTitle: 'Warning'
+
+ }, PE.Views.HeaderFooterDialog || {}))
+});
\ No newline at end of file
diff --git a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js
index c29988007..8c16332fb 100644
--- a/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js
+++ b/apps/presentationeditor/main/app/view/ParagraphSettingsAdvanced.js
@@ -523,10 +523,10 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
removeTab: function(btn, eOpts){
var rec = this.tabList.getSelectedRec();
- if (rec.length>0) {
+ if (rec) {
var store = this.tabList.store;
- var idx = _.indexOf(store.models, rec[0]);
- store.remove(rec[0]);
+ var idx = _.indexOf(store.models, rec);
+ store.remove(rec);
if (idx>store.length-1) idx = store.length-1;
if (store.length>0) {
this.tabList.selectByIndex(idx);
diff --git a/apps/presentationeditor/main/app/view/SlideSettings.js b/apps/presentationeditor/main/app/view/SlideSettings.js
index cbab1e457..742ab375a 100644
--- a/apps/presentationeditor/main/app/view/SlideSettings.js
+++ b/apps/presentationeditor/main/app/view/SlideSettings.js
@@ -79,7 +79,8 @@ define([
this._stateDisabled = {
background: true,
effects: true,
- timing: true
+ timing: true,
+ header: true
};
this._state = {
@@ -249,6 +250,20 @@ define([
if (this.api) this.api.SlideTimingApplyToAll();
this.fireEvent('editcomplete', this);
}, this));
+
+ this.chSlideNum = new Common.UI.CheckBox({
+ el: $('#slide-checkbox-slidenum'),
+ labelText: this.strSlideNum,
+ disabled: true
+ });
+ this.chSlideNum.on('change', _.bind(this.onHeaderChange, this, 'slidenum'));
+
+ this.chDateTime = new Common.UI.CheckBox({
+ el: $('#slide-checkbox-datetime'),
+ labelText: this.strDateTime,
+ disabled: true
+ });
+ this.chDateTime.on('change', _.bind(this.onHeaderChange, this, 'datetime'));
},
render: function () {
@@ -1011,6 +1026,15 @@ define([
this.fireEvent('editcomplete', this);
},
+ onHeaderChange: function(type, field, newValue, oldValue, eOpts){
+ if (this.api && !this._noApply) {
+ var props = this.api.asc_getHeaderFooterProperties();
+ props.get_Slide()[(type=='slidenum') ? 'put_ShowSlideNum' : 'put_ShowDateTime'](field.getValue()=='checked');
+ this.api.asc_setHeaderFooterProperties(props);
+ }
+ this.fireEvent('editcomplete', this);
+ },
+
UpdateThemeColors: function() {
if (!this.btnBackColor) {
this.btnBackColor = new Common.UI.ColorButton({
@@ -1419,11 +1443,19 @@ define([
this._state.GradColor = color;
}
+
+ value = this.api.asc_getHeaderFooterProperties();
+ if (value) {
+ var slideprops = value.get_Slide() || new AscCommonSlide.CAscHFProps();
+ this.chSlideNum.setValue(!!slideprops.get_ShowSlideNum(), true);
+ this.chDateTime.setValue(!!slideprops.get_ShowDateTime(), true);
+ }
+
this._noApply = false;
}
},
- SetSlideDisabled: function(background, effects, timing) {
+ SetSlideDisabled: function(background, effects, timing, header) {
if (this._initSettings) return;
if (background !== this._stateDisabled.background) {
@@ -1448,6 +1480,11 @@ define([
this.btnApplyToAll.setDisabled(timing);
this._stateDisabled.timing = timing;
}
+ if (header !== this._stateDisabled.header) {
+ this.chSlideNum.setDisabled(header);
+ this.chDateTime.setDisabled(header);
+ this._stateDisabled.header = header;
+ }
},
strColor : 'Color',
@@ -1520,6 +1557,8 @@ define([
textDirection: 'Direction',
textStyle: 'Style',
textGradient: 'Gradient',
- textSec: 's'
+ textSec: 's',
+ strSlideNum: 'Show Slide Number',
+ strDateTime: 'Show Date and Time'
}, PE.Views.SlideSettings || {}));
});
diff --git a/apps/presentationeditor/main/app/view/TableSettings.js b/apps/presentationeditor/main/app/view/TableSettings.js
index aa3ba303b..6944d3052 100644
--- a/apps/presentationeditor/main/app/view/TableSettings.js
+++ b/apps/presentationeditor/main/app/view/TableSettings.js
@@ -443,7 +443,7 @@ define([
if (this._isTemplatesChanged) {
if (rec)
- this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec()[0],true);
+ this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec(),true);
else
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true);
}
diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js
index 4bbdf1555..836eb8822 100644
--- a/apps/presentationeditor/main/app/view/Toolbar.js
+++ b/apps/presentationeditor/main/app/view/Toolbar.js
@@ -571,6 +571,33 @@ define([
});
me.slideOnlyControls.push(me.btnInsertTextArt);
+ me.btnEditHeader = new Common.UI.Button({
+ id: 'id-toolbar-btn-editheader',
+ cls: 'btn-toolbar x-huge icon-top',
+ iconCls: 'btn-editheader',
+ caption: me.capBtnInsHeader,
+ lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart]
+ });
+ me.slideOnlyControls.push(me.btnEditHeader);
+
+ me.btnInsDateTime = new Common.UI.Button({
+ id: 'id-toolbar-btn-datetime',
+ cls: 'btn-toolbar x-huge icon-top',
+ iconCls: 'btn-datetime',
+ caption: me.capBtnDateTime,
+ lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.paragraphLock, _set.disableOnStart]
+ });
+ me.slideOnlyControls.push(me.btnInsDateTime);
+
+ me.btnInsSlideNum = new Common.UI.Button({
+ id: 'id-toolbar-btn-slidenum',
+ cls: 'btn-toolbar x-huge icon-top',
+ iconCls: 'btn-pagenum',
+ caption: me.capBtnSlideNum,
+ lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.paragraphLock, _set.disableOnStart]
+ });
+ me.slideOnlyControls.push(me.btnInsSlideNum);
+
me.btnColorSchemas = new Common.UI.Button({
id: 'id-toolbar-btn-colorschemas',
cls: 'btn-toolbar',
@@ -917,6 +944,9 @@ define([
_injectComponent('#slot-btn-colorschemas', this.btnColorSchemas);
_injectComponent('#slot-btn-slidesize', this.btnSlideSize);
_injectComponent('#slot-field-styles', this.listTheme);
+ _injectComponent('#slot-btn-editheader', this.btnEditHeader);
+ _injectComponent('#slot-btn-datetime', this.btnInsDateTime);
+ _injectComponent('#slot-btn-slidenum', this.btnInsSlideNum);
this.btnsInsertImage = Common.Utils.injectButtons($host.find('.slot-insertimg'), 'tlbtn-insertimage-', 'btn-insertimage', this.capInsertImage,
[PE.enumLock.slideDeleted, PE.enumLock.lostConnect, PE.enumLock.noSlides, PE.enumLock.disableOnStart], false, true);
@@ -1024,6 +1054,9 @@ define([
this.btnShapeAlign.updateHint(this.tipShapeAlign);
this.btnShapeArrange.updateHint(this.tipShapeArrange);
this.btnSlideSize.updateHint(this.tipSlideSize);
+ this.btnEditHeader.updateHint(this.tipEditHeader);
+ this.btnInsDateTime.updateHint(this.tipDateTime);
+ this.btnInsSlideNum.updateHint(this.tipSlideNum);
// set menus
@@ -1644,7 +1677,13 @@ define([
textTabProtect: 'Protection',
mniImageFromStorage: 'Image from Storage',
txtSlideAlign: 'Align to Slide',
- txtObjectsAlign: 'Align Selected Objects'
+ txtObjectsAlign: 'Align Selected Objects',
+ tipEditHeader: 'Edit Header or Footer',
+ tipSlideNum: 'Insert slide number',
+ tipDateTime: 'Insert current date and time',
+ capBtnInsHeader: 'Header/Footer',
+ capBtnSlideNum: 'Slide Number',
+ capBtnDateTime: 'Date & Time'
}
}()), PE.Views.Toolbar || {}));
});
\ No newline at end of file
diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json
index eaa27f412..0eed32caa 100644
--- a/apps/presentationeditor/main/locale/en.json
+++ b/apps/presentationeditor/main/locale/en.json
@@ -946,6 +946,14 @@
"PE.Views.ChartSettingsAdvanced.textAltTip": "The alternative text-based representation of the visual object information, which will be read to the people with vision or cognitive impairments to help them better understand what information there is in the image, autoshape, chart or table.",
"PE.Views.ChartSettingsAdvanced.textAltTitle": "Title",
"PE.Views.ChartSettingsAdvanced.textTitle": "Chart - Advanced Settings",
+ "PE.Views.DateTimeDialog.cancelButtonText": "Cancel",
+ "PE.Views.DateTimeDialog.okButtonText": "OK",
+ "PE.Views.DateTimeDialog.txtTitle": "Date & Time",
+ "PE.Views.DateTimeDialog.textLang": "Language",
+ "PE.Views.DateTimeDialog.textFormat": "Formats",
+ "PE.Views.DateTimeDialog.textUpdate": "Update automatically",
+ "PE.Views.DateTimeDialog.textDefault": "Set as default",
+ "PE.Views.DateTimeDialog.confirmDefault": "Set default format for {0}: \"{1}\"",
"PE.Views.DocumentHolder.aboveText": "Above",
"PE.Views.DocumentHolder.addCommentText": "Add Comment",
"PE.Views.DocumentHolder.advancedImageText": "Image Advanced Settings",
@@ -1218,6 +1226,20 @@
"PE.Views.FileMenuPanels.Settings.txtPt": "Point",
"PE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"PE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
+ "PE.Views.HeaderFooterDialog.textTitle": "Header/Footer Settings",
+ "PE.Views.HeaderFooterDialog.cancelButtonText": "Cancel",
+ "PE.Views.HeaderFooterDialog.applyAllText": "Apply to all",
+ "PE.Views.HeaderFooterDialog.applyText": "Apply",
+ "PE.Views.HeaderFooterDialog.textLang": "Language",
+ "PE.Views.HeaderFooterDialog.textFormat": "Formats",
+ "PE.Views.HeaderFooterDialog.textUpdate": "Update automatically",
+ "PE.Views.HeaderFooterDialog.textDateTime": "Date and time",
+ "PE.Views.HeaderFooterDialog.textSlideNum": "Slide number",
+ "PE.Views.HeaderFooterDialog.textFooter": "Text in footer",
+ "PE.Views.HeaderFooterDialog.textNotTitle": "Don't show on title slide",
+ "PE.Views.HeaderFooterDialog.textPreview": "Preview",
+ "PE.Views.HeaderFooterDialog.diffLanguage": "You can’t use a date format in a different language than the slide master. To change the master, click 'Apply to all' instead of 'Apply'",
+ "PE.Views.HeaderFooterDialog.notcriticalErrorTitle": "Warning",
"PE.Views.HyperlinkSettingsDialog.cancelButtonText": "Cancel",
"PE.Views.HyperlinkSettingsDialog.okButtonText": "OK",
"PE.Views.HyperlinkSettingsDialog.strDisplay": "Display",
@@ -1503,6 +1525,8 @@
"PE.Views.SlideSettings.txtLeather": "Leather",
"PE.Views.SlideSettings.txtPapyrus": "Papyrus",
"PE.Views.SlideSettings.txtWood": "Wood",
+ "PE.Views.SlideSettings.strSlideNum": "Show Slide Number",
+ "PE.Views.SlideSettings.strDateTime": "Show Date and Time",
"PE.Views.SlideshowSettings.cancelButtonText": "Cancel",
"PE.Views.SlideshowSettings.okButtonText": "OK",
"PE.Views.SlideshowSettings.textLoop": "Loop continuously until 'Esc' is pressed",
diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js
index f31ff7be5..2e8e33f82 100644
--- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js
+++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js
@@ -274,7 +274,7 @@ define([
if (this._isTemplatesChanged) {
if (rec)
- view.pivotStyles.fillComboView(view.pivotStyles.menuPicker.getSelectedRec()[0],true);
+ view.pivotStyles.fillComboView(view.pivotStyles.menuPicker.getSelectedRec(),true);
else
view.pivotStyles.fillComboView(view.pivotStyles.menuPicker.store.at(0), true);
}
diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
index 415df6b02..7bc92c5f1 100644
--- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
+++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js
@@ -1019,7 +1019,7 @@ define([
data.preventDefault();
data.stopPropagation();
- this.updateCellCheck(listView, listView.getSelectedRec()[0]);
+ this.updateCellCheck(listView, listView.getSelectedRec());
} else {
Common.UI.DataView.prototype.onKeyDown.call(this.cellsList, e, data);
diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js
index 68cf3afdf..5159c589b 100644
--- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js
+++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js
@@ -182,7 +182,7 @@ define([
if (this._isChartStylesChanged) {
if (rec)
- this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec()[0],true);
+ this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.getSelectedRec(),true);
else
this.cmbChartStyle.fillComboView(this.cmbChartStyle.menuPicker.store.at(0), true);
}
diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js
index 2e82f80d8..cb64f5a10 100644
--- a/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js
+++ b/apps/spreadsheeteditor/main/app/view/ChartSettingsDlg.js
@@ -1433,7 +1433,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
if (this.isChart) {
var rec = this.mnuChartTypePicker.getSelectedRec(),
- type = (rec && rec.length>0) ? rec[0].get('type') : this.currentChartType;
+ type = (rec) ? rec.get('type') : this.currentChartType;
this.chartSettings.putType(type);
@@ -1492,7 +1492,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
var isvalid;
if (!_.isEmpty(this.txtDataRange.getValue())) {
var rec = this.mnuChartTypePicker.getSelectedRec(),
- type = (rec && rec.length>0) ? rec[0].get('type') : this.currentChartType;
+ type = (rec) ? rec.get('type') : this.currentChartType;
isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, this.txtDataRange.getValue(), true, this.cmbDataDirect.getValue()==0, type);
if (isvalid == Asc.c_oAscError.ID.No)
diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
index 694215470..b11713712 100644
--- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
+++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js
@@ -218,9 +218,7 @@ define([
show: function() {
Common.UI.BaseView.prototype.show.call(this,arguments);
var item = this.viewSettingsPicker.getSelectedRec();
- if (item[0]) {
- item[0].get('panel').show();
- }
+ item && item.get('panel').show();
},
setMode: function(mode) {
diff --git a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js
index 2790fbe20..c59178d5d 100644
--- a/apps/spreadsheeteditor/main/app/view/FormulaDialog.js
+++ b/apps/spreadsheeteditor/main/app/view/FormulaDialog.js
@@ -71,7 +71,6 @@ define([
'',
'',
-
'',
'',
'',
diff --git a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js
index 8f7cf01c6..7e1db263b 100644
--- a/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js
+++ b/apps/spreadsheeteditor/main/app/view/NameManagerDlg.js
@@ -284,8 +284,8 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
var me = this,
xy = me.$window.offset(),
rec = this.rangeList.getSelectedRec(),
- idx = _.indexOf(this.rangeList.store.models, rec[0]),
- oldname = (isEdit && rec.length>0) ? new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'), undefined, undefined, undefined, true) : null;
+ idx = _.indexOf(this.rangeList.store.models, rec),
+ oldname = (isEdit && rec.length>0) ? new Asc.asc_CDefName(rec.get('name'), rec.get('range'), rec.get('scope'), rec.get('isTable'), undefined, undefined, undefined, true) : null;
var win = new SSE.Views.NamedRangeEditDlg({
api: me.api,
@@ -317,9 +317,9 @@ define([ 'text!spreadsheeteditor/main/app/template/NameManagerDlg.template',
onDeleteRange: function () {
var rec = this.rangeList.getSelectedRec();
- if (rec.length>0) {
- this.currentNamedRange = _.indexOf(this.rangeList.store.models, rec[0]);
- this.api.asc_delDefinedNames(new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'), undefined, undefined, undefined, true));
+ if (rec) {
+ this.currentNamedRange = _.indexOf(this.rangeList.store.models, rec);
+ this.api.asc_delDefinedNames(new Asc.asc_CDefName(rec.get('name'), rec.get('range'), rec.get('scope'), rec.get('isTable'), undefined, undefined, undefined, true));
}
},
diff --git a/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js b/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js
index 54f86f95e..44fea2bc6 100644
--- a/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js
+++ b/apps/spreadsheeteditor/main/app/view/NamedRangePasteDlg.js
@@ -150,7 +150,7 @@ define([
getSettings: function() {
var rec = this.rangeList.getSelectedRec();
- return (rec.length>0) ? (new Asc.asc_CDefName(rec[0].get('name'), rec[0].get('range'), rec[0].get('scope'), rec[0].get('isTable'), undefined, undefined, undefined, true)) : null;
+ return (rec) ? (new Asc.asc_CDefName(rec.get('name'), rec.get('range'), rec.get('scope'), rec.get('isTable'), undefined, undefined, undefined, true)) : null;
},
onPrimary: function() {
diff --git a/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js
index 24cc31f88..1007f9a0f 100644
--- a/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js
+++ b/apps/spreadsheeteditor/main/app/view/ParagraphSettingsAdvanced.js
@@ -522,10 +522,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
removeTab: function(btn, eOpts){
var rec = this.tabList.getSelectedRec();
- if (rec.length>0) {
+ if (rec) {
var store = this.tabList.store;
- var idx = _.indexOf(store.models, rec[0]);
- store.remove(rec[0]);
+ var idx = _.indexOf(store.models, rec);
+ store.remove(rec);
if (idx>store.length-1) idx = store.length-1;
if (store.length>0) {
this.tabList.selectByIndex(idx);
diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js
index 5f93bd61d..247da69e5 100644
--- a/apps/spreadsheeteditor/main/app/view/Statusbar.js
+++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js
@@ -738,7 +738,7 @@ define([
if (this.options.handler) {
this.options.handler.call(this,
- event.currentTarget.attributes['result'].value, active[0].get('inindex'));
+ event.currentTarget.attributes['result'].value, active.get('inindex'));
}
this.close();
@@ -746,7 +746,7 @@ define([
onPrimary: function() {
if (this.options.handler) {
- this.options.handler.call(this, 'ok', this.listNames.getSelectedRec()[0].get('inindex'));
+ this.options.handler.call(this, 'ok', this.listNames.getSelectedRec().get('inindex'));
}
this.close();
diff --git a/apps/spreadsheeteditor/main/app/view/TableSettings.js b/apps/spreadsheeteditor/main/app/view/TableSettings.js
index f3932796b..810f49060 100644
--- a/apps/spreadsheeteditor/main/app/view/TableSettings.js
+++ b/apps/spreadsheeteditor/main/app/view/TableSettings.js
@@ -407,7 +407,7 @@ define([
if (this._isTemplatesChanged) {
if (rec)
- this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec()[0],true);
+ this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec(),true);
else
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true);
}