' +
+ '
' +
'' +
'' +
'
' +
@@ -70,7 +70,7 @@ define([
'
' +
'' +
'
' +
- '
' +
+ '
' +
'' +
'
' +
'
' +
@@ -84,11 +84,11 @@ define([
'' +
'
' +
'
' +
- '
' +
+ '
' +
'' +
'
' +
'
' +
- '
' +
+ '
' +
'' +
'
' +
'';
@@ -647,7 +647,7 @@ define([
button.setDisabled(state);
}
}, this);
- this.btnChat && this.btnChat.setDisabled(state);
+ // this.btnChat && this.btnChat.setDisabled(state);
this.btnCommentRemove && this.btnCommentRemove.setDisabled(state || !Common.Utils.InternalSettings.get(this.appPrefix + "settings-livecomment"));
},
diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/big/btn-sheet-view.png b/apps/common/main/resources/img/toolbar/1.25x/big/btn-sheet-view.png
similarity index 100%
rename from apps/spreadsheeteditor/main/resources/img/toolbar/1.25x/big/btn-sheet-view.png
rename to apps/common/main/resources/img/toolbar/1.25x/big/btn-sheet-view.png
diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/big/btn-sheet-view.png b/apps/common/main/resources/img/toolbar/1.5x/big/btn-sheet-view.png
similarity index 100%
rename from apps/spreadsheeteditor/main/resources/img/toolbar/1.5x/big/btn-sheet-view.png
rename to apps/common/main/resources/img/toolbar/1.5x/big/btn-sheet-view.png
diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/big/btn-sheet-view.png b/apps/common/main/resources/img/toolbar/1.75x/big/btn-sheet-view.png
similarity index 100%
rename from apps/spreadsheeteditor/main/resources/img/toolbar/1.75x/big/btn-sheet-view.png
rename to apps/common/main/resources/img/toolbar/1.75x/big/btn-sheet-view.png
diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/1x/big/btn-sheet-view.png b/apps/common/main/resources/img/toolbar/1x/big/btn-sheet-view.png
similarity index 100%
rename from apps/spreadsheeteditor/main/resources/img/toolbar/1x/big/btn-sheet-view.png
rename to apps/common/main/resources/img/toolbar/1x/big/btn-sheet-view.png
diff --git a/apps/common/main/resources/img/toolbar/1x/btn-arrow-down.png b/apps/common/main/resources/img/toolbar/1x/btn-arrow-down.png
new file mode 100644
index 000000000..77b1c0c64
Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1x/btn-arrow-down.png differ
diff --git a/apps/common/main/resources/img/toolbar/1x/btn-arrow-up.png b/apps/common/main/resources/img/toolbar/1x/btn-arrow-up.png
new file mode 100644
index 000000000..8b08b1fb8
Binary files /dev/null and b/apps/common/main/resources/img/toolbar/1x/btn-arrow-up.png differ
diff --git a/apps/spreadsheeteditor/main/resources/img/toolbar/2x/big/btn-sheet-view.png b/apps/common/main/resources/img/toolbar/2x/big/btn-sheet-view.png
similarity index 100%
rename from apps/spreadsheeteditor/main/resources/img/toolbar/2x/big/btn-sheet-view.png
rename to apps/common/main/resources/img/toolbar/2x/big/btn-sheet-view.png
diff --git a/apps/common/main/resources/img/toolbar/2x/btn-arrow-down.png b/apps/common/main/resources/img/toolbar/2x/btn-arrow-down.png
new file mode 100644
index 000000000..c01427ae7
Binary files /dev/null and b/apps/common/main/resources/img/toolbar/2x/btn-arrow-down.png differ
diff --git a/apps/common/main/resources/img/toolbar/2x/btn-arrow-up.png b/apps/common/main/resources/img/toolbar/2x/btn-arrow-up.png
new file mode 100644
index 000000000..7de6f592e
Binary files /dev/null and b/apps/common/main/resources/img/toolbar/2x/btn-arrow-up.png differ
diff --git a/apps/documenteditor/main/app.js b/apps/documenteditor/main/app.js
index bd53d3271..87306dd58 100644
--- a/apps/documenteditor/main/app.js
+++ b/apps/documenteditor/main/app.js
@@ -151,6 +151,7 @@ require([
'Toolbar',
'Statusbar',
'Links',
+ 'FormsTab',
'Navigation',
'RightMenu',
'LeftMenu',
@@ -176,6 +177,7 @@ require([
'documenteditor/main/app/controller/DocumentHolder',
'documenteditor/main/app/controller/Toolbar',
'documenteditor/main/app/controller/Statusbar',
+ 'documenteditor/main/app/controller/FormsTab',
'documenteditor/main/app/controller/Links',
'documenteditor/main/app/controller/Navigation',
'documenteditor/main/app/controller/RightMenu',
diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js
new file mode 100644
index 000000000..91d7b619d
--- /dev/null
+++ b/apps/documenteditor/main/app/controller/FormsTab.js
@@ -0,0 +1,290 @@
+/*
+ *
+ * (c) Copyright Ascensio System SIA 2010-2020
+ *
+ * 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
+ *
+ */
+
+/**
+ * FormsTab.js
+ *
+ * Created by Julia Radzhabova on 06.10.2020
+ * Copyright (c) 2020 Ascensio System SIA. All rights reserved.
+ *
+ */
+
+define([
+ 'core',
+ 'documenteditor/main/app/view/FormsTab'
+], function () {
+ 'use strict';
+
+ DE.Controllers.FormsTab = Backbone.Controller.extend(_.extend({
+ models : [],
+ collections : [
+ ],
+ views : [
+ 'FormsTab'
+ ],
+ sdkViewName : '#id_main',
+
+ initialize: function () {
+ },
+ onLaunch: function () {
+ this._state = {
+ prcontrolsdisable:undefined
+ };
+ },
+
+ setApi: function (api) {
+ if (api) {
+ this.api = api;
+ this.api.asc_registerCallback('asc_onFocusObject', this.onApiFocusObject.bind(this));
+ this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
+ Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
+ this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this));
+ this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
+ Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
+
+ // this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
+ // this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this));
+ }
+ return this;
+ },
+
+ setConfig: function(config) {
+ this.toolbar = config.toolbar;
+ this.view = this.createView('FormsTab', {
+ toolbar: this.toolbar.toolbar
+ });
+ this.addListeners({
+ 'FormsTab': {
+ 'forms:insert': this.onControlsSelect,
+ 'forms:new-color': this.onNewControlsColor,
+ 'forms:clear': this.onClearClick,
+ 'forms:no-color': this.onNoControlsColor,
+ 'forms:select-color': this.onSelectControlsColor,
+ 'forms:open-color': this.onColorsShow,
+ 'forms:mode': this.onModeClick
+ }
+ });
+ },
+
+ SetDisabled: function(state) {
+ this.view && this.view.SetDisabled(state);
+ },
+
+ getView: function(name) {
+ return !name && this.view ?
+ this.view : Backbone.Controller.prototype.getView.call(this, name);
+ },
+
+ onCoAuthoringDisconnect: function() {
+ this.SetDisabled(true);
+ },
+
+ onApiFocusObject: function(selectedObjects) {
+ if (!this.toolbar.editMode) return;
+
+ var pr, i = -1, type,
+ paragraph_locked = false,
+ header_locked = false;
+
+ while (++i < selectedObjects.length) {
+ type = selectedObjects[i].get_ObjectType();
+ pr = selectedObjects[i].get_ObjectValue();
+
+ if (type === Asc.c_oAscTypeSelectElement.Paragraph) {
+ paragraph_locked = pr.get_Locked();
+ } else if (type === Asc.c_oAscTypeSelectElement.Header) {
+ header_locked = pr.get_Locked();
+ }
+ }
+ var in_control = this.api.asc_IsContentControl();
+ var control_props = in_control ? this.api.asc_GetContentControlProperties() : null,
+ lock_type = (in_control&&control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
+ control_plain = (in_control&&control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false;
+ (lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked);
+ var content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
+ var need_disable = (paragraph_locked || header_locked || control_plain || content_locked);
+ if (this._state.prcontrolsdisable !== need_disable) {
+ this.view.btnTextField.setDisabled(need_disable);
+ this.view.btnComboBox.setDisabled(need_disable);
+ this.view.btnDropDown.setDisabled(need_disable);
+ this.view.btnCheckBox.setDisabled(need_disable);
+ this.view.btnRadioBox.setDisabled(need_disable);
+ this.view.btnImageField.setDisabled(need_disable);
+ this.view.btnTextField.setDisabled(need_disable);
+ this._state.prcontrolsdisable = need_disable;
+ }
+ },
+
+ onSendThemeColors: function() {
+ this._needUpdateColors = true;
+ },
+
+ updateThemeColors: function() {
+ var updateColors = function(picker, defaultColorIndex) {
+ if (picker) {
+ var clr;
+
+ var effectcolors = Common.Utils.ThemeColor.getEffectColors();
+ for (var i = 0; i < effectcolors.length; i++) {
+ if (typeof(picker.currentColor) == 'object' &&
+ clr === undefined &&
+ picker.currentColor.effectId == effectcolors[i].effectId)
+ clr = effectcolors[i];
+ }
+
+ picker.updateColors(effectcolors, Common.Utils.ThemeColor.getStandartColors());
+ if (picker.currentColor === undefined) {
+ picker.currentColor = effectcolors[defaultColorIndex];
+ } else if ( clr!==undefined ) {
+ picker.currentColor = clr;
+ }
+ }
+ };
+
+ this.view && this.view.mnuFormsColorPicker && updateColors(this.view.mnuFormsColorPicker, 1);
+ this.onChangeSpecialFormsGlobalSettings();
+ },
+
+ onChangeSpecialFormsGlobalSettings: function() {
+ if (this.view && this.view.mnuFormsColorPicker) {
+ var clr = this.api.asc_GetSpecialFormsHighlightColor(),
+ show = !!clr;
+ this.view.mnuNoFormsColor.setChecked(!show, true);
+ this.view.mnuFormsColorPicker.clearSelection();
+ if (clr) {
+ clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b());
+ this.view.mnuFormsColorPicker.selectByRGB(clr, true);
+ }
+ this.view.btnHighlight.currentColor = clr;
+ $('.btn-color-value-line', this.view.btnHighlight.cmpEl).css('background-color', clr ? '#' + clr : 'transparent');
+ }
+ },
+
+ onColorsShow: function(menu) {
+ this._needUpdateColors && this.updateThemeColors();
+ this._needUpdateColors = false;
+ },
+
+ onControlsSelect: function(type) {
+ if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl)) return;
+
+ var oPr,
+ oFormPr = new AscCommon.CSdtFormPr();
+ this.toolbar.toolbar.fireEvent('insertcontrol', this.toolbar.toolbar);
+ if (type == 'picture')
+ this.api.asc_AddContentControlPicture(oFormPr);
+ else if (type == 'checkbox' || type == 'radiobox') {
+ oPr = new AscCommon.CSdtCheckBoxPr();
+ (type == 'radiobox') && oPr.put_GroupKey('Group 1');
+ this.api.asc_AddContentControlCheckBox(oPr, oFormPr);
+ } else if (type == 'combobox' || type == 'dropdown')
+ this.api.asc_AddContentControlList(type == 'combobox', oPr, oFormPr);
+ else if (type == 'text') {
+ oPr = new AscCommon.CSdtTextFormPr();
+ this.api.asc_AddContentControlTextForm(oPr, oFormPr);
+ }
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
+ onModeClick: function(state) {
+ if (this.api) {
+ this.disableEditing(state);
+ this.api.asc_setRestriction(state ? Asc.c_oAscRestrictionType.OnlyForms : Asc.c_oAscRestrictionType.None);
+ }
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
+ onClearClick: function() {
+ if (this.api) {
+ this.api.asc_ClearAllSpecialForms();
+ }
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
+ onNewControlsColor: function() {
+ this.view.mnuFormsColorPicker.addNewColor();
+ },
+
+ onNoControlsColor: function(item) {
+ if (!item.isChecked())
+ this.api.asc_SetSpecialFormsHighlightColor(255, 192, 0);
+ else
+ this.api.asc_SetSpecialFormsHighlightColor();
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
+ onSelectControlsColor: function(color) {
+ var clr = Common.Utils.ThemeColor.getRgbColor(color);
+ if (this.api) {
+ this.api.asc_SetSpecialFormsHighlightColor(clr.get_r(), clr.get_g(), clr.get_b());
+ }
+ Common.NotificationCenter.trigger('edit:complete', this.toolbar);
+ },
+
+ disableEditing: function(disable) {
+ if (this._state.DisabledEditing != disable) {
+ this._state.DisabledEditing = disable;
+
+ var app = this.getApplication();
+ var rightMenuController = app.getController('RightMenu');
+ rightMenuController.getView('RightMenu').clearSelection();
+ rightMenuController.SetDisabled(disable);
+ app.getController('Toolbar').DisableToolbar(disable, false, false, true);
+ app.getController('Statusbar').getView('Statusbar').SetDisabled(disable);
+ app.getController('Common.Controllers.ReviewChanges').SetDisabled(disable);
+ app.getController('DocumentHolder').getView().SetDisabled(disable);
+ app.getController('Navigation') && app.getController('Navigation').SetDisabled(disable);
+ app.getController('LeftMenu').setPreviewMode(disable);
+ var comments = app.getController('Common.Controllers.Comments');
+ if (comments)
+ comments.setPreviewMode(disable);
+ if (this.view)
+ this.view.$el.find('.no-group-mask.form-view').css('opacity', 1);
+ }
+ },
+
+ onAppReady: function (config) {
+ var me = this;
+ (new Promise(function (accept, reject) {
+ accept();
+ })).then(function(){
+ if (config.canEditContentControl) {
+ var clr = me.api.asc_GetSpecialFormsHighlightColor();
+ clr && (clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b()));
+ me.view.btnHighlight.currentColor = clr;
+ }
+ });
+ }
+
+ }, DE.Controllers.FormsTab || {}));
+});
\ No newline at end of file
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 0d90807a3..860a60da3 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -1357,6 +1357,7 @@ define([
toolbarView.on('insertshape', _.bind(me.onInsertShape, me));
toolbarView.on('inserttextart', _.bind(me.onInsertTextArt, me));
toolbarView.on('insertchart', _.bind(me.onInsertChart, me));
+ toolbarView.on('insertcontrol', _.bind(me.onInsertControl, me));
}
var value = Common.localStorage.getItem('de-settings-unit');
@@ -2033,6 +2034,10 @@ define([
this.getApplication().getController('RightMenu').onInsertTextArt();
},
+ onInsertControl: function() {
+ this.getApplication().getController('RightMenu').onInsertControl();
+ },
+
unitsChanged: function(m) {
var value = Common.localStorage.getItem("de-settings-unit");
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js
index f33f7e4cf..d15dec586 100644
--- a/apps/documenteditor/main/app/controller/RightMenu.js
+++ b/apps/documenteditor/main/app/controller/RightMenu.js
@@ -80,6 +80,7 @@ define([
this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.MailMerge] = {panelId: "id-mail-merge-settings", panel: rightMenu.mergeSettings, btn: rightMenu.btnMailMerge, hidden: 1, props: {}, locked: false};
this._settings[Common.Utils.documentSettingsType.Signature] = {panelId: "id-signature-settings", panel: rightMenu.signatureSettings, btn: rightMenu.btnSignature, hidden: 1, props: {}, locked: false};
+ this._settings[Common.Utils.documentSettingsType.Form] = {panelId: "id-form-settings", panel: rightMenu.formSettings, btn: rightMenu.btnForm, hidden: 1, props: {}, locked: false};
},
setApi: function(api) {
@@ -124,6 +125,8 @@ define([
this._settings[Common.Utils.documentSettingsType.Signature].locked = false;
var isChart = false;
+ var control_props = this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
+ control_lock = false;
for (i=0; i
0)
diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js
index 6f8025a92..37bae74aa 100644
--- a/apps/documenteditor/main/app/controller/Toolbar.js
+++ b/apps/documenteditor/main/app/controller/Toolbar.js
@@ -790,11 +790,12 @@ define([
toolbar.btnContentControls.setDisabled(paragraph_locked || header_locked);
if (!(paragraph_locked || header_locked)) {
- var control_disable = control_plain || content_locked;
- for (var i=0; i<14; i++)
+ var control_disable = control_plain || content_locked,
+ if_form = control_props && control_props.get_FormPr();
+ for (var i=0; i<7; i++)
toolbar.btnContentControls.menu.items[i].setDisabled(control_disable);
- toolbar.btnContentControls.menu.items[15].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
- toolbar.btnContentControls.menu.items[17].setDisabled(!in_control);
+ toolbar.btnContentControls.menu.items[8].setDisabled(!in_control || lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked || if_form);
+ toolbar.btnContentControls.menu.items[10].setDisabled(!in_control || if_form);
}
var need_text_disable = paragraph_locked || header_locked || in_chart || rich_edit_lock || plain_edit_lock;
@@ -1905,6 +1906,7 @@ define([
oPr, oFormPr;
if (isnew) {
oFormPr = new AscCommon.CSdtFormPr();
+ this.toolbar.fireEvent('insertcontrol', this.toolbar);
}
if (item.value == 'plain' || item.value == 'rich')
this.api.asc_AddContentControl((item.value=='plain') ? Asc.c_oAscSdtLevelType.Inline : Asc.c_oAscSdtLevelType.Block);
@@ -2967,27 +2969,36 @@ define([
this.DisableToolbar(true, true);
},
- DisableToolbar: function(disable, viewMode, reviewmode) {
+ DisableToolbar: function(disable, viewMode, reviewmode, fillformmode) {
if (viewMode!==undefined) this.editMode = !viewMode;
disable = disable || !this.editMode;
var toolbar_mask = $('.toolbar-mask'),
group_mask = $('.toolbar-group-mask'),
- mask = reviewmode ? group_mask : toolbar_mask;
+ mask = (reviewmode || fillformmode) ? group_mask : toolbar_mask;
if (disable && mask.length>0 || !disable && mask.length==0) return;
var toolbar = this.toolbar;
if(disable) {
if (reviewmode) {
- mask = $("
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/documenteditor/main/app/view/ControlSettingsDialog.js b/apps/documenteditor/main/app/view/ControlSettingsDialog.js
index d013b740a..863793b91 100644
--- a/apps/documenteditor/main/app/view/ControlSettingsDialog.js
+++ b/apps/documenteditor/main/app/view/ControlSettingsDialog.js
@@ -313,7 +313,8 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
step: .1,
width: 80,
defaultUnit : "cm",
- value: '3 cm',
+ value: 'Auto',
+ allowAuto: true,
maxValue: 55.88,
minValue: 0.1
});
@@ -550,7 +551,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
this.spnMaxChars.setValue(val && val>=0 ? val : 10);
val = formTextPr.get_Width();
- this.spnWidth.setValue(val ? val : '', true);
+ this.spnWidth.setValue(val!==0 && val!==undefined ? Common.Utils.Metric.fnRecalcFromMM(val * 25.4 / 20 / 72.0) : -1, true);
}
if ((type == Asc.c_oAscContentControlSpecificType.CheckBox || type == Asc.c_oAscContentControlSpecificType.Picture) && !formPr ) {// standart checkbox or picture
@@ -563,7 +564,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
var props = new AscCommon.CContentControlPr();
props.put_Alias(this.txtName.getValue());
props.put_Tag(this.txtTag.getValue());
- props.put_PlaceholderText(this.txtPlaceholder.getValue());
+ props.put_PlaceholderText(this.txtPlaceholder.getValue() || ' ');
props.put_Appearance(this.cmbShow.getValue());
if (this.isSystemColor) {
@@ -639,8 +640,12 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
if (this.btnsCategory[5].isVisible()) {
var formTextPr = new AscCommon.CSdtTextFormPr();
- if (this.spnWidth.getValue())
- formTextPr.put_Width(this.spnWidth.getNumberValue());
+ if (this.spnWidth.getValue()) {
+ var value = this.spnWidth.getNumberValue();
+ formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4));
+ } else
+ formTextPr.put_Width(0);
+
if (this.placeholder && this.placeholder.changed) {
formTextPr.put_PlaceHolderSymbol(this.placeholder.code);
formTextPr.put_PlaceHolderFont(this.placeholder.font);
@@ -650,7 +655,7 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
var checked = (this.chMaxChars.getValue()=='checked' || this.chComb.getValue()=='checked');
formTextPr.put_MaxCharacters(checked);
if (checked)
- formTextPr.put_MaxCharacters(this.spnMaxChars.getNumberValue() || 12);
+ formTextPr.put_MaxCharacters(this.spnMaxChars.getNumberValue() || 10);
props.put_TextFormPr(formTextPr);
}
diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js
index 68cc1e0f9..b5e1e7163 100644
--- a/apps/documenteditor/main/app/view/DocumentHolder.js
+++ b/apps/documenteditor/main/app/view/DocumentHolder.js
@@ -491,20 +491,24 @@ define([
var showPoint, ToolTip,
type = moveData.get_Type();
- if (type==1 || type==3) { // 1 - hyperlink, 3 - footnote
+ if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink || type==Asc.c_oAscMouseMoveDataTypes.Footnote || type==Asc.c_oAscMouseMoveDataTypes.Form) { // 1 - hyperlink, 3 - footnote
if (isTooltipHiding) {
mouseMoveData = moveData;
return;
}
- if (type==1) {
+ if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) {
var hyperProps = moveData.get_Hyperlink();
if (!hyperProps) return;
ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
- } else {
+ } else if (type == Asc.c_oAscMouseMoveDataTypes.Footnote) {
ToolTip = moveData.get_FootnoteText();
if (ToolTip.length>1000)
ToolTip = ToolTip.substr(0, 1000) + '...';
+ } else if (type==Asc.c_oAscMouseMoveDataTypes.Form) {
+ ToolTip = moveData.get_FormHelpText();
+ if (ToolTip.length>1000)
+ ToolTip = ToolTip.substr(0, 1000) + '...';
}
var recalc = false;
@@ -513,7 +517,7 @@ define([
ToolTip = Common.Utils.String.htmlEncode(ToolTip);
if (screenTip.tipType !== type || screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) {
- screenTip.toolTip.setTitle((type==1) ? (ToolTip + '
' + me.txtPressLink + '') : ToolTip);
+ screenTip.toolTip.setTitle((type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) ? (ToolTip + '
' + me.txtPressLink + '') : ToolTip);
screenTip.tipLength = ToolTip.length;
screenTip.strTip = ToolTip;
screenTip.tipType = type;
@@ -547,7 +551,7 @@ define([
screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'});
}
/** coauthoring begin **/
- else if (moveData.get_Type()==2 && me.mode.isEdit) { // 2 - locked object
+ else if (moveData.get_Type()==Asc.c_oAscMouseMoveDataTypes.LockedObject && me.mode.isEdit) { // 2 - locked object
var src;
if (me.usertipcount >= me.usertips.length) {
src = $(document.createElement("div"));
@@ -2793,13 +2797,14 @@ define([
});
var menuTableRemoveControl = new Common.UI.MenuItem({
+ iconCls: 'menu__icon cc-remove',
caption: me.textRemove,
value: 'remove'
}).on('click', _.bind(me.onControlsSelect, me));
var menuTableControlSettings = new Common.UI.MenuItem({
- caption: me.textSettings,
- value: 'settings'
+ caption: me.textSettings,
+ value: 'settings'
}).on('click', _.bind(me.onControlsSelect, me));
var menuTableControl = new Common.UI.MenuItem({
@@ -3229,9 +3234,11 @@ define([
menuTableControl.setVisible(in_control);
if (in_control) {
var control_props = me.api.asc_GetContentControlProperties(),
- lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
+ lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
+ is_form = control_props && control_props.get_FormPr();
menuTableRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
- menuTableControlSettings.setVisible(me.mode.canEditContentControl);
+ menuTableRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl);
+ menuTableControlSettings.setVisible(me.mode.canEditContentControl && !is_form);
var spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None;
control_lock = control_lock || spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
@@ -3676,6 +3683,7 @@ define([
});
var menuParaRemoveControl = new Common.UI.MenuItem({
+ iconCls: 'menu__icon cc-remove',
caption: me.textRemoveControl,
value: 'remove'
}).on('click', _.bind(me.onControlsSelect, me));
@@ -3908,14 +3916,16 @@ define([
!value.paraProps.value.can_DeleteInlineContentControl() || !value.paraProps.value.can_EditInlineContentControl()) : false;
var in_toc = me.api.asc_GetTableOfContentsPr(true),
- in_control = !in_toc && me.api.asc_IsContentControl() ;
+ in_control = !in_toc && me.api.asc_IsContentControl(),
+ control_props = in_control ? me.api.asc_GetContentControlProperties() : null,
+ is_form = control_props && control_props.get_FormPr();
menuParaRemoveControl.setVisible(in_control);
- menuParaControlSettings.setVisible(in_control && me.mode.canEditContentControl);
+ menuParaControlSettings.setVisible(in_control && me.mode.canEditContentControl && !is_form);
menuParaControlSeparator.setVisible(in_control);
if (in_control) {
- var control_props = me.api.asc_GetContentControlProperties(),
- lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
+ var lock_type = (control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
menuParaRemoveControl.setDisabled(lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.SdtLocked);
+ menuParaRemoveControl.setCaption(is_form ? me.getControlLabel(control_props) : me.textRemoveControl);
var spectype = control_props ? control_props.get_SpecificType() : Asc.c_oAscContentControlSpecificType.None;
control_lock = control_lock || spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.Picture ||
@@ -4236,6 +4246,7 @@ define([
var type = obj.type,
props = obj.pr,
specProps = (type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.get_ComboBoxPr() : props.get_DropDownListPr(),
+ isForm = !!props.get_FormPr(),
menu = this.listControlMenu,
menuContainer = menu ? this.cmpEl.find(Common.Utils.String.format('#menu-container-{0}', menu.id)) : null,
me = this;
@@ -4272,14 +4283,25 @@ define([
});
}
if (specProps) {
+ if (isForm){ // for dropdown and combobox form control always add placeholder item
+ menu.addItem(new Common.UI.MenuItem({
+ caption : props.get_PlaceholderText(),
+ value : '',
+ template : _.template([
+ '
opacity: 0.6 <% } %>">',
+ '<%= caption %>',
+ ''
+ ].join(''))
+ }));
+ }
var count = specProps.get_ItemsCount();
for (var i=0; i
'].join('')),
+ itemTemplate: _.template([
+ '
',
+ // '
<%= name %>
',
+ '
<%= name %>
',
+ '
'
+ ].join(''))
+ });
+ this.list.on('item:select', _.bind(this.onSelectItem, this));
+ this.lockedControls.push(this.list);
+
+ this.btnListAdd = new Common.UI.Button({
+ parentEl: $markup.findById('#form-list-add'),
+ cls: 'btn-toolbar',
+ iconCls: 'toolbar__icon btn-zoomup',
+ hint: this.textTipAdd
+ });
+ this.btnListAdd.on('click', _.bind(this.onAddItem, this));
+ this.lockedControls.push(this.btnListAdd);
+
+ this.btnListDelete = new Common.UI.Button({
+ parentEl: $markup.findById('#form-list-delete'),
+ cls: 'btn-toolbar',
+ iconCls: 'toolbar__icon cc-remove',
+ hint: this.textTipDelete
+ });
+ this.btnListDelete.on('click', _.bind(this.onDeleteItem, this));
+ this.lockedControls.push(this.btnListDelete);
+
+ this.btnListUp = new Common.UI.Button({
+ parentEl: $markup.findById('#form-list-up'),
+ cls: 'btn-toolbar',
+ iconCls: 'toolbar__icon btn-arrow-up',
+ hint: this.textTipUp
+ });
+ this.btnListUp.on('click', _.bind(this.onMoveItem, this, true));
+ this.lockedControls.push(this.btnListUp);
+
+ this.btnListDown = new Common.UI.Button({
+ parentEl: $markup.findById('#form-list-down'),
+ cls: 'btn-toolbar',
+ iconCls: 'toolbar__icon btn-arrow-down',
+ hint: this.textTipDown
+ });
+ this.btnListDown.on('click', _.bind(this.onMoveItem, this, false));
+ this.lockedControls.push(this.btnListDown);
+
+ // image props
+ this.btnSelectImage = new Common.UI.Button({
+ parentEl: $('#form-button-replace'),
+ cls: 'btn-text-menu-default',
+ caption: this.textSelectImage,
+ style: "width:100%;",
+ menu: new Common.UI.Menu({
+ style: 'min-width: 194px;',
+ maxHeight: 200,
+ items: [
+ {caption: this.textFromFile, value: 0},
+ {caption: this.textFromUrl, value: 1},
+ {caption: this.textFromStorage, value: 2}
+ ]
+ })
+ });
+ this.lockedControls.push(this.btnSelectImage);
+ this.btnSelectImage.menu.on('item:click', _.bind(this.onImageSelect, this));
+ this.btnSelectImage.menu.items[2].setVisible(this.mode.canRequestInsertImage || this.mode.fileChoiceUrl && this.mode.fileChoiceUrl.indexOf("{documentType}")>-1);
+
+ this.btnRemForm = new Common.UI.Button({
+ parentEl: $markup.findById('#form-btn-delete'),
+ cls : 'btn-toolbar',
+ iconCls : 'toolbar__icon cc-remove',
+ caption : this.textDelete,
+ style : 'text-align: left;'
+ });
+ this.btnRemForm.on('click', _.bind(function(btn){
+ this.api.asc_RemoveContentControlWrapper(this._state.id);
+ }, this));
+ this.lockedControls.push(this.btnRemForm);
+
+ this.btnLockForm = new Common.UI.Button({
+ parentEl: $markup.findById('#form-btn-lock'),
+ cls : 'btn-toolbar',
+ iconCls : 'toolbar__icon btn-lock',
+ caption : this.textLock,
+ style : 'text-align: left;'
+ });
+ this.btnLockForm.on('click', _.bind(function(btn){
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ props.put_Lock(!this._state.LockDelete ? Asc.c_oAscSdtLockType.SdtLocked : Asc.c_oAscSdtLockType.Unlocked);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ }
+ }, this));
+
+ this.updateMetricUnit();
+ this.UpdateThemeColors();
+ },
+
+ setApi: function(api) {
+ this.api = api;
+ if (this.api) {
+ // this.api.asc_registerCallback('asc_onParaSpacingLine', _.bind(this._onLineSpacing, this));
+ }
+ return this;
+ },
+
+ setMode: function(mode) {
+ this.mode = mode;
+ },
+
+ onKeyChanged: function(combo, record) {
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formPr = this._originalFormProps || new AscCommon.CSdtFormPr();
+ formPr.put_Key(record.value);
+ props.put_FormPr(formPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onPlaceholderChanged: function(input, newValue, oldValue, e) {
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ props.put_PlaceholderText(newValue || ' ');
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onHelpChanged: function(input, newValue, oldValue, e) {
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formPr = this._originalFormProps || new AscCommon.CSdtFormPr();
+ formPr.put_HelpText(newValue);
+ props.put_FormPr(formPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onChMaxCharsChanged: function(field, newValue, oldValue, eOpts){
+ var checked = (field.getValue()=='checked');
+ this.spnMaxChars.setDisabled(!checked);
+ if (!checked) {
+ this.chComb.setValue(false, true);
+ this.spnWidth.setDisabled(true);
+ }
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
+ (!checked) && formTextPr.put_Comb(checked);
+ formTextPr.put_MaxCharacters(checked ? (this.spnMaxChars.getNumberValue() || 10) : checked);
+ props.put_TextFormPr(formTextPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onMaxCharsChange: function(field, newValue, oldValue, eOpts){
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
+ var checked = (this.chMaxChars.getValue()=='checked' || this.chComb.getValue()=='checked');
+ formTextPr.put_MaxCharacters(checked ? (field.getNumberValue() || 10) : checked);
+ props.put_TextFormPr(formTextPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onChCombChanged: function(field, newValue, oldValue, eOpts){
+ var checked = (field.getValue()=='checked');
+ if (checked) {
+ this.chMaxChars.setValue(true, true);
+ this.spnMaxChars.setDisabled(false);
+ }
+ this.spnWidth.setDisabled(!checked);
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
+ formTextPr.put_Comb(checked);
+ if (checked) {
+ formTextPr.put_MaxCharacters(this.spnMaxChars.getNumberValue() || 10);
+ if (this.spnWidth.getValue()) {
+ var value = this.spnWidth.getNumberValue();
+ formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4));
+ } else
+ formTextPr.put_Width(0);
+ }
+ props.put_TextFormPr(formTextPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onWidthChange: function(field, newValue, oldValue, eOpts){
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
+ if (this.spnWidth.getValue()) {
+ var value = this.spnWidth.getNumberValue();
+ formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4));
+ } else
+ formTextPr.put_Width(0);
+
+ props.put_TextFormPr(formTextPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ onGroupKeyChanged: function(combo, record) {
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var specProps = this._originalCheckProps || new AscCommon.CSdtCheckBoxPr();
+ specProps.put_GroupKey(record.value);
+ props.put_CheckBoxPr(specProps);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ fillListProps: function() {
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var specProps = this._originalListProps || new AscCommon.CSdtComboBoxPr();
+ specProps.clear();
+ this.list.store.each(function (item, index) {
+ specProps.add_Item(item.get('name'), item.get('value'));
+ });
+ (this.type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.put_ComboBoxPr(specProps) : props.put_DropDownListPr(specProps);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ }
+ },
+
+ onAddItem: function() {
+ var store = this.list.store,
+ value = this.txtNewValue.getValue();
+ if (value!=='') {
+ var rec = store.findWhere({value: value});
+ if (!rec) {
+ store.add({value: value, name: value});
+ this.fillListProps();
+ }
+ }
+ this.fireEvent('editcomplete', this);
+ },
+
+ onDeleteItem: function(btn, eOpts){
+ var rec = this.list.getSelectedRec();
+ if (rec) {
+ var store = this.list.store;
+ store.remove(rec);
+ this.fillListProps();
+ }
+ this.fireEvent('editcomplete', this);
+ },
+
+ onMoveItem: function(up) {
+ var store = this.list.store,
+ length = store.length,
+ rec = this.list.getSelectedRec();
+ if (rec) {
+ var index = store.indexOf(rec);
+ store.add(store.remove(rec), {at: up ? Math.max(0, index-1) : Math.min(length-1, index+1)});
+ this.fillListProps();
+ }
+ this.fireEvent('editcomplete', this);
+ },
+
+ setImageUrl: function(url, token) {
+ this.api.asc_SetContentControlPictureUrl(url, this.internalId, token);
+ },
+
+ insertImageFromStorage: function(data) {
+ if (data && data.url && data.c=='control') {
+ this.setImageUrl(data.url, data.token);
+ }
+ },
+
+ onImageSelect: function(menu, item) {
+ if (item.value==1) {
+ var me = this;
+ (new Common.Views.ImageFromUrlDialog({
+ handler: function(result, value) {
+ if (result == 'ok') {
+ if (me.api) {
+ var checkUrl = value.replace(/ /g, '');
+ if (!_.isEmpty(checkUrl)) {
+ me.setImageUrl(checkUrl);
+ }
+ }
+ }
+ me.fireEvent('editcomplete', me);
+ }
+ })).show();
+ } else if (item.value==2) {
+ Common.NotificationCenter.trigger('storage:image-load', 'control');
+ } else {
+ if (this._isFromFile) return;
+ this._isFromFile = true;
+ if (this.api) this.api.asc_addImage(this._originalProps);
+ this.fireEvent('editcomplete', this);
+ this._isFromFile = false;
+ }
+ },
+
+ onColorPickerSelect: function(btn, color) {
+ this.BorderColor = color;
+ this._state.BorderColor = this.BorderColor;
+
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
+ if (color == 'transparent') {
+ formTextPr.put_CombBorder();
+ } else {
+ var brd = formTextPr.get_CombBorder();
+ if (!brd)
+ brd = new Asc.asc_CTextBorder();
+ brd.put_Value(1);
+ brd.put_Color(Common.Utils.ThemeColor.getRgbColor(color));
+ formTextPr.put_CombBorder(brd);
+ }
+ props.put_TextFormPr(formTextPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
+ ChangeSettings: function(props) {
+ if (this._initSettings)
+ this.createDelayedElements();
+
+ if (props) {
+ this._originalProps = props;
+
+ this._noApply = true;
+
+ this.internalId = props.get_InternalId();
+
+ var val = props.get_PlaceholderText();
+ if (this._state.placeholder !== val) {
+ this.txtPlaceholder.setValue(val ? val : '');
+ this._state.placeholder = val;
+ }
+
+ val = props.get_Lock();
+ (val===undefined) && (val = Asc.c_oAscSdtLockType.Unlocked);
+ if (this._state.LockDelete !== (val==Asc.c_oAscSdtLockType.SdtContentLocked || val==Asc.c_oAscSdtLockType.SdtLocked)) {
+ this._state.LockDelete = (val==Asc.c_oAscSdtLockType.SdtContentLocked || val==Asc.c_oAscSdtLockType.SdtLocked);
+ this.btnLockForm.setCaption(this._state.LockDelete ? this.textUnlock : this.textLock);
+ }
+ this.disableControls(this._locked);
+
+ var type = props.get_SpecificType();
+ var specProps;
+ //for list controls
+ if (type == Asc.c_oAscContentControlSpecificType.ComboBox || type == Asc.c_oAscContentControlSpecificType.DropDownList) {
+ this.labelFormName.text(type == Asc.c_oAscContentControlSpecificType.ComboBox ? this.textCombobox : this.textDropDown);
+ specProps = (type == Asc.c_oAscContentControlSpecificType.ComboBox) ? props.get_ComboBoxPr() : props.get_DropDownListPr();
+ if (specProps) {
+ this._originalListProps = specProps;
+ var count = specProps.get_ItemsCount();
+ var arr = [];
+ for (var i=0; i
0.1) {
+ this.spnWidth.setValue(val!==0 && val!==undefined ? Common.Utils.Metric.fnRecalcFromMM(val * 25.4 / 20 / 72.0) : -1, true);
+ this._state.Width=val;
+ }
+
+ val = this.api.asc_GetTextFormAutoWidth();
+ if ( (this._state.WidthPlaceholder!==val) || Math.abs(this._state.WidthPlaceholder-val)>0.01) {
+ this.spnWidth.setDefaultValue(val!==undefined && val!==null ? Common.Utils.Metric.fnRecalcFromMM(val) : this.spnWidth.options.minValue);
+ this._state.WidthPlaceholder=val;
+ }
+
+ val = formTextPr.get_MaxCharacters();
+ this.chMaxChars.setValue(val && val>=0);
+ this.spnMaxChars.setDisabled(!val || val<0);
+ this.spnMaxChars.setValue(val && val>=0 ? val : 10);
+
+ var brd = formTextPr.get_CombBorder();
+ if (brd) {
+ var color = brd.get_Color();
+ if (color) {
+ if (color.get_type() == Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
+ this.BorderColor = {color: Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b()), effectValue: color.get_value() };
+ } else {
+ this.BorderColor = Common.Utils.ThemeColor.getHexColor(color.get_r(), color.get_g(), color.get_b());
+ }
+ } else
+ this.BorderColor = 'transparent';
+ } else
+ this.BorderColor = 'transparent';
+
+ var type1 = typeof(this.BorderColor),
+ type2 = typeof(this._state.BorderColor);
+ if ( (type1 !== type2) || (type1=='object' &&
+ (this.BorderColor.effectValue!==this._state.BorderColor.effectValue || this._state.BorderColor.color.indexOf(this.BorderColor.color)<0)) ||
+ (type1!='object' && this._state.BorderColor.indexOf(this.BorderColor)<0 )) {
+
+ this.btnColor.setColor(this.BorderColor);
+ this.mnuColorPicker.clearSelection();
+ this.mnuColorPicker.selectByRGB(typeof(this.BorderColor) == 'object' ? this.BorderColor.color : this.BorderColor,true);
+ this._state.BorderColor = this.BorderColor;
+ }
+ }
+
+ this._noApply = false;
+
+ if (this.type !== type || type == Asc.c_oAscContentControlSpecificType.CheckBox)
+ this.showHideControls(type, formTextPr, specProps);
+ this.type = type;
+ }
+ },
+
+ updateMetricUnit: function() {
+ if (this.spinners) {
+ for (var i=0; i ')},
+ {template: _.template('')}
+ ]
+ }));
+ me.mnuFormsColorPicker = new Common.UI.ThemeColorPalette({
+ el: $('#id-toolbar-menu-form-color')
+ });
+ var colorVal = $('