From 63b6a5934246d86d3b5983156b722ab33a5bd046 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 6 Apr 2016 16:38:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B0=20=D0=BB=D0=BE=D0=BA=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B5=D0=B4=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=20=D0=B8=D0=B7=D0=BC=D0=B5=D1=80=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=20(Cm,=20Pt).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/lib/component/ComboBorderSize.js | 31 ++++++++++--------- .../main/lib/component/MetricSpinner.js | 20 ++++++------ .../main/lib/controller/ReviewChanges.js | 16 +++++----- apps/common/main/lib/util/utils.js | 22 +++++++++---- .../main/app/controller/Main.js | 10 +++--- .../main/app/view/ChartSettings.js | 8 ++--- .../main/app/view/DropcapSettingsAdvanced.js | 22 ++++++------- .../main/app/view/HeaderFooterSettings.js | 2 +- .../main/app/view/ImageSettings.js | 12 +++---- .../main/app/view/ImageSettingsAdvanced.js | 2 +- .../main/app/view/PageMarginsDialog.js | 2 +- .../main/app/view/PageSizeDialog.js | 2 +- .../main/app/view/ParagraphSettings.js | 4 +-- .../app/view/ParagraphSettingsAdvanced.js | 6 ++-- .../main/app/view/ShapeSettings.js | 11 ++++--- .../main/app/view/TableSettingsAdvanced.js | 10 +++--- .../main/app/view/TextArtSettings.js | 11 ++++--- apps/documenteditor/main/app/view/Toolbar.js | 8 ++--- apps/documenteditor/main/locale/en.json | 2 ++ apps/documenteditor/main/locale/ru.json | 2 ++ .../main/app/view/ChartSettings.js | 2 +- .../main/app/view/ImageSettings.js | 12 +++---- .../main/app/view/ImageSettingsAdvanced.js | 2 +- .../main/app/view/ParagraphSettings.js | 4 +-- .../app/view/ParagraphSettingsAdvanced.js | 6 ++-- .../main/app/view/ShapeSettings.js | 11 ++++--- .../main/app/view/ShapeSettingsAdvanced.js | 2 +- .../main/app/view/SlideSettings.js | 7 +++-- .../main/app/view/SlideSizeSettings.js | 2 +- .../main/app/view/TableSettingsAdvanced.js | 2 +- .../main/app/view/TextArtSettings.js | 11 ++++--- apps/presentationeditor/main/locale/en.json | 3 ++ apps/presentationeditor/main/locale/ru.json | 3 ++ .../main/app/controller/DocumentHolder.js | 5 +-- .../main/app/view/ChartSettings.js | 2 +- .../main/app/view/FileMenuPanels.js | 2 +- .../main/app/view/ImageSettings.js | 2 +- .../main/app/view/ParagraphSettings.js | 4 +-- .../app/view/ParagraphSettingsAdvanced.js | 6 ++-- .../main/app/view/PrintSettings.js | 2 +- .../main/app/view/ShapeSettings.js | 11 ++++--- .../main/app/view/ShapeSettingsAdvanced.js | 2 +- .../main/app/view/TextArtSettings.js | 11 ++++--- apps/spreadsheeteditor/main/locale/en.json | 3 ++ apps/spreadsheeteditor/main/locale/ru.json | 3 ++ 45 files changed, 186 insertions(+), 137 deletions(-) diff --git a/apps/common/main/lib/component/ComboBorderSize.js b/apps/common/main/lib/component/ComboBorderSize.js index 455abc63f6..86a7f6f2a9 100644 --- a/apps/common/main/lib/component/ComboBorderSize.js +++ b/apps/common/main/lib/component/ComboBorderSize.js @@ -94,18 +94,20 @@ define([ ].join('')), initialize : function(options) { + var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt); + Common.UI.ComboBox.prototype.initialize.call(this, _.extend({ editable: false, store: new Common.UI.BordersStore(), data: [ {displayValue: this.txtNoBorders, value: 0, pxValue: 0 }, - {displayValue: '0.5 pt', value: 0.5, pxValue: 0.5, offsety: 0}, - {displayValue: '1 pt', value: 1, pxValue: 1, offsety: 20}, - {displayValue: '1.5 pt', value: 1.5, pxValue: 2, offsety: 40}, - {displayValue: '2.25 pt', value: 2.25,pxValue: 3, offsety: 60}, - {displayValue: '3 pt', value: 3, pxValue: 4, offsety: 80}, - {displayValue: '4.5 pt', value: 4.5, pxValue: 5, offsety: 100}, - {displayValue: '6 pt', value: 6, pxValue: 6, offsety: 120} + {displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0}, + {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20}, + {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40}, + {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, offsety: 60}, + {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80}, + {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100}, + {displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120} ], menuStyle: 'min-width: 150px;' }, options)); @@ -187,19 +189,20 @@ define([ initialize : function(options) { this.txtNoBorders = options.txtNoBorders || this.txtNoBorders; + var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt); Common.UI.ComboBox.prototype.initialize.call(this, _.extend({ editable: true, store: new Common.UI.BordersStore(), data: [ {displayValue: this.txtNoBorders, value: 0, pxValue: 0 }, - {displayValue: '0.5 pt', value: 0.5, pxValue: 0.5, offsety: 0}, - {displayValue: '1 pt', value: 1, pxValue: 1, offsety: 20}, - {displayValue: '1.5 pt', value: 1.5, pxValue: 2, offsety: 40}, - {displayValue: '2.25 pt', value: 2.25,pxValue: 3, offsety: 60}, - {displayValue: '3 pt', value: 3, pxValue: 4, offsety: 80}, - {displayValue: '4.5 pt', value: 4.5, pxValue: 5, offsety: 100}, - {displayValue: '6 pt', value: 6, pxValue: 6, offsety: 120} + {displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0}, + {displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20}, + {displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40}, + {displayValue: '2.25 ' + txtPt, value: 2.25,pxValue: 3, offsety: 60}, + {displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80}, + {displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100}, + {displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120} ], menuStyle: 'min-width: 150px;' }, options)); diff --git a/apps/common/main/lib/component/MetricSpinner.js b/apps/common/main/lib/component/MetricSpinner.js index 6dbc8f8f40..4b86614b9f 100644 --- a/apps/common/main/lib/component/MetricSpinner.js +++ b/apps/common/main/lib/component/MetricSpinner.js @@ -58,7 +58,7 @@ * * * @property {String} defaultUnit - * Name of the unit of measurement. Can be px|em|%|en|ex|pt|in|cm|mm|pc|s|ms. + * Name of the unit of measurement. Can be px|em|%|en|ex|pt|in|cm|mm|pc|s|ms|см|мм|пт|сек|мс. * * defaultUnit: 'px', * @@ -262,7 +262,7 @@ define([ var units = this.options.defaultUnit; if ( typeof value.match !== 'undefined'){ - var searchUnits = value.match(/(px|em|%|en|ex|pt|in|cm|mm|pc|s|ms)$/i); + var searchUnits = value.match(/(px|em|%|en|ex|pt|in|cm|mm|pc|s|ms|см|мм|пт|сек|мс)$/i); if (null !== searchUnits && searchUnits[0]!=='undefined') { units = searchUnits[0].toLowerCase(); } @@ -482,25 +482,25 @@ define([ }, _recalcUnits: function(value, fromUnit){ - if ( fromUnit.match(/(s|ms)$/i) && this.options.defaultUnit.match(/(s|ms)$/i) ) { + if ( fromUnit.match(/(s|ms|сек|мс)$/i) && this.options.defaultUnit.match(/(s|ms|сек|мс)$/i) ) { var v_out = value; // to sec - if (fromUnit=='ms') + if (fromUnit=='ms' || fromUnit=='мс') v_out = v_out/1000.; // from sec - if (this.options.defaultUnit=='ms') + if (this.options.defaultUnit=='ms' || this.options.defaultUnit=='мс') v_out = v_out*1000; return v_out; } - if ( fromUnit.match(/(pt|in|cm|mm|pc)$/i)===null || this.options.defaultUnit.match(/(pt|in|cm|mm|pc)$/i)===null) + if ( fromUnit.match(/(pt|in|cm|mm|pc|см|мм|пт)$/i)===null || this.options.defaultUnit.match(/(pt|in|cm|mm|pc|см|мм|пт)$/i)===null) return value; var v_out = value; // to mm - if (fromUnit=='cm') + if (fromUnit=='cm' || fromUnit=='см') v_out = v_out*10; - else if (fromUnit=='pt') + else if (fromUnit=='pt' || fromUnit=='пт') v_out = v_out * 25.4 / 72.0; else if (fromUnit=='in') v_out = v_out * 25.4; @@ -508,9 +508,9 @@ define([ v_out = v_out * 25.4 / 6.0; // from mm - if (this.options.defaultUnit=='cm') + if (this.options.defaultUnit=='cm' || this.options.defaultUnit=='см') v_out = v_out/10.; - else if (this.options.defaultUnit=='pt') + else if (this.options.defaultUnit=='pt' || this.options.defaultUnit=='пт') v_out = parseFloat((v_out * 72.0 / 25.4).toFixed(3)); else if (this.options.defaultUnit=='in') v_out = v_out / 25.4; diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index 218b5e1742..11b41f0b1e 100644 --- a/apps/common/main/lib/controller/ReviewChanges.js +++ b/apps/common/main/lib/controller/ReviewChanges.js @@ -285,9 +285,9 @@ define([ if (value.Get_FontSize() !== undefined) proptext += (value.Get_FontSize() + ', '); if (value.Get_Spacing() !== undefined) - proptext += (me.textSpacing + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_Spacing()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ', '); + proptext += (me.textSpacing + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_Spacing()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); if (value.Get_Position() !== undefined) - proptext += (me.textPosition + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_Position()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ', '); + proptext += (me.textPosition + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_Position()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); if (value.Get_Lang() !== undefined) proptext += (Common.util.LanguageInfo.getLocalLanguageName(value.Get_Lang())[1] + ', '); @@ -303,11 +303,11 @@ define([ if (value.Get_ContextualSpacing()) proptext += ((value.Get_ContextualSpacing() ? me.textContextual : me.textNoContextual) + ', '); if (value.Get_IndLeft() !== undefined) - proptext += (me.textIndentLeft + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndLeft()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ', '); + proptext += (me.textIndentLeft + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndLeft()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); if (value.Get_IndRight() !== undefined) - proptext += (me.textIndentRight + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndRight()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ', '); + proptext += (me.textIndentRight + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndRight()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); if (value.Get_IndFirstLine() !== undefined) - proptext += (me.textFirstLine + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndFirstLine()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ', '); + proptext += (me.textFirstLine + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_IndFirstLine()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); if (value.Get_Jc() !== undefined) { switch (value.Get_Jc()) { case 0: @@ -334,16 +334,16 @@ define([ if (value.Get_SpacingLineRule() !== undefined && value.Get_SpacingLine() !== undefined) { proptext += me.textLineSpacing; proptext += (((value.Get_SpacingLineRule() == c_paragraphLinerule.LINERULE_LEAST) ? me.textAtLeast : ((value.Get_SpacingLineRule() == c_paragraphLinerule.LINERULE_AUTO) ? me.textMultiple : me.textExact)) + ' '); - proptext += (((value.Get_SpacingLineRule()==c_paragraphLinerule.LINERULE_AUTO) ? value.Get_SpacingLine() : Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingLine()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]) + ', '); + proptext += (((value.Get_SpacingLineRule()==c_paragraphLinerule.LINERULE_AUTO) ? value.Get_SpacingLine() : Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingLine()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName()) + ', '); } if (value.Get_SpacingBeforeAutoSpacing()) proptext += (me.textSpacingBefore + ' ' + me.textAuto +', '); else if (value.Get_SpacingBefore() !== undefined) - proptext += (me.textSpacingBefore + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingBefore()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ', '); + proptext += (me.textSpacingBefore + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingBefore()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); if (value.Get_SpacingAfterAutoSpacing()) proptext += (me.textSpacingAfter + ' ' + me.textAuto +', '); else if (value.Get_SpacingAfter() !== undefined) - proptext += (me.textSpacingAfter + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingAfter()).toFixed(2) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ', '); + proptext += (me.textSpacingAfter + ' ' + Common.Utils.Metric.fnRecalcFromMM(value.Get_SpacingAfter()).toFixed(2) + ' ' + Common.Utils.Metric.getCurrentMetricName() + ', '); if (value.Get_WidowControl()) proptext += ((value.Get_WidowControl() ? me.textWidow : me.textNoWidow) + ', '); if (value.Get_Tabs() !== undefined) diff --git a/apps/common/main/lib/util/utils.js b/apps/common/main/lib/util/utils.js index 9b9dff1fad..d865647700 100644 --- a/apps/common/main/lib/util/utils.js +++ b/apps/common/main/lib/util/utils.js @@ -38,7 +38,7 @@ if (Common.Utils === undefined) { Common.Utils = {}; } -Common.Utils = new(function() { +Common.Utils = _.extend(new(function() { var userAgent = navigator.userAgent.toLowerCase(), check = function(regex){ return regex.test(userAgent); @@ -164,7 +164,7 @@ Common.Utils = new(function() { hostnameStrongRe: hostnameStrongRe, documentSettingsType: documentSettingsType } -})(); +})(), Common.Utils || {}); Common.Utils.ThemeColor = new(function() { return { @@ -249,19 +249,21 @@ Common.Utils.ThemeColor = new(function() { } })(); -Common.Utils.Metric = new(function() { +Common.Utils.Metric = _.extend( new(function() { var me = this; me.c_MetricUnits = { cm: 0, pt: 1 }; + me.currentMetric = me.c_MetricUnits.pt; - me.metricName = ['cm', 'pt']; + me.metricName = ['Cm', 'Pt']; return { c_MetricUnits: me.c_MetricUnits, - metricName : me.metricName, + txtCm : 'cm', + txtPt : 'pt', setCurrentMetric: function(value) { me.currentMetric = value; @@ -271,6 +273,14 @@ Common.Utils.Metric = new(function() { return me.currentMetric; }, + getCurrentMetricName: function() { + return this['txt' + me.metricName[me.currentMetric]]; + }, + + getMetricName: function(unit) { + return this['txt' + me.metricName[(unit !== undefined) ? unit : 0]]; + }, + fnRecalcToMM: function(value) { // value in pt/cm. need to convert to mm if (value!==null && value!==undefined) { @@ -295,7 +305,7 @@ Common.Utils.Metric = new(function() { return value; } } -})(); +})(), Common.Utils.Metric || {}); Common.Utils.RGBColor = function(colorString) { var r, g, b; diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 15bfe10642..d0ef62a318 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -105,7 +105,10 @@ define([ return; } - var value = Common.localStorage.getItem("de-settings-fontrender"); + var value = Common.localStorage.getItem('de-settings-unit'); + Common.Utils.Metric.setCurrentMetric((value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm); + + value = Common.localStorage.getItem("de-settings-fontrender"); if (value === null) window.devicePixelRatio > 1 ? value = '1' : '0'; @@ -1047,10 +1050,7 @@ define([ toolbarView.on('insertchart', _.bind(me.onInsertChart, me)); } - var value = Common.localStorage.getItem('de-settings-unit'); - Common.Utils.Metric.setCurrentMetric((value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm); - - value = Common.localStorage.getItem('de-hidden-rulers'); + var value = Common.localStorage.getItem('de-hidden-rulers'); me.api.asc_SetViewRulers(value===null || parseInt(value) === 0); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); diff --git a/apps/documenteditor/main/app/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js index b0e94ffe55..ad602759c9 100644 --- a/apps/documenteditor/main/app/view/ChartSettings.js +++ b/apps/documenteditor/main/app/view/ChartSettings.js @@ -311,13 +311,13 @@ define([ value = props.get_Width(); if ( Math.abs(this._state.Width-value)>0.001 ) { - this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this._state.Width = value; } value = props.get_Height(); if ( Math.abs(this._state.Height-value)>0.001 ) { - this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this._state.Height = value; } } @@ -325,10 +325,10 @@ define([ updateMetricUnit: function() { var value = Common.Utils.Metric.fnRecalcFromMM(this._state.Width); - this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelWidth[0].innerHTML = this.textWidth + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); value = Common.Utils.Metric.fnRecalcFromMM(this._state.Height); - this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelHeight[0].innerHTML = this.textHeight + ': ' + value.toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); }, createDelayedElements: function() { diff --git a/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js b/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js index cbc7979137..25465be8e1 100644 --- a/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/DropcapSettingsAdvanced.js @@ -135,20 +135,20 @@ define([ }); }, this); - + var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt); this.cmbBorderSize = new Common.UI.ComboBorderSize({ el : $('#drop-advanced-input-bordersize'), style : 'width: 90px;', store : new Backbone.Collection(), data: [ {id: Common.UI.getId(), displayValue: this.txtNoBorders, value: 0, borderstyle: ''}, - {id: Common.UI.getId(), displayValue: '0.5 pt', value: 0.5, pxValue: 0.5, offsety: 0}, - {id: Common.UI.getId(), displayValue: '1 pt', value: 1, pxValue: 1, offsety: 20}, - {id: Common.UI.getId(), displayValue: '1.5 pt', value: 1.5, pxValue: 2, offsety: 40}, - {id: Common.UI.getId(), displayValue: '2.25 pt', value: 2.25, pxValue: 3, offsety: 60}, - {id: Common.UI.getId(), displayValue: '3 pt', value: 3, pxValue: 4, offsety: 80}, - {id: Common.UI.getId(), displayValue: '4.5 pt', value: 4.5, pxValue: 5, offsety: 100}, - {id: Common.UI.getId(), displayValue: '6 pt', value: 6, pxValue: 6, offsety: 120} + {id: Common.UI.getId(), displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0}, + {id: Common.UI.getId(), displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20}, + {id: Common.UI.getId(), displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40}, + {id: Common.UI.getId(), displayValue: '2.25 ' + txtPt, value: 2.25, pxValue: 3, offsety: 60}, + {id: Common.UI.getId(), displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80}, + {id: Common.UI.getId(), displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100}, + {id: Common.UI.getId(), displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120} ] }).on('selected', _.bind(function(combo, record) { this.BorderSize = {ptValue: record.value, pxValue: record.pxValue}; @@ -851,7 +851,7 @@ define([ me.spnX, me.spnY ], function(spinner) { - spinner.setDefaultUnit(Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]); + spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()); spinner.setStep(Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits.cm ? 0.1 : 1); }); }, @@ -902,7 +902,7 @@ define([ } } else { value = frame_props.get_X(); - this.cmbHAlign.setValue(Common.Utils.Metric.fnRecalcFromMM((value!==undefined) ? value : 0) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]); + this.cmbHAlign.setValue(Common.Utils.Metric.fnRecalcFromMM((value!==undefined) ? value : 0) + ' ' + Common.Utils.Metric.getCurrentMetricName()); } value = frame_props.get_VAnchor(); @@ -924,7 +924,7 @@ define([ } } else { value = frame_props.get_Y(); - this.cmbVAlign.setValue(Common.Utils.Metric.fnRecalcFromMM((value!==undefined) ? value : 0) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]); + this.cmbVAlign.setValue(Common.Utils.Metric.fnRecalcFromMM((value!==undefined) ? value : 0) + ' ' + Common.Utils.Metric.getCurrentMetricName()); } value = frame_props.get_Wrap(); diff --git a/apps/documenteditor/main/app/view/HeaderFooterSettings.js b/apps/documenteditor/main/app/view/HeaderFooterSettings.js index df5d135a63..74a8a18268 100644 --- a/apps/documenteditor/main/app/view/HeaderFooterSettings.js +++ b/apps/documenteditor/main/app/view/HeaderFooterSettings.js @@ -234,7 +234,7 @@ define([ if (this.spinners) { for (var i=0; i0.001 ) { - this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this._state.Width = value; } value = props.get_Height(); if ( Math.abs(this._state.Height-value)>0.001 ) { - this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this._state.Height = value; } @@ -278,8 +278,8 @@ define([ var w = imgsize.get_ImageWidth(); var h = imgsize.get_ImageHeight(); - this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; - this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); + this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); var properties = new CImgProperty(); properties.put_Width(w); diff --git a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js index 7a0cef060c..f606a42609 100644 --- a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js @@ -1248,7 +1248,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat if (this.spinners) { for (var i=0; i1584) { + var value = parseFloat(record.value), + expr = new RegExp('^\\s*(\\d*(\\.|,)?\\d+)\\s*(' + me.txtPt + ')?\\s*$'); + if (!(expr.exec(record.value)) || value<0 || value>1584) { this._state.StrokeType = this._state.StrokeWidth = -1; Common.UI.error({ msg: this.textBorderSizeErr, @@ -1483,7 +1486,7 @@ define([ if (this._state.StrokeType !== strokeType || strokeType == c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == c_oAscStrokeType.STROKE_COLOR ) { var w = stroke.get_width(); - var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !(/pt\s*$/.test(this.cmbBorderSize.getRawValue())); + var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !((new RegExp(this.txtPt + '\\s*$')).test(this.cmbBorderSize.getRawValue())); if ( Math.abs(this._state.StrokeWidth-w)>0.001 || check_value || (this._state.StrokeWidth===null || w===null)&&(this._state.StrokeWidth!==w)) { this._state.StrokeWidth = w; @@ -1497,7 +1500,7 @@ define([ if (_selectedItem) this.cmbBorderSize.selectRecord(_selectedItem); else { - this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' pt' : ''); + this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : ''); } this.BorderSize = w; } diff --git a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js index 878b9cfb48..517ba7dbea 100644 --- a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js @@ -184,7 +184,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this.cmbUnit.on('selected', _.bind(function(combo, record) { if (this._changedProps) { var maxwidth = Common.Utils.Metric.fnRecalcFromMM(558); - this.nfWidth.setDefaultUnit(record.value ? '%' : Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]); + this.nfWidth.setDefaultUnit(record.value ? '%' : Common.Utils.Metric.getCurrentMetricName()); this.nfWidth.setMaxValue(record.value ? parseFloat((100 * maxwidth/this.pageWidth).toFixed(2)) : maxwidth); this.nfWidth.setStep((record.value || Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.1); this.nfWidth.setValue((record.value) ? 100*this.nfWidth.getNumberValue()/this.pageWidth : this.pageWidth*this.nfWidth.getNumberValue()/100); @@ -477,7 +477,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this.cmbPrefWidthUnit.on('selected', _.bind(function(combo, record) { if (this._changedProps) { var maxwidth = Common.Utils.Metric.fnRecalcFromMM(558); - this.nfPrefWidth.setDefaultUnit(record.value ? '%' : Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]); + this.nfPrefWidth.setDefaultUnit(record.value ? '%' : Common.Utils.Metric.getCurrentMetricName()); this.nfPrefWidth.setMaxValue(record.value ? parseFloat((100 * maxwidth/this.pageWidth).toFixed(2)) : maxwidth); this.nfPrefWidth.setStep((record.value || Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.1); this.nfPrefWidth.setValue((record.value) ? 100*this.nfPrefWidth.getNumberValue()/this.pageWidth : this.pageWidth*this.nfPrefWidth.getNumberValue()/100); @@ -1170,7 +1170,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this.cmbUnit.store.at(0).set('displayValue', (Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits['pt']) ? this.txtPt : this.txtCm); this.cmbUnit.setValue(TableWidth<0 ? 1 : 0); - this.nfWidth.setDefaultUnit(TableWidth<0 ? '%' : Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]); + this.nfWidth.setDefaultUnit(TableWidth<0 ? '%' : Common.Utils.Metric.getCurrentMetricName()); if (TableWidth<0) //% this.nfWidth.setMaxValue(parseFloat((100 * Common.Utils.Metric.fnRecalcFromMM(558)/this.pageWidth).toFixed(2))); this.nfWidth.setStep((TableWidth<0 || Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.1); @@ -1234,7 +1234,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this.cmbPrefWidthUnit.store.at(0).set('displayValue', (Common.Utils.Metric.getCurrentMetric() == Common.Utils.Metric.c_MetricUnits['pt']) ? this.txtPt : this.txtCm); this.cmbPrefWidthUnit.setValue(cellWidth<0 ? 1 : 0); - this.nfPrefWidth.setDefaultUnit(cellWidth<0 ? '%' : Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]); + this.nfPrefWidth.setDefaultUnit(cellWidth<0 ? '%' : Common.Utils.Metric.getCurrentMetricName()); if (cellWidth<0) //% this.nfPrefWidth.setMaxValue(parseFloat((100 * Common.Utils.Metric.fnRecalcFromMM(558)/this.pageWidth).toFixed(2))); this.nfPrefWidth.setStep((cellWidth<0 || Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.1); @@ -2069,7 +2069,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat if (this.spinners) { for (var i=0; i1584) { + var value = parseFloat(record.value), + expr = new RegExp('^\\s*(\\d*(\\.|,)?\\d+)\\s*(' + me.txtPt + ')?\\s*$'); + if (!(expr.exec(record.value)) || value<0 || value>1584) { this._state.StrokeType = this._state.StrokeWidth = -1; Common.UI.error({ msg: this.textBorderSizeErr, @@ -985,7 +988,7 @@ define([ if (this._state.StrokeType !== strokeType || strokeType == c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == c_oAscStrokeType.STROKE_COLOR ) { var w = stroke.get_width(); - var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !(/pt\s*$/.test(this.cmbBorderSize.getRawValue())); + var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !((new RegExp(this.txtPt + '\\s*$')).test(this.cmbBorderSize.getRawValue())); if ( Math.abs(this._state.StrokeWidth-w)>0.001 || check_value || (this._state.StrokeWidth===null || w===null)&&(this._state.StrokeWidth!==w)) { this._state.StrokeWidth = w; @@ -999,7 +1002,7 @@ define([ if (_selectedItem) this.cmbBorderSize.selectRecord(_selectedItem); else { - this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' pt' : ''); + this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : ''); } this.BorderSize = w; } diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index e1e2573ab3..8410366cd0 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -686,10 +686,10 @@ define([ var pageMarginsTemplate = _.template('
<%= caption %>
' + '<% if (options.value !== null) { %>
' + - '' + - '
' + - ''+ - '
'+ + '' + + '
' + + ''+ + '
'+ '<% } %>
'); this.btnPageMargins = new Common.UI.Button({ diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 4cd7fc0e78..ba2c84852d 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -1,4 +1,6 @@ { + "Common.Utils.Metric.txtCm": "cm", + "Common.Utils.Metric.txtPt": "pt", "Common.Controllers.Chat.notcriticalErrorTitle": "Warning", "Common.Controllers.Chat.textEnterMessage": "Enter your message here", "Common.Controllers.Chat.textUserLimit": "You are using ONLYOFFICE Free Edition.
Only two users can co-edit the document simultaneously.
Want more? Consider buying ONLYOFFICE Enterprise Edition.
Read more", diff --git a/apps/documenteditor/main/locale/ru.json b/apps/documenteditor/main/locale/ru.json index 07f4a7bf43..a5e9344ebb 100644 --- a/apps/documenteditor/main/locale/ru.json +++ b/apps/documenteditor/main/locale/ru.json @@ -1,4 +1,6 @@ { + "Common.Utils.Metric.txtCm": "см", + "Common.Utils.Metric.txtPt": "пт", "Common.Controllers.Chat.notcriticalErrorTitle": "Предупреждение", "Common.Controllers.Chat.textEnterMessage": "Введите здесь своё сообщение", "Common.Controllers.Chat.textUserLimit": "Вы используете бесплатную версию ONLYOFFICE.
Только два пользователя одновременно могут совместно редактировать документ.
Требуется больше? Рекомендуем приобрести корпоративную версию ONLYOFFICE.
Читать дальше", diff --git a/apps/presentationeditor/main/app/view/ChartSettings.js b/apps/presentationeditor/main/app/view/ChartSettings.js index 44445c0b38..77dd87dfd0 100644 --- a/apps/presentationeditor/main/app/view/ChartSettings.js +++ b/apps/presentationeditor/main/app/view/ChartSettings.js @@ -319,7 +319,7 @@ define([ if (this.spinners) { for (var i=0; i0.001 ) { - this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this._state.Width = value; } value = props.get_Height(); if ( Math.abs(this._state.Height-value)>0.001 ) { - this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(value).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); this._state.Height = value; } @@ -166,8 +166,8 @@ define([ var w = imgsize.get_ImageWidth(); var h = imgsize.get_ImageHeight(); - this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; - this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]; + this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); + this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName(); var properties = new CImgProperty(); properties.put_Width(w); diff --git a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js index b68bc2257d..b7631a9f9b 100644 --- a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js @@ -233,7 +233,7 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem if (this.spinners) { for (var i=0; i1584) { + var value = parseFloat(record.value), + expr = new RegExp('^\\s*(\\d*(\\.|,)?\\d+)\\s*(' + me.txtPt + ')?\\s*$'); + if (!(expr.exec(record.value)) || value<0 || value>1584) { this._state.StrokeType = this._state.StrokeWidth = -1; Common.UI.error({ msg: this.textBorderSizeErr, @@ -1347,7 +1350,7 @@ define([ if (this._state.StrokeType !== strokeType || strokeType == c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == c_oAscStrokeType.STROKE_COLOR ) { var w = stroke.get_width(); - var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !(/pt\s*$/.test(this.cmbBorderSize.getRawValue())); + var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !((new RegExp(this.txtPt + '\\s*$')).test(this.cmbBorderSize.getRawValue())); if ( Math.abs(this._state.StrokeWidth-w)>0.001 || check_value || (this._state.StrokeWidth===null || w===null)&&(this._state.StrokeWidth!==w)) { this._state.StrokeWidth = w; @@ -1361,7 +1364,7 @@ define([ if (_selectedItem) this.cmbBorderSize.selectRecord(_selectedItem); else { - this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' pt' : ''); + this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : ''); } this.BorderSize = w; } diff --git a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js index 9d9fbbaf6f..e59a114f99 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js @@ -528,7 +528,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem if (this.spinners) { for (var i=0; i1584) { + var value = parseFloat(record.value), + expr = new RegExp('^\\s*(\\d*(\\.|,)?\\d+)\\s*(' + me.txtPt + ')?\\s*$'); + if (!(expr.exec(record.value)) || value<0 || value>1584) { this._state.StrokeType = this._state.StrokeWidth = -1; Common.UI.error({ msg: this.textBorderSizeErr, @@ -1346,7 +1349,7 @@ define([ if (this._state.StrokeType !== strokeType || strokeType == c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == c_oAscStrokeType.STROKE_COLOR ) { var w = stroke.get_width(); - var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !(/pt\s*$/.test(this.cmbBorderSize.getRawValue())); + var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !((new RegExp(this.txtPt + '\\s*$')).test(this.cmbBorderSize.getRawValue())); if ( Math.abs(this._state.StrokeWidth-w)>0.001 || check_value || (this._state.StrokeWidth===null || w===null)&&(this._state.StrokeWidth!==w)) { this._state.StrokeWidth = w; @@ -1360,7 +1363,7 @@ define([ if (_selectedItem) this.cmbBorderSize.selectRecord(_selectedItem); else { - this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' pt' : ''); + this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : ''); } this.BorderSize = w; } diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 05c8825f95..372e4e2e48 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -1,4 +1,6 @@ { + "Common.Utils.Metric.txtCm": "cm", + "Common.Utils.Metric.txtPt": "pt", "Common.Controllers.Chat.notcriticalErrorTitle": "Warning", "Common.Controllers.Chat.textEnterMessage": "Enter your message here", "Common.Controllers.Chat.textUserLimit": "You are using ONLYOFFICE Free Edition.
Only two users can co-edit the document simultaneously.
Want more? Consider buying ONLYOFFICE Enterprise Edition.
Read more", @@ -572,6 +574,7 @@ "PE.Views.SlideSettings.textRadial": "Radial", "PE.Views.SlideSettings.textReset": "Reset Changes", "PE.Views.SlideSettings.textRight": "Right", + "PE.Views.SlideSettings.textSec": "s", "PE.Views.SlideSettings.textSelectTexture": "Select", "PE.Views.SlideSettings.textSmoothly": "Smoothly", "PE.Views.SlideSettings.textSplit": "Split", diff --git a/apps/presentationeditor/main/locale/ru.json b/apps/presentationeditor/main/locale/ru.json index 97cc37c81d..d26169a552 100644 --- a/apps/presentationeditor/main/locale/ru.json +++ b/apps/presentationeditor/main/locale/ru.json @@ -1,4 +1,6 @@ { + "Common.Utils.Metric.txtCm": "см", + "Common.Utils.Metric.txtPt": "пт", "Common.Controllers.Chat.notcriticalErrorTitle": "Предупреждение", "Common.Controllers.Chat.textEnterMessage": "Введите здесь своё сообщение", "Common.Controllers.Chat.textUserLimit": "Вы используете бесплатную версию ONLYOFFICE.
Только два пользователя одновременно могут совместно редактировать документ.
Требуется больше? Рекомендуем приобрести корпоративную версию ONLYOFFICE.
Читать дальше", @@ -572,6 +574,7 @@ "PE.Views.SlideSettings.textRadial": "Радиальный", "PE.Views.SlideSettings.textReset": "Сбросить изменения", "PE.Views.SlideSettings.textRight": "Справа", + "PE.Views.SlideSettings.textSec": "сек", "PE.Views.SlideSettings.textSelectTexture": "Выбрать", "PE.Views.SlideSettings.textSmoothly": "Плавно", "PE.Views.SlideSettings.textSplit": "Панорама", diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index ded0560c7c..2afd3dba3f 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -420,7 +420,7 @@ define([ startvalue: item.options.action == 'row-height' ? me.api.asc_getRowHeight() : me.api.asc_getColumnWidth(), maxvalue: item.options.action == 'row-height' ? c_oAscMaxRowHeight : c_oAscMaxColumnWidth, step: item.options.action == 'row-height' ? 0.75 : 1, - defaultUnit: item.options.action == 'row-height' ? "pt" : "sym", + defaultUnit: item.options.action == 'row-height' ? Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt) : me.textSym, handler: function(dlg, result) { if (result == 'ok') { var val = dlg.getSettings(); @@ -1438,7 +1438,8 @@ define([ textChangeColumnWidth : 'Column Width {0} symbols ({1} pixels)', textChangeRowHeight : 'Row Height {0} points ({1} pixels)', textInsertLeft : 'Insert Left', - textInsertTop : 'Insert Top' + textInsertTop : 'Insert Top', + textSym : 'sym' }, SSE.Controllers.DocumentHolder || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index 36c2e12420..f5108e09bc 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -321,7 +321,7 @@ define([ if (this.spinners) { for (var i=0; i1584) { + var value = parseFloat(record.value), + expr = new RegExp('^\\s*(\\d*(\\.|,)?\\d+)\\s*(' + me.txtPt + ')?\\s*$'); + if (!(expr.exec(record.value)) || value<0 || value>1584) { this._state.StrokeType = this._state.StrokeWidth = -1; Common.UI.error({ msg: this.textBorderSizeErr, @@ -1368,7 +1371,7 @@ define([ if (this._state.StrokeType !== strokeType || strokeType == c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == c_oAscStrokeType.STROKE_COLOR ) { var w = stroke.asc_getWidth(); - var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !(/pt\s*$/.test(this.cmbBorderSize.getRawValue())); + var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !((new RegExp(this.txtPt + '\\s*$')).test(this.cmbBorderSize.getRawValue())); if ( Math.abs(this._state.StrokeWidth-w)>0.001 || check_value || (this._state.StrokeWidth===null || w===null)&&(this._state.StrokeWidth!==w)) { this._state.StrokeWidth = w; @@ -1382,7 +1385,7 @@ define([ if (_selectedItem) this.cmbBorderSize.selectRecord(_selectedItem); else { - this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' pt' : ''); + this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : ''); } this.BorderSize = w; } diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js index eeb03f1c25..077b70f987 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js @@ -554,7 +554,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp if (this.spinners) { for (var i=0; i1584) { + var value = parseFloat(record.value), + expr = new RegExp('^\\s*(\\d*(\\.|,)?\\d+)\\s*(' + me.txtPt + ')?\\s*$'); + if (!(expr.exec(record.value)) || value<0 || value>1584) { this._state.StrokeType = this._state.StrokeWidth = -1; Common.UI.error({ msg: this.textBorderSizeErr, @@ -1349,7 +1352,7 @@ define([ if (this._state.StrokeType !== strokeType || strokeType == c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == c_oAscStrokeType.STROKE_COLOR ) { var w = stroke.asc_getWidth(); - var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !(/pt\s*$/.test(this.cmbBorderSize.getRawValue())); + var check_value = (Math.abs(this._state.StrokeWidth-w)<0.001) && !((new RegExp(this.txtPt + '\\s*$')).test(this.cmbBorderSize.getRawValue())); if ( Math.abs(this._state.StrokeWidth-w)>0.001 || check_value || (this._state.StrokeWidth===null || w===null)&&(this._state.StrokeWidth!==w)) { this._state.StrokeWidth = w; @@ -1363,7 +1366,7 @@ define([ if (_selectedItem) this.cmbBorderSize.selectRecord(_selectedItem); else { - this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' pt' : ''); + this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : ''); } this.BorderSize = w; } diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 96a6246741..0badefc9ac 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1,4 +1,6 @@ { + "Common.Utils.Metric.txtCm": "cm", + "Common.Utils.Metric.txtPt": "pt", "cancelButtonText": "Cancel", "Common.Controllers.Chat.notcriticalErrorTitle": "Warning", "Common.Controllers.Chat.textEnterMessage": "Enter your message here", @@ -91,6 +93,7 @@ "SSE.Controllers.DocumentHolder.tipIsLocked": "This element is being edited by another user.", "SSE.Controllers.DocumentHolder.txtHeight": "Height", "SSE.Controllers.DocumentHolder.txtRowHeight": "Row Height", + "SSE.Controllers.DocumentHolder.textSym": "sym", "SSE.Controllers.DocumentHolder.txtWidth": "Width", "SSE.Controllers.LeftMenu.newDocumentTitle": "Unnamed spreadsheet", "SSE.Controllers.LeftMenu.textByColumns": "By columns", diff --git a/apps/spreadsheeteditor/main/locale/ru.json b/apps/spreadsheeteditor/main/locale/ru.json index aaec826812..172c3b9f12 100644 --- a/apps/spreadsheeteditor/main/locale/ru.json +++ b/apps/spreadsheeteditor/main/locale/ru.json @@ -1,4 +1,6 @@ { + "Common.Utils.Metric.txtCm": "см", + "Common.Utils.Metric.txtPt": "пт", "cancelButtonText": "Отмена", "Common.Controllers.Chat.notcriticalErrorTitle": "Предупреждение", "Common.Controllers.Chat.textEnterMessage": "Введите здесь своё сообщение", @@ -91,6 +93,7 @@ "SSE.Controllers.DocumentHolder.tipIsLocked": "Этот элемент редактируется другим пользователем.", "SSE.Controllers.DocumentHolder.txtHeight": "Высота", "SSE.Controllers.DocumentHolder.txtRowHeight": "Высота строки", + "SSE.Controllers.DocumentHolder.textSym": "симв", "SSE.Controllers.DocumentHolder.txtWidth": "Ширина", "SSE.Controllers.LeftMenu.newDocumentTitle": "Электронная таблица без имени", "SSE.Controllers.LeftMenu.textByColumns": "По столбцам",