Merge branch 'develop' of https://github.com/ONLYOFFICE/web-apps into develop

This commit is contained in:
Julia Svinareva 2019-12-16 15:16:32 +03:00
commit 0b48f70053
11 changed files with 27 additions and 27 deletions

View file

@ -131,7 +131,8 @@
toolbarHideFileName: false,
reviewDisplay: 'original',
spellcheck: true,
compatibleFeatures: false
compatibleFeatures: false,
unit: 'cm' // cm, pt, inch
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],

View file

@ -14,6 +14,7 @@
height: 14px;
background: #fff;
border: 1px solid @gray;
border-radius: 2px;
position: absolute;
left: 0;
margin-top: auto;
@ -27,10 +28,9 @@
border: solid @gray-deep;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
width: 6px;
height: 10px;
left: 3px;
top: -1px;
width: 5px;
height: 9px;
left: 4px;
}
}
}

View file

@ -1316,7 +1316,8 @@ define([
}
var value = Common.localStorage.getItem('de-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
value = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.unit ? Common.Utils.Metric.c_MetricUnits[this.appOptions.customization.unit.toLocaleLowerCase()] : Common.Utils.Metric.getDefaultMetric());
(value===undefined) && (value = Common.Utils.Metric.getDefaultMetric());
Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("de-settings-unit", value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));

View file

@ -798,8 +798,9 @@ define([
if (this.appOptions.isEdit) {
var me = this;
var value = Common.localStorage.getItem('de-mobile-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
var value = Common.localStorage.getItem('de-mobile-settings-unit');
value = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.unit ? Common.Utils.Metric.c_MetricUnits[this.appOptions.customization.unit.toLocaleLowerCase()] : Common.Utils.Metric.getDefaultMetric());
(value===undefined) && (value = Common.Utils.Metric.getDefaultMetric());
Common.Utils.Metric.setCurrentMetric(value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));

View file

@ -377,8 +377,7 @@ define([
var me = this,
$unitMeasurement = $('.page[data-page=settings-advanced-view] input:radio[name=unit-of-measurement]');
$unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me));
var value = Common.localStorage.getItem('de-mobile-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
var value = Common.Utils.Metric.getCurrentMetric();
$unitMeasurement.val([value]);
var _stateDisplayMode = DE.getController('Common.Controllers.Collaboration').getDisplayMode();
if(_stateDisplayMode == "final" || _stateDisplayMode == "original") {
@ -643,7 +642,6 @@ define([
Common.Utils.Metric.setCurrentMetric(value);
Common.localStorage.setItem("de-mobile-settings-unit", value);
this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
},
onPageMarginsChange: function (align, e) {

View file

@ -1021,7 +1021,8 @@ define([
}
var value = Common.localStorage.getItem('pe-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
value = (value!==null) ? parseInt(value) : (me.appOptions.customization && me.appOptions.customization.unit ? Common.Utils.Metric.c_MetricUnits[me.appOptions.customization.unit.toLocaleLowerCase()] : Common.Utils.Metric.getDefaultMetric());
(value===undefined) && (value = Common.Utils.Metric.getDefaultMetric());
Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("pe-settings-unit", value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));

View file

@ -725,10 +725,11 @@ define([
var me = this,
value;
// var value = Common.localStorage.getItem('pe-settings-unit');
// value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
// Common.Utils.Metric.setCurrentMetric(value);
// me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
value = Common.localStorage.getItem('pe-mobile-settings-unit');
value = (value!==null) ? parseInt(value) : (me.appOptions.customization && me.appOptions.customization.unit ? Common.Utils.Metric.c_MetricUnits[me.appOptions.customization.unit.toLocaleLowerCase()] : Common.Utils.Metric.getDefaultMetric());
(value===undefined) && (value = Common.Utils.Metric.getDefaultMetric());
Common.Utils.Metric.setCurrentMetric(value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
// value = Common.localStorage.getItem('pe-hidden-rulers');
// if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(value===null || parseInt(value) === 0);

View file

@ -272,8 +272,7 @@ define([
var me = this,
$unitMeasurement = $('.page[data-page=settings-application-view] input:radio[name=unit-of-measurement]');
$unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me));
var value = Common.localStorage.getItem('pe-mobile-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
var value = Common.Utils.Metric.getCurrentMetric();
$unitMeasurement.val([value]);
},

View file

@ -1106,7 +1106,8 @@ define([
this.toolbarView = toolbarController.getView('Toolbar');
var value = Common.localStorage.getItem('sse-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
value = (value!==null) ? parseInt(value) : (me.appOptions.customization && me.appOptions.customization.unit ? Common.Utils.Metric.c_MetricUnits[me.appOptions.customization.unit.toLocaleLowerCase()] : Common.Utils.Metric.getDefaultMetric());
(value===undefined) && (value = Common.Utils.Metric.getDefaultMetric());
Common.Utils.Metric.setCurrentMetric(value);
Common.Utils.InternalSettings.set("sse-settings-unit", value);

View file

@ -752,8 +752,10 @@ define([
if (this.appOptions.isEdit) {
var me = this;
var value = Common.localStorage.getItem('sse-settings-unit');
Common.Utils.Metric.setCurrentMetric((value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric());
var value = Common.localStorage.getItem('se-mobile-settings-unit');
value = (value!==null) ? parseInt(value) : (me.appOptions.customization && me.appOptions.customization.unit ? Common.Utils.Metric.c_MetricUnits[me.appOptions.customization.unit.toLocaleLowerCase()] : Common.Utils.Metric.getDefaultMetric());
(value===undefined) && (value = Common.Utils.Metric.getDefaultMetric());
Common.Utils.Metric.setCurrentMetric(value);
me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));

View file

@ -371,10 +371,6 @@ define([
this.changeCurrentPageSize(opt.asc_getWidth(), opt.asc_getHeight());
$pageSize.find('.item-title').text(_pageSizes[_pageSizesIndex]['caption']);
var valueUnit = Common.localStorage.getItem('se-mobile-settings-unit');
valueUnit = (valueUnit!==null) ? parseInt(valueUnit) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(valueUnit);
var curMetricName = Common.Utils.Metric.getMetricName(Common.Utils.Metric.getCurrentMetric()),
sizeW = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][0]).toFixed(2)),
sizeH = parseFloat(Common.Utils.Metric.fnRecalcFromMM(_pageSizes[_pageSizesIndex]['value'][1]).toFixed(2));
@ -570,8 +566,7 @@ define([
var me = this,
$unitMeasurement = $('.page[data-page=settings-application-view] input:radio[name=unit-of-measurement]');
$unitMeasurement.single('change', _.bind(me.unitMeasurementChange, me));
var value = Common.localStorage.getItem('se-mobile-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
var value = Common.Utils.Metric.getCurrentMetric();
$unitMeasurement.val([value]);
//init formula language