Merge branch 'develop' into feature/sse-filter-settings

This commit is contained in:
Julia Radzhabova 2016-04-26 16:23:29 +03:00
commit 44f71cdcef
65 changed files with 1779 additions and 491 deletions

View file

@ -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));

View file

@ -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));

View file

@ -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)

View file

@ -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;

View file

@ -76,6 +76,7 @@ define([
this.handler = _options.handler;
this.toggleGroup = _options.toggleGroup;
this.contentWidth = _options.contentWidth;
this.storageName = _options.storageName;
Common.UI.Window.prototype.initialize.call(this, _options);
},
@ -143,6 +144,37 @@ define([
return false;
},
setActiveCategory: function(index) {
if (this.btnsCategory.length<1) return;
var btnActive = this.btnsCategory[(index>=0 && index<this.btnsCategory.length) ? index : 0];
if (!btnActive.isVisible() || btnActive.isDisabled()) {
for (var i = 0; i<this.btnsCategory.length; i++){
var btn = this.btnsCategory[i];
if (btn.isVisible() && !btn.isDisabled()) {
btnActive = btn;
break;
}
}
}
btnActive.toggle(true);
this.onCategoryClick(btnActive);
},
getActiveCategory: function() {
var index = -1;
this.btnsCategory.forEach(function(btn, idx){
if (btn.pressed) index = idx;
});
return index;
},
close: function(suppressevent) {
if (this.storageName)
Common.localStorage.setItem(this.storageName, this.getActiveCategory());
Common.UI.Window.prototype.close.call(this, suppressevent);
},
cancelButtonText: 'Cancel',
okButtonText : 'Ok'
}, Common.Views.AdvancedSettingsWindow || {}));

View file

