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 1a2d0856e4..8611da192b 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|"|cm|mm|pc|s|ms. + * Name of the unit of measurement. Can be px|em|%|en|ex|pt|"|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|"|cm|mm|pc|s|ms)$/i); + var searchUnits = value.match(/(px|em|%|en|ex|pt|"|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|"|cm|mm|pc)$/i)===null || this.options.defaultUnit.match(/(pt|"|cm|mm|pc)$/i)===null) + if ( fromUnit.match(/(pt|"|cm|mm|pc|см|мм|пт)$/i)===null || this.options.defaultUnit.match(/(pt|"|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=='\"') 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=='\"') v_out = parseFloat((v_out / 25.4).toFixed(3)); diff --git a/apps/common/main/lib/controller/ReviewChanges.js b/apps/common/main/lib/controller/ReviewChanges.js index b442e01d97..2efcf0de62 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 1bfee8ae59..c7f6f0a6b2 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,7 +249,7 @@ Common.Utils.ThemeColor = new(function() { } })(); -Common.Utils.Metric = new(function() { +Common.Utils.Metric = _.extend( new(function() { var me = this; me.c_MetricUnits = { @@ -257,13 +257,16 @@ Common.Utils.Metric = new(function() { pt: 1, inch: 2 }; + me.currentMetric = me.c_MetricUnits.pt; - me.metricName = ['cm', 'pt', '\"']; + me.metricName = ['Cm', 'Pt', 'Inch']; me.defaultMetric = me.c_MetricUnits.cm; return { c_MetricUnits: me.c_MetricUnits, - metricName : me.metricName, + txtCm : 'cm', + txtPt : 'pt', + txtInch : '\"', setCurrentMetric: function(value) { me.currentMetric = value; @@ -273,6 +276,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]]; + }, + setDefaultMetric: function(value) { me.defaultMetric = value; }, @@ -309,7 +320,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/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js index a396fdf0b6..c202e3d34e 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 a6eea5c858..6cc6e56699 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.pt ? 1 : 0.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 58d042c25c..9162235171 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 Asc.asc_CImgProperty(); properties.put_Width(w); diff --git a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js index 05544bcb3f..b1a6bf88e0 100644 --- a/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/ImageSettingsAdvanced.js @@ -1476,7 +1476,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 == Asc.c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == Asc.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 0539653409..bc3f6876ef 100644 --- a/apps/documenteditor/main/app/view/TableSettingsAdvanced.js +++ b/apps/documenteditor/main/app/view/TableSettingsAdvanced.js @@ -185,7 +185,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); @@ -478,7 +478,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); @@ -1172,7 +1172,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat // main props this.cmbUnit.store.at(0).set('displayValue', (currmetric == Common.Utils.Metric.c_MetricUnits.pt) ? this.txtPt : ((currmetric == Common.Utils.Metric.c_MetricUnits.inch) ? this.txtInch : 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); @@ -1236,7 +1236,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat this.cmbPrefWidthUnit.store.at(0).set('displayValue', (currmetric == Common.Utils.Metric.c_MetricUnits.pt) ? this.txtPt : ((currmetric == Common.Utils.Metric.c_MetricUnits.inch) ? this.txtInch : 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); @@ -2071,7 +2071,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 == Asc.c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == Asc.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 fa38787612..7c8023ac94 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({ @@ -713,8 +713,8 @@ define([ this.toolbarControls.push(this.btnPageMargins); var pageSizeTemplate = _.template('
<%= caption %>
' + - '
<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[0]).toFixed(2)) %> <%= Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] %> x '+ - '<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[1]).toFixed(2)) %> <%= Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] %>
'); + '
<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[0]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %> x '+ + '<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[1]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %>
'); this.btnPageSize = new Common.UI.Button({ id : 'id-toolbar-btn-pagesize', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index f32e01a8f4..7f180bac3b 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 8853942d9f..6153828219 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 66e269e471..141c896e38 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 Asc.asc_CImgProperty(); properties.put_Width(w); diff --git a/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ImageSettingsAdvanced.js index 77e3d51eb3..e34c220a18 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 == Asc.c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == Asc.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 5760d117f2..5e298ab609 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 == Asc.c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == Asc.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 c7f5cffa41..b56b91066e 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", @@ -574,6 +576,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 c50819a162..8ad354d954 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.
Читать дальше", @@ -573,6 +575,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 95d714df30..e36329f4e7 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -450,7 +450,7 @@ define([ startvalue: item.options.action == 'row-height' ? me.api.asc_getRowHeight() : me.api.asc_getColumnWidth(), maxvalue: item.options.action == 'row-height' ? Asc.c_oAscMaxRowHeight : Asc.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(); @@ -1487,7 +1487,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 23a6348671..01ec3e5c60 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 == Asc.c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == Asc.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 0f2cf69a76..f577bbb346 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 == Asc.c_oAscStrokeType.STROKE_COLOR) { if ( strokeType == Asc.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 1889a1daa8..47e3cf7334 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 e98f1a6b6e..adb299e63a 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": "По столбцам",