@ -146,8 +146,8 @@
background-color: @secondary;
}
&:active,
&.active {
&:active:not(.disabled),
&.active:not(.disabled) {
background-color: @primary;
color: #fff;
}

View file

@ -157,9 +157,8 @@
}
}
.combo-template {
.combo-template(@combo-dataview-height: 64px) {
@combo-dataview-button-width: 18px;
@combo-dataview-height: 64px;
height: @combo-dataview-height;
@ -196,6 +195,10 @@
}
};
.combo-template {
.combo-template(64px);
}
.combo-pattern {
@combo-dataview-button-width: 15px;
@combo-dataview-height: 40px;

View file

@ -20,6 +20,76 @@
</table>
</div>
</div>
<div id="id-adv-shape-size" class="settings-panel active">
<div class="inner-content">
<table cols="3">
<tr>
<td colspan="3">
<label class="header"><%= scope.textWidth %></label>
</td>
</tr>
<tr>
<td style="vertical-align: bottom; padding-bottom: 12px;">
<div id="shape-radio-hsize"></div>
</td>
<td class="padding-small">
<label class="input-label"><%= scope.textAbsoluteWH %></label>
<div id="shape-advanced-spin-width"></div>
</td>
</tr>
<tr>
<td style="vertical-align: bottom; padding-bottom: 19px;">
<div id="shape-radio-hsizepc"></div>
</td>
<td class="padding-large" style="padding-right: 15px;">
<label class="input-label"><%= scope.textRelativeWH %></label>
<div id="shape-advanced-spin-width-rel"></div>
</td>
<td class="padding-large">
<label class="input-label"><%= scope.textRelative %></label>
<div id="shape-combo-width-rel" style="width: 115px;"></div>
</td>
</tr>
<tr>
<td colspan="3">
<label class="header"><%= scope.textHeight %></label>
</td>
</tr>
<tr>
<td style="vertical-align: bottom; padding-bottom: 12px;">
<div id="shape-radio-vsize"></div>
</td>
<td class="padding-small">
<label class="input-label"><%= scope.textAbsoluteWH %></label>
<div id="shape-advanced-spin-height"></div>
</td>
</tr>
<tr>
<td style="vertical-align: bottom; padding-bottom: 19px;">
<div id="shape-radio-vsizepc"></div>
</td>
<td class="padding-large" style="padding-right: 15px;">
<label class="input-label"><%= scope.textRelativeWH %></label>
<div id="shape-advanced-spin-height-rel"></div>
</td>
<td class="padding-large">
<label class="input-label"><%= scope.textRelative %></label>
<div id="shape-combo-height-rel" style="width: 115px;"></div>
</td>
</tr>
</table>
</div>
<div class="separator horizontal padding-large"></div>
<div class="inner-content">
<table cols="1" style="width: 100%;">
<tr>
<td>
<div id="shape-checkbox-ratio"></div>
</td>
</tr>
</table>
</div>
</div>
<div id="id-adv-image-wrap" class="settings-panel">
<div class="inner-content padding-large">
<label class="header padding-small"><%= scope.textWrap %></label>

View file

@ -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() {

View file

@ -61,7 +61,8 @@ define([
options: {
contentWidth: 320,
height : 380,
toggleGroup : 'dropcap-adv-settings-group'
toggleGroup : 'dropcap-adv-settings-group',
storageName: 'de-dropcap-settings-adv-category'
},
initialize : function(options) {
@ -135,20 +136,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};
@ -742,26 +743,13 @@ define([
this._UpdateTableBordersStyle(ct, border, size, color, this.Borders);
}, this);
var btnCategoryFrame, btnCategoryDropcap;
_.each(this.btnsCategory, function(btn) {
if (btn.options.contentTarget == 'id-adv-dropcap-frame')
btnCategoryFrame = btn;
else if(btn.options.contentTarget == 'id-adv-dropcap-dropcap')
btnCategoryDropcap = btn;
});
this.content_panels.filter('.active').removeClass('active');
if (!this.isFrame) {
btnCategoryFrame.hide();
btnCategoryDropcap.toggle(true, true);
$("#" + btnCategoryDropcap.options.contentTarget).addClass('active');
} else {
btnCategoryDropcap.hide();
btnCategoryFrame.toggle(true, true);
$("#" + btnCategoryFrame.options.contentTarget).addClass('active');
if (this.isFrame)
this.setHeight(500);
this.btnsCategory[(this.isFrame) ? 1 : 0].setVisible(false);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
@ -851,7 +839,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 +890,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 +912,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();

View file

@ -234,7 +234,7 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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.01);
}
}

View file

@ -160,10 +160,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() {
@ -204,13 +204,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;
}
@ -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);

View file

@ -54,7 +54,8 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
toggleGroup: 'image-adv-settings-group',
sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88},
properties: null
properties: null,
storageName: 'de-img-settings-adv-category'
},
initialize : function(options) {
@ -62,6 +63,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
title: this.textTitle,
items: [
{panelId: 'id-adv-image-width', panelCaption: this.textSize},
{panelId: 'id-adv-shape-size', panelCaption: this.textSize},
{panelId: 'id-adv-image-wrap', panelCaption: this.textBtnWrap},
{panelId: 'id-adv-image-position', panelCaption: this.textPosition},
{panelId: 'id-adv-image-shape', panelCaption: this.textShape},
@ -80,10 +82,12 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
HAlignFrom: Asc.c_oAscRelativeFromH.Character,
HPositionFrom: Asc.c_oAscRelativeFromH.Character,
HPositionPcFrom: Asc.c_oAscRelativeFromH.Page,
ShapeWidthPcFrom: Asc.c_oAscRelativeFromH.Margin,
VAlignType: Asc.c_oAscAlignV.Top,
VAlignFrom: Asc.c_oAscRelativeFromV.Line,
VPositionFrom: Asc.c_oAscRelativeFromV.Line,
VAlignFrom: Asc.c_oAscRelativeFromV.Paragraph,
VPositionFrom: Asc.c_oAscRelativeFromV.Paragraph,
VPositionPcFrom: Asc.c_oAscRelativeFromV.Page,
ShapeHeightPcFrom: Asc.c_oAscRelativeFromV.Margin,
spnXChanged: false,
spnYChanged: false,
spnXPcChanged: false,
@ -105,6 +109,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
var me = this;
// Image & Chart Size
this.spnWidth = new Common.UI.MetricSpinner({
el: $('#image-advanced-spin-width'),
step: .1,
@ -186,6 +191,177 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
}
}, this));
// Shape Size
this.radioHSize = new Common.UI.RadioBox({
el: $('#shape-radio-hsize'),
name: 'asc-radio-width',
checked: true
});
this.radioHSize.on('change', _.bind(this.onRadioHSizeChange, this));
this.radioHSizePc = new Common.UI.RadioBox({
el: $('#shape-radio-hsizepc'),
name: 'asc-radio-width'
});
this.radioHSizePc.on('change', _.bind(this.onRadioHSizePcChange, this));
this.radioVSize = new Common.UI.RadioBox({
el: $('#shape-radio-vsize'),
name: 'asc-radio-height',
checked: true
});
this.radioVSize.on('change', _.bind(this.onRadioVSizeChange, this));
this.radioVSizePc = new Common.UI.RadioBox({
el: $('#shape-radio-vsizepc'),
name: 'asc-radio-height'
});
this.radioVSizePc.on('change', _.bind(this.onRadioVSizePcChange, this));
this.chRatio = new Common.UI.CheckBox({
el: $('#shape-checkbox-ratio'),
labelText: this.textAspectRatio
});
this.chRatio.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if ((field.getValue()=='checked') && this.spnShapeHeight.getNumberValue()>0) {
this._nRatio = this.spnShapeWidth.getNumberValue()/this.spnShapeHeight.getNumberValue();
}
}, this));
this.spnShapeWidth = new Common.UI.MetricSpinner({
el: $('#shape-advanced-spin-width'),
step: .1,
width: 80,
defaultUnit : "cm",
value: '3 cm',
maxValue: 55.88,
minValue: 0
});
this.spnShapeWidth.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this.chRatio.getValue()=='checked' && !this.chRatio.isDisabled()) {
var w = field.getNumberValue();
var h = w/this._nRatio;
if (h>this.sizeMax.height) {
h = this.sizeMax.height;
w = h * this._nRatio;
this.spnShapeWidth.setValue(w, true);
}
this.spnShapeHeight.setValue(h, true);
}
if (this._changedProps) {
this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
this.fillShapeHeight();
}
}, this));
this.spinners.push(this.spnShapeWidth);
this.spnShapeHeight = new Common.UI.MetricSpinner({
el: $('#shape-advanced-spin-height'),
step: .1,
width: 80,
defaultUnit : "cm",
value: '3 cm',
maxValue: 55.88,
minValue: 0
});
this.spnShapeHeight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
var h = field.getNumberValue(), w = null;
if (this.chRatio.getValue()=='checked' && !this.chRatio.isDisabled()) {
w = h * this._nRatio;
if (w>this.sizeMax.width) {
w = this.sizeMax.width;
h = w/this._nRatio;
this.spnShapeHeight.setValue(h, true);
}
this.spnShapeWidth.setValue(w, true);
}
if (this._changedProps) {
this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
this.fillShapeWidth();
}
}, this));
this.spinners.push(this.spnShapeHeight);
this.spnShapeWidthPc = new Common.UI.MetricSpinner({
el: $('#shape-advanced-spin-width-rel'),
disabled: true,
step: 1,
width: 80,
defaultUnit : "%",
value: '1 %',
maxValue: 1000,
minValue: 1
});
this.spnShapeWidthPc.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_SizeRelH()===null || this._changedProps.get_SizeRelH()===undefined)
this._changedProps.put_SizeRelH(new Asc.CImagePositionH());
this._changedProps.get_SizeRelH().put_Value(field.getNumberValue());
this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom);
this.fillShapeHeight();
}
}, this));
this.spnShapeHeightPc = new Common.UI.MetricSpinner({
el: $('#shape-advanced-spin-height-rel'),
disabled: true,
step: 1,
width: 80,
defaultUnit : "%",
value: '1 %',
maxValue: 1000,
minValue: 1
});
this.spnShapeHeightPc.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_SizeRelV()===null || this._changedProps.get_SizeRelV()===undefined)
this._changedProps.put_SizeRelV(new Asc.CImagePositionV());
this._changedProps.get_SizeRelV().put_Value(field.getNumberValue());
this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom);
this.fillShapeWidth();
}
}, this));
this._arrHRelativePc = [
{displayValue: this.textLeftMargin, value: Asc.c_oAscRelativeFromH.LeftMargin},
{displayValue: this.textMargin, value: Asc.c_oAscRelativeFromH.Margin},
{displayValue: this.textPage, value: Asc.c_oAscRelativeFromH.Page},
{displayValue: this.textRightMargin, value: Asc.c_oAscRelativeFromH.RightMargin}
];
this.cmbWidthPc = new Common.UI.ComboBox({
el: $('#shape-combo-width-rel'),
cls: 'input-group-nr',
menuStyle: 'min-width: 115px;',
editable: false,
data: this._arrHRelativePc
});
this.cmbWidthPc.setDisabled(true);
this.cmbWidthPc.setValue(this._state.ShapeWidthPcFrom);
this.cmbWidthPc.on('selected', _.bind(this.onCmbWidthPcSelect, this));
this._arrVRelativePc = [
{displayValue: this.textMargin, value: Asc.c_oAscRelativeFromV.Margin},
{displayValue: this.textBottomMargin, value: Asc.c_oAscRelativeFromV.BottomMargin},
{displayValue: this.textPage, value: Asc.c_oAscRelativeFromV.Page},
{displayValue: this.textTopMargin, value: Asc.c_oAscRelativeFromV.TopMargin}
];
this.cmbHeightPc = new Common.UI.ComboBox({
el: $('#shape-combo-height-rel'),
cls: 'input-group-nr',
menuStyle: 'min-width: 115px;',
editable: false,
data: this._arrVRelativePc
});
this.cmbHeightPc.setDisabled(true);
this.cmbHeightPc.setValue(this._state.ShapeHeightPcFrom);
this.cmbHeightPc.on('selected', _.bind(this.onCmbHeightPcSelect, this));
// Wrapping
this.btnWrapInline = new Common.UI.Button({
@ -471,13 +647,6 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
}
}, this));
this._arrHRelativePc = [
{displayValue: this.textLeftMargin, value: Asc.c_oAscRelativeFromH.LeftMargin},
{displayValue: this.textMargin, value: Asc.c_oAscRelativeFromH.Margin},
{displayValue: this.textPage, value: Asc.c_oAscRelativeFromH.Page},
{displayValue: this.textRightMargin, value: Asc.c_oAscRelativeFromH.RightMargin}
];
this.cmbHPositionPc = new Common.UI.ComboBox({
el: $('#image-combo-hpositionpc'),
cls: 'input-group-nr',
@ -560,13 +729,6 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
}
}, this));
this._arrVRelativePc = [
{displayValue: this.textMargin, value: Asc.c_oAscRelativeFromV.Margin},
{displayValue: this.textBottomMargin, value: Asc.c_oAscRelativeFromV.BottomMargin},
{displayValue: this.textPage, value: Asc.c_oAscRelativeFromV.Page},
{displayValue: this.textTopMargin, value: Asc.c_oAscRelativeFromV.TopMargin}
];
this.cmbVPositionPc = new Common.UI.ComboBox({
el: $('#image-combo-vpositionpc'),
cls: 'input-group-nr',
@ -906,6 +1068,11 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
this.btnsCategory[(this._objectType == Asc.c_oAscTypeSelectElement.Shape) ? 0 : 1].setVisible(false);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
_setDefaults: function(props) {
@ -958,13 +1125,6 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this._DisableElem(Asc.c_oAscWrapStyle2.Inline);
}
this.spnWidth.setMaxValue(this.sizeMax.width);
this.spnHeight.setMaxValue(this.sizeMax.height);
value = props.get_Width();
this.spnWidth.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
value = props.get_Height();
this.spnHeight.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
if (props.get_Paddings()) {
var Paddings = {
Top: props.get_Paddings().get_Top(),
@ -1081,15 +1241,58 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.btnOriginalSize.setVisible(!(shapeprops || chartprops));
this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined);
this.btnsCategory[3].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Shapes
this.btnsCategory[4].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Margins
this.btnsCategory[1].setDisabled(props.get_FromGroup()); // Wrapping
this.btnsCategory[4].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Shapes
this.btnsCategory[5].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Margins
this.btnsCategory[2].setDisabled(props.get_FromGroup()); // Wrapping
if (shapeprops) {
this._objectType = Asc.c_oAscTypeSelectElement.Shape;
this._setShapeDefaults(shapeprops);
this.setTitle(this.textTitleShape);
value = Common.localStorage.getItem("de-settings-shaperatio");
if (value!==null && parseInt(value) == 1) {
this.chRatio.setValue(true);
}
this.spnShapeWidth.setMaxValue(this.sizeMax.width);
this.spnShapeHeight.setMaxValue(this.sizeMax.height);
var sizeRelH = props.get_SizeRelH();
if (sizeRelH) {
this.radioHSizePc.setValue(true);
this.spnShapeWidthPc.setValue(sizeRelH.get_Value());
value = sizeRelH.get_RelativeFrom();
for (i=0; i<this._arrHRelativePc.length; i++) {
if (value == this._arrHRelativePc[i].value) {
this.cmbWidthPc.setValue(value);
this._state.ShapeWidthPcFrom = value;
break;
}
}
} else {
this.radioHSize.setValue(true);
value = props.get_Width();
this.spnShapeWidth.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
}
var sizeRelV = props.get_SizeRelV();
if (sizeRelV) {
this.radioVSizePc.setValue(true);
this.spnShapeHeightPc.setValue(sizeRelV.get_Value());
value = sizeRelV.get_RelativeFrom();
for (i=0; i<this._arrVRelativePc.length; i++) {
if (value == this._arrVRelativePc[i].value) {
this.cmbHeightPc.setValue(value);
this._state.ShapeHeightPcFrom = value;
break;
}
}
} else {
this.radioVSize.setValue(true);
value = props.get_Height();
this.spnShapeHeight.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
}
this.chRatio.setDisabled(this.radioVSizePc.getValue() || this.radioHSizePc.getValue());
var margins = shapeprops.get_paddings();
if (margins) {
@ -1103,21 +1306,30 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnMarginBottom.setValue((null !== val && undefined !== val) ? Common.Utils.Metric.fnRecalcFromMM(val) : '', true);
}
this.btnsCategory[4].setDisabled(null === margins); // Margins
}
else if (chartprops) {
this._objectType = Asc.c_oAscTypeSelectElement.Chart;
this.setTitle(this.textTitleChart);
value = Common.localStorage.getItem("de-settings-chartratio");
}
else {
this.setTitle(this.textTitle);
value = Common.localStorage.getItem("de-settings-imageratio");
if (value===null) value = 1;
}
this.btnsCategory[5].setDisabled(null === margins); // Margins
if (value!==null && parseInt(value) == 1) {
this.btnRatio.toggle(true);
} else {
if (chartprops) {
this._objectType = Asc.c_oAscTypeSelectElement.Chart;
this.setTitle(this.textTitleChart);
value = Common.localStorage.getItem("de-settings-chartratio");
}
else {
this.setTitle(this.textTitle);
value = Common.localStorage.getItem("de-settings-imageratio");
if (value===null) value = 1;
}
if (value!==null && parseInt(value) == 1) {
this.btnRatio.toggle(true);
}
this.spnWidth.setMaxValue(this.sizeMax.width);
this.spnHeight.setMaxValue(this.sizeMax.height);
value = props.get_Width();
this.spnWidth.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
value = props.get_Height();
this.spnHeight.setValue((value!==undefined) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
}
this._changedProps = new Asc.asc_CImgProperty();
@ -1125,15 +1337,17 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
},
getSettings: function() {
var value = (this.btnRatio.pressed) ? 1 : 0;
if (this._objectType==Asc.c_oAscTypeSelectElement.Shape) {
Common.localStorage.setItem("de-settings-shaperatio", value);
}
else if (this._objectType==Asc.c_oAscTypeSelectElement.Chart) {
Common.localStorage.setItem("de-settings-chartratio", value);
}
else {
Common.localStorage.setItem("de-settings-imageratio", value);
if (!this.chRatio.isDisabled())
Common.localStorage.setItem("de-settings-shaperatio", (this.chRatio.getValue()=='checked') ? 1 : 0);
} else {
var value = (this.btnRatio.pressed) ? 1 : 0;
if (this._objectType==Asc.c_oAscTypeSelectElement.Chart) {
Common.localStorage.setItem("de-settings-chartratio", value);
}
else {
Common.localStorage.setItem("de-settings-imageratio", value);
}
}
var properties = this._changedProps;
@ -1248,7 +1462,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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.01);
}
}
@ -1279,7 +1493,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnTop.setDisabled(disabledTB);
this.spnBottom.setDisabled(disabledTB);
this.btnsCategory[2].setDisabled(btnId == Asc.c_oAscWrapStyle2.Inline);
this.btnsCategory[3].setDisabled(btnId == Asc.c_oAscWrapStyle2.Inline);
},
onHAlignSelect: function(combo, record){
@ -1388,7 +1602,6 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
}
},
onVPositionPcSelect: function(combo, record){
if (this._changedProps) {
if (this._changedProps.get_PositionV()===null || this._changedProps.get_PositionV()===undefined)
@ -1544,6 +1757,122 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
}
},
onRadioHSizeChange: function(field, newValue, eOpts) {
if (newValue) {
if (this._changedProps) {
this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnShapeWidth.getNumberValue()));
this._changedProps.put_SizeRelH(undefined);
this.fillShapeHeight();
}
this.chRatio.setDisabled(this.radioVSizePc.getValue());
this.cmbWidthPc.setDisabled(true);
this.spnShapeWidthPc.setDisabled(true);
this.spnShapeWidth.setDisabled(false);
}
},
onRadioHSizePcChange: function(field, newValue, eOpts) {
if (newValue) {
if (this._changedProps) {
if (this._changedProps.get_SizeRelH()===null || this._changedProps.get_SizeRelH()===undefined)
this._changedProps.put_SizeRelH(new Asc.CImagePositionH());
this._changedProps.get_SizeRelH().put_Value(this.spnShapeWidthPc.getNumberValue());
this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom);
this.fillShapeHeight();
}
this.chRatio.setDisabled(true);
this.cmbWidthPc.setDisabled(false);
this.spnShapeWidthPc.setDisabled(false);
this.spnShapeWidth.setDisabled(true);
}
},
onRadioVSizeChange: function(field, newValue, eOpts) {
if (newValue) {
if (this._changedProps) {
this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnShapeHeight.getNumberValue()));
this._changedProps.put_SizeRelV(undefined);
this.fillShapeWidth();
}
this.chRatio.setDisabled(this.radioHSizePc.getValue());
this.cmbHeightPc.setDisabled(true);
this.spnShapeHeightPc.setDisabled(true);
this.spnShapeHeight.setDisabled(false);
}
},
onRadioVSizePcChange: function(field, newValue, eOpts) {
if (newValue) {
if (this._changedProps) {
if (this._changedProps.get_SizeRelV()===null || this._changedProps.get_SizeRelV()===undefined)
this._changedProps.put_SizeRelV(new Asc.CImagePositionV());
this._changedProps.get_SizeRelV().put_Value(this.spnShapeHeightPc.getNumberValue());
this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom);
this.fillShapeWidth();
}
this.chRatio.setDisabled(true);
this.cmbHeightPc.setDisabled(false);
this.spnShapeHeightPc.setDisabled(false);
this.spnShapeHeight.setDisabled(true);
}
},
onCmbWidthPcSelect: function(combo, record){
if (this._changedProps) {
if (this._changedProps.get_SizeRelH()===null || this._changedProps.get_SizeRelH()===undefined)
this._changedProps.put_SizeRelH(new Asc.CImagePositionH());
this._state.ShapeWidthPcFrom = record.value;
this._changedProps.get_SizeRelH().put_Value(this.spnShapeWidthPc.getNumberValue());
this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom);
this.fillShapeHeight();
}
},
onCmbHeightPcSelect: function(combo, record){
if (this._changedProps) {
if (this._changedProps.get_SizeRelV()===null || this._changedProps.get_SizeRelV()===undefined)
this._changedProps.put_SizeRelV(new Asc.CImagePositionV());
this._state.ShapeHeightPcFrom = record.value;
this._changedProps.get_SizeRelV().put_Value(this.spnShapeHeightPc.getNumberValue());
this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom);
this.fillShapeWidth();
}
},
fillShapeWidth: function(combo, record){
if (this.radioHSize.getValue())
this._changedProps.put_Width(Common.Utils.Metric.fnRecalcToMM(this.spnShapeWidth.getNumberValue()));
else {
if (this._changedProps.get_SizeRelH()===null || this._changedProps.get_SizeRelH()===undefined)
this._changedProps.put_SizeRelH(new Asc.CImagePositionH());
this._changedProps.get_SizeRelH().put_Value(this.spnShapeWidthPc.getNumberValue());
this._changedProps.get_SizeRelH().put_RelativeFrom(this._state.ShapeWidthPcFrom);
}
},
fillShapeHeight: function(combo, record){
if (this.radioVSize.getValue())
this._changedProps.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnShapeHeight.getNumberValue()));
else {
if (this._changedProps.get_SizeRelV()===null || this._changedProps.get_SizeRelV()===undefined)
this._changedProps.put_SizeRelV(new Asc.CImagePositionV());
this._changedProps.get_SizeRelV().put_Value(this.spnShapeHeightPc.getNumberValue());
this._changedProps.get_SizeRelV().put_RelativeFrom(this._state.ShapeHeightPcFrom);
}
},
_updateSizeArr: function(combo, picker, record, sizeidx) {
if (record.get('value')>0) {
picker.store.each( function(rec){
@ -1674,7 +2003,10 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
textBeginSize: 'Begin Size',
textEndStyle: 'End Style',
textEndSize: 'End Size',
textPositionPc: 'Relative position'
textPositionPc: 'Relative position',
textAspectRatio: 'Lock aspect ratio',
textAbsoluteWH: 'Absolute',
textRelativeWH: 'Relative'
}, DE.Views.ImageSettingsAdvanced || {}));
});

View file

@ -213,7 +213,7 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -154,7 +154,7 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -407,11 +407,11 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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.01);
}
}
this._arrLineRule[2].defaultUnit = this._arrLineRule[0].defaultUnit = Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()];
this._arrLineRule[2].defaultUnit = this._arrLineRule[0].defaultUnit = Common.Utils.Metric.getCurrentMetricName();
this._arrLineRule[2].minValue = this._arrLineRule[0].minValue = parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2));
this._arrLineRule[2].step = this._arrLineRule[0].step = (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01;
if (this._state.LineRuleIdx !== null) {

View file

@ -54,7 +54,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
options: {
contentWidth: 325,
height: 394,
toggleGroup: 'paragraph-adv-settings-group'
toggleGroup: 'paragraph-adv-settings-group',
storageName: 'de-para-settings-adv-category'
},
initialize : function(options) {
@ -698,7 +699,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
var rec = new Common.UI.DataViewModel();
rec.set({
tabPos: pos,
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: tab.get_Value()
});
arr.push(rec);
@ -719,7 +720,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
spinner.setDefaultUnit(Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]);
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position' )
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
else
@ -768,6 +769,11 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
}
this._UpdateTableBordersStyle(ct, border, size, color, this.Borders);
}, this);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
onStrikeChange: function(field, newValue, oldValue, eOpts){
@ -1093,7 +1099,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
rec = new Common.UI.DataViewModel();
rec.set({
tabPos: val,
value: val + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
value: val + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: align
});
store.add(rec);

View file

@ -79,6 +79,8 @@ define([
this._sendUndoPoint = true;
this._sliderChanged = false;
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
this._state = {
Transparency: null,
FillType: Asc.c_oAscFill.FILL_TYPE_SOLID,
@ -1036,8 +1038,9 @@ define([
onBorderSizeChanged: function(before, combo, record, e) {
var me = this;
if (before) {
var value = parseFloat(record.value);
if (!(/^\s*(\d*(\.|,)?\d+)\s*(pt)?\s*$/.exec(record.value)) || value<0 || value>1584) {
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;
}

View file

@ -91,7 +91,6 @@ define([
this._locked = false;
this._originalLook = new Asc.CTablePropLook();
var fullwidth = 218;
this._originalProps = null;
this.CellBorders = {};
this.CellColor = {Value: 1, Color: 'transparent'}; // value=1 - цвет определен - прозрачный или другой, value=0 - цвет не определен, рисуем прозрачным

View file

@ -55,7 +55,8 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
options: {
contentWidth: 340,
height: 436,
toggleGroup: 'table-adv-settings-group'
toggleGroup: 'table-adv-settings-group',
storageName: 'de-table-settings-adv-category'
},
initialize : function(options) {
@ -185,7 +186,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 +479,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);
@ -1133,6 +1134,11 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
}
this._UpdateTableBordersStyle(ct, border, size, color, (this._allTable) ? this.TableBorders : this.CellBorders, (this._allTable) ? this.ChangedTableBorders : this.ChangedCellBorders);
}, this);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
getSettings: function() {
@ -1172,7 +1178,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 +1242,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 +2077,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -77,6 +77,8 @@ define([
this._sendUndoPoint = true;
this._sliderChanged = false;
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
this._state = {
Transparency: null,
FillType: Asc.c_oAscFill.FILL_TYPE_SOLID,
@ -730,8 +732,9 @@ define([
onBorderSizeChanged: function(before, combo, record, e) {
var me = this;
if (before) {
var value = parseFloat(record.value);
if (!(/^\s*(\d*(\.|,)?\d+)\s*(pt)?\s*$/.exec(record.value)) || value<0 || value>1584) {
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;
}

View file

@ -686,10 +686,10 @@ define([
var pageMarginsTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><div><b><%= caption %></b></div>' +
'<% if (options.value !== null) { %><div style="display: inline-block;margin-right: 20px;min-width: 80px;">' +
'<label style="display: block;">'+ this.textTop +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[0]).toFixed(2)) %> <%= Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] %></label>' +
'<label style="display: block;">'+ this.textLeft +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[1]).toFixed(2)) %> <%= Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] %></label></div><div style="display: inline-block;">' +
'<label style="display: block;">'+ this.textBottom +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[2]).toFixed(2)) %> <%= Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] %></label>'+
'<label style="display: block;">'+ this.textRight +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[3]).toFixed(2)) %> <%= Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] %></label></div>'+
'<label style="display: block;">'+ this.textTop +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[0]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %></label>' +
'<label style="display: block;">'+ this.textLeft +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[1]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %></label></div><div style="display: inline-block;">' +
'<label style="display: block;">'+ this.textBottom +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[2]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %></label>'+
'<label style="display: block;">'+ this.textRight +'<%= parseFloat(Common.Utils.Metric.fnRecalcFromMM(options.value[3]).toFixed(2)) %> <%= Common.Utils.Metric.getCurrentMetricName() %></label></div>'+
'<% } %></a>');
this.btnPageMargins = new Common.UI.Button({
@ -713,8 +713,8 @@ define([
this.toolbarControls.push(this.btnPageMargins);
var pageSizeTemplate = _.template('<a id="<%= id %>" tabindex="-1" type="menuitem"><div><b><%= caption %></b></div>' +
'<div><%= 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()] %></div></a>');
'<div><%= 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() %></div></a>');
this.btnPageSize = new Common.UI.Button({
id : 'id-toolbar-btn-pagesize',

View file

@ -244,83 +244,90 @@
<script type="text/javascript" src="../../../../sdkjs/common/downloaderfiles.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/docscoapi.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/spellcheckapi.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/wordcopypaste.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/spellCheckLanguage.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/spellCheckLanguagesAll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeChart.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/AdvancedOptions.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_map.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Metafile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/TextMeasurer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/WorkEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Hit.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ArcTo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ColorArray.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Constants.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/CommonController.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/DrawingStates.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/CreateGeometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Geometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Format.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Shape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Path.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Image.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/GroupShape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartSpace.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/TextBody.js"></script>
<!-- For chart editor -->
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/charts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeChart.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Constants.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Format.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_map.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Externals.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/GlobalLoaders.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingArea.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/3DTransformation.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/Spline.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TextDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Externals.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/GlobalLoaders.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/CollaborativeEditingBase.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Controls.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Overlay.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/HatchPattern.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/scroll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Scrolls/iscroll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/wordcopypaste.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/translations.js"></script>
<!--Drawings -->
<script type="text/javascript" src="../../../../sdkjs/common/Charts/charts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/3DTransformation.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingArea.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/Spline.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ArcTo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ColorArray.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/CommonController.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Hit.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Joined.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Math.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Shape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Image.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/GroupShape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartSpace.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Constants.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/CreateGeometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Format.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Geometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Path.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/TextBody.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TextDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/Format/ShapePrototype.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/Format/ImagePrototype.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/Format/GroupPrototype.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/Format/ChartSpacePrototype.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/Format/GraphicFrame.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/DrawingStates.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/GraphicObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/GraphicPage.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/GraphicObjects/WrapManager.js"></script>
<!--Drawings -->
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Metafile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/CollaborativeEditingBase.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/CollaborativeEditing.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Comments.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/History.js"></script>
@ -351,18 +358,10 @@
<script type="text/javascript" src="../../../../sdkjs/word/Editor/FontClassification.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Spelling.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/HatchPattern.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Graphics.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/ArcTo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Hit.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/ColorArray.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Overlay.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/ShapeDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/DrawingDocument.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/GraphicsEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Scrolls/iscroll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/WorkEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Controls.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Rulers.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/HtmlPage.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/documentrenderer.js"></script>
@ -372,13 +371,9 @@
<script type="text/javascript" src="../../../../sdkjs/word/api.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/apiExport.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/document/empty.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/scroll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/CollaborativeEditing.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/SerializeCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Math/mathTypes.js"></script>
@ -406,7 +401,6 @@
<script type="text/javascript" src="../../../../sdkjs/cell/model/WorkbookElems.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/Workbook.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/CellInfo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/AdvancedOptions.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Private/Locks.js"></script>
<!-- apply changes -->

View file

@ -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.<br>Only two users can co-edit the document simultaneously.<br>Want more? Consider buying ONLYOFFICE Enterprise Edition.<br><a href=\"http://www.onlyoffice.com/free-edition.aspx\" target=\"_blank\">Read more</a>",
@ -1017,6 +1019,9 @@
"DE.Views.ImageSettingsAdvanced.textWrapThroughTooltip": "Through",
"DE.Views.ImageSettingsAdvanced.textWrapTightTooltip": "Tight",
"DE.Views.ImageSettingsAdvanced.textWrapTopbottomTooltip": "Top and Bottom",
"DE.Views.ImageSettingsAdvanced.textAspectRatio": "Lock aspect ratio",
"DE.Views.ImageSettingsAdvanced.textAbsoluteWH": "Absolute",
"DE.Views.ImageSettingsAdvanced.textRelativeWH": "Relative",
"DE.Views.LeftMenu.tipAbout": "About",
"DE.Views.LeftMenu.tipChat": "Chat",
"DE.Views.LeftMenu.tipComments": "Comments",

View file

@ -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.<br>Только два пользователя одновременно могут совместно редактировать документ.<br>Требуется больше? Рекомендуем приобрести корпоративную версию ONLYOFFICE.<br><a href=\"http://www.onlyoffice.com/free-edition.aspx\" target=\"_blank\">Читать дальше</a>",

View file

@ -319,7 +319,7 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -123,10 +123,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() {
@ -146,13 +146,13 @@ define([
var 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;
}
@ -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);

View file

@ -50,7 +50,8 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
contentWidth: 340,
height: 235,
sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88}
sizeMax: {width: 55.88, height: 55.88},
storageName: 'pe-img-settings-adv-category'
},
initialize : function(options) {
@ -183,6 +184,10 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
_setDefaults: function(props) {
@ -233,7 +238,7 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -293,12 +293,12 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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.01);
}
}
var rec = this.cmbLineRule.store.at(1);
rec.set({defaultUnit: Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});

View file

@ -51,7 +51,8 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
options: {
contentWidth: 320,
height: 394,
toggleGroup: 'paragraph-adv-settings-group'
toggleGroup: 'paragraph-adv-settings-group',
storageName: 'pe-para-settings-adv-category'
},
initialize : function(options) {
@ -337,7 +338,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
var rec = new Common.UI.DataViewModel();
rec.set({
tabPos: pos,
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: tab.get_Value()
});
arr.push(rec);
@ -357,7 +358,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
spinner.setDefaultUnit(Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]);
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
if (spinner.el.id == 'paragraphadv-spin-spacing')
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
else
@ -370,6 +371,10 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
onStrikeChange: function(field, newValue, oldValue, eOpts){
@ -506,7 +511,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
rec = new Common.UI.DataViewModel();
rec.set({
tabPos: val,
value: val + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
value: val + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: align
});
store.add(rec);

View file

@ -78,6 +78,8 @@ define([
this._sendUndoPoint = true;
this._sliderChanged = false;
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
this._state = {
Transparency: null,
FillType: Asc.c_oAscFill.FILL_TYPE_SOLID,
@ -983,8 +985,9 @@ define([
onBorderSizeChanged: function(before, combo, record, e) {
var me = this;
if (before) {
var value = parseFloat(record.value);
if (!(/^\s*(\d*(\.|,)?\d+)\s*(pt)?\s*$/.exec(record.value)) || value<0 || value>1584) {
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;
}

View file

@ -52,7 +52,8 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
toggleGroup: 'shape-adv-settings-group',
sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88},
properties: null
properties: null,
storageName: 'pe-shape-settings-adv-category'
},
initialize : function(options) {
@ -412,6 +413,10 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
_setDefaults: function(props) {
@ -528,7 +533,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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.01);
}
}

View file

@ -506,7 +506,7 @@ define([
step: 1,
width: 65,
value: '2 s',
defaultUnit : "s",
defaultUnit : this.textSec,
maxValue: 300,
minValue: 0
});
@ -517,7 +517,7 @@ define([
step: 1,
width: 70,
value: '2 s',
defaultUnit : "s",
defaultUnit : this.textSec,
maxValue: 300,
minValue: 0,
disabled: true
@ -1565,6 +1565,7 @@ define([
textRadial: 'Radial',
textDirection: 'Direction',
textStyle: 'Style',
textGradient: 'Gradient'
textGradient: 'Gradient',
textSec: 's'
}, PE.Views.SlideSettings || {}));
});

View file

@ -201,11 +201,10 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}
},
textTitle: 'Slide Size Settings',

View file

@ -48,7 +48,8 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
options: {
alias: 'TableSettingsAdvanced',
contentWidth: 280,
height: 385
height: 385,
storageName: 'pe-table-settings-adv-category'
},
initialize : function(options) {
@ -304,6 +305,10 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
getSettings: function() {
@ -380,7 +385,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -77,6 +77,8 @@ define([
this._sendUndoPoint = true;
this._sliderChanged = false;
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
this._state = {
Transparency: null,
FillType: Asc.c_oAscFill.FILL_TYPE_SOLID,
@ -1013,8 +1015,9 @@ define([
onBorderSizeChanged: function(before, combo, record, e) {
var me = this;
if (before) {
var value = parseFloat(record.value);
if (!(/^\s*(\d*(\.|,)?\d+)\s*(pt)?\s*$/.exec(record.value)) || value<0 || value>1584) {
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;
}

View file

@ -245,46 +245,83 @@
<script type="text/javascript" src="../../../../sdkjs/common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/docscoapi.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeChart.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/AdvancedOptions.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_map.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Metafile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/TextMeasurer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/WorkEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Hit.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ArcTo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ColorArray.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Constants.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/CommonController.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/States.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/CreateGeometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Geometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Format.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Shape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Path.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Image.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/GroupShape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartSpace.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/TextBody.js"></script>
<!-- For chart editor -->
<script type="text/javascript" src="../../../../sdkjs/common/Charts/charts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingArea.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/3DTransformation.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/Spline.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TextDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Externals.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/GlobalLoaders.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/CollaborativeEditingBase.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Controls.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Overlay.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/HatchPattern.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/scroll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/wordcopypaste.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_map.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Externals.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/GlobalLoaders.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/themes/Themes.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Drawing/ThemeLoader.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeChart.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/charts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/3DTransformation.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingArea.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Serialize2.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Styles.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Numbering.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Metafile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/CollaborativeEditingBase.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/CollaborativeEditing.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/GraphicsEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/WorkEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Controls.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Rulers.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Table.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Table/TableRecalculate.js"></script>
@ -293,57 +330,21 @@
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Table/TableCell.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Common.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Sections.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/scroll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/History.js"></script>
<script src="../../../../sdkjs/common/Drawings/Hit.js"></script>
<script src="../../../../sdkjs/common/Drawings/States.js"></script>
<script src="../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/Spline.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/HatchPattern.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Graphics.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Overlay.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/ShapeDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Drawing/Transitions.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Drawing/DrawingDocument.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Drawing/HtmlPage.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Constants.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/themes/Themes.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/SerializeWriter.js"></script>
<script src="../../../../sdkjs/word/Editor/SerializeCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Math.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ArcTo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/ColorArray.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/Format/Presentation.js"></script>
<script src="../../../../sdkjs/common/Drawings/CommonController.js"></script>
<script src="../../../../sdkjs/cell/view/DrawingObjectsController.js"></script>
<script src="../../../../sdkjs/slide/Editor/DrawingObjectsController.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Format.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/CreateGeometry.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Geometry.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Path.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Shape.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Image.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/GroupShape.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/ChartSpace.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/ChartFormat.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/TextBody.js"></script>
<script src="../../../../sdkjs/common/Drawings/TextDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/Format/Slide.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/Format/SlideMaster.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/Format/Layout.js"></script>
@ -388,7 +389,6 @@
<script type="text/javascript" src="../../../../sdkjs/cell/model/WorkbookElems.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/Workbook.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/CellInfo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/AdvancedOptions.js"></script>
<script src="../../../../sdkjs/word/Editor/FlowObjects.js"></script>
<script src="../../../../sdkjs/word/Editor/Paragraph.js"></script>

View file

@ -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.<br>Only two users can co-edit the document simultaneously.<br>Want more? Consider buying ONLYOFFICE Enterprise Edition.<br><a href=\"http://www.onlyoffice.com/free-edition.aspx\" target=\"_blank\">Read more</a>",
@ -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",

View file

@ -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.<br>Только два пользователя одновременно могут совместно редактировать документ.<br>Требуется больше? Рекомендуем приобрести корпоративную версию ONLYOFFICE.<br><a href=\"http://www.onlyoffice.com/free-edition.aspx\" target=\"_blank\">Читать дальше</a>",
@ -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": "Панорама",

View file

@ -153,6 +153,9 @@ define([
view.pmiDeleteCells.menu.on('item:click', _.bind(me.onDeleteCells, me));
view.pmiSortCells.menu.on('item:click', _.bind(me.onSortCells, me));
view.pmiClear.menu.on('item:click', _.bind(me.onClear, me));
view.pmiSelectTable.menu.on('item:click', _.bind(me.onSelectTable, me));
view.pmiInsertTable.menu.on('item:click', _.bind(me.onInsertTable, me));
view.pmiDeleteTable.menu.on('item:click', _.bind(me.onDeleteTable, me));
view.pmiInsFunction.on('click', _.bind(me.onInsFunction, me));
view.menuAddHyperlink.on('click', _.bind(me.onInsHyperlink, me));
view.menuEditHyperlink.on('click', _.bind(me.onInsHyperlink, me));
@ -349,6 +352,33 @@ define([
}
},
onSelectTable: function(menu, item) {
if (this.api && this.documentHolder.ssMenu.formatTableName) {
this.api.asc_changeSelectionFormatTable(this.documentHolder.ssMenu.formatTableName, item.value);
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Select Table');
}
},
onInsertTable: function(menu, item) {
if (this.api && this.documentHolder.ssMenu.formatTableName) {
this.api.asc_insertCellsInTable(this.documentHolder.ssMenu.formatTableName, item.value);
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Insert to Table');
}
},
onDeleteTable: function(menu, item) {
if (this.api && this.documentHolder.ssMenu.formatTableName) {
this.api.asc_deleteCellsInTable(this.documentHolder.ssMenu.formatTableName, item.value);
Common.NotificationCenter.trigger('edit:complete', this.documentHolder);
Common.component.Analytics.trackEvent('DocumentHolder', 'Delete from Table');
}
},
onInsFunction: function(item) {
var controller = this.getApplication().getController('FormulaDialog');
if (controller && this.api) {
@ -420,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();
@ -1147,17 +1177,35 @@ define([
seltype !== Asc.c_oAscSelectionType.RangeChart && seltype !== Asc.c_oAscSelectionType.RangeChartText && seltype !== Asc.c_oAscSelectionType.RangeShapeText)) {
if (!showMenu && !documentHolder.ssMenu.isVisible()) return;
var iscelledit = this.api.isCellEdited;
var iscelledit = this.api.isCellEdited,
formatTableInfo = cellinfo.asc_getFormatTableInfo(),
isintable = (formatTableInfo !== null);
documentHolder.ssMenu.formatTableName = (isintable) ? formatTableInfo.asc_getTableName() : null;
documentHolder.pmiInsertEntire.setVisible(isrowmenu||iscolmenu);
documentHolder.pmiInsertEntire.setCaption((isrowmenu) ? this.textInsertTop : this.textInsertLeft);
documentHolder.pmiDeleteEntire.setVisible(isrowmenu||iscolmenu);
documentHolder.pmiInsertCells.setVisible(iscellmenu && !iscelledit);
documentHolder.pmiDeleteCells.setVisible(iscellmenu && !iscelledit);
documentHolder.pmiSortCells.setVisible((iscellmenu||isallmenu||cansort) && !iscelledit);
documentHolder.pmiInsertCells.setVisible(iscellmenu && !iscelledit && !isintable);
documentHolder.pmiDeleteCells.setVisible(iscellmenu && !iscelledit && !isintable);
documentHolder.pmiSelectTable.setVisible(iscellmenu && !iscelledit && isintable);
documentHolder.pmiInsertTable.setVisible(iscellmenu && !iscelledit && isintable);
documentHolder.pmiDeleteTable.setVisible(iscellmenu && !iscelledit && isintable);
documentHolder.pmiSortCells.setVisible((iscellmenu||isallmenu||cansort) && !iscelledit && !isintable);
documentHolder.pmiInsFunction.setVisible(iscellmenu||insfunc);
documentHolder.pmiAddNamedRange.setVisible(iscellmenu && !iscelledit);
if (isintable) {
documentHolder.pmiInsertTable.menu.items[0].setDisabled(!formatTableInfo.asc_getIsInsertRowAbove());
documentHolder.pmiInsertTable.menu.items[1].setDisabled(!formatTableInfo.asc_getIsInsertRowBelow());
documentHolder.pmiInsertTable.menu.items[2].setDisabled(!formatTableInfo.asc_getIsInsertColumnLeft());
documentHolder.pmiInsertTable.menu.items[3].setDisabled(!formatTableInfo.asc_getIsInsertColumnRight());
documentHolder.pmiDeleteTable.menu.items[0].setDisabled(!formatTableInfo.asc_getIsDeleteRow());
documentHolder.pmiDeleteTable.menu.items[1].setDisabled(!formatTableInfo.asc_getIsDeleteColumn());
documentHolder.pmiDeleteTable.menu.items[2].setDisabled(!formatTableInfo.asc_getIsDeleteTable());
}
var hyperinfo = cellinfo.asc_getHyperlink();
documentHolder.menuHyperlink.setVisible(iscellmenu && hyperinfo && !iscelledit);
documentHolder.menuAddHyperlink.setVisible(iscellmenu && !hyperinfo && !iscelledit);
@ -1170,7 +1218,7 @@ define([
documentHolder.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane() ? documentHolder.textUnFreezePanes : documentHolder.textFreezePanes);
/** coauthoring begin **/
documentHolder.ssMenu.items[10].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments);
documentHolder.ssMenu.items[13].setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments);
documentHolder.pmiAddComment.setVisible(iscellmenu && !iscelledit && this.permissions.canCoAuthoring && this.permissions.canComments);
/** coauthoring end **/
documentHolder.pmiCellMenuSeparator.setVisible(iscellmenu || isrowmenu || iscolmenu || isallmenu || insfunc);
@ -1188,7 +1236,8 @@ define([
documentHolder.pmiClear.menu.items[3].setVisible(!this.permissions.isEditDiagram);
documentHolder.pmiClear.menu.items[4].setVisible(!this.permissions.isEditDiagram);
var filterInfo = cellinfo.asc_getAutoFilterInfo() && cellinfo.asc_getAutoFilterInfo().asc_getIsApplyAutoFilter();
var filterInfo = cellinfo.asc_getAutoFilterInfo();
filterInfo = (filterInfo) ? filterInfo.asc_getIsApplyAutoFilter() : false;
documentHolder.pmiInsertCells.menu.items[0].setDisabled(filterInfo);
documentHolder.pmiDeleteCells.menu.items[0].setDisabled(filterInfo);
documentHolder.pmiInsertCells.menu.items[1].setDisabled(filterInfo);
@ -1438,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 || {}));
});

View file

@ -77,7 +77,8 @@ define([
this._settings[Common.Utils.documentSettingsType.Image] = {panelId: "id-image-settings", panel: rightMenu.imageSettings, btn: rightMenu.btnImage, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Shape] = {panelId: "id-shape-settings", panel: rightMenu.shapeSettings, btn: rightMenu.btnShape, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.TextArt] = {panelId: "id-textart-settings", panel: rightMenu.textartSettings, btn: rightMenu.btnTextArt, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Chart] = {panelId: "id-chart-settings", panel: rightMenu.chartSettings, btn: rightMenu.btnChart, hidden: 1, locked: false};
this._settings[Common.Utils.documentSettingsType.Table] = {panelId: "id-table-settings", panel: rightMenu.tableSettings, btn: rightMenu.btnTable, hidden: 1, locked: false};
},
setApi: function(api) {
@ -103,19 +104,20 @@ define([
onSelectionChanged: function(info) {
var SelectedObjects = [],
selectType = info.asc_getFlags().asc_getSelectionType();
selectType = info.asc_getFlags().asc_getSelectionType(),
formatTableInfo = info.asc_getFormatTableInfo();
if (selectType == Asc.c_oAscSelectionType.RangeImage || selectType == Asc.c_oAscSelectionType.RangeShape ||
selectType == Asc.c_oAscSelectionType.RangeChart || selectType == Asc.c_oAscSelectionType.RangeChartText || selectType == Asc.c_oAscSelectionType.RangeShapeText) {
SelectedObjects = this.api.asc_getGraphicObjectProps();
}
if (SelectedObjects.length<=0 && !this.rightmenu.minimizedMode) {
if (SelectedObjects.length<=0 && !formatTableInfo && !this.rightmenu.minimizedMode) {
this.rightmenu.clearSelection();
this._openRightMenu = true;
}
this.onFocusObject(SelectedObjects);
this.onFocusObject(SelectedObjects, formatTableInfo);
var need_disable = info.asc_getLocked(),
me = this;
@ -128,7 +130,7 @@ define([
}
},
onFocusObject: function(SelectedObjects) {
onFocusObject: function(SelectedObjects, formatTableInfo) {
if (!this.editMode)
return;
@ -166,6 +168,12 @@ define([
this._settings[settingsType].locked = value.asc_getLocked();
}
if (formatTableInfo) {
settingsType = Common.Utils.documentSettingsType.Table;
this._settings[settingsType].props = formatTableInfo;
this._settings[settingsType].hidden = 0;
}
var lastactive = -1, currentactive, priorityactive = -1;
for (i=0; i<this._settings.length; ++i) {
var pnl = this._settings[i];
@ -211,8 +219,7 @@ define([
},
onCoAuthoringDisconnect: function() {
if (this.rightmenu)
this.rightmenu.SetDisabled('', true, true);
this.SetDisabled(true);
this.setMode({isEdit: false});
},
@ -256,6 +263,7 @@ define([
this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this));
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this));
this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this));
this.onSelectionChanged(this.api.asc_getCellInfo());
}
},
@ -289,6 +297,27 @@ define([
case Asc.c_oAscTypeSelectElement.Image:
return Common.Utils.documentSettingsType.Image;
}
},
SetDisabled: function(disabled) {
if (this.rightmenu) {
this.rightmenu.paragraphSettings.disableControls(disabled);
this.rightmenu.shapeSettings.disableControls(disabled);
this.rightmenu.imageSettings.disableControls(disabled);
this.rightmenu.chartSettings.disableControls(disabled);
this.rightmenu.tableSettings.disableControls(disabled);
if (disabled) {
this.rightmenu.btnText.setDisabled(disabled);
this.rightmenu.btnTable.setDisabled(disabled);
this.rightmenu.btnImage.setDisabled(disabled);
this.rightmenu.btnShape.setDisabled(disabled);
this.rightmenu.btnTextArt.setDisabled(disabled);
this.rightmenu.btnChart.setDisabled(disabled);
} else {
this.onSelectionChanged(this.api.asc_getCellInfo());
}
}
}
});
});

View file

@ -1182,9 +1182,7 @@ define([
shortcuts: {
'command+l,ctrl+l': function(e) {
if (me.editMode) {
var cellinfo = me.api.asc_getCellInfo(),
filterinfo = cellinfo.asc_getAutoFilterInfo();
if (!filterinfo || filterinfo.asc_getTableName()===null)
if (!me.api.asc_getCellInfo().asc_getFormatTableInfo())
me._setTableFormat(me.toolbar.mnuTableTemplatePicker.store.at(23).get('name'));
}
@ -1687,7 +1685,8 @@ define([
// (coauth_disable !== toolbar.btnClearStyle.isDisabled()) && toolbar.btnClearStyle.setDisabled(coauth_disable);
// (coauth_disable !== toolbar.btnCopyStyle.isDisabled()) && toolbar.btnCopyStyle.setDisabled(coauth_disable);
var filterInfo = info.asc_getAutoFilterInfo();
var filterInfo = info.asc_getAutoFilterInfo(),
formatTableInfo = info.asc_getFormatTableInfo();
if (!toolbar.mode.isEditMailMerge) {
/* read cell horizontal align */
fontparam = info.asc_getHorAlign();
@ -1764,7 +1763,7 @@ define([
}
}
need_disable = this._state.controlsdisabled.filters || filterInfo && (filterInfo.asc_getTableName()!==null || filterInfo.asc_getIsAutoFilter()===null);
need_disable = this._state.controlsdisabled.filters || formatTableInfo!==null || filterInfo && filterInfo.asc_getIsAutoFilter()===null;
// (need_disable !== toolbar.btnMerge.isDisabled()) && toolbar.btnMerge.setDisabled(need_disable);
toolbar.lockToolbar(SSE.enumLock.ruleMerge, need_disable, {array:[toolbar.btnMerge]});
@ -1795,7 +1794,7 @@ define([
{ array: [toolbar.btnSortDown, toolbar.btnSortUp, toolbar.mnuitemSortAZ, toolbar.mnuitemSortZA,
toolbar.btnTableTemplate,toolbar.btnSetAutofilter,toolbar.mnuitemAutoFilter,toolbar.btnAutofilter] });
val = (filterInfo) ? filterInfo.asc_getTableStyleName() : null;
val = (formatTableInfo) ? formatTableInfo.asc_getTableStyleName() : null;
if (this._state.tablestylename !== val && this.toolbar.mnuTableTemplatePicker) {
val = this.toolbar.mnuTableTemplatePicker.store.findWhere({name: val});
if (val) {
@ -1807,7 +1806,7 @@ define([
}
}
this._state.tablename = (filterInfo) ? filterInfo.asc_getTableName() : undefined;
this._state.tablename = (formatTableInfo) ? formatTableInfo.asc_getTableName() : undefined;
need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true);
toolbar.lockToolbar(SSE.enumLock.ruleDelFilter, need_disable, {array:[toolbar.btnClearAutofilter,toolbar.mnuitemClearFilter]});

View file

@ -1,5 +1,7 @@
<div id="view-right-menu" class="tool-menu right">
<div class="right-panel">
<div id="id-table-settings" class="settings-panel">
</div>
<div id="id-shape-settings" class="settings-panel">
</div>
<div id="id-image-settings" class="settings-panel">
@ -13,6 +15,7 @@
</div>
<div class="tool-menu-btns">
<div class="ct-btn-category arrow-left" />
<button id="id-right-menu-table" class="btn btn-category arrow-left" content-target="id-table-settings"><span class="btn-icon img-toolbarmenu btn-menu-table">&nbsp;</span></button>
<button id="id-right-menu-shape" class="btn btn-category arrow-left" content-target="id-shape-settings"><span class="btn-icon img-toolbarmenu btn-menu-shape">&nbsp;</span></button>
<button id="id-right-menu-image" class="btn btn-category arrow-left" content-target="id-image-settings"><span class="btn-icon img-toolbarmenu btn-menu-image">&nbsp;</span></button>
<button id="id-right-menu-chart" class="btn btn-category arrow-left" content-target="id-chart-settings"><span class="btn-icon img-toolbarmenu btn-menu-chart">&nbsp;</span></button>

View file

@ -0,0 +1,82 @@
<table cols="2">
<tr>
<td width="50%">
<label class="header"><%= scope.textRows %></label>
</td>
<td width="50%">
<label class="header"><%= scope.textColumns %></label>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="table-checkbox-header"></div>
</td>
<td class="padding-small">
<div id="table-checkbox-first"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="table-checkbox-total"></div>
</td>
<td class="padding-small">
<div id="table-checkbox-last"></div>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="table-checkbox-banded"></div>
</td>
<td class="padding-small">
<div id="table-checkbox-col-banded"></div>
</td>
</tr>
<tr>
<td colspan=2 class="padding-small">
<div id="table-checkbox-filter"></div>
</td>
</tr>
<tr>
<td colspan=2>
<label class="header"><%= scope.textTemplate %></label>
</td>
</tr>
<tr>
<td colspan=2 class="padding-small">
<div class="" id="table-combo-template" style="width: 100%; height: 60px;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="hidden">
<td colspan=2>
<label class="header"><%= scope.textTableName %></label>
</td>
</tr>
<tr class="hidden">
<td colspan=2 class="padding-small">
<div id="table-txt-name" class="input-row" style="width: 100%;"></div>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<label class="header" style="margin-top: 3px;"><%= scope.textResize %></label>
<button type="button" class="btn btn-text-default" id="table-btn-select-data" style="display: inline-block; float:right; min-width: 100px;"><%= scope.textSelectData %></button>
</td>
</tr>
<tr>
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<td colspan=2>
<label class="header" style="margin-top: 3px;"><%= scope.textEdit %></label>
<div id="table-btn-edit" style="display: inline-block; float:right;"></div>
</td>
</tr>
<tr class="finish-cell"></tr>
</table>

View file

@ -142,6 +142,8 @@ define([
if (this.api)
this.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None);
Common.NotificationCenter.trigger('cells:range', Asc.c_oAscSelectionDialogType.None);
SSE.getController('RightMenu').SetDisabled(false);
},
onKeyPress: function(event) {
@ -162,6 +164,11 @@ define([
this.close();
},
show: function () {
Common.UI.Window.prototype.show.call(this);
SSE.getController('RightMenu').SetDisabled(true);
},
txtTitle : 'Select Data Range',
textCancel : 'Cancel',
txtEmpty : 'This field is required',

View file

@ -321,7 +321,7 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -50,7 +50,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
options: {
contentWidth: 322,
height: 535,
toggleGroup: 'chart-settings-dlg-group'
toggleGroup: 'chart-settings-dlg-group',
storageName: 'sse-chart-settings-adv-category'
},
initialize : function(options) {
@ -806,6 +807,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
this.updateChartStyles(this.api.asc_getChartPreviews(this._state.ChartType));
this._setDefaults(this.chartSettings);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
onSelectType: function(btn, picker, itemView, record) {
@ -1148,8 +1153,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ChartSettingsDlg.template'
} else
this.txtDataRange.showError([this.txtEmpty]);
this.btnsCategory[0].toggle(true);
this.onCategoryClick(this.btnsCategory[0]);
this.setActiveCategory(0);
if (isvalid == Asc.c_oAscError.ID.StockChartError) {
Common.UI.warning({msg: this.errorStockChart});
} else if (isvalid == Asc.c_oAscError.ID.MaxDataSeriesError) {

View file

@ -104,6 +104,19 @@ define([
value : 'paste'
});
me.pmiSelectTable = new Common.UI.MenuItem({
caption : me.txtSelect,
menu : new Common.UI.Menu({
menuAlign : 'tl-tr',
items: [
{ caption: this.selectRowText, value: Asc.c_oAscChangeSelectionFormatTable.row},
{ caption: this.selectColumnText, value: Asc.c_oAscChangeSelectionFormatTable.column},
{ caption: this.selectDataText, value: Asc.c_oAscChangeSelectionFormatTable.data},
{ caption: this.selectTableText, value: Asc.c_oAscChangeSelectionFormatTable.all}
]
})
});
me.pmiInsertEntire = new Common.UI.MenuItem({
caption : me.txtInsert
});
@ -129,6 +142,19 @@ define([
]
})
});
me.pmiInsertTable = new Common.UI.MenuItem({
caption : me.txtInsert,
menu : new Common.UI.Menu({
menuAlign : 'tl-tr',
items: [
{ caption: me.insertRowAboveText, value: Asc.c_oAscInsertOptions.InsertTableRowAbove},
{ caption: me.insertRowBelowText, value: Asc.c_oAscInsertOptions.InsertTableRowBelow},
{ caption: me.insertColumnLeftText, value: Asc.c_oAscInsertOptions.InsertTableColLeft},
{ caption: me.insertColumnRightText, value: Asc.c_oAscInsertOptions.InsertTableColRight}
]
})
});
me.pmiDeleteEntire = new Common.UI.MenuItem({
caption : me.txtDelete
@ -156,6 +182,18 @@ define([
})
});
me.pmiDeleteTable = new Common.UI.MenuItem({
caption : me.txtDelete,
menu : new Common.UI.Menu({
menuAlign : 'tl-tr',
items: [
{ caption: this.deleteRowText, value: Asc.c_oAscDeleteOptions.DeleteRows},
{ caption: this.deleteColumnText, value: Asc.c_oAscDeleteOptions.DeleteColumns},
{ caption: this.deleteTableText, value: Asc.c_oAscDeleteOptions.DeleteTable}
]
})
});
me.pmiClear = new Common.UI.MenuItem({
caption : me.txtClear,
menu : new Common.UI.Menu({
@ -273,10 +311,13 @@ define([
me.pmiCopy,
me.pmiPaste,
{caption: '--'},
me.pmiSelectTable,
me.pmiInsertEntire,
me.pmiInsertCells,
me.pmiInsertTable,
me.pmiDeleteEntire,
me.pmiDeleteCells,
me.pmiDeleteTable,
me.pmiClear,
me.pmiSortCells,
{caption: '--'},
@ -576,7 +617,19 @@ define([
direct270Text: 'Rotate at 270°',
txtAddNamedRange: 'Define Name',
textFreezePanes: 'Freeze Panes',
textUnFreezePanes: 'Unfreeze Panes'
textUnFreezePanes: 'Unfreeze Panes',
txtSelect: 'Select',
selectRowText : 'Select Row',
selectColumnText : 'Select Entire Column',
selectDataText : 'Select Column Data',
selectTableText : 'Select Table',
insertRowAboveText : 'Insert Row Above',
insertRowBelowText : 'Insert Row Below',
insertColumnLeftText : 'Insert Column Left',
insertColumnRightText : 'Insert Column Right',
deleteRowText : 'Delete Row',
deleteColumnText : 'Delete Column',
deleteTableText : 'Delete Table'
}, SSE.Views.DocumentHolder || {}));
});

View file

@ -379,7 +379,7 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}
@ -390,8 +390,8 @@ define([
pagewidth = /^\d{3}\.?\d*/.exec(value),
pageheight = /\d{3}\.?\d*$/.exec(value);
item.set('displayValue', item.get('caption') + ' (' + parseFloat(Common.Utils.Metric.fnRecalcFromMM(pagewidth).toFixed(2)) + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ' x ' +
parseFloat(Common.Utils.Metric.fnRecalcFromMM(pageheight).toFixed(2)) + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ')');
item.set('displayValue', item.get('caption') + ' (' + parseFloat(Common.Utils.Metric.fnRecalcFromMM(pagewidth).toFixed(2)) + Common.Utils.Metric.getCurrentMetricName() + ' x ' +
parseFloat(Common.Utils.Metric.fnRecalcFromMM(pageheight).toFixed(2)) + Common.Utils.Metric.getCurrentMetricName() + ')');
}
this.cmbPaperSize.onResetItems();
},
@ -590,12 +590,32 @@ define([
this.cmbRegSettings = new Common.UI.ComboBox({
el : $('#fms-cmb-reg-settings'),
style : 'width: 160px;',
menuStyle: 'max-height: 185px;',
editable : false,
cls : 'input-group-nr',
data : [
{ value: 0x0409, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0409)[1] },
{ value: 0x042C, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x042C)[1] },
{ value: 0x0405, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0405)[1] },
{ value: 0x0407, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0407)[1] },
{ value: 0x0419, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0419)[1] }
{ value: 0x0408, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0408)[1] },
{ value: 0x0809, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0809)[1] },
{ value: 0x0409, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0409)[1] },
{ value: 0x0C0A, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0C0A)[1] },
{ value: 0x040B, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x040B)[1] },
{ value: 0x040C, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x040C)[1] },
{ value: 0x0410, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0410)[1] },
{ value: 0x0411, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0411)[1] },
{ value: 0x0412, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0412)[1] },
{ value: 0x0426, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0426)[1] },
{ value: 0x0415, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0415)[1] },
{ value: 0x0416, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0416)[1] },
{ value: 0x0816, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0816)[1] },
{ value: 0x0419, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0419)[1] },
{ value: 0x0424, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0424)[1] },
{ value: 0x041F, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x041F)[1] },
{ value: 0x0422, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0422)[1] },
{ value: 0x042A, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x042A)[1] },
{ value: 0x0804, displayValue: Common.util.LanguageInfo.getLocalLanguageName(0x0804)[1] }
]
}).on('selected', _.bind(function(combo, record) {
this.updateRegionalExample(record.value);

View file

@ -168,7 +168,7 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}

View file

@ -298,12 +298,12 @@ define([
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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.01);
}
}
var rec = this.cmbLineRule.store.at(1);
rec.set({defaultUnit: Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
rec.set({defaultUnit: Common.Utils.Metric.getCurrentMetricName(),
minValue: parseFloat(Common.Utils.Metric.fnRecalcFromMM(0.3).toFixed(2)),
step: (Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt) ? 1 : 0.01});

View file

@ -51,7 +51,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
options: {
contentWidth: 320,
height: 394,
toggleGroup: 'paragraph-adv-settings-group'
toggleGroup: 'paragraph-adv-settings-group',
storageName: 'sse-para-settings-adv-category'
},
initialize : function(options) {
@ -336,7 +337,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
var rec = new Common.UI.DataViewModel();
rec.set({
tabPos: pos,
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: tab.asc_getValue()
});
arr.push(rec);
@ -356,7 +357,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
spinner.setDefaultUnit(Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()]);
spinner.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName());
if (spinner.el.id == 'paragraphadv-spin-spacing' || spinner.el.id == 'paragraphadv-spin-position' )
spinner.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt ? 1 : 0.01);
else
@ -369,6 +370,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
onStrikeChange: function(field, newValue, oldValue, eOpts){
@ -505,7 +510,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ParagraphSettingsAdvanced.
rec = new Common.UI.DataViewModel();
rec.set({
tabPos: val,
value: val + ' ' + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()],
value: val + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: align
});
store.add(rec);

View file

@ -241,7 +241,7 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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);
}
}
@ -252,8 +252,8 @@ define([ 'text!spreadsheeteditor/main/app/template/PrintSettings.template',
pagewidth = /^\d{3}\.?\d*/.exec(value),
pageheight = /\d{3}\.?\d*$/.exec(value);
item.set('displayValue', item.get('caption') + ' (' + parseFloat(Common.Utils.Metric.fnRecalcFromMM(pagewidth).toFixed(2)) + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ' x ' +
parseFloat(Common.Utils.Metric.fnRecalcFromMM(pageheight).toFixed(2)) + Common.Utils.Metric.metricName[Common.Utils.Metric.getCurrentMetric()] + ')');
item.set('displayValue', item.get('caption') + ' (' + parseFloat(Common.Utils.Metric.fnRecalcFromMM(pagewidth).toFixed(2)) + Common.Utils.Metric.getCurrentMetricName() + ' x ' +
parseFloat(Common.Utils.Metric.fnRecalcFromMM(pageheight).toFixed(2)) + Common.Utils.Metric.getCurrentMetricName() + ')');
}
this.cmbPaperSize.onResetItems();
},

View file

@ -54,6 +54,7 @@ define([
'spreadsheeteditor/main/app/view/ChartSettings',
'spreadsheeteditor/main/app/view/ShapeSettings',
'spreadsheeteditor/main/app/view/TextArtSettings',
'spreadsheeteditor/main/app/view/TableSettings',
'common/main/lib/component/Scroller'
], function (menuTemplate, $, _, Backbone) {
'use strict';
@ -108,12 +109,21 @@ define([
toggleGroup: 'tabpanelbtnsGroup'
});
this.btnTable = new Common.UI.Button({
hint: this.txtTableSettings,
asctype: Common.Utils.documentSettingsType.Table,
enableToggle: true,
disabled: true,
toggleGroup: 'tabpanelbtnsGroup'
});
this._settings = [];
this._settings[Common.Utils.documentSettingsType.Paragraph] = {panel: "id-paragraph-settings", btn: this.btnText};
this._settings[Common.Utils.documentSettingsType.Image] = {panel: "id-image-settings", btn: this.btnImage};
this._settings[Common.Utils.documentSettingsType.Shape] = {panel: "id-shape-settings", btn: this.btnShape};
this._settings[Common.Utils.documentSettingsType.Chart] = {panel: "id-chart-settings", btn: this.btnChart};
this._settings[Common.Utils.documentSettingsType.TextArt] = {panel: "id-textart-settings", btn: this.btnTextArt};
this._settings[Common.Utils.documentSettingsType.Table] = {panel: "id-table-settings", btn: this.btnTable};
return this;
},
@ -134,18 +144,21 @@ define([
this.btnChart.el = $('#id-right-menu-chart'); this.btnChart.render();
this.btnShape.el = $('#id-right-menu-shape'); this.btnShape.render();
this.btnTextArt.el = $('#id-right-menu-textart'); this.btnTextArt.render();
this.btnTable.el = $('#id-right-menu-table'); this.btnTable.render();
this.btnText.on('click', _.bind(this.onBtnMenuClick, this));
this.btnImage.on('click', _.bind(this.onBtnMenuClick, this));
this.btnChart.on('click', _.bind(this.onBtnMenuClick, this));
this.btnShape.on('click', _.bind(this.onBtnMenuClick, this));
this.btnTextArt.on('click', _.bind(this.onBtnMenuClick, this));
this.btnTable.on('click', _.bind(this.onBtnMenuClick, this));
this.paragraphSettings = new SSE.Views.ParagraphSettings();
this.imageSettings = new SSE.Views.ImageSettings();
this.chartSettings = new SSE.Views.ChartSettings();
this.shapeSettings = new SSE.Views.ShapeSettings();
this.textartSettings = new SSE.Views.TextArtSettings();
this.tableSettings = new SSE.Views.TableSettings();
if (_.isUndefined(this.scroller)) {
this.scroller = new Common.UI.Scroller({
@ -167,6 +180,7 @@ define([
this.chartSettings.setApi(api);
this.shapeSettings.setApi(api);
this.textartSettings.setApi(api);
this.tableSettings.setApi(api);
},
setMode: function(mode) {
@ -223,21 +237,6 @@ define([
return (this.minimizedMode) ? null : $(".settings-panel.active")[0].id;
},
SetDisabled: function(id, disabled, all) {
if (all) {
this.paragraphSettings.disableControls(disabled);
this.shapeSettings.disableControls(disabled);
this.imageSettings.disableControls(disabled);
this.chartSettings.disableControls(disabled);
} else {
var cmp = $("#" + id);
if (disabled !== cmp.hasClass('disabled')) {
cmp.toggleClass('disabled', disabled);
(disabled) ? cmp.attr({disabled: disabled}) : cmp.removeAttr('disabled');
}
}
},
clearSelection: function() {
var target_pane = $(".right-panel");
target_pane.find('> .active').removeClass('active');
@ -255,6 +254,7 @@ define([
txtImageSettings: 'Image Settings',
txtShapeSettings: 'Shape Settings',
txtTextArtSettings: 'Text Art Settings',
txtChartSettings: 'Chart Settings'
txtChartSettings: 'Chart Settings',
txtTableSettings: 'Table Settings'
}, SSE.Views.RightMenu || {}));
});

View file

@ -79,6 +79,8 @@ define([
this._sendUndoPoint = true;
this._sliderChanged = false;
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
this._state = {
Transparency: null,
FillType: Asc.c_oAscFill.FILL_TYPE_SOLID,
@ -998,8 +1000,9 @@ define([
onBorderSizeChanged: function(before, combo, record, e) {
var me = this;
if (before) {
var value = parseFloat(record.value);
if (!(/^\s*(\d*(\.|,)?\d+)\s*(pt)?\s*$/.exec(record.value)) || value<0 || value>1584) {
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;
}

View file

@ -52,7 +52,8 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
toggleGroup: 'shape-adv-settings-group',
sizeOriginal: {width: 0, height: 0},
sizeMax: {width: 55.88, height: 55.88},
properties: null
properties: null,
storageName: 'sse-shape-settings-adv-category'
},
initialize : function(options) {
@ -436,6 +437,10 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
if (this.storageName) {
var value = Common.localStorage.getItem(this.storageName);
this.setActiveCategory((value!==null) ? parseInt(value) : 0);
}
},
_setDefaults: function(props) {
@ -554,7 +559,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp
if (this.spinners) {
for (var i=0; i<this.spinners.length; i++) {
var spinner = this.spinners[i];
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.01);
}
}

View file

@ -63,8 +63,8 @@ define([
this.template = [
'<div class="box">',
'<div id="id-dlg-tableoptions-range" class="input-row" style="margin-bottom: 10px;"></div>',
'<div class="input-row" id="id-dlg-tableoptions-title"></div>',
'<div id="id-dlg-tableoptions-range" class="input-row" style="margin-bottom: 5px;"></div>',
'<div class="input-row" id="id-dlg-tableoptions-title" style="margin-top: 5px;"></div>',
'</div>',
'<div class="footer right">',
'<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">' + this.okButtonText + '</button>',
@ -73,6 +73,7 @@ define([
].join('');
this.options.tpl = _.template(this.template, this.options);
this.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTable;
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -114,30 +115,39 @@ define([
if (settings.api) {
me.api = settings.api;
var options = me.api.asc_getAddFormatTableOptions();
if (settings.range) {
me.cbTitle.setVisible(false);
me.setHeight(130);
me.checkRangeType = Asc.c_oAscSelectionDialogType.FormatTableChangeRange;
me.inputRange.setValue(settings.range);
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.FormatTable, settings.range);
} else {
var options = me.api.asc_getAddFormatTableOptions();
me.inputRange.setValue(options.asc_getRange());
me.cbTitle.setValue(options.asc_getIsTitle());
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.FormatTable, options.asc_getRange());
}
if (settings.title)
me.setTitle(settings.title);
this.inputRange.setValue(options.asc_getRange());
this.cbTitle.setValue(options.asc_getIsTitle());
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.FormatTable, options.asc_getRange());
me.api.asc_unregisterCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
me.api.asc_registerCallback('asc_onSelectionRangeChanged', _.bind(me.onApiRangeChanged, me));
Common.NotificationCenter.trigger('cells:range', Asc.c_oAscSelectionDialogType.FormatTable);
}
me.inputRange.validation = function(value) {
var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.FormatTable, value, false);
var isvalid = me.api.asc_checkDataRange(me.checkRangeType, value, false);
return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.txtInvalidRange : true;
};
},
getSettings: function () {
var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());
// options.asc_setRange(this.inputRange.getValue());
options.asc_setIsTitle(this.cbTitle.checked);
return options;
if (this.checkRangeType == Asc.c_oAscSelectionDialogType.FormatTable) {
var options = this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());
options.asc_setIsTitle(this.cbTitle.checked);
return options;
} else
return this.inputRange.getValue();
},
onApiRangeChanged: function(info) {
@ -147,12 +157,16 @@ define([
},
isRangeValid: function() {
var isvalid = this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.FormatTable, this.inputRange.getValue(), true);
var isvalid = this.api.asc_checkDataRange(this.checkRangeType, this.inputRange.getValue(), true);
if (isvalid == Asc.c_oAscError.ID.No)
return true;
else {
if (isvalid == Asc.c_oAscError.ID.AutoFilterDataRangeError) {
Common.UI.warning({msg: this.errorAutoFilterDataRange});
} else if (isvalid == Asc.c_oAscError.ID.FTChangeTableRangeError) {
Common.UI.warning({msg: this.errorFTChangeTableRangeError});
} else if (isvalid == Asc.c_oAscError.ID.FTRangeIncludedOtherTables) {
Common.UI.warning({msg: this.errorFTRangeIncludedOtherTables});
}
}
return false;
@ -165,9 +179,10 @@ define([
onClose: function(event) {
if (this.api)
this.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None);
Common.NotificationCenter.trigger('cells:range', Asc.c_oAscSelectionDialogType.None);
Common.NotificationCenter.trigger('edit:complete', this);
SSE.getController('RightMenu').SetDisabled(false);
},
onKeyPress: function(event) {
@ -188,20 +203,18 @@ define([
this.close();
},
// show: function () {
// Common.UI.Window.prototype.show.call(this);
//
// var me = this;
// _.delay(function () {
// me.inputRange.cmpEl.find('input').focus();
// }, 500, me);
// },
show: function () {
Common.UI.Window.prototype.show.call(this);
SSE.getController('RightMenu').SetDisabled(true);
},
txtTitle : 'Title',
txtFormat : 'Format as table',
txtFormat : 'Create table',
textCancel : 'Cancel',
txtEmpty : 'This field is required',
txtInvalidRange: 'ERROR! Invalid cells range',
errorAutoFilterDataRange: 'The operation could not be done for the selected range of cells.<br>Select a uniform data range inside or outside the table and try again.'
errorAutoFilterDataRange: 'The operation could not be done for the selected range of cells.<br>Select a uniform data range inside or outside the table and try again.',
errorFTChangeTableRangeError: 'Operation could not be completed for the selected cell range.<br>Select a range so that the first table row was on the same row<br>and the resulting table overlapped the current one.',
errorFTRangeIncludedOtherTables: 'Operation could not be completed for the selected cell range.<br>Select a range which does not include other tables.'
}, SSE.Views.TableOptionsDialog || {}))
});

View file

@ -0,0 +1,458 @@
/**
* TableSettings.js
*
* Created by Julia Radzhabova on 3/28/16
* Copyright (c) 2016 Ascensio System SIA. All rights reserved.
*
*/
define([
'text!spreadsheeteditor/main/app/template/TableSettings.template',
'jquery',
'underscore',
'backbone',
'common/main/lib/component/Button',
'common/main/lib/component/CheckBox',
'common/main/lib/component/ComboDataView',
'spreadsheeteditor/main/app/view/TableOptionsDialog'
], function (menuTemplate, $, _, Backbone) {
'use strict';
SSE.Views.TableSettings = Backbone.View.extend(_.extend({
el: '#id-table-settings',
// Compile our stats template
template: _.template(menuTemplate),
// Delegated events for creating new items, and clearing completed ones.
events: {
},
options: {
alias: 'TableSettings'
},
initialize: function () {
var me = this;
this._state = {
TableName: '',
TemplateName: '',
Range: '',
CheckHeader: false,
CheckTotal: false,
CheckBanded: false,
CheckFirst: false,
CheckLast: false,
CheckColBanded: false,
CheckFilter: false,
DisabledControls: false,
TableNameError: false
};
this.lockedControls = [];
this._locked = false;
this._originalProps = null;
this._noApply = false;
this.render();
this.chHeader = new Common.UI.CheckBox({
el: $('#table-checkbox-header'),
labelText: this.textHeader
});
this.lockedControls.push(this.chHeader);
this.chTotal = new Common.UI.CheckBox({
el: $('#table-checkbox-total'),
labelText: this.textTotal
});
this.lockedControls.push(this.chTotal);
this.chBanded = new Common.UI.CheckBox({
el: $('#table-checkbox-banded'),
labelText: this.textBanded
});
this.lockedControls.push(this.chBanded);
this.chFirst = new Common.UI.CheckBox({
el: $('#table-checkbox-first'),
labelText: this.textFirst
});
this.lockedControls.push(this.chFirst);
this.chLast = new Common.UI.CheckBox({
el: $('#table-checkbox-last'),
labelText: this.textLast
});
this.lockedControls.push(this.chLast);
this.chColBanded = new Common.UI.CheckBox({
el: $('#table-checkbox-col-banded'),
labelText: this.textBanded
});
this.lockedControls.push(this.chColBanded);
this.chFilter = new Common.UI.CheckBox({
el: $('#table-checkbox-filter'),
labelText: this.textFilter
});
this.lockedControls.push(this.chFilter);
this.chHeader.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.rowHeader));
this.chTotal.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.rowTotal));
this.chBanded.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.rowBanded));
this.chFirst.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.columnFirst));
this.chLast.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.columnLast));
this.chColBanded.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.columnBanded));
this.chFilter.on('change', _.bind(this.onCheckTemplateChange, this, Asc.c_oAscChangeTableStyleInfo.filterButton));
this.cmbTableTemplate = new Common.UI.ComboDataView({
itemWidth: 61,
itemHeight: 46,
menuMaxHeight: 300,
enableKeyEvents: true
});
this.cmbTableTemplate.render($('#table-combo-template'));
this.cmbTableTemplate.openButton.menu.cmpEl.css({
'min-width': 175,
'max-width': 175
});
this.cmbTableTemplate.on('click', _.bind(this.onTableTemplateSelect, this));
this.cmbTableTemplate.openButton.menu.on('show:after', function () {
me.cmbTableTemplate.menuPicker.scroller.update({alwaysVisibleY: true});
});
this.lockedControls.push(this.cmbTableTemplate);
this.txtTableName = new Common.UI.InputField({
el : $('#table-txt-name'),
name : 'tablename',
style : 'width: 100%;',
validateOnBlur: false
});
this.txtTableName.on('changed:after', _.bind(this.onTableNameChanged, this));
this.lockedControls.push(this.txtTableName);
this.btnSelectData = new Common.UI.Button({
el: $('#table-btn-select-data')
});
this.btnSelectData.on('click', _.bind(this.onSelectData, this));
this.lockedControls.push(this.btnSelectData);
this.btnEdit = new Common.UI.Button({
cls: 'btn-icon-default',
iconCls: 'btn-edit-table',
menu : new Common.UI.Menu({
menuAlign: 'tr-br',
items: [
{ caption: this.selectRowText, value: Asc.c_oAscChangeSelectionFormatTable.row, idx: 0 },
{ caption: this.selectColumnText, value: Asc.c_oAscChangeSelectionFormatTable.column, idx: 1 },
{ caption: this.selectDataText, value: Asc.c_oAscChangeSelectionFormatTable.data, idx: 2 },
{ caption: this.selectTableText, value: Asc.c_oAscChangeSelectionFormatTable.all, idx: 3 },
{ caption: '--' },
{ caption: this.insertRowAboveText, value: Asc.c_oAscInsertOptions.InsertTableRowAbove, idx: 4 },
{ caption: this.insertRowBelowText, value: Asc.c_oAscInsertOptions.InsertTableRowBelow, idx: 5 },
{ caption: this.insertColumnLeftText, value: Asc.c_oAscInsertOptions.InsertTableColLeft, idx: 6 },
{ caption: this.insertColumnRightText, value: Asc.c_oAscInsertOptions.InsertTableColRight, idx: 7 },
{ caption: '--' },
{ caption: this.deleteRowText, value: Asc.c_oAscDeleteOptions.DeleteRows, idx: 8 },
{ caption: this.deleteColumnText, value: Asc.c_oAscDeleteOptions.DeleteColumns, idx: 9 },
{ caption: this.deleteTableText, value: Asc.c_oAscDeleteOptions.DeleteTable, idx: 10 }
]
})
});
this.btnEdit.render( $('#table-btn-edit')) ;
this.btnEdit.menu.on('show:after', _.bind( function(menu){
if (this.api) {
menu.items[5].setDisabled(!this._originalProps.asc_getIsInsertRowAbove());
menu.items[6].setDisabled(!this._originalProps.asc_getIsInsertRowBelow());
menu.items[7].setDisabled(!this._originalProps.asc_getIsInsertColumnLeft());
menu.items[8].setDisabled(!this._originalProps.asc_getIsInsertColumnRight());
menu.items[10].setDisabled(!this._originalProps.asc_getIsDeleteRow());
menu.items[11].setDisabled(!this._originalProps.asc_getIsDeleteColumn());
menu.items[12].setDisabled(!this._originalProps.asc_getIsDeleteTable());
}
}, this));
this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this));
this.lockedControls.push(this.btnEdit);
},
onCheckTemplateChange: function(type, field, newValue, oldValue, eOpts) {
if (this.api)
this.api.asc_changeFormatTableInfo(this._state.TableName, type, newValue=='checked');
Common.NotificationCenter.trigger('edit:complete', this);
},
onTableTemplateSelect: function(combo, record){
if (this.api && !this._noApply) {
if (this._state.TemplateName)
this.api.asc_changeAutoFilter(this._state.TableName, Asc.c_oAscChangeFilterOptions.style, record.get('name'));
}
Common.NotificationCenter.trigger('edit:complete', this);
},
onEditClick: function(menu, item, e) {
if (this.api) {
if (item.options.idx>=0 && item.options.idx<4)
this.api.asc_changeSelectionFormatTable(this._state.TableName, item.value);
else if (item.options.idx>=4 && item.options.idx<8) {
this.api.asc_insertCellsInTable(this._state.TableName, item.value);
} else {
this.api.asc_deleteCellsInTable(this._state.TableName, item.value);
}
}
Common.NotificationCenter.trigger('edit:complete', this);
},
onTableNameChanged: function(input, newValue, oldValue) {
var oldName = this._state.TableName;
this._state.TableName = '';
if (oldName.toLowerCase() == newValue.toLowerCase()) {
Common.NotificationCenter.trigger('edit:complete', this);
return;
}
var me = this,
isvalid = this.api.asc_checkDefinedName(newValue, null);
if (isvalid.asc_getStatus() === true) isvalid = true;
else {
switch (isvalid.asc_getReason()) {
case Asc.c_oAscDefinedNameReason.IsLocked:
isvalid = this.textIsLocked;
break;
case Asc.c_oAscDefinedNameReason.Existed:
isvalid = this.textExistName;
break;
case Asc.c_oAscDefinedNameReason.NameReserved:
isvalid = this.textReservedName;
break;
default:
isvalid = this.textInvalidName;
}
}
if (isvalid === true) {
this.api.asc_changeDisplayNameTable(oldName, newValue);
Common.NotificationCenter.trigger('edit:complete', this);
} else if (!this._state.TableNameError) {
this._state.TableNameError = true;
Common.UI.alert({
msg: isvalid,
title: this.notcriticalErrorTitle,
iconCls: 'warn',
buttons: ['ok'],
callback: function(btn){
Common.NotificationCenter.trigger('edit:complete', this);
me._state.TableNameError = false;
}
});
}
},
render: function () {
var el = $(this.el);
el.html(this.template({
scope: this
}));
},
setApi: function(o) {
this.api = o;
if (o) {
this.api.asc_registerCallback('asc_onInitTablePictures', _.bind(this.onApiInitTableTemplates, this));
}
return this;
},
ChangeSettings: function(props) {
this.disableControls(this._locked);
if (props )//formatTableInfo
{
this._originalProps = props;
var value = props.asc_getTableName();
if (this._state.TableName!==value) {
this.txtTableName.setValue(value);
this._state.TableName=value;
}
this._state.Range = props.asc_getTableRange();
var needTablePictures = false;
value = props.asc_getFirstRow();
if (this._state.CheckHeader!==value) {
this.chHeader.setValue(value, true);
this._state.CheckHeader=value;
needTablePictures = true;
}
value = props.asc_getLastRow();
if (this._state.CheckTotal!==value) {
this.chTotal.setValue(value, true);
this._state.CheckTotal=value;
needTablePictures = true;
}
value = props.asc_getBandHor();
if (this._state.CheckBanded!==value) {
this.chBanded.setValue(value, true);
this._state.CheckBanded=value;
needTablePictures = true;
}
value = props.asc_getFirstCol();
if (this._state.CheckFirst!==value) {
this.chFirst.setValue(value, true);
this._state.CheckFirst=value;
needTablePictures = true;
}
value = props.asc_getLastCol();
if (this._state.CheckLast!==value) {
this.chLast.setValue(value, true);
this._state.CheckLast=value;
needTablePictures = true;
}
value = props.asc_getBandVer();
if (this._state.CheckColBanded!==value) {
this.chColBanded.setValue(value, true);
this._state.CheckColBanded=value;
needTablePictures = true;
}
value = props.asc_getFilterButton();
if (this._state.CheckFilter!==value) {
this.chFilter.setValue(value, true);
this._state.CheckFilter=value;
}
if (this.chFilter.isDisabled() == this._state.CheckHeader)
this.chFilter.setDisabled(!this._state.CheckHeader);
if (needTablePictures)
this.onApiInitTableTemplates(this.api.asc_getTablePictures(props));
//for table-template
value = props.asc_getTableStyleName();
if (this._state.TemplateName!==value || this._isTemplatesChanged) {
this.cmbTableTemplate.suspendEvents();
var rec = this.cmbTableTemplate.menuPicker.store.findWhere({
name: value
});
this.cmbTableTemplate.menuPicker.selectRecord(rec);
this.cmbTableTemplate.resumeEvents();
if (this._isTemplatesChanged) {
if (rec)
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.getSelectedRec(),true);
else
this.cmbTableTemplate.fillComboView(this.cmbTableTemplate.menuPicker.store.at(0), true);
}
this._state.TemplateName=value;
}
this._isTemplatesChanged = false;
}
},
onApiInitTableTemplates: function(Templates){
var self = this;
this._isTemplatesChanged = true;
var count = self.cmbTableTemplate.menuPicker.store.length;
if (count>0 && count==Templates.length) {
var data = self.cmbTableTemplate.menuPicker.store.models;
_.each(Templates, function(template, index){
data[index].set('imageUrl', template.asc_getImage());
});
} else {
self.cmbTableTemplate.menuPicker.store.reset([]);
var arr = [];
_.each(Templates, function(template){
arr.push({
id : Common.UI.getId(),
name : template.asc_getName(),
caption : template.asc_getDisplayName(),
type : template.asc_getType(),
imageUrl : template.asc_getImage(),
allowSelected : true,
selected : false
});
});
self.cmbTableTemplate.menuPicker.store.add(arr);
}
},
onSelectData: function() {
var me = this;
if (me.api) {
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
me.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.None);
me.api.asc_changeTableRange(me._state.TableName, dlg.getSettings());
}
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
};
var win = new SSE.Views.TableOptionsDialog({
handler: handlerDlg
});
win.show();
win.setSettings({
api : me.api,
range : me._state.Range,
title: me.textResize
});
}
},
setLocked: function (locked) {
this._locked = locked;
},
disableControls: function(disable) {
if (this._state.DisabledControls!==disable) {
this._state.DisabledControls = disable;
_.each(this.lockedControls, function(item) {
item.setDisabled(disable);
});
}
},
textEdit: 'Rows & Columns',
selectRowText : 'Select Row',
selectColumnText : 'Select Entire Column',
selectDataText : 'Select Column Data',
selectTableText : 'Select Table',
insertRowAboveText : 'Insert Row Above',
insertRowBelowText : 'Insert Row Below',
insertColumnLeftText : 'Insert Column Left',
insertColumnRightText : 'Insert Column Right',
deleteRowText : 'Delete Row',
deleteColumnText : 'Delete Column',
deleteTableText : 'Delete Table',
textOK : 'OK',
textCancel : 'Cancel',
textTemplate : 'Select From Template',
textRows : 'Rows',
textColumns : 'Columns',
textHeader : 'Header',
textTotal : 'Total',
textBanded : 'Banded',
textFirst : 'First',
textLast : 'Last',
textEmptyTemplate : 'No templates',
textFilter : 'Filter button',
textTableName : 'Table Name',
textResize : 'Resize table',
textSelectData : 'Select Data',
textInvalidName : 'ERROR! Invalid table name',
textExistName : 'ERROR! Range with such a name already exists',
textIsLocked : 'This element is being edited by another user.',
notcriticalErrorTitle : 'Warning',
textReservedName : 'The name you are trying to use is already referenced in cell formulas. Please use some other name.'
}, SSE.Views.TableSettings || {}));
});

View file

@ -78,6 +78,8 @@ define([
this._sendUndoPoint = true;
this._sliderChanged = false;
this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
this._state = {
Transparency: null,
FillType: Asc.c_oAscFill.FILL_TYPE_SOLID,
@ -1013,8 +1015,9 @@ define([
onBorderSizeChanged: function(before, combo, record, e) {
var me = this;
if (before) {
var value = parseFloat(record.value);
if (!(/^\s*(\d*(\.|,)?\d+)\s*(pt)?\s*$/.exec(record.value)) || value<0 || value>1584) {
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;
}

View file

@ -248,32 +248,72 @@
<script type="text/javascript" src="../../../../sdkjs/common/docscoapicommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/docscoapi.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeChart.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/AdvancedOptions.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_map.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Metafile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/TextMeasurer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/WorkEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/SerializeWriter.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Hit.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ArcTo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/ColorArray.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Constants.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/CommonController.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/States.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/CreateGeometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Geometry.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Format.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Shape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Path.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/Image.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/GroupShape.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartSpace.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/ChartFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Format/TextBody.js"></script>
<!-- For chart editor -->
<script type="text/javascript" src="../../../../sdkjs/common/Charts/charts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingArea.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/3DTransformation.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TrackObjects/Spline.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/TextDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/Externals.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/GlobalLoaders.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/CollaborativeEditingBase.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Controls.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Overlay.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Drawings/HatchPattern.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/scroll.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingArea.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/DrawingObjects.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/charts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/ChartsDrawer.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Charts/3DTransformation.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/FontsFreeType/font_map.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/wordcopypaste.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/HatchPattern.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/WorkEvents.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Externals.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/Metafile.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/utils/utils.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/UndoRedo.js"></script>
@ -307,7 +347,6 @@
<script type="text/javascript" src="../../../../sdkjs/cell/model/WorkbookElems.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/Workbook.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/CellInfo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/AdvancedOptions.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/History.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/view/StringRender.js"></script>
@ -322,58 +361,18 @@
<script type="text/javascript" src="../../../../sdkjs/cell/api.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Private/license.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/Private/comments.js"></script>
<!--for theme-->
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/Serialize.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/Shapes/SerializeWriter.js"></script>
<!--for chart-->
<script type="text/javascript" src="../../../../sdkjs/common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeChart.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/SerializeCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/ArcTo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Drawing/ColorArray.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/SerializeCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Common.js"></script>
<!--for shapes-->
<script src="../../../../sdkjs/common/Drawings/Hit.js"></script>
<script src="../../../../sdkjs/common/Drawings/States.js"></script>
<script src="../../../../sdkjs/common/Drawings/DrawingObjectsHandlers.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/AdjustmentTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/ResizeTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/RotateTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/NewShapeTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/PolyLine.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/Spline.js"></script>
<script src="../../../../sdkjs/common/Drawings/TrackObjects/MoveTracks.js"></script>
<script src="../../../../sdkjs/common/Drawings/CommonController.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Constants.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Format.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/CreateGeometry.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Geometry.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Path.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Shape.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/GroupShape.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/Image.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/ChartSpace.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/ChartFormat.js"></script>
<script src="../../../../sdkjs/common/Drawings/Format/TextBody.js"></script>
<script src="../../../../sdkjs/common/Drawings/TextDrawer.js"></script>
<script src="../../../../sdkjs/common/Controls.js"></script>
<script src="../../../../sdkjs/cell/view/DrawingObjectsController.js"></script>
<script src="../../../../sdkjs/cell/model/DrawingObjects/Graphics.js"></script>
<script src="../../../../sdkjs/common/Overlay.js"></script>
<script src="../../../../sdkjs/cell/model/DrawingObjects/ShapeDrawer.js"></script>
<script src="../../../../sdkjs/cell/model/DrawingObjects/DrawingDocument.js"></script>
<script src="../../../../sdkjs/common/GlobalLoaders.js"></script>
<script src="../../../../sdkjs/cell/model/DrawingObjects/Format/ShapePrototype.js"></script>
@ -408,7 +407,6 @@
<script src="../../../../sdkjs/word/Editor/Spelling.js"></script>
<script src="../../../../sdkjs/word/Editor/GraphicObjects/WrapManager.js"></script>
<script src="../../../../sdkjs/common/CollaborativeEditingBase.js"></script>
<script src="../../../../sdkjs/cell/model/DrawingObjects/GlobalCounters.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Math/mathTypes.js"></script>

View file

@ -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",
@ -471,6 +474,18 @@
"SSE.Views.DocumentHolder.txtUngroup": "Ungroup",
"SSE.Views.DocumentHolder.txtWidth": "Width",
"SSE.Views.DocumentHolder.vertAlignText": "Vertical Alignment",
"SSE.Views.DocumentHolder.txtSelect": "Select",
"SSE.Views.DocumentHolder.selectRowText": "Select Row",
"SSE.Views.DocumentHolder.selectColumnText": "Select Entire Column",
"SSE.Views.DocumentHolder.selectDataText": "Select Column Data",
"SSE.Views.DocumentHolder.selectTableText": "Select Table",
"SSE.Views.DocumentHolder.insertRowAboveText": "Insert Row Above",
"SSE.Views.DocumentHolder.insertRowBelowText": "Insert Row Below",
"SSE.Views.DocumentHolder.insertColumnLeftText": "Insert Column Left",
"SSE.Views.DocumentHolder.insertColumnRightText": "Insert Column Right",
"SSE.Views.DocumentHolder.deleteRowText": "Delete Row",
"SSE.Views.DocumentHolder.deleteColumnText": "Delete Column",
"SSE.Views.DocumentHolder.deleteTableText": "Delete Table",
"SSE.Views.FileMenu.btnBackCaption": "Go to Documents",
"SSE.Views.FileMenu.btnCreateNewCaption": "Create New",
"SSE.Views.FileMenu.btnDownloadCaption": "Download as...",
@ -738,6 +753,7 @@
"SSE.Views.RightMenu.txtParagraphSettings": "Text Settings",
"SSE.Views.RightMenu.txtSettings": "Common Settings",
"SSE.Views.RightMenu.txtShapeSettings": "Shape Settings",
"SSE.Views.RightMenu.txtTableSettings": "Table Settings",
"SSE.Views.RightMenu.txtTextArtSettings": "Text Art Settings",
"SSE.Views.SetValueDialog.cancelButtonText": "Cancel",
"SSE.Views.SetValueDialog.okButtonText": "OK",
@ -854,6 +870,40 @@
"SSE.Views.TableOptionsDialog.txtFormat": "Create table",
"SSE.Views.TableOptionsDialog.txtInvalidRange": "ERROR! Invalid cells range",
"SSE.Views.TableOptionsDialog.txtTitle": "Title",
"SSE.Views.TableOptionsDialog.errorFTChangeTableRangeError": "Operation could not be completed for the selected cell range.<br>Select a range so that the first table row was on the same row<br>and the resulting table overlapped the current one.",
"SSE.Views.TableOptionsDialog.errorFTRangeIncludedOtherTables": "Operation could not be completed for the selected cell range.<br>Select a range which does not include other tables.",
"SSE.Views.TableSettings.textEdit": "Rows & Columns",
"SSE.Views.TableSettings.selectRowText": "Select Row",
"SSE.Views.TableSettings.selectColumnText": "Select Entire Column",
"SSE.Views.TableSettings.selectDataText": "Select Column Data",
"SSE.Views.TableSettings.selectTableText": "Select Table",
"SSE.Views.TableSettings.insertRowAboveText": "Insert Row Above",
"SSE.Views.TableSettings.insertRowBelowText": "Insert Row Below",
"SSE.Views.TableSettings.insertColumnLeftText": "Insert Column Left",
"SSE.Views.TableSettings.insertColumnRightText": "Insert Column Right",
"SSE.Views.TableSettings.deleteRowText": "Delete Row",
"SSE.Views.TableSettings.deleteColumnText": "Delete Column",
"SSE.Views.TableSettings.deleteTableText": "Delete Table",
"SSE.Views.TableSettings.textOK": "OK",
"SSE.Views.TableSettings.textCancel": "Cancel",
"SSE.Views.TableSettings.textTemplate": "Select From Template",
"SSE.Views.TableSettings.textRows": "Rows",
"SSE.Views.TableSettings.textColumns": "Columns",
"SSE.Views.TableSettings.textHeader": "Header",
"SSE.Views.TableSettings.textTotal": "Total",
"SSE.Views.TableSettings.textBanded": "Banded",
"SSE.Views.TableSettings.textFirst": "First",
"SSE.Views.TableSettings.textLast": "Last",
"SSE.Views.TableSettings.textEmptyTemplate": "No templates",
"SSE.Views.TableSettings.textFilter": "Filter button",
"SSE.Views.TableSettings.textTableName": "Table Name",
"SSE.Views.TableSettings.textResize": "Resize table",
"SSE.Views.TableSettings.textSelectData": "Select Data",
"SSE.Views.TableSettings.textInvalidName": "ERROR! Invalid table name",
"SSE.Views.TableSettings.textExistName": "ERROR! Range with such a name already exists",
"SSE.Views.TableSettings.textIsLocked": "This element is being edited by another user.",
"SSE.Views.TableSettings.notcriticalErrorTitle": "Warning",
"SSE.Views.TableSettings.textReservedName": "The name you are trying to use is already referenced in cell formulas. Please use some other name.",
"SSE.Views.TextArtSettings.strBackground": "Background color",
"SSE.Views.TextArtSettings.strColor": "Color",
"SSE.Views.TextArtSettings.strFill": "Fill",

View file

@ -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": "По столбцам",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View file

@ -20,6 +20,9 @@
/*menuTextArt*/
.toolbar-btn-icon(btn-menu-textart, 66, @toolbar-icon-size);
/*menuTable*/
.toolbar-btn-icon(btn-menu-table, 80, @toolbar-icon-size);
}
}
@ -79,12 +82,19 @@
}
}
.btn-edit-table,
.btn-change-shape {
.background-ximage('@{app-image-path}/right-panels/rowscols_icon.png', '@{app-image-path}/right-panels/rowscols_icon@2x.png', 84px);
margin-right: 2px !important;
margin-bottom: 1px !important;
}
.btn-edit-table {background-position: 0 0;}
button.over .btn-edit-table {background-position: -28px 0;}
.btn-group.open .btn-edit-table,
button.active .btn-edit-table,
button:active .btn-edit-table {background-position: -56px 0;}
.btn-change-shape {background-position: 0 -16px;}
button.over .btn-change-shape {background-position: -28px -16px;}
.btn-group.open .btn-change-shape,
@ -283,4 +293,8 @@ button:active .btn-change-shape {background-position: -56px -16px;}
.pie-doughnut{
background-position: -200px 0;
}
#table-combo-template .combo-dataview{
.combo-template(60px);
}