Merge branch 'develop' into feature/metric-translate

This commit is contained in:
Julia Radzhabova 2016-04-19 17:26:17 +03:00
commit ab9da153e6
64 changed files with 1834 additions and 680 deletions

View file

@ -46,6 +46,7 @@
editorConfig: {
mode: 'view or edit',
lang: <language code>,
location: <location>,
canCoAuthoring: <can coauthoring documents>,
canAutosave: <can autosave documents>,
canBackToFolder: <can return to folder> - deprecated. use "customization.goback" parameter,

View file

@ -268,7 +268,7 @@ define([
}
}
if (this.options.defaultUnit !== units) {
if (this.options.defaultUnit !== units && !showError) {
number = this._recalcUnits(number, units);
}
if (number > this.options.maxValue) { number = this.options.maxValue; showError = true; }

View file

@ -301,9 +301,14 @@ define([
options.primary = 'ok';
var newBtns = {};
_.each(options.buttons, function(b){
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''};
if (b=='custom')
newBtns[b].cls += ' custom';
if (typeof(b) == 'object') {
if (b.value !== undefined)
newBtns[b.value] = {text: b.caption, cls: 'custom' + ((b.primary || options.primary==b.value) ? ' primary' : '')};
} else {
newBtns[b] = {text: (b=='custom') ? options.customButtonText : arrBtns[b], cls: (options.primary==b) ? 'primary' : ''};
if (b=='custom')
newBtns[b].cls += ' custom';
}
});
options.buttons = newBtns;

View file

@ -50,6 +50,7 @@ define([
Common.Controllers.ExternalDiagramEditor = Backbone.Controller.extend(_.extend((function() {
var appLang = 'en',
customization = undefined,
targetApp = '',
externalEditor = null;
@ -67,6 +68,7 @@ define([
},
editorConfig: {
mode : 'editdiagram',
targetApp : targetApp,
lang : appLang,
canCoAuthoring : false,
canBackToFolder : false,
@ -148,6 +150,7 @@ define([
if (data && data.config) {
if (data.config.lang) appLang = data.config.lang;
if (data.config.customization) customization = data.config.customization;
if (data.config.targetApp) targetApp = data.config.targetApp;
}
},

View file

@ -50,6 +50,7 @@ define([
Common.Controllers.ExternalMergeEditor = Backbone.Controller.extend(_.extend((function() {
var appLang = 'en',
customization = undefined,
targetApp = '',
externalEditor = null;
@ -67,6 +68,7 @@ define([
},
editorConfig: {
mode : 'editmerge',
targetApp : targetApp,
lang : appLang,
canCoAuthoring : false,
canBackToFolder : false,
@ -149,6 +151,7 @@ define([
if (data && data.config) {
if (data.config.lang) appLang = data.config.lang;
if (data.config.customization) customization = data.config.customization;
if (data.config.targetApp) targetApp = data.config.targetApp;
}
},

View file

@ -224,7 +224,7 @@ Common.Utils.ThemeColor = new(function() {
color=color.replace(/#/,'');
if(color.length==3) color=color.replace(/(.)/g,'$1$1');
color=parseInt(color,16);
var c = new CAscColor();
var c = new Asc.asc_CColor();
c.put_type( (typeof(clr) == 'object' && clr.effectId !== undefined)? Asc.c_oAscColor.COLOR_TYPE_SCHEME : Asc.c_oAscColor.COLOR_TYPE_SRGB);
c.put_r(color>>16);
c.put_g((color&0xff00)>>8);
@ -260,6 +260,7 @@ Common.Utils.Metric = _.extend( new(function() {
me.currentMetric = me.c_MetricUnits.pt;
me.metricName = ['Cm', 'Pt', 'Inch'];
me.defaultMetric = me.c_MetricUnits.cm;
return {
c_MetricUnits: me.c_MetricUnits,
@ -282,6 +283,14 @@ Common.Utils.Metric = _.extend( new(function() {
getMetricName: function(unit) {
return this['txt' + me.metricName[(unit !== undefined) ? unit : 0]];
},
setDefaultMetric: function(value) {
me.defaultMetric = value;
},
getDefaultMetric: function() {
return me.defaultMetric;
},
fnRecalcToMM: function(value) {
// value in pt/cm/inch. need to convert to mm

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

@ -171,7 +171,7 @@ var ApplicationController = new(function(){
if (docConfig) {
permissions = $.extend(permissions, docConfig.permissions);
var docInfo = new CDocInfo();
var docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(docConfig.key);
docInfo.put_Url(docConfig.url);
docInfo.put_Title(docConfig.title);

View file

@ -235,6 +235,7 @@ define([
this.appOptions.recent = this.editorConfig.recent;
this.appOptions.createUrl = this.editorConfig.createUrl;
this.appOptions.lang = this.editorConfig.lang;
this.appOptions.location = (typeof (this.editorConfig.location) == 'string') ? this.editorConfig.location.toLowerCase() : '';
this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl;
this.appOptions.fileChoiceUrl = this.editorConfig.fileChoiceUrl;
this.appOptions.mergeFolderUrl = this.editorConfig.mergeFolderUrl;
@ -251,6 +252,9 @@ define([
if (this.editorConfig.lang)
this.api.asc_setLocale(this.editorConfig.lang);
if (this.appOptions.location == 'us' || this.appOptions.location == 'ca')
Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch);
},
loadDocument: function(data) {
@ -262,13 +266,13 @@ define([
if (data.doc) {
this.permissions = $.extend(this.permissions, data.doc.permissions);
var _user = new CUserInfo();
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new CDocInfo();
docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(data.doc.key);
docInfo.put_Url(data.doc.url);
docInfo.put_Title(data.doc.title);
@ -768,12 +772,11 @@ define([
if (tips.length) me.showTips(tips);
}
document.removeEventListener('visibilitychange', checkWarns);
}
if (typeof document.hidden !== 'undefined' && document.hidden) {
document.addEventListener('visibilitychange', function() {
setTimeout(checkWarns, 50);
});
document.addEventListener('visibilitychange', checkWarns);
} else checkWarns();
me.api.asc_registerCallback('asc_onStartAction', _.bind(me.onLongActionBegin, me));
@ -889,14 +892,19 @@ define([
if (now - value > 86400000) {
Common.localStorage.setItem("de-license-warning", now);
Common.UI.info({
width: 400,
title: this.textNoLicenseTitle,
msg : this.warnNoLicense,
buttons: ['custom'],
primary: 'custom',
customButtonText: this.textBuyNow,
buttons: [
{value: 'buynow', caption: this.textBuyNow},
{value: 'contact', caption: this.textContactUs}
],
primary: 'buynow',
callback: function(btn) {
if (btn == 'custom')
if (btn == 'buynow')
window.open('http://www.onlyoffice.com/enterprise-edition.aspx', "_blank");
else if (btn == 'contact')
window.open('mailto:sales@onlyoffice.com', "_blank");
}
});
}
@ -995,7 +1003,7 @@ define([
translateChart.asc_setSeries(this.txtSeries);
this.api.asc_setChartTranslate(translateChart);
var translateArt = new asc_TextArtTranslate();
var translateArt = new Asc.asc_TextArtTranslate();
translateArt.asc_setDefaultText(this.txtArt);
this.api.asc_setTextArtTranslate(translateArt);
}
@ -1048,7 +1056,7 @@ define([
}
var value = Common.localStorage.getItem('de-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm;
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
@ -1587,7 +1595,7 @@ define([
unitsChanged: function(m) {
var value = Common.localStorage.getItem("de-settings-unit");
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm;
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value);
this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
this.getApplication().getController('RightMenu').updateMetricUnit();
@ -1788,8 +1796,9 @@ define([
textStrict: 'Strict mode',
txtErrorLoadHistory: 'Loading history failed',
textBuyNow: 'Buy now',
textNoLicenseTitle: 'License expired',
warnNoLicense: 'The license expired. You cannot create or edit files.<br>Click the \'Buy now\' button to prolong the license.'
textNoLicenseTitle: 'License expired or not found',
warnNoLicense: 'The license could not be found or expired. You cannot edit files.<br>Click \'Buy now\' to purchase Enterprise Edition license or \'Contact us\' if you use Integration Edition.',
textContactUs: 'Contact us'
}
})(), DE.Controllers.Main || {}))
});

View file

@ -1529,7 +1529,7 @@ define([
var pr = SelectedObjects[i].get_ObjectValue();
var value = pr.get_FramePr();
if (!_.isUndefined(value)) {
value = new CParagraphFrame();
value = new Asc.asc_CParagraphFrame();
value.put_FromDropCapMenu(true);
value.put_DropCap(item.value);
this.api.put_FramePr(value);
@ -1987,7 +1987,7 @@ define([
onAutoFontColor: function(e) {
this._state.clrtext = this._state.clrtext_asccolor = undefined;
var color = new CAscColor();
var color = new Asc.asc_CColor();
color.put_auto(true);
this.api.put_TextColor(color);

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

@ -241,7 +241,7 @@ define([
this.disableControls(this._locked);
if (props && props.get_ChartProperties()){
this._originalProps = new CImgProperty(props);
this._originalProps = new Asc.asc_CImgProperty(props);
this._noApply = true;
var value = props.get_WrappingStyle();
@ -367,7 +367,7 @@ define([
this.btnWrapType.setIconCls('item-wrap ' + rawData.iconCls);
if (this.api) {
var props = new CImgProperty();
var props = new Asc.asc_CImgProperty();
props.put_WrappingStyle((rawData.data));
if (this._state.WrappingStyle===Asc.c_oAscWrapStyle2.Inline && rawData.data!==Asc.c_oAscWrapStyle2.Inline ) {
@ -461,7 +461,7 @@ define([
this._state.ChartType = -1;
if (this.api && !this._noApply && this.chartProps) {
var props = new CImgProperty();
var props = new Asc.asc_CImgProperty();
this.chartProps.changeType(rawData.type);
props.put_ChartProperties(this.chartProps);
this.api.ImgApply(props);
@ -491,7 +491,7 @@ define([
btnIconEl.css('background-image', style);
if (this.api && !this._noApply && this.chartProps) {
var props = new CImgProperty();
var props = new Asc.asc_CImgProperty();
this.chartProps.putStyle(rawData.data);
props.put_ChartProperties(this.chartProps);
this.api.ImgApply(props);

View file

@ -1697,7 +1697,7 @@ define([
menu : (function(){
function onItemClick(item, e) {
if (me.api) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
if (!_.isUndefined(item.options.halign)) {
properties.put_PositionH(new Asc.CImagePositionH());
properties.get_PositionH().put_UseAlign(true);
@ -1757,7 +1757,7 @@ define([
iconCls : 'mnu-arrange-group'
}).on('click', function(item, e) {
if (me.api) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_Group(1);
me.api.ImgApply(properties);
}
@ -1769,7 +1769,7 @@ define([
caption : this.txtUngroup
}).on('click', function(item, e) {
if (me.api) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_Group(-1);
me.api.ImgApply(properties);
}
@ -1781,7 +1781,7 @@ define([
menu : (function(){
function onItemClick(item, e) {
if (me.api) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_ChangeLevel(item.options.valign);
me.api.ImgApply(properties);
}
@ -1835,7 +1835,7 @@ define([
menu : (function(){
function onItemClick(item, e) {
if (me.api) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_WrappingStyle(item.options.wrapType);
if (me.menuImageWrap._originalProps.get_WrappingStyle() === Asc.c_oAscWrapStyle2.Inline && item.wrapType !== Asc.c_oAscWrapStyle2.Inline ) {
@ -1976,7 +1976,7 @@ define([
if (me.api){
var originalImageSize = me.api.get_OriginalSizeImage();
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_Width(originalImageSize.get_ImageWidth());
properties.put_Height(originalImageSize.get_ImageHeight());
@ -2690,7 +2690,7 @@ define([
var paragraphVAlign = function(item, e) {
if (me.api) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_VerticalTextAlign(item.options.valign);
me.api.ImgApply(properties);
}
@ -2728,7 +2728,7 @@ define([
var paragraphDirection = function(item, e) {
if (me.api) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_Vert(item.options.direction);
me.api.ImgApply(properties);
}

View file

@ -92,7 +92,7 @@ define([
this._noApply = true;
this.Margins = undefined;
this._originalProps = new CParagraphProp(this.options.paragraphProps);
this._originalProps = new Asc.asc_CParagraphProperty(this.options.paragraphProps);
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
},
@ -244,7 +244,7 @@ define([
if (me._changedProps) {
if (me._changedProps.get_Shade()===undefined || me._changedProps.get_Shade()===null) {
me._changedProps.put_Shade(new CParagraphShd());
me._changedProps.put_Shade(new Asc.asc_CParagraphShd());
}
if (color=='transparent') {
me._changedProps.get_Shade().put_Value(Asc.c_oAscShdNil);
@ -525,7 +525,7 @@ define([
me.spnHeight.setValue((record.value==0) ? '' : 1);
me.spnHeight.resumeEvents();
me._changedProps.put_HRule((record.value==0) ? linerule_Auto : ((record.value==1) ? linerule_Exact : linerule_AtLeast));
me._changedProps.put_HRule((record.value==0) ? Asc.linerule_Auto : ((record.value==1) ? Asc.linerule_Exact : Asc.linerule_AtLeast));
if (record.value > 0)
this._changedProps.put_H(Common.Utils.Metric.fnRecalcToMM(this.spnHeight.getNumberValue()));
}
@ -542,16 +542,16 @@ define([
})
.on('change', _.bind(function(field, newValue, oldValue) {
if (me._changedProps) {
var type = linerule_Auto;
var type = Asc.linerule_Auto;
if (me.cmbHeight.getValue()==me._arrHeight[1].value)
type = linerule_Exact;
type = Asc.linerule_Exact;
else if (me.cmbHeight.getValue()==me._arrHeight[2].value)
type = linerule_AtLeast;
type = Asc.linerule_AtLeast;
if (type==linerule_Auto) {
if (type==Asc.linerule_Auto) {
me.cmbHeight.suspendEvents();
me.cmbHeight.setValue(me._arrHeight[2].value);
type = linerule_AtLeast;
type = Asc.linerule_AtLeast;
me.cmbHeight.resumeEvents();
}
@ -729,7 +729,7 @@ define([
for (var j=0; j<this.tableStyler.columns; j++) {
this.tableStyler.getCell(j, i).on('borderclick', function(ct, border, size, color){
if (this.ChangedBorders===undefined) {
this.ChangedBorders = new CParagraphBorders();
this.ChangedBorders = new Asc.asc_CParagraphBorders();
}
this._UpdateCellBordersStyle(ct, border, size, color, this.Borders);
}, this);
@ -737,7 +737,7 @@ define([
}
this.tableStyler.on('borderclick', function(ct, border, size, color){
if (this.ChangedBorders===undefined) {
this.ChangedBorders = new CParagraphBorders();
this.ChangedBorders = new Asc.asc_CParagraphBorders();
}
this._UpdateTableBordersStyle(ct, border, size, color, this.Borders);
}, this);
@ -775,30 +775,30 @@ define([
if (this.Margins) {
var borders = this._changedProps.get_Borders();
if (borders===undefined || borders===null) {
this._changedProps.put_Borders(new CParagraphBorders());
this._changedProps.put_Borders(new Asc.asc_CParagraphBorders());
borders = this._changedProps.get_Borders();
}
if (this.Margins.Left!==undefined) {
if (borders.get_Left()===undefined || borders.get_Left()===null)
borders.put_Left(new CBorder(this.Borders.get_Left()));
borders.put_Left(new Asc.asc_CTextBorder(this.Borders.get_Left()));
borders.get_Left().put_Space(this.Margins.Left);
}
if (this.Margins.Top!==undefined) {
if (borders.get_Top()===undefined || borders.get_Top()===null)
borders.put_Top(new CBorder(this.Borders.get_Top()));
borders.put_Top(new Asc.asc_CTextBorder(this.Borders.get_Top()));
borders.get_Top().put_Space(this.Margins.Top);
}
if (this.Margins.Right!==undefined) {
if (borders.get_Right()===undefined || borders.get_Right()===null)
borders.put_Right(new CBorder(this.Borders.get_Right()));
borders.put_Right(new Asc.asc_CTextBorder(this.Borders.get_Right()));
borders.get_Right().put_Space(this.Margins.Right);
}
if (this.Margins.Bottom!==undefined) {
if (borders.get_Bottom()===undefined || borders.get_Bottom()===null)
borders.put_Bottom(new CBorder(this.Borders.get_Bottom()));
borders.put_Bottom(new Asc.asc_CTextBorder(this.Borders.get_Bottom()));
borders.get_Bottom().put_Space(this.Margins.Bottom);
if (borders.get_Between()===undefined || borders.get_Between()===null)
borders.put_Between(new CBorder(this.Borders.get_Between()));
borders.put_Between(new Asc.asc_CTextBorder(this.Borders.get_Between()));
borders.get_Between().put_Space(this.Margins.Bottom);
}
}
@ -859,7 +859,7 @@ define([
_setDefaults: function(props) {
if (props) {
this._noApply = true;
this._originalProps = new CParagraphProp(props);
this._originalProps = new Asc.asc_CParagraphProperty(props);
var frame_props = props.get_FramePr();
if (frame_props) {
var value;
@ -870,7 +870,7 @@ define([
value = frame_props.get_HRule();
if (value!==undefined) {
this.cmbHeight.setValue((value===linerule_Exact) ? this._arrHeight[1].value : this._arrHeight[2].value);
this.cmbHeight.setValue((value===Asc.linerule_Exact) ? this._arrHeight[1].value : this._arrHeight[2].value);
this.spnHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(frame_props.get_H()));
} else {
@ -954,7 +954,7 @@ define([
}
}
this.Borders = new CParagraphBorders(frame_props.get_Borders());
this.Borders = new Asc.asc_CParagraphBorders(frame_props.get_Borders());
if (this.Borders) {
var brd = this.Borders.get_Left();
@ -1004,7 +1004,7 @@ define([
this._noApply = false;
this._changedProps = new CParagraphFrame();
this._changedProps = new Asc.asc_CParagraphFrame();
if (this.isFrame && frame_props && frame_props.get_W()!==undefined) {
this._changedProps.put_W(frame_props.get_W());
}
@ -1114,7 +1114,7 @@ define([
_UpdateBorderStyle: function(border, visible) {
if (null == border)
border = new CBorder();
border = new Asc.asc_CTextBorder();
if (visible && this.BorderSize.ptValue > 0){
var size = parseFloat(this.BorderSize.ptValue);
@ -1124,7 +1124,7 @@ define([
border.put_Color(color);
}
else {
border.put_Color(new CColor());
border.put_Color(new Asc.asc_CColor());
border.put_Value(0);
}
return border;
@ -1136,28 +1136,28 @@ define([
if ( ct.col==0 && border.indexOf('l') > -1 ) {
updateBorders.put_Left(this._UpdateBorderStyle(updateBorders.get_Left(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Left(new CBorder(updateBorders.get_Left()));
this.ChangedBorders.put_Left(new Asc.asc_CTextBorder(updateBorders.get_Left()));
}
}
if ( ct.col== this.tableStylerColumns-1 && border.indexOf('r') > -1 ) {
updateBorders.put_Right(this._UpdateBorderStyle(updateBorders.get_Right(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Right(new CBorder(updateBorders.get_Right()));
this.ChangedBorders.put_Right(new Asc.asc_CTextBorder(updateBorders.get_Right()));
}
}
if ( ct.row==0 && border.indexOf('t') > -1 ) {
updateBorders.put_Top(this._UpdateBorderStyle(updateBorders.get_Top(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Top(new CBorder(updateBorders.get_Top()));
this.ChangedBorders.put_Top(new Asc.asc_CTextBorder(updateBorders.get_Top()));
}
}
if ( ct.row== this.tableStylerRows-1 && border.indexOf('b') > -1 ) {
updateBorders.put_Bottom(this._UpdateBorderStyle(updateBorders.get_Bottom(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Bottom(new CBorder(updateBorders.get_Bottom()));
this.ChangedBorders.put_Bottom(new Asc.asc_CTextBorder(updateBorders.get_Bottom()));
}
}
@ -1165,7 +1165,7 @@ define([
ct.row== this.tableStylerRows-1 && border.indexOf('t') > -1) {
updateBorders.put_Between(this._UpdateBorderStyle(updateBorders.get_Between(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Between(new CBorder(updateBorders.get_Between()));
this.ChangedBorders.put_Between(new Asc.asc_CTextBorder(updateBorders.get_Between()));
}
}
},
@ -1176,25 +1176,25 @@ define([
if (border.indexOf('l') > -1) {
updateBorders.put_Left(this._UpdateBorderStyle(updateBorders.get_Left(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Left(new CBorder(updateBorders.get_Left()));
this.ChangedBorders.put_Left(new Asc.asc_CTextBorder(updateBorders.get_Left()));
}
}
if (border.indexOf('t') > -1) {
updateBorders.put_Top(this._UpdateBorderStyle(updateBorders.get_Top(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Top(new CBorder(updateBorders.get_Top()));
this.ChangedBorders.put_Top(new Asc.asc_CTextBorder(updateBorders.get_Top()));
}
}
if (border.indexOf('r') > -1) {
updateBorders.put_Right(this._UpdateBorderStyle(updateBorders.get_Right(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Right(new CBorder(updateBorders.get_Right()));
this.ChangedBorders.put_Right(new Asc.asc_CTextBorder(updateBorders.get_Right()));
}
}
if (border.indexOf('b') > -1) {
updateBorders.put_Bottom(this._UpdateBorderStyle(updateBorders.get_Bottom(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Bottom(new CBorder(updateBorders.get_Bottom()));
this.ChangedBorders.put_Bottom(new Asc.asc_CTextBorder(updateBorders.get_Bottom()));
}
}
},

View file

@ -329,7 +329,7 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("de-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1);
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline);
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
@ -348,11 +348,11 @@ define([
value = Common.localStorage.getItem("de-settings-unit");
item = this.cmbUnit.store.findWhere({value: parseInt(value)});
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : 0);
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric());
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("de-settings-autosave");
this.chAutosave.setValue(fast_coauth);
this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1));
value = Common.localStorage.getItem("de-settings-spellcheck");
this.chSpell.setValue(value===null || parseInt(value) == 1);

View file

@ -179,7 +179,7 @@ define([
this.disableControls(this._locked);
if (props ){
this._originalProps = new CImgProperty(props);
this._originalProps = new Asc.asc_CImgProperty(props);
var value = props.get_WrappingStyle();
if (this._state.WrappingStyle!==value) {
@ -250,7 +250,7 @@ define([
this.btnWrapType.setIconCls('item-wrap ' + rawData.iconcls);
if (this.api) {
var props = new CImgProperty();
var props = new Asc.asc_CImgProperty();
props.put_WrappingStyle((rawData.data));
if (this._state.WrappingStyle===Asc.c_oAscWrapStyle2.Inline && rawData.data!==Asc.c_oAscWrapStyle2.Inline ) {
props.put_PositionH(new Asc.CImagePositionH());
@ -281,7 +281,7 @@ define([
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_Width(w);
properties.put_Height(h);
this.api.ImgApply(properties);
@ -297,7 +297,7 @@ define([
if (me.api) {
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
var props = new CImgProperty();
var props = new Asc.asc_CImgProperty();
props.put_ImageUrl(checkUrl);
me.api.ImgApply(props);
}

View file

@ -62,6 +62,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 +81,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,
VPositionPcFrom: Asc.c_oAscRelativeFromV.Page,
ShapeHeightPcFrom: Asc.c_oAscRelativeFromV.Margin,
spnXChanged: false,
spnYChanged: false,
spnXPcChanged: false,
@ -105,6 +108,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 +190,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({
@ -284,7 +459,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnTop.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Paddings()===null || this._changedProps.get_Paddings()===undefined)
this._changedProps.put_Paddings(new CPaddings());
this._changedProps.put_Paddings(new Asc.asc_CPaddings());
this._changedProps.get_Paddings().put_Top(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
@ -303,7 +478,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnBottom.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Paddings()===null || this._changedProps.get_Paddings()===undefined)
this._changedProps.put_Paddings(new CPaddings());
this._changedProps.put_Paddings(new Asc.asc_CPaddings());
this._changedProps.get_Paddings().put_Bottom(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
@ -322,7 +497,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Paddings()===null || this._changedProps.get_Paddings()===undefined)
this._changedProps.put_Paddings(new CPaddings());
this._changedProps.put_Paddings(new Asc.asc_CPaddings());
this._changedProps.get_Paddings().put_Left(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
@ -341,7 +516,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Paddings()===null || this._changedProps.get_Paddings()===undefined)
this._changedProps.put_Paddings(new CPaddings());
this._changedProps.put_Paddings(new Asc.asc_CPaddings());
this._changedProps.get_Paddings().put_Right(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
@ -471,13 +646,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 +728,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',
@ -658,7 +819,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnMarginTop.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this.Margins===undefined)
this.Margins= new CPaddings();
this.Margins= new Asc.asc_CPaddings();
this.Margins.put_Top(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -676,7 +837,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnMarginBottom.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this.Margins===undefined)
this.Margins= new CPaddings();
this.Margins= new Asc.asc_CPaddings();
this.Margins.put_Bottom(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -694,7 +855,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnMarginLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this.Margins===undefined)
this.Margins= new CPaddings();
this.Margins= new Asc.asc_CPaddings();
this.Margins.put_Left(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -712,7 +873,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.spnMarginRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this.Margins===undefined)
this.Margins= new CPaddings();
this.Margins= new Asc.asc_CPaddings();
this.Margins.put_Right(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -736,7 +897,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.cmbCapType.on('selected', _.bind(function(combo, record){
if (this._changedShapeProps) {
if (this._changedShapeProps.get_stroke()===null)
this._changedShapeProps.put_stroke(new CAscStroke());
this._changedShapeProps.put_stroke(new Asc.asc_CStroke());
this._changedShapeProps.get_stroke().put_linecap(record.value);
}
@ -758,7 +919,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
this.cmbJoinType.on('selected', _.bind(function(combo, record){
if (this._changedShapeProps) {
if (this._changedShapeProps.get_stroke()===null)
this._changedShapeProps.put_stroke(new CAscStroke());
this._changedShapeProps.put_stroke(new Asc.asc_CStroke());
this._changedShapeProps.get_stroke().put_linejoin(record.value);
}
@ -906,6 +1067,26 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
afterRender: function() {
this.updateMetricUnit();
this._setDefaults(this._originalProps);
var btnCategoryShapeSize, btnCategoryImageSize;
_.each(this.btnsCategory, function(btn) {
if (btn.options.contentTarget == 'id-adv-image-width')
btnCategoryImageSize = btn;
else if(btn.options.contentTarget == 'id-adv-shape-size')
btnCategoryShapeSize = btn;
});
this.content_panels.filter('.active').removeClass('active');
if (this._objectType == Asc.c_oAscTypeSelectElement.Shape) {
btnCategoryImageSize.hide();
btnCategoryShapeSize.toggle(true, true);
$("#" + btnCategoryShapeSize.options.contentTarget).addClass('active');
} else {
btnCategoryShapeSize.hide();
btnCategoryImageSize.toggle(true, true);
$("#" + btnCategoryImageSize.options.contentTarget).addClass('active');
}
},
_setDefaults: function(props) {
@ -958,13 +1139,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 +1255,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,37 +1320,48 @@ 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
} 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);
}
if (value!==null && parseInt(value) == 1) {
this.btnRatio.toggle(true);
}
this._changedProps = new CImgProperty();
this._changedProps = new Asc.asc_CImgProperty();
}
},
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;
@ -1142,7 +1370,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
properties.put_ShapeProperties(this._changedShapeProps);
if (this.Margins) {
if (properties.get_ShapeProperties()===null || properties.get_ShapeProperties()===undefined)
properties.put_ShapeProperties(new CAscShapeProp);
properties.put_ShapeProperties(new Asc.asc_CShapeProperty());
properties.get_ShapeProperties().put_paddings(this.Margins);
}
}
@ -1241,7 +1469,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
}
}
}
this._changedShapeProps = new CAscShapeProp();
this._changedShapeProps = new Asc.asc_CShapeProperty();
},
updateMetricUnit: function() {
@ -1279,7 +1507,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 +1616,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 +1771,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){
@ -1569,7 +1912,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
onSelectBeginStyle: function(picker, view, record, e){
if (this._changedShapeProps) {
if (this._changedShapeProps.get_stroke()===null)
this._changedShapeProps.put_stroke(new CAscStroke());
this._changedShapeProps.put_stroke(new Asc.asc_CStroke());
this._changedShapeProps.get_stroke().put_linebeginstyle(record.get('type'));
}
@ -1582,7 +1925,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
onSelectBeginSize: function(picker, view, record, e){
if (this._changedShapeProps) {
if (this._changedShapeProps.get_stroke()===null)
this._changedShapeProps.put_stroke(new CAscStroke());
this._changedShapeProps.put_stroke(new Asc.asc_CStroke());
this._changedShapeProps.get_stroke().put_linebeginsize(record.get('type'));
}
@ -1593,7 +1936,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
onSelectEndStyle: function(picker, view, record, e){
if (this._changedShapeProps) {
if (this._changedShapeProps.get_stroke()===null)
this._changedShapeProps.put_stroke(new CAscStroke());
this._changedShapeProps.put_stroke(new Asc.asc_CStroke());
this._changedShapeProps.get_stroke().put_lineendstyle(record.get('type'));
}
@ -1606,7 +1949,7 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
onSelectEndSize: function(picker, view, record, e){
if (this._changedShapeProps) {
if (this._changedShapeProps.get_stroke()===null)
this._changedShapeProps.put_stroke(new CAscStroke());
this._changedShapeProps.put_stroke(new Asc.asc_CStroke());
this._changedShapeProps.get_stroke().put_lineendsize(record.get('type'));
}
@ -1674,7 +2017,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

@ -88,7 +88,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.tableStylerColumns = this.options.tableStylerColumns;
this.borderProps = this.options.borderProps;
this.api = this.options.api;
this._originalProps = new CParagraphProp(this.options.paragraphProps);
this._originalProps = new Asc.asc_CParagraphProperty(this.options.paragraphProps);
this.isChart = this.options.isChart;
},
@ -112,7 +112,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.numFirstLine.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Ind()===null || this._changedProps.get_Ind()===undefined)
this._changedProps.put_Ind(new CParagraphInd());
this._changedProps.put_Ind(new Asc.asc_CParagraphInd());
this._changedProps.get_Ind().put_FirstLine(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -131,7 +131,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.numIndentsLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Ind()===null || this._changedProps.get_Ind()===undefined)
this._changedProps.put_Ind(new CParagraphInd());
this._changedProps.put_Ind(new Asc.asc_CParagraphInd());
this._changedProps.get_Ind().put_Left(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -150,7 +150,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.numIndentsRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Ind()===null || this._changedProps.get_Ind()===undefined)
this._changedProps.put_Ind(new CParagraphInd());
this._changedProps.put_Ind(new Asc.asc_CParagraphInd());
this._changedProps.get_Ind().put_Right(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -371,7 +371,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this._changedProps.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
}
@ -393,7 +393,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this._changedProps.put_Position(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_Position(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
}
@ -567,38 +567,38 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
if (this.Margins) {
var borders = this._changedProps.get_Borders();
if (borders===undefined || borders===null) {
this._changedProps.put_Borders(new CParagraphBorders());
this._changedProps.put_Borders(new Asc.asc_CParagraphBorders());
borders = this._changedProps.get_Borders();
}
if (this.Margins.Left!==undefined) {
if (borders.get_Left()===undefined || borders.get_Left()===null)
borders.put_Left(new CBorder(this.Borders.get_Left()));
borders.put_Left(new Asc.asc_CTextBorder(this.Borders.get_Left()));
borders.get_Left().put_Space(this.Margins.Left);
}
if (this.Margins.Top!==undefined) {
if (borders.get_Top()===undefined || borders.get_Top()===null)
borders.put_Top(new CBorder(this.Borders.get_Top()));
borders.put_Top(new Asc.asc_CTextBorder(this.Borders.get_Top()));
borders.get_Top().put_Space(this.Margins.Top);
}
if (this.Margins.Right!==undefined) {
if (borders.get_Right()===undefined || borders.get_Right()===null)
borders.put_Right(new CBorder(this.Borders.get_Right()));
borders.put_Right(new Asc.asc_CTextBorder(this.Borders.get_Right()));
borders.get_Right().put_Space(this.Margins.Right);
}
if (this.Margins.Bottom!==undefined) {
if (borders.get_Bottom()===undefined || borders.get_Bottom()===null)
borders.put_Bottom(new CBorder(this.Borders.get_Bottom()));
borders.put_Bottom(new Asc.asc_CTextBorder(this.Borders.get_Bottom()));
borders.get_Bottom().put_Space(this.Margins.Bottom);
if (borders.get_Between()===undefined || borders.get_Between()===null)
borders.put_Between(new CBorder(this.Borders.get_Between()));
borders.put_Between(new Asc.asc_CTextBorder(this.Borders.get_Between()));
borders.get_Between().put_Space(this.Margins.Bottom);
}
}
if ( this._tabListChanged ) {
if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined)
this._changedProps.put_Tabs(new CParagraphTabs());
this._changedProps.put_Tabs(new Asc.asc_CParagraphTabs());
this.tabList.store.each(function (item, index) {
var tab = new CParagraphTab(Common.Utils.Metric.fnRecalcToMM(item.get('tabPos')), item.get('tabAlign'));
var tab = new Asc.asc_CParagraphTab(Common.Utils.Metric.fnRecalcToMM(item.get('tabPos')), item.get('tabAlign'));
this._changedProps.get_Tabs().add_Tab(tab);
}, this);
}
@ -607,7 +607,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
_setDefaults: function(props) {
if (props ){
this._originalProps = new CParagraphProp(props);
this._originalProps = new Asc.asc_CParagraphProperty(props);
this.hideTextOnlySettings(this.isChart);
@ -621,7 +621,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.chKeepNext.setValue((props.get_KeepNext() !== null && props.get_KeepNext() !== undefined) ? props.get_KeepNext() : 'indeterminate', true);
this.chOrphan.setValue((props.get_WidowControl() !== null && props.get_WidowControl() !== undefined) ? props.get_WidowControl() : 'indeterminate', true);
this.Borders = new CParagraphBorders(props.get_Borders());
this.Borders = new Asc.asc_CParagraphBorders(props.get_Borders());
// Margins
if (this.Borders) {
@ -710,7 +710,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this._noApply = false;
this._changedProps = new CParagraphProp();
this._changedProps = new Asc.asc_CParagraphProperty();
this.ChangedBorders = undefined;
}
},
@ -756,7 +756,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
for (var j=0; j<this.BordersImage.columns; j++) {
this.BordersImage.getCell(j, i).on('borderclick', function(ct, border, size, color){
if (this.ChangedBorders===undefined) {
this.ChangedBorders = new CParagraphBorders();
this.ChangedBorders = new Asc.asc_CParagraphBorders();
}
this._UpdateCellBordersStyle(ct, border, size, color, this.Borders);
}, this);
@ -764,7 +764,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
}
this.BordersImage.on('borderclick', function(ct, border, size, color){
if (this.ChangedBorders===undefined) {
this.ChangedBorders = new CParagraphBorders();
this.ChangedBorders = new Asc.asc_CParagraphBorders();
}
this._UpdateTableBordersStyle(ct, border, size, color, this.Borders);
}, this);
@ -783,7 +783,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_Strikeout(field.getValue()=='checked');
properties.put_DStrikeout(this.chDoubleStrike.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -803,7 +803,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_DStrikeout(field.getValue()=='checked');
properties.put_Strikeout(this.chStrike.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -823,7 +823,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_Superscript(field.getValue()=='checked');
properties.put_Subscript(this.chSubscript.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -843,7 +843,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_Subscript(field.getValue()=='checked');
properties.put_Superscript(this.chSuperscript.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -863,7 +863,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_SmallCaps(field.getValue()=='checked');
properties.put_AllCaps(this.chAllCaps.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -883,7 +883,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_AllCaps(field.getValue()=='checked');
properties.put_SmallCaps(this.chSmallCaps.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -910,7 +910,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
if (this._changedProps) {
if (this._changedProps.get_Shade()===undefined || this._changedProps.get_Shade()===null) {
this._changedProps.put_Shade(new CParagraphShd());
this._changedProps.put_Shade(new Asc.asc_CParagraphShd());
}
if (this.paragraphShade=='transparent') {
this._changedProps.get_Shade().put_Value(Asc.c_oAscShdNil);
@ -937,7 +937,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
_UpdateBorderStyle: function(border, visible) {
if (null == border)
border = new CBorder();
border = new Asc.asc_CTextBorder();
if (visible && this.BorderSize.ptValue > 0){
var size = parseFloat(this.BorderSize.ptValue);
@ -947,7 +947,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
border.put_Color(color);
}
else {
border.put_Color(new CAscColor());
border.put_Color(new Asc.asc_CColor());
border.put_Value(0);
}
return border;
@ -959,28 +959,28 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
if ( ct.col==0 && border.indexOf('l') > -1 ) {
updateBorders.put_Left(this._UpdateBorderStyle(updateBorders.get_Left(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Left(new CBorder(updateBorders.get_Left()));
this.ChangedBorders.put_Left(new Asc.asc_CTextBorder(updateBorders.get_Left()));
}
}
if ( ct.col== this.tableStylerColumns-1 && border.indexOf('r') > -1 ) {
updateBorders.put_Right(this._UpdateBorderStyle(updateBorders.get_Right(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Right(new CBorder(updateBorders.get_Right()));
this.ChangedBorders.put_Right(new Asc.asc_CTextBorder(updateBorders.get_Right()));
}
}
if ( ct.row==0 && border.indexOf('t') > -1 ) {
updateBorders.put_Top(this._UpdateBorderStyle(updateBorders.get_Top(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Top(new CBorder(updateBorders.get_Top()));
this.ChangedBorders.put_Top(new Asc.asc_CTextBorder(updateBorders.get_Top()));
}
}
if ( ct.row== this.tableStylerRows-1 && border.indexOf('b') > -1 ) {
updateBorders.put_Bottom(this._UpdateBorderStyle(updateBorders.get_Bottom(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Bottom(new CBorder(updateBorders.get_Bottom()));
this.ChangedBorders.put_Bottom(new Asc.asc_CTextBorder(updateBorders.get_Bottom()));
}
}
@ -988,7 +988,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
ct.row== this.tableStylerRows-1 && border.indexOf('t') > -1) {
updateBorders.put_Between(this._UpdateBorderStyle(updateBorders.get_Between(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Between(new CBorder(updateBorders.get_Between()));
this.ChangedBorders.put_Between(new Asc.asc_CTextBorder(updateBorders.get_Between()));
}
}
},
@ -999,25 +999,25 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
if (border.indexOf('l') > -1) {
updateBorders.put_Left(this._UpdateBorderStyle(updateBorders.get_Left(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Left(new CBorder(updateBorders.get_Left()));
this.ChangedBorders.put_Left(new Asc.asc_CTextBorder(updateBorders.get_Left()));
}
}
if (border.indexOf('t') > -1) {
updateBorders.put_Top(this._UpdateBorderStyle(updateBorders.get_Top(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Top(new CBorder(updateBorders.get_Top()));
this.ChangedBorders.put_Top(new Asc.asc_CTextBorder(updateBorders.get_Top()));
}
}
if (border.indexOf('r') > -1) {
updateBorders.put_Right(this._UpdateBorderStyle(updateBorders.get_Right(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Right(new CBorder(updateBorders.get_Right()));
this.ChangedBorders.put_Right(new Asc.asc_CTextBorder(updateBorders.get_Right()));
}
}
if (border.indexOf('b') > -1) {
updateBorders.put_Bottom(this._UpdateBorderStyle(updateBorders.get_Bottom(), (size>0)));
if (this.ChangedBorders) {
this.ChangedBorders.put_Bottom(new CBorder(updateBorders.get_Bottom()));
this.ChangedBorders.put_Bottom(new Asc.asc_CTextBorder(updateBorders.get_Bottom()));
}
}
},

View file

@ -621,10 +621,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_SOLID:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor((this.ShapeColor.Color=='transparent') ? {color: '4f81bd', effectId: 24} : this.ShapeColor.Color));
props.put_fill(fill);
this.imgprops.put_ShapeProperties(props);
@ -634,10 +634,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_GRAD:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -667,10 +667,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_PATT:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_PATT;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
var fHexColor = Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();
@ -692,8 +692,8 @@ define([
case Asc.c_oAscFill.FILL_TYPE_NOFILL:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_NOFILL;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
props.put_fill(fill);
@ -710,15 +710,15 @@ define([
this.ShapeColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
if (this.ShapeColor.Color=='transparent') {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
} else {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color));
}
@ -736,10 +736,10 @@ define([
onPatternSelect: function(combo, record){
if (this.api && !this._noApply) {
this.PatternFillType = record.get('type');
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -756,10 +756,10 @@ define([
this.btnFGColor.setColor(color);
this.FGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
@ -776,10 +776,10 @@ define([
this.btnBGColor.setColor(color);
this.BGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -796,10 +796,10 @@ define([
this.BlipFillType = record.value;
if (this.api && this._fromTextureCmb !== true && this.OriginalFillType == Asc.c_oAscFill.FILL_TYPE_BLIP) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(this.BlipFillType);
@ -814,8 +814,8 @@ define([
this.sldrTransparency.setValue(field.getNumberValue(), true);
if (this.api) {
var num = field.getNumberValue();
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(num * 2.55);
props.put_fill(fill);
this.imgprops.put_ShapeProperties(props);
@ -845,8 +845,8 @@ define([
_transparencyApplyFunc: function() {
if (this._sliderChanged!==undefined) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(this._sliderChanged * 2.55);
props.put_fill(fill);
this.imgprops.put_ShapeProperties(props);
@ -880,10 +880,10 @@ define([
}
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -918,10 +918,10 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(rawData.type * 60000);
fill.get_fill().put_linear_scale(true);
@ -941,10 +941,10 @@ define([
this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(color) == 'object') ? color.color : color));
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]), Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]);
@ -984,10 +984,10 @@ define([
_gradientApplyFunc: function() {
if (this._sliderChanged) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_positions([this.GradColor.values[0]*1000, this.GradColor.values[1]*1000]);
@ -1011,8 +1011,8 @@ define([
this.BorderSize = value;
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var stroke = new CAscStroke();
var props = new Asc.asc_CShapeProperty();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
this._state.StrokeType = this._state.StrokeWidth = -1;
@ -1063,8 +1063,8 @@ define([
this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color};
if (this.api && this.BorderSize>0 && !this._noApply) {
var props = new CAscShapeProp();
var stroke = new CAscStroke();
var props = new Asc.asc_CShapeProperty();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
@ -1111,7 +1111,7 @@ define([
this.btnWrapType.setIconCls('item-wrap ' + rawData.iconcls);
if (this.api) {
var props = new CImgProperty();
var props = new Asc.asc_CImgProperty();
props.put_WrappingStyle((rawData.data));
if (this._state.WrappingStyle===Asc.c_oAscWrapStyle2.Inline && rawData.data!==Asc.c_oAscWrapStyle2.Inline ) {
@ -1143,10 +1143,10 @@ define([
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
if (me.BlipFillType !== null) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(me.BlipFillType);
fill.get_fill().put_url(checkUrl);
@ -1197,7 +1197,7 @@ define([
ChangeSettings: function(props) {
if (this.imgprops==null)
this.imgprops = new CImgProperty();
this.imgprops = new Asc.asc_CImgProperty();
else
this.imgprops.put_ImageUrl(null);
@ -1209,7 +1209,7 @@ define([
{
var shapeprops = props.get_ShapeProperties(),
shapetype = shapeprops.asc_getType();
this._originalProps = new CImgProperty(props);
this._originalProps = new Asc.asc_CImgProperty(props);
this._noApply = true;
@ -1662,10 +1662,10 @@ define([
this._fromTextureCmb = false;
if (this.api) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(Asc.c_oAscFillBlipType.TILE);
fill.get_fill().put_texture_id(record.get('type'));
props.put_fill(fill);

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 - цвет не определен, рисуем прозрачным
@ -662,39 +661,39 @@ define([
if (border.indexOf('l') > -1 || !visible) {
if (updateBorders.get_Left()===null || updateBorders.get_Left()===undefined)
updateBorders.put_Left(new CBorder());
updateBorders.put_Left(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Left(), visible);
}
if (border.indexOf('t') > -1 || !visible) {
if (updateBorders.get_Top()===null || updateBorders.get_Top()===undefined)
updateBorders.put_Top(new CBorder());
updateBorders.put_Top(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Top(), visible);
}
if (border.indexOf('r') > -1 || !visible) {
if (updateBorders.get_Right()===null || updateBorders.get_Right()===undefined)
updateBorders.put_Right(new CBorder());
updateBorders.put_Right(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Right(), visible);
}
if (border.indexOf('b') > -1 || !visible) {
if (updateBorders.get_Bottom()===null || updateBorders.get_Bottom()===undefined)
updateBorders.put_Bottom(new CBorder());
updateBorders.put_Bottom(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Bottom(), visible);
}
if (border.indexOf('c') > -1 || !visible) {
if (updateBorders.get_InsideV()===null || updateBorders.get_InsideV()===undefined)
updateBorders.put_InsideV(new CBorder());
updateBorders.put_InsideV(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_InsideV(), visible);
}
if (border.indexOf('m') > -1 || !visible) {
if (updateBorders.get_InsideH()===null || updateBorders.get_InsideH()===undefined)
updateBorders.put_InsideH(new CBorder());
updateBorders.put_InsideH(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_InsideH(), visible);
}
},
_UpdateBorderStyle: function(border, visible) {
if (null == border)
border = new CBorder();
border = new Asc.asc_CTextBorder();
if (visible && this.BorderSize > 0){
var size = parseFloat(this.BorderSize);

View file

@ -253,7 +253,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Top');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Top((this.TableMargins.Top!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Top) : null);
this.TableMargins.isChanged = true;
}
@ -273,7 +273,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Bottom');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Bottom((this.TableMargins.Bottom!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Bottom) : null);
this.TableMargins.isChanged = true;
}
@ -293,7 +293,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Left');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Left((this.TableMargins.Left!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Left) : null);
this.TableMargins.isChanged = true;
}
@ -313,7 +313,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Right');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Right((this.TableMargins.Right!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Right) : null);
this.TableMargins.isChanged = true;
}
@ -609,7 +609,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.spnDistanceTop.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_TablePaddings()===undefined)
this._changedProps.put_TablePaddings(new CPaddings());
this._changedProps.put_TablePaddings(new Asc.asc_CPaddings());
this._changedProps.get_TablePaddings().put_Top(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -627,7 +627,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.spnDistanceBottom.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_TablePaddings()===undefined)
this._changedProps.put_TablePaddings(new CPaddings());
this._changedProps.put_TablePaddings(new Asc.asc_CPaddings());
this._changedProps.get_TablePaddings().put_Bottom(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -645,7 +645,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.spnDistanceLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_TablePaddings()===undefined)
this._changedProps.put_TablePaddings(new CPaddings());
this._changedProps.put_TablePaddings(new Asc.asc_CPaddings());
this._changedProps.get_TablePaddings().put_Left(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -663,7 +663,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this.spnDistanceRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_TablePaddings()===undefined)
this._changedProps.put_TablePaddings(new CPaddings());
this._changedProps.put_TablePaddings(new Asc.asc_CPaddings());
this._changedProps.get_TablePaddings().put_Right(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -1713,7 +1713,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
if (this.CellColor.Color=='transparent') {
this._cellBackground.put_Value(1);
this._cellBackground.put_Color(new CAscColor(0,0,0));
this._cellBackground.put_Color(new Asc.asc_CColor(0,0,0));
} else {
this._cellBackground.put_Value(0);
this._cellBackground.put_Color(Common.Utils.ThemeColor.getRgbColor(this.CellColor.Color));
@ -1732,7 +1732,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
}
if (this.TableColor.Color=='transparent') {
background.put_Value(1);
background.put_Color(new CAscColor(0, 0,0));
background.put_Color(new Asc.asc_CColor(0, 0,0));
} else {
background.put_Value(0);
background.put_Color(Common.Utils.ThemeColor.getRgbColor(this.TableColor.Color));
@ -1769,7 +1769,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this._UpdateCellBorderSpacing_(source.get_Bottom(), 'b', this.tableBordersImageSpacing.getCell(i, this.tableBordersImageSpacing.rows-1));
}
if (this._allTable && source.get_InsideV() === null) {
source.put_InsideV(new CBorder());
source.put_InsideV(new Asc.asc_CTextBorder());
}
if (source.get_InsideV() !== null) {
for (i=0; i<this.tableBordersImageSpacing.rows; i++) {
@ -1779,7 +1779,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
}
if (this._allTable && source.get_InsideH() === null) {
source.put_InsideH(new CBorder());
source.put_InsideH(new Asc.asc_CTextBorder());
}
if (source.get_InsideH() !== null) {
for (i=0; i<this.tableBordersImageSpacing.columns; i++) {
@ -1842,7 +1842,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
this._UpdateTableBorderNoSpacing_(source.get_Bottom(), 'b');
if (this._allTable && source.get_InsideV() == null) {
source.put_InsideV(new CBorder());
source.put_InsideV(new Asc.asc_CTextBorder());
}
if (source.get_InsideV() !== null) {
for (var i=0; i<this.tableBordersImage.rows; i++) {
@ -1852,7 +1852,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
}
if (this._allTable && source.get_InsideH() == null) {
source.put_InsideH(new CBorder());
source.put_InsideH(new Asc.asc_CTextBorder());
}
if (source.get_InsideH() !== null) {
for (i=0; i<this.tableBordersImage.columns; i++) {
@ -1967,42 +1967,42 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
if ( ct.col==0 && border.indexOf('l') > -1 ) {
this._UpdateBorderStyle(updateBorders.get_Left(), (size>0));
if (changed_destination) {
changed_destination.put_Left(new CBorder(updateBorders.get_Left()));
changed_destination.put_Left(new Asc.asc_CTextBorder(updateBorders.get_Left()));
}
}
if ( ct.col== this.tableStylerColumns-1 && border.indexOf('r') > -1 ) {
this._UpdateBorderStyle(updateBorders.get_Right(), (size>0));
if (changed_destination) {
changed_destination.put_Right(new CBorder(updateBorders.get_Right()));
changed_destination.put_Right(new Asc.asc_CTextBorder(updateBorders.get_Right()));
}
}
if ( ct.row==0 && border.indexOf('t') > -1 ) {
this._UpdateBorderStyle(updateBorders.get_Top(), (size>0));
if (changed_destination) {
changed_destination.put_Top(new CBorder(updateBorders.get_Top()));
changed_destination.put_Top(new Asc.asc_CTextBorder(updateBorders.get_Top()));
}
}
if ( ct.row== this.tableStylerRows-1 && border.indexOf('b') > -1 ) {
this._UpdateBorderStyle(updateBorders.get_Bottom(), (size>0));
if (changed_destination) {
changed_destination.put_Bottom(new CBorder(updateBorders.get_Bottom()));
changed_destination.put_Bottom(new Asc.asc_CTextBorder(updateBorders.get_Bottom()));
}
}
if ( ct.col==0 && border.indexOf('r') > -1 || ct.col== this.tableStylerColumns-1 && border.indexOf('l') > -1) {
this._UpdateBorderStyle(updateBorders.get_InsideV(), (size>0));
if (changed_destination) {
changed_destination.put_InsideV(new CBorder(updateBorders.get_InsideV()));
changed_destination.put_InsideV(new Asc.asc_CTextBorder(updateBorders.get_InsideV()));
}
}
if ( ct.row==0 && border.indexOf('b') > -1 || ct.row== this.tableStylerRows-1 && border.indexOf('t') > -1) {
this._UpdateBorderStyle(updateBorders.get_InsideH(), (size>0));
if (changed_destination) {
changed_destination.put_InsideH(new CBorder(updateBorders.get_InsideH()));
changed_destination.put_InsideH(new Asc.asc_CTextBorder(updateBorders.get_InsideH()));
}
}
},
@ -2013,25 +2013,25 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
if (border.indexOf('l') > -1) {
this._UpdateBorderStyle(updateBorders.get_Left(), (size>0));
if (changed_destination) {
changed_destination.put_Left(new CBorder(updateBorders.get_Left()));
changed_destination.put_Left(new Asc.asc_CTextBorder(updateBorders.get_Left()));
}
}
if (border.indexOf('t') > -1) {
this._UpdateBorderStyle(updateBorders.get_Top(), (size>0));
if (changed_destination) {
changed_destination.put_Top(new CBorder(updateBorders.get_Top()));
changed_destination.put_Top(new Asc.asc_CTextBorder(updateBorders.get_Top()));
}
}
if (border.indexOf('r') > -1) {
this._UpdateBorderStyle(updateBorders.get_Right(), (size>0));
if (changed_destination) {
changed_destination.put_Right(new CBorder(updateBorders.get_Right()));
changed_destination.put_Right(new Asc.asc_CTextBorder(updateBorders.get_Right()));
}
}
if (border.indexOf('b') > -1) {
this._UpdateBorderStyle(updateBorders.get_Bottom(), (size>0));
if (changed_destination) {
changed_destination.put_Bottom(new CBorder(updateBorders.get_Bottom()));
changed_destination.put_Bottom(new Asc.asc_CTextBorder(updateBorders.get_Bottom()));
}
}
},
@ -2047,7 +2047,7 @@ define([ 'text!documenteditor/main/app/template/TableSettingsAdvanced.templat
border.put_Color(color);
}
else {
border.put_Color(new CAscColor());
border.put_Color(new Asc.asc_CColor());
border.put_Value(0);
}
return border.get_Value();

View file

@ -420,10 +420,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_SOLID:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
if (!this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor((this.ShapeColor.Color=='transparent') ? {color: '4f81bd', effectId: 24} : this.ShapeColor.Color));
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -433,10 +433,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_GRAD:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
if (!this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -463,8 +463,8 @@ define([
case Asc.c_oAscFill.FILL_TYPE_NOFILL:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_NOFILL;
if (!this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
props.asc_putFill(fill);
@ -481,15 +481,15 @@ define([
this.ShapeColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
if (this.ShapeColor.Color=='transparent') {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
} else {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color));
}
@ -508,8 +508,8 @@ define([
this.sldrTransparency.setValue(field.getNumberValue(), true);
if (this.api) {
var num = field.getNumberValue();
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(num * 2.55);
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -539,8 +539,8 @@ define([
_transparencyApplyFunc: function() {
if (this._sliderChanged!==undefined) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(this._sliderChanged * 2.55);
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -574,10 +574,10 @@ define([
}
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -612,10 +612,10 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(rawData.type * 60000);
fill.get_fill().put_linear_scale(true);
@ -635,10 +635,10 @@ define([
this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(color) == 'object') ? color.color : color));
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]), Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]);
@ -678,10 +678,10 @@ define([
_gradientApplyFunc: function() {
if (this._sliderChanged) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_positions([this.GradColor.values[0]*1000, this.GradColor.values[1]*1000]);
@ -705,8 +705,8 @@ define([
this.BorderSize = value;
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var stroke = new CAscStroke();
var props = new Asc.asc_TextArtProperties();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
this._state.StrokeType = this._state.StrokeWidth = -1;
@ -757,8 +757,8 @@ define([
this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color};
if (this.api && this.BorderSize>0 && !this._noApply) {
var props = new asc_TextArtProperties();
var stroke = new CAscStroke();
var props = new Asc.asc_TextArtProperties();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
@ -775,8 +775,8 @@ define([
ChangeSettings: function(props) {
if (this.imgprops==null) {
this.imgprops = new CImgProperty();
this.imgprops.put_ShapeProperties(new CAscShapeProp());
this.imgprops = new Asc.asc_CImgProperty();
this.imgprops.put_ShapeProperties(new Asc.asc_CShapeProperty());
this.shapeprops = this.imgprops.get_ShapeProperties();
} else
this.imgprops.put_ImageUrl(null);
@ -1081,7 +1081,7 @@ define([
onTextArtSelect: function(combo, record){
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var props = new Asc.asc_TextArtProperties();
props.asc_putStyle(record.get('data'));
this.shapeprops.put_TextArtProperties(props);
this.api.ImgApply(this.imgprops);
@ -1114,7 +1114,7 @@ define([
onTransformSelect: function(combo, record){
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var props = new Asc.asc_TextArtProperties();
props.asc_putForm(record.get('type'));
this.shapeprops.put_TextArtProperties(props);
this.api.ImgApply(this.imgprops);

View file

@ -701,6 +701,7 @@ define([
items: [
{ caption: this.textMarginsLast, checkable: true, template: pageMarginsTemplate, toggleGroup: 'menuPageMargins'}, //top,left,bottom,right
{ caption: this.textMarginsNormal, checkable: true, template: pageMarginsTemplate, toggleGroup: 'menuPageMargins', value: [20, 30, 20, 15] },
{ caption: this.textMarginsUsNormal, checkable: true, template: pageMarginsTemplate, toggleGroup: 'menuPageMargins', value: [25.4, 25.4, 25.4, 25.4] },
{ caption: this.textMarginsNarrow, checkable: true, template: pageMarginsTemplate, toggleGroup: 'menuPageMargins', value: [12.7, 12.7, 12.7, 12.7] },
{ caption: this.textMarginsModerate,checkable: true, template: pageMarginsTemplate, toggleGroup: 'menuPageMargins', value: [25.4, 19.1, 25.4, 19.1] },
{ caption: this.textMarginsWide, checkable: true, template: pageMarginsTemplate, toggleGroup: 'menuPageMargins', value: [25.4, 50.8, 25.4, 50.8] },
@ -1844,6 +1845,7 @@ define([
tipPageMargins: 'Page Margins',
textMarginsLast: 'Last Custom',
textMarginsNormal: 'Normal',
textMarginsUsNormal: 'US Normal',
textMarginsNarrow: 'Narrow',
textMarginsModerate: 'Moderate',
textMarginsWide: 'Wide',

View file

@ -240,22 +240,24 @@
<script type="text/javascript" src="../../../../sdkjs/common/AllFonts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/browser.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/editorscommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/commonDefines.js"></script>
<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/word/apiDefines.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/commonDefines.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>
@ -364,7 +366,6 @@
<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>
<script type="text/javascript" src="../../../../sdkjs/word/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/apiCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiBase.js"></script>

View file

@ -236,7 +236,7 @@
"DE.Controllers.Main.textBuyNow": "Buy now",
"DE.Controllers.Main.textCloseTip": "\nClick to close the tip",
"DE.Controllers.Main.textLoadingDocument": "Loading document",
"DE.Controllers.Main.textNoLicenseTitle": "License expired",
"DE.Controllers.Main.textNoLicenseTitle": "License expired or not found",
"DE.Controllers.Main.textStrict": "Strict mode",
"DE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.",
"DE.Controllers.Main.titleUpdateVersion": "Version changed",
@ -266,8 +266,9 @@
"DE.Controllers.Main.uploadImageTitleText": "Uploading Image",
"DE.Controllers.Main.warnBrowserIE9": "The application has low capabilities on IE9. Use IE10 or higher",
"DE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"DE.Controllers.Main.warnNoLicense": "The license expired. You cannot create or edit files.<br>Click the 'Buy now' button to prolong the license.",
"DE.Controllers.Main.warnNoLicense": "The license could not be found or expired. You cannot edit files.<br>Click 'Buy now' to purchase Enterprise Edition license or 'Contact us' if you use Integration Edition.",
"DE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"DE.Controllers.Main.textContactUs": "Contact us",
"DE.Controllers.Statusbar.textHasChanges": "New changes have been tracked",
"DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled",
"DE.Controllers.Statusbar.zoomText": "Zoom {0}%",
@ -1018,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",
@ -1432,6 +1436,7 @@
"DE.Views.Toolbar.textMarginsModerate": "Moderate",
"DE.Views.Toolbar.textMarginsNarrow": "Narrow",
"DE.Views.Toolbar.textMarginsNormal": "Normal",
"DE.Views.Toolbar.textMarginsUsNormal": "US Normal",
"DE.Views.Toolbar.textMarginsWide": "Wide",
"DE.Views.Toolbar.textNewColor": "Add New Custom Color",
"DE.Views.Toolbar.textNextPage": "Next Page",

View file

@ -108,13 +108,13 @@ Ext.define('DE.controller.Main', {
if ( data.doc ) {
this.permissions = data.doc.permissions;
var _user = new CUserInfo();
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.editorConfig.user.id);
_user.put_FirstName(this.editorConfig.user.firstname);
_user.put_LastName(this.editorConfig.user.lastname);
_user.put_FullName(this.editorConfig.user.fullname);
var docInfo = new CDocInfo();
var docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(data.doc.key);
docInfo.put_Url(data.doc.url);
docInfo.put_Title(data.doc.title);

View file

@ -85,7 +85,7 @@ Ext.define('DE.controller.tablet.panel.Insert', {
mpImg.imageLoadListeners.push(function() {
var canvas = document.createElement('canvas'),
imgProperty = new CImgProperty();
imgProperty = new Asc.asc_CImgProperty();
mpImg.render(canvas, { maxWidth: 1024, maxHeight: 1024 });
imgProperty.put_WrappingStyle((input == inputInlineMedia) ? Asc.c_oAscWrapStyle2.Inline : Asc.c_oAscWrapStyle2.Square);

View file

@ -171,7 +171,7 @@ Ext.define('DE.controller.tablet.panel.TextColor', {
textColorList.select(record);
var color = record.get('color'),
ascColor = new CAscColor();
ascColor = new Asc.asc_CColor();
ascColor.put_r(parseInt((color[0] + color[1]), 16));
ascColor.put_g(parseInt((color[2] + color[3]), 16));

View file

@ -168,7 +168,7 @@ var ApplicationController = new(function(){
if (docConfig) {
permissions = $.extend(permissions, docConfig.permissions);
var docInfo = new CDocInfo();
var docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(docConfig.key);
docInfo.put_Url(docConfig.url);
docInfo.put_Title(docConfig.title);

View file

@ -218,6 +218,7 @@ define([
this.appOptions.recent = this.editorConfig.recent;
this.appOptions.createUrl = this.editorConfig.createUrl;
this.appOptions.lang = this.editorConfig.lang;
this.appOptions.location = (typeof (this.editorConfig.location) == 'string') ? this.editorConfig.location.toLowerCase() : '';
this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl;
this.appOptions.canAnalytics = false;
this.appOptions.customization = this.editorConfig.customization;
@ -232,6 +233,9 @@ define([
if (this.editorConfig.lang)
this.api.asc_setLocale(this.editorConfig.lang);
if (this.appOptions.location == 'us' || this.appOptions.location == 'ca')
Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch);
},
loadDocument: function(data) {
@ -243,13 +247,13 @@ define([
if (data.doc) {
this.permissions = $.extend(this.permissions, data.doc.permissions);
var _user = new CUserInfo();
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new CDocInfo();
docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(data.doc.key);
docInfo.put_Url(data.doc.url);
docInfo.put_Title(data.doc.title);
@ -547,8 +551,7 @@ define([
return;
var me = this,
value,
tips = [];
value;
me._isDocReady = true;
@ -560,13 +563,21 @@ define([
var zf = (value!==null) ? parseInt(value) : -1;
(zf == -1) ? this.api.zoomFitToPage() : this.api.zoom(zf);
if (!window['AscDesktopEditor']) {
Common.Utils.isIE9m && tips.push(me.warnBrowserIE9);
!Common.Utils.isGecko && (Math.abs(me.getBrowseZoomLevel() - 1) > 0.1) && tips.push(Common.Utils.String.platformKey(me.warnBrowserZoom, '{0}'));
function checkWarns() {
if (!window['AscDesktopEditor']) {
var tips = [];
Common.Utils.isIE9m && tips.push(me.warnBrowserIE9);
!Common.Utils.isGecko && (Math.abs(me.getBrowseZoomLevel() - 1) > 0.1) && tips.push(Common.Utils.String.platformKey(me.warnBrowserZoom, '{0}'));
if (tips.length) me.showTips(tips);
if (tips.length) me.showTips(tips);
}
document.removeEventListener('visibilitychange', checkWarns);
}
if (typeof document.hidden !== 'undefined' && document.hidden) {
document.addEventListener('visibilitychange', checkWarns);
} else checkWarns();
me.api.asc_registerCallback('asc_onStartAction', _.bind(me.onLongActionBegin, me));
me.api.asc_registerCallback('asc_onEndAction', _.bind(me.onLongActionEnd, me));
me.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(me.onCoAuthoringDisconnect, me));
@ -672,14 +683,19 @@ define([
if (now - value > 86400000) {
Common.localStorage.setItem("de-license-warning", now);
Common.UI.info({
width: 400,
title: this.textNoLicenseTitle,
msg : this.warnNoLicense,
buttons: ['custom'],
primary: 'custom',
customButtonText: this.textBuyNow,
buttons: [
{value: 'buynow', caption: this.textBuyNow},
{value: 'contact', caption: this.textContactUs}
],
primary: 'buynow',
callback: function(btn) {
if (btn == 'custom')
if (btn == 'buynow')
window.open('http://www.onlyoffice.com/enterprise-edition.aspx', "_blank");
else if (btn == 'contact')
window.open('mailto:sales@onlyoffice.com', "_blank");
}
});
}
@ -763,7 +779,7 @@ define([
translateChart.asc_setSeries(this.txtSeries);
this.api.asc_setChartTranslate(translateChart);
var translateArt = new asc_TextArtTranslate();
var translateArt = new Asc.asc_TextArtTranslate();
translateArt.asc_setDefaultText(this.txtArt);
this.api.asc_setTextArtTranslate(translateArt);
}
@ -816,7 +832,7 @@ define([
}
var value = Common.localStorage.getItem('pe-settings-unit');
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm;
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
@ -1258,7 +1274,7 @@ define([
unitsChanged: function(m) {
var value = Common.localStorage.getItem("pe-settings-unit");
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm;
value = (value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric();
Common.Utils.Metric.setCurrentMetric(value);
this.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
this.getApplication().getController('RightMenu').updateMetricUnit();
@ -1594,8 +1610,9 @@ define([
textTryUndoRedo: 'The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the \'Strict mode\' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.',
textStrict: 'Strict mode',
textBuyNow: 'Buy now',
textNoLicenseTitle: 'License expired',
warnNoLicense: 'The license expired. You cannot create or edit files.<br>Click the \'Buy now\' button to prolong the license.'
textNoLicenseTitle: 'License expired or not found',
warnNoLicense: 'The license could not be found or expired. You cannot edit files.<br>Click \'Buy now\' to purchase Enterprise Edition license or \'Contact us\' if you use Integration Edition.',
textContactUs: 'Contact us'
}
})(), PE.Controllers.Main || {}))
});

View file

@ -1510,7 +1510,7 @@ define([
menu : (function(){
function onItemClick(item) {
if (me.api) {
var properties = new CAscShapeProp();
var properties = new Asc.asc_CShapeProperty();
properties.put_VerticalTextAlign(item.value);
me.api.ShapeApply(properties);
@ -1548,7 +1548,7 @@ define([
var paragraphDirection = function(item, e) {
if (me.api) {
var properties = new CAscShapeProp();
var properties = new Asc.asc_CShapeProperty();
properties.put_Vert(item.options.direction);
me.api.ShapeApply(properties);
}
@ -1600,7 +1600,7 @@ define([
var originalImageSize = me.api.get_OriginalSizeImage();
if (originalImageSize) {
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_Width(originalImageSize.get_ImageWidth());
properties.put_Height(originalImageSize.get_ImageHeight());

View file

@ -273,7 +273,7 @@ define([
/** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1);
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline);
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
@ -282,11 +282,11 @@ define([
value = Common.localStorage.getItem("pe-settings-unit");
item = this.cmbUnit.store.findWhere({value: parseInt(value)});
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : 0);
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric());
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("pe-settings-autosave");
this.chAutosave.setValue(fast_coauth);
this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1));
value = Common.localStorage.getItem("pe-settings-showsnaplines");
this.chAlignGuides.setValue(value===null || parseInt(value) == 1);

View file

@ -142,7 +142,7 @@ define([
this.disableControls(this._locked);
if (props ){
this._originalProps = new CImgProperty(props);
this._originalProps = new Asc.asc_CImgProperty(props);
var value = props.get_Width();
if ( Math.abs(this._state.Width-value)>0.001 ) {
@ -169,7 +169,7 @@ define([
this.labelWidth[0].innerHTML = this.textWidth + ': ' + Common.Utils.Metric.fnRecalcFromMM(w).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
this.labelHeight[0].innerHTML = this.textHeight + ': ' + Common.Utils.Metric.fnRecalcFromMM(h).toFixed(1) + ' ' + Common.Utils.Metric.getCurrentMetricName();
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
properties.put_Width(w);
properties.put_Height(h);
this.api.ImgApply(properties);
@ -185,7 +185,7 @@ define([
if (me.api) {
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
var props = new CImgProperty();
var props = new Asc.asc_CImgProperty();
props.put_ImageUrl(checkUrl);
me.api.ImgApply(props);
}

View file

@ -213,7 +213,7 @@ define([ 'text!presentationeditor/main/app/template/ImageSettingsAdvanced.tem
getSettings: function() {
Common.localStorage.setItem("pe-settings-imageratio", (this.btnRatio.pressed) ? 1 : 0);
var properties = new CImgProperty();
var properties = new Asc.asc_CImgProperty();
if (this.spnHeight.getValue()!=='')
properties.put_Height(Common.Utils.Metric.fnRecalcToMM(this.spnHeight.getNumberValue()));
if (this.spnWidth.getValue()!=='')

View file

@ -75,7 +75,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.spinners = [];
this.api = this.options.api;
this._originalProps = new CParagraphProp(this.options.paragraphProps);
this._originalProps = new Asc.asc_CParagraphProperty(this.options.paragraphProps);
},
render: function() {
@ -98,7 +98,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.numFirstLine.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Ind()===null || this._changedProps.get_Ind()===undefined)
this._changedProps.put_Ind(new CParagraphInd());
this._changedProps.put_Ind(new Asc.asc_CParagraphInd());
this._changedProps.get_Ind().put_FirstLine(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -118,7 +118,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
var numval = field.getNumberValue();
if (this._changedProps) {
if (this._changedProps.get_Ind()===null || this._changedProps.get_Ind()===undefined)
this._changedProps.put_Ind(new CParagraphInd());
this._changedProps.put_Ind(new Asc.asc_CParagraphInd());
this._changedProps.get_Ind().put_Left(Common.Utils.Metric.fnRecalcToMM(numval));
}
this.numFirstLine.setMinValue(-numval);
@ -140,7 +140,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.numIndentsRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_Ind()===null || this._changedProps.get_Ind()===undefined)
this._changedProps.put_Ind(new CParagraphInd());
this._changedProps.put_Ind(new Asc.asc_CParagraphInd());
this._changedProps.get_Ind().put_Right(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -199,7 +199,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this._changedProps.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_TextSpacing(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
}
@ -292,9 +292,9 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
getSettings: function() {
if ( this._tabListChanged ) {
if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined)
this._changedProps.put_Tabs(new CParagraphTabs());
this._changedProps.put_Tabs(new Asc.asc_CParagraphTabs());
this.tabList.store.each(function (item, index) {
var tab = new CParagraphTab(Common.Utils.Metric.fnRecalcToMM(item.get('tabPos')), item.get('tabAlign'));
var tab = new Asc.asc_CParagraphTab(Common.Utils.Metric.fnRecalcToMM(item.get('tabPos')), item.get('tabAlign'));
this._changedProps.get_Tabs().add_Tab(tab);
}, this);
}
@ -303,7 +303,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
_setDefaults: function(props) {
if (props ){
this._originalProps = new CParagraphProp(props);
this._originalProps = new Asc.asc_CParagraphProperty(props);
this.numIndentsLeft.setValue((props.get_Ind() !== null && props.get_Ind().get_Left() !== null) ? Common.Utils.Metric.fnRecalcFromMM(props.get_Ind().get_Left()) : '', true);
this.numFirstLine.setMinValue(-this.numIndentsLeft.getNumberValue());
@ -349,7 +349,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this._noApply = false;
this._changedProps = new CParagraphProp();
this._changedProps = new Asc.asc_CParagraphProperty();
}
},
@ -385,7 +385,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_Strikeout(field.getValue()=='checked');
properties.put_DStrikeout(this.chDoubleStrike.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -405,7 +405,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_DStrikeout(field.getValue()=='checked');
properties.put_Strikeout(this.chStrike.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -425,7 +425,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_Superscript(field.getValue()=='checked');
properties.put_Subscript(this.chSubscript.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -445,7 +445,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_Subscript(field.getValue()=='checked');
properties.put_Superscript(this.chSuperscript.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -465,7 +465,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_SmallCaps(field.getValue()=='checked');
properties.put_AllCaps(this.chAllCaps.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);
@ -485,7 +485,7 @@ define([ 'text!presentationeditor/main/app/template/ParagraphSettingsAdvanced
this.checkGroup = 0;
}
if (this.api && !this._noApply) {
var properties = (this._originalProps) ? this._originalProps : new CParagraphProp();
var properties = (this._originalProps) ? this._originalProps : new Asc.asc_CParagraphProperty();
properties.put_AllCaps(field.getValue()=='checked');
properties.put_SmallCaps(this.chSmallCaps.getValue()=='checked');
this.api.SetDrawImagePlaceParagraph('paragraphadv-font-img', properties);

View file

@ -583,10 +583,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_SOLID:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor((this.ShapeColor.Color=='transparent') ? {color: '4f81bd', effectId: 24} : this.ShapeColor.Color));
props.put_fill(fill);
this.api.ShapeApply(props);
@ -595,10 +595,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_GRAD:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -627,10 +627,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_PATT:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_PATT;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
var fHexColor = Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();
@ -652,8 +652,8 @@ define([
case Asc.c_oAscFill.FILL_TYPE_NOFILL:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_NOFILL;
if (!this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
props.put_fill(fill);
@ -669,15 +669,15 @@ define([
this.ShapeColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
if (this.ShapeColor.Color=='transparent') {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
} else {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color));
}
@ -694,10 +694,10 @@ define([
onPatternSelect: function(combo, record){
if (this.api && !this._noApply) {
this.PatternFillType = record.get('type');
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -713,10 +713,10 @@ define([
this.btnFGColor.setColor(color);
this.FGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
@ -732,10 +732,10 @@ define([
this.btnBGColor.setColor(color);
this.BGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -751,10 +751,10 @@ define([
this.BlipFillType = record.value;
if (this.api && this._fromTextureCmb !== true && this.OriginalFillType == Asc.c_oAscFill.FILL_TYPE_BLIP) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(this.BlipFillType);
@ -768,8 +768,8 @@ define([
this.sldrTransparency.setValue(field.getNumberValue(), true);
if (this.api) {
var num = field.getNumberValue();
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(num * 2.55);
props.put_fill(fill);
this.api.ShapeApply(props);
@ -798,8 +798,8 @@ define([
_transparencyApplyFunc: function() {
if (this._sliderChanged!==undefined) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(this._sliderChanged * 2.55);
props.put_fill(fill);
this.api.ShapeApply(props);
@ -832,10 +832,10 @@ define([
}
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -869,10 +869,10 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(rawData.type * 60000);
fill.get_fill().put_linear_scale(true);
@ -891,10 +891,10 @@ define([
this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(color) == 'object') ? color.color : color));
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]), Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]);
@ -933,10 +933,10 @@ define([
_gradientApplyFunc: function() {
if (this._sliderChanged) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_positions([this.GradColor.values[0]*1000, this.GradColor.values[1]*1000]);
@ -959,8 +959,8 @@ define([
this.BorderSize = value;
if (this.api && !this._noApply) {
var props = new CAscShapeProp();
var stroke = new CAscStroke();
var props = new Asc.asc_CShapeProperty();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
this._state.StrokeType = this._state.StrokeWidth = -1;
@ -1010,8 +1010,8 @@ define([
this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color};
if (this.api && this.BorderSize>0 && !this._noApply) {
var props = new CAscShapeProp();
var stroke = new CAscStroke();
var props = new Asc.asc_CShapeProperty();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
@ -1034,10 +1034,10 @@ define([
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
if (me.BlipFillType !== null) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(me.BlipFillType);
fill.get_fill().put_url(checkUrl);
@ -1526,10 +1526,10 @@ define([
this._fromTextureCmb = false;
if (this.api) {
var props = new CAscShapeProp();
var fill = new CAscFill();
var props = new Asc.asc_CShapeProperty();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(Asc.c_oAscFillBlipType.TILE);
fill.get_fill().put_texture_id(record.get('type'));
props.put_fill(fill);

View file

@ -164,7 +164,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.spnMarginTop.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_paddings()===null || this._changedProps.get_paddings()===undefined)
this._changedProps.put_paddings(new CPaddings());
this._changedProps.put_paddings(new Asc.asc_CPaddings());
this._changedProps.get_paddings().put_Top(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -182,7 +182,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.spnMarginBottom.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_paddings()===null || this._changedProps.get_paddings()===undefined)
this._changedProps.put_paddings(new CPaddings());
this._changedProps.put_paddings(new Asc.asc_CPaddings());
this._changedProps.get_paddings().put_Bottom(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -200,7 +200,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.spnMarginLeft.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_paddings()===null || this._changedProps.get_paddings()===undefined)
this._changedProps.put_paddings(new CPaddings());
this._changedProps.put_paddings(new Asc.asc_CPaddings());
this._changedProps.get_paddings().put_Left(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -218,7 +218,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.spnMarginRight.on('change', _.bind(function(field, newValue, oldValue, eOpts){
if (this._changedProps) {
if (this._changedProps.get_paddings()===null || this._changedProps.get_paddings()===undefined)
this._changedProps.put_paddings(new CPaddings());
this._changedProps.put_paddings(new Asc.asc_CPaddings());
this._changedProps.get_paddings().put_Right(Common.Utils.Metric.fnRecalcToMM(field.getNumberValue()));
}
}, this));
@ -242,7 +242,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.cmbCapType.on('selected', _.bind(function(combo, record){
if (this._changedProps) {
if (this._changedProps.get_stroke()===null)
this._changedProps.put_stroke(new CAscStroke());
this._changedProps.put_stroke(new Asc.asc_CStroke());
this._changedProps.get_stroke().put_linecap(record.value);
}
@ -264,7 +264,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
this.cmbJoinType.on('selected', _.bind(function(combo, record){
if (this._changedProps) {
if (this._changedProps.get_stroke()===null)
this._changedProps.put_stroke(new CAscStroke());
this._changedProps.put_stroke(new Asc.asc_CStroke());
this._changedProps.get_stroke().put_linejoin(record.value);
}
@ -442,7 +442,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
}
this.btnsCategory[2].setDisabled(null === margins); // Margins
this._changedProps = new CAscShapeProp();
this._changedProps = new Asc.asc_CShapeProperty();
}
},
@ -568,7 +568,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
onSelectBeginStyle: function(picker, view, record){
if (this._changedProps) {
if (this._changedProps.get_stroke()===null)
this._changedProps.put_stroke(new CAscStroke());
this._changedProps.put_stroke(new Asc.asc_CStroke());
this._changedProps.get_stroke().put_linebeginstyle(record.get('type'));
}
@ -581,7 +581,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
onSelectBeginSize: function(picker, view, record){
if (this._changedProps) {
if (this._changedProps.get_stroke()===null)
this._changedProps.put_stroke(new CAscStroke());
this._changedProps.put_stroke(new Asc.asc_CStroke());
this._changedProps.get_stroke().put_linebeginsize(record.get('type'));
}
@ -592,7 +592,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
onSelectEndStyle: function(picker, view, record){
if (this._changedProps) {
if (this._changedProps.get_stroke()===null)
this._changedProps.put_stroke(new CAscStroke());
this._changedProps.put_stroke(new Asc.asc_CStroke());
this._changedProps.get_stroke().put_lineendstyle(record.get('type'));
}
@ -605,7 +605,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem
onSelectEndSize: function(picker, view, record){
if (this._changedProps) {
if (this._changedProps.get_stroke()===null)
this._changedProps.put_stroke(new CAscStroke());
this._changedProps.put_stroke(new Asc.asc_CStroke());
this._changedProps.get_stroke().put_lineendsize(record.get('type'));
}

View file

@ -577,10 +577,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_SOLID:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
if (!this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor((this.SlideColor.Color=='transparent') ? {color: '4f81bd', effectId: 24} : this.SlideColor.Color));
props.put_background(fill);
this.api.SetSlideProps(props);
@ -589,10 +589,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_GRAD:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
if (!this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -621,10 +621,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_PATT:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_PATT;
if (!this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
var fHexColor = Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();
@ -645,8 +645,8 @@ define([
case Asc.c_oAscFill.FILL_TYPE_NOFILL:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_NOFILL;
if (!this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
props.put_background(fill);
@ -662,15 +662,15 @@ define([
this.SlideColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
if (this.SlideColor.Color=='transparent') {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
} else {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.SlideColor.Color));
}
@ -687,10 +687,10 @@ define([
onPatternSelect: function(combo, record){
if (this.api && !this._noApply) {
this.PatternFillType = record.get('type');
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -706,10 +706,10 @@ define([
this.btnFGColor.setColor(color);
this.FGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
@ -725,10 +725,10 @@ define([
this.btnBGColor.setColor(color);
this.BGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -744,10 +744,10 @@ define([
this.BlipFillType = record.value;
if (this.api && this._fromTextureCmb !== true && this.OriginalFillType == Asc.c_oAscFill.FILL_TYPE_BLIP) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(this.BlipFillType);
@ -782,10 +782,10 @@ define([
}
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -819,10 +819,10 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(rawData.type * 60000);
fill.get_fill().put_linear_scale(true);
@ -841,10 +841,10 @@ define([
this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(color) == 'object') ? color.color : color));
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]), Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]);
@ -883,10 +883,10 @@ define([
_gradientApplyFunc: function() {
if (this._sliderChanged) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_positions([this.GradColor.values[0]*1000, this.GradColor.values[1]*1000]);
@ -912,10 +912,10 @@ define([
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
if (me.BlipFillType !== null) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(me.BlipFillType);
fill.get_fill().put_url(checkUrl);
@ -996,10 +996,10 @@ define([
this._fromTextureCmb = false;
if (this.api) {
var props = new CAscSlideProps();
var fill = new CAscFill();
var props = new Asc.CAscSlideProps();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(Asc.c_oAscFillBlipType.TILE);
fill.get_fill().put_texture_id(record.get('type'));
props.put_background(fill);
@ -1057,8 +1057,8 @@ define([
this.fillEffectTypeCombo(type);
this.Effect = type;
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var timing = new Asc.Asc.CAscSlideProps();
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_TransitionType(type);
timing.put_TransitionOption(this.EffectType);
props.put_timing(timing);
@ -1070,8 +1070,8 @@ define([
onEffectTypeSelect: function(combo, record) {
this.EffectType = record.value;
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var timing = new Asc.Asc.CAscSlideProps();
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_TransitionType(this.Effect);
timing.put_TransitionOption(this.EffectType);
props.put_timing(timing);
@ -1082,8 +1082,8 @@ define([
onDurationChange: function(field, newValue, oldValue, eOpts){
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var timing = new Asc.Asc.CAscSlideProps();
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_TransitionDuration(field.getNumberValue()*1000);
props.put_timing(timing);
this.api.SetSlideProps(props);
@ -1093,8 +1093,8 @@ define([
onDelayChange: function(field, newValue, oldValue, eOpts){
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var timing = new Asc.Asc.CAscSlideProps();
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceDuration(field.getNumberValue()*1000);
props.put_timing(timing);
this.api.SetSlideProps(props);
@ -1104,8 +1104,8 @@ define([
onStartOnClickChange: function(field, newValue, oldValue, eOpts){
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var timing = new Asc.Asc.CAscSlideProps();
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceOnMouseClick(field.getValue()=='checked');
props.put_timing(timing);
this.api.SetSlideProps(props);
@ -1116,8 +1116,8 @@ define([
onCheckDelayChange: function(field, newValue, oldValue, eOpts){
this.numDelay.setDisabled(field.getValue()!=='checked');
if (this.api && !this._noApply) {
var props = new CAscSlideProps();
var timing = new Asc.Asc.CAscSlideProps();
var props = new Asc.CAscSlideProps();
var timing = new Asc.CAscSlideTiming();
timing.put_SlideAdvanceAfter(field.getValue()=='checked');
props.put_timing(timing);
this.api.SetSlideProps(props);

View file

@ -571,39 +571,39 @@ define([
if (border.indexOf('l') > -1 || !visible) {
if (updateBorders.get_Left()===null || updateBorders.get_Left()===undefined)
updateBorders.put_Left(new CBorder());
updateBorders.put_Left(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Left(), visible);
}
if (border.indexOf('t') > -1 || !visible) {
if (updateBorders.get_Top()===null || updateBorders.get_Top()===undefined)
updateBorders.put_Top(new CBorder());
updateBorders.put_Top(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Top(), visible);
}
if (border.indexOf('r') > -1 || !visible) {
if (updateBorders.get_Right()===null || updateBorders.get_Right()===undefined)
updateBorders.put_Right(new CBorder());
updateBorders.put_Right(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Right(), visible);
}
if (border.indexOf('b') > -1 || !visible) {
if (updateBorders.get_Bottom()===null || updateBorders.get_Bottom()===undefined)
updateBorders.put_Bottom(new CBorder());
updateBorders.put_Bottom(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_Bottom(), visible);
}
if (border.indexOf('c') > -1 || !visible) {
if (updateBorders.get_InsideV()===null || updateBorders.get_InsideV()===undefined)
updateBorders.put_InsideV(new CBorder());
updateBorders.put_InsideV(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_InsideV(), visible);
}
if (border.indexOf('m') > -1 || !visible) {
if (updateBorders.get_InsideH()===null || updateBorders.get_InsideH()===undefined)
updateBorders.put_InsideH(new CBorder());
updateBorders.put_InsideH(new Asc.asc_CTextBorder());
this._UpdateBorderStyle (updateBorders.get_InsideH(), visible);
}
},
_UpdateBorderStyle: function(border, visible) {
if (null == border)
border = new CBorder();
border = new Asc.asc_CTextBorder();
if (visible && this.BorderSize > 0){
var size = parseFloat(this.BorderSize);

View file

@ -118,7 +118,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Top');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Top((this.TableMargins.Top!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Top) : null);
this.TableMargins.isChanged = true;
}
@ -138,7 +138,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Bottom');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Bottom((this.TableMargins.Bottom!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Bottom) : null);
this.TableMargins.isChanged = true;
}
@ -158,7 +158,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Left');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Left((this.TableMargins.Left!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Left) : null);
this.TableMargins.isChanged = true;
}
@ -178,7 +178,7 @@ define([ 'text!presentationeditor/main/app/template/TableSettingsAdvanced.tem
this._marginsChange( field, newValue, oldValue, eOpts, 'table', 'Right');
if (this._changedProps) {
if (this._changedProps.get_DefaultMargins()===undefined)
this._changedProps.put_DefaultMargins(new CPaddings());
this._changedProps.put_DefaultMargins(new Asc.asc_CPaddings());
this._changedProps.get_DefaultMargins().put_Right((this.TableMargins.Right!==null) ? Common.Utils.Metric.fnRecalcToMM(this.TableMargins.Right) : null);
this.TableMargins.isChanged = true;
}

View file

@ -598,10 +598,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_SOLID:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_SOLID;
if (!this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor((this.ShapeColor.Color=='transparent') ? {color: '4f81bd', effectId: 24} : this.ShapeColor.Color));
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -611,10 +611,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_GRAD:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_GRAD;
if (!this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -644,10 +644,10 @@ define([
case Asc.c_oAscFill.FILL_TYPE_PATT:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_PATT;
if (!this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
var fHexColor = Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();
@ -669,8 +669,8 @@ define([
case Asc.c_oAscFill.FILL_TYPE_NOFILL:
this._state.FillType = Asc.c_oAscFill.FILL_TYPE_NOFILL;
if (!this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
props.asc_putFill(fill);
@ -687,15 +687,15 @@ define([
this.ShapeColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
if (this.ShapeColor.Color=='transparent') {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_NOFILL);
fill.put_fill(null);
} else {
fill.put_type(Asc.c_oAscFill.FILL_TYPE_SOLID);
fill.put_fill( new CAscFillSolid());
fill.put_fill( new Asc.asc_CFillSolid());
fill.get_fill().put_color(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color));
}
@ -713,10 +713,10 @@ define([
onPatternSelect: function(combo, record){
if (this.api && !this._noApply) {
this.PatternFillType = record.get('type');
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_pattern_type(this.PatternFillType);
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -733,10 +733,10 @@ define([
this.btnFGColor.setColor(color);
this.FGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
@ -753,10 +753,10 @@ define([
this.btnBGColor.setColor(color);
this.BGColor = {Value: 1, Color: color};
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_PATT);
fill.put_fill( new CAscFillHatch());
fill.put_fill( new Asc.asc_CFillHatch());
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_PATT) {
fill.get_fill().put_pattern_type(this.PatternFillType);
fill.get_fill().put_color_fg(Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color));
@ -773,10 +773,10 @@ define([
this.BlipFillType = record.value;
if (this.api && this._fromTextureCmb !== true && this.OriginalFillType == Asc.c_oAscFill.FILL_TYPE_BLIP) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(this.BlipFillType);
@ -791,8 +791,8 @@ define([
this.sldrTransparency.setValue(field.getNumberValue(), true);
if (this.api) {
var num = field.getNumberValue();
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(num * 2.55);
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -822,8 +822,8 @@ define([
_transparencyApplyFunc: function() {
if (this._sliderChanged!==undefined) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_transparent(this._sliderChanged * 2.55);
props.asc_putFill(fill);
this.shapeprops.put_TextArtProperties(props);
@ -857,10 +857,10 @@ define([
}
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
fill.get_fill().put_linear_angle(this.GradLinearDirectionType * 60000);
@ -895,10 +895,10 @@ define([
(this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) ? this.GradLinearDirectionType = rawData.type : this.GradRadialDirectionIdx = 0;
if (this.api) {
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_linear_angle(rawData.type * 60000);
fill.get_fill().put_linear_scale(true);
@ -918,10 +918,10 @@ define([
this.sldrGradient.setColorValue(Common.Utils.String.format('#{0}', (typeof(color) == 'object') ? color.color : color));
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_colors([Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]), Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])]);
@ -961,10 +961,10 @@ define([
_gradientApplyFunc: function() {
if (this._sliderChanged) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_GRAD);
fill.put_fill( new CAscFillGrad());
fill.put_fill( new Asc.asc_CFillGrad());
fill.get_fill().put_grad_type(this.GradFillType);
fill.get_fill().put_positions([this.GradColor.values[0]*1000, this.GradColor.values[1]*1000]);
@ -988,8 +988,8 @@ define([
this.BorderSize = value;
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var stroke = new CAscStroke();
var props = new Asc.asc_TextArtProperties();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
this._state.StrokeType = this._state.StrokeWidth = -1;
@ -1040,8 +1040,8 @@ define([
this.btnBorderColor.setColor(color);
this.BorderColor = {Value: 1, Color: color};
if (this.api && this.BorderSize>0 && !this._noApply) {
var props = new asc_TextArtProperties();
var stroke = new CAscStroke();
var props = new Asc.asc_TextArtProperties();
var stroke = new Asc.asc_CStroke();
if (this.BorderSize<0.01) {
stroke.put_type( Asc.c_oAscStrokeType.STROKE_NONE);
} else {
@ -1065,10 +1065,10 @@ define([
var checkUrl = value.replace(/ /g, '');
if (!_.isEmpty(checkUrl)) {
if (me.BlipFillType !== null) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(me.BlipFillType);
fill.get_fill().put_url(checkUrl);
@ -1086,7 +1086,7 @@ define([
ChangeSettings: function(props) {
if (this.shapeprops==null) {
this.shapeprops = new CAscShapeProp();
this.shapeprops = new Asc.asc_CShapeProperty();
}
if (this._initSettings)
@ -1533,10 +1533,10 @@ define([
this._fromTextureCmb = false;
if (this.api) {
var props = new asc_TextArtProperties();
var fill = new CAscFill();
var props = new Asc.asc_TextArtProperties();
var fill = new Asc.asc_CShapeFill();
fill.put_type(Asc.c_oAscFill.FILL_TYPE_BLIP);
fill.put_fill( new CAscFillBlip());
fill.put_fill( new Asc.asc_CFillBlip());
fill.get_fill().put_type(Asc.c_oAscFillBlipType.TILE);
fill.get_fill().put_texture_id(record.get('type'));
props.asc_putFill(fill);
@ -1565,7 +1565,7 @@ define([
onTextArtSelect: function(combo, record){
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var props = new Asc.asc_TextArtProperties();
props.asc_putStyle(record.get('data'));
this.shapeprops.put_TextArtProperties(props);
this.api.ShapeApply(this.shapeprops);
@ -1598,7 +1598,7 @@ define([
onTransformSelect: function(combo, record){
if (this.api && !this._noApply) {
var props = new asc_TextArtProperties();
var props = new Asc.asc_TextArtProperties();
props.asc_putForm(record.get('type'));
this.shapeprops.put_TextArtProperties(props);
this.api.ShapeApply(this.shapeprops);

View file

@ -231,34 +231,41 @@
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>
<script type="text/javascript" src="../../../vendor/underscore/underscore-min.js"></script>
<link rel="stylesheet" type="text/css" href="../../../vendor/perfect-scrollbar/src/perfect-scrollbar.css" />
<script type="text/javascript" src="../../../vendor/perfect-scrollbar/src/jquery.mousewheel.js"></script>
<script type="text/javascript" src="../../../vendor/perfect-scrollbar/src/perfect-scrollbar.js"></script>
<script type="text/javascript">
window.g_debug_mode = true;
</script>
<!-- sdk -->
<script type="text/javascript" src="../../../../sdkjs/common/AllFonts.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/browser.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/commonDefines.js"></script>
<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/slide/apiDefines.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/common/AllFonts.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/wordcopypaste.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/editorscommon.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/commonDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeCommonWordExcel.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/SerializeChart.js"></script>
@ -269,8 +276,6 @@
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
<script type="text/javascript" src="../../../../sdkjs/word/Editor/Serialize2.js"></script>
<script src="../../../../sdkjs/common/commonDefines.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>
@ -344,12 +349,8 @@
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/Format/Layout.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/Editor/Format/Comments.js"></script>
<script type="text/javascript" src="../../../../sdkjs/slide/apiDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiCommon.js"></script>
<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/slide/apiCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiBase.js"></script>

View file

@ -149,7 +149,7 @@
"PE.Controllers.Main.textBuyNow": "Buy now",
"PE.Controllers.Main.textCloseTip": "\nClick to close the tip",
"PE.Controllers.Main.textLoadingDocument": "Loading presentation",
"PE.Controllers.Main.textNoLicenseTitle": "License expired",
"PE.Controllers.Main.textNoLicenseTitle": "License expired or not found",
"PE.Controllers.Main.textShape": "Shape",
"PE.Controllers.Main.textStrict": "Strict mode",
"PE.Controllers.Main.textTryUndoRedo": "The Undo/Redo functions are disabled for the Fast co-editing mode.<br>Click the 'Strict mode' button to switch to the Strict co-editing mode to edit the file without other users interference and send your changes only after you save them. You can switch between the co-editing modes using the editor Advanced settings.",
@ -214,8 +214,9 @@
"PE.Controllers.Main.uploadImageTitleText": "Uploading Image",
"PE.Controllers.Main.warnBrowserIE9": "The application has low capabilities on IE9. Use IE10 or higher",
"PE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"PE.Controllers.Main.warnNoLicense": "The license expired. You cannot create or edit files.<br>Click the 'Buy now' button to prolong the license.",
"PE.Controllers.Main.warnNoLicense": "The license could not be found or expired. You cannot edit files.<br>Click 'Buy now' to purchase Enterprise Edition license or 'Contact us' if you use Integration Edition.",
"PE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"PE.Controllers.Main.textContactUs": "Contact us",
"PE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"PE.Controllers.Toolbar.confirmAddFontName": "The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the system fonts, the saved font will be used when it is available.<br>Do you want to continue?",
"PE.Controllers.Toolbar.textEmptyImgUrl": "You need to specify image URL.",

View file

@ -109,13 +109,13 @@ Ext.define('PE.controller.Main', {
if (data.doc) {
this.permissions = data.doc.permissions;
var _user = new CUserInfo();
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.editorConfig.user.id);
_user.put_FirstName(this.editorConfig.user.firstname);
_user.put_LastName(this.editorConfig.user.lastname);
_user.put_FullName(this.editorConfig.user.fullname);
var docInfo = new CDocInfo();
var docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(data.doc.key);
docInfo.put_Url(data.doc.url);
docInfo.put_Title(data.doc.title);

View file

@ -160,7 +160,7 @@ var ApplicationController = new(function(){
if (docConfig) {
permissions = $.extend(permissions, docConfig.permissions);
var docInfo = new CDocInfo();
var docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(docConfig.key);
docInfo.put_Url(docConfig.url);
docInfo.put_Title(docConfig.title);

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

View file

@ -242,6 +242,7 @@ define([
this.appOptions.recent = this.editorConfig.recent;
this.appOptions.createUrl = this.editorConfig.createUrl;
this.appOptions.lang = this.editorConfig.lang;
this.appOptions.location = (typeof (this.editorConfig.location) == 'string') ? this.editorConfig.location.toLowerCase() : '';
this.appOptions.canAutosave = false;
this.appOptions.canAnalytics = false;
this.appOptions.sharingSettingsUrl = this.editorConfig.sharingSettingsUrl;
@ -270,6 +271,9 @@ define([
} else
value = SSE.Views.FormulaLang.get(value);
if (value) this.api.asc_setLocalization(value);
if (this.appOptions.location == 'us' || this.appOptions.location == 'ca')
Common.Utils.Metric.setDefaultMetric(Common.Utils.Metric.c_MetricUnits.inch);
},
loadDocument: function(data) {
@ -280,13 +284,13 @@ define([
if (data.doc) {
this.permissions = _.extend(this.permissions, data.doc.permissions);
var _user = new CUserInfo();
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.appOptions.user.id);
_user.put_FirstName(this.appOptions.user.firstname);
_user.put_LastName(this.appOptions.user.lastname);
_user.put_FullName(this.appOptions.user.fullname);
docInfo = new CDocInfo();
docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(data.doc.key);
docInfo.put_Url(data.doc.url);
docInfo.put_Title(data.doc.title);
@ -536,8 +540,7 @@ define([
return;
var me = this,
value,
tips = [];
value;
me._isDocReady = true;
@ -663,16 +666,22 @@ define([
$(document).on('contextmenu', _.bind(me.onContextMenu, me));
// me.getViewport().getEl().un('keypress', me.lockEscapeKey, me);
if (!window['AscDesktopEditor']) {
Common.Utils.isIE9m && tips.push(me.warnBrowserIE9);
!Common.Utils.isGecko &&
!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram &&
!me.appOptions.nativeApp &&
function checkWarns() {
if (!window['AscDesktopEditor']) {
var tips = [];
Common.Utils.isIE9m && tips.push(me.warnBrowserIE9);
!Common.Utils.isGecko && !me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram && !me.appOptions.nativeApp &&
(Math.abs(me.getBrowseZoomLevel() - 1) > 0.1) && tips.push(Common.Utils.String.platformKey(me.warnBrowserZoom, '{0}'));
if (tips.length) me.showTips(tips);
if (tips.length) me.showTips(tips);
}
document.removeEventListener('visibilitychange', checkWarns);
}
if (typeof document.hidden !== 'undefined' && document.hidden) {
document.addEventListener('visibilitychange', checkWarns);
} else checkWarns();
if (this._state.licenseWarning) {
value = Common.localStorage.getItem("de-license-warning");
value = (value!==null) ? parseInt(value) : 0;
@ -680,14 +689,19 @@ define([
if (now - value > 86400000) {
Common.localStorage.setItem("de-license-warning", now);
Common.UI.info({
width: 400,
title: this.textNoLicenseTitle,
msg : this.warnNoLicense,
buttons: ['custom'],
primary: 'custom',
customButtonText: this.textBuyNow,
buttons: [
{value: 'buynow', caption: this.textBuyNow},
{value: 'contact', caption: this.textContactUs}
],
primary: 'buynow',
callback: function(btn) {
if (btn == 'custom')
if (btn == 'buynow')
window.open('http://www.onlyoffice.com/enterprise-edition.aspx', "_blank");
else if (btn == 'contact')
window.open('mailto:sales@onlyoffice.com', "_blank");
}
});
}
@ -867,7 +881,7 @@ define([
}
var value = Common.localStorage.getItem('sse-settings-unit');
Common.Utils.Metric.setCurrentMetric((value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm);
Common.Utils.Metric.setCurrentMetric((value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric());
if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) {
var options = {};
@ -1549,7 +1563,7 @@ define([
unitsChanged: function(m) {
var value = Common.localStorage.getItem("sse-settings-unit");
Common.Utils.Metric.setCurrentMetric((value!==null) ? parseInt(value) : Common.Utils.Metric.c_MetricUnits.cm);
Common.Utils.Metric.setCurrentMetric((value!==null) ? parseInt(value) : Common.Utils.Metric.getDefaultMetric());
this.getApplication().getController('RightMenu').updateMetricUnit();
this.getApplication().getController('Print').getView('MainSettingsPrint').updateMetricUnit();
},
@ -1769,8 +1783,9 @@ define([
errorOpenWarning: 'The length of one of the formulas in the file exceeded<br>the allowed number of characters and it was removed.',
errorFrmlWrongReferences: 'The function refers to a sheet that does not exist.<br>Please check the data and try again.',
textBuyNow: 'Buy now',
textNoLicenseTitle: 'License expired',
warnNoLicense: 'The license expired. You cannot create or edit files.<br>Click the \'Buy now\' button to prolong the license.'
textNoLicenseTitle: 'License expired or not found',
warnNoLicense: 'The license could not be found or expired. You cannot edit files.<br>Click \'Buy now\' to purchase Enterprise Edition license or \'Contact us\' if you use Integration Edition.',
textContactUs: 'Contact us'
}
})(), SSE.Controllers.Main || {}))
});

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,18 +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;
@ -127,7 +130,7 @@ define([
}
},
onFocusObject: function(SelectedObjects) {
onFocusObject: function(SelectedObjects, formatTableInfo) {
if (!this.editMode)
return;
@ -165,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];
@ -255,6 +264,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());
}
},

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

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

@ -648,7 +648,7 @@ define([
this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0));
value = Common.localStorage.getItem("sse-settings-coauthmode");
var fast_coauth = (value===null || parseInt(value) == 1);
var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline);
item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)});
this.cmbCoAuthMode.setValue(item ? item.get('value') : 1);
@ -661,11 +661,11 @@ define([
value = Common.localStorage.getItem("sse-settings-unit");
item = this.cmbUnit.store.findWhere({value: parseInt(value)});
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : 0);
this.cmbUnit.setValue(item ? parseInt(item.get('value')) : Common.Utils.Metric.getDefaultMetric());
this._oldUnits = this.cmbUnit.getValue();
value = Common.localStorage.getItem("sse-settings-autosave");
this.chAutosave.setValue(fast_coauth);
this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1));
value = Common.localStorage.getItem("sse-settings-func-locale");
if (value===null)

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) {
@ -229,6 +243,7 @@ define([
this.shapeSettings.disableControls(disabled);
this.imageSettings.disableControls(disabled);
this.chartSettings.disableControls(disabled);
this.tableSettings.disableControls(disabled);
} else {
var cmp = $("#" + id);
if (disabled !== cmp.hasClass('disabled')) {
@ -255,6 +270,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

@ -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;
@ -198,10 +212,12 @@ define([
// },
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,457 @@
/**
* 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.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

@ -235,28 +235,31 @@
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>
<script type="text/javascript" src="../../../vendor/xregexp/xregexp-all-min.js"></script>
<link rel="stylesheet" type="text/css" href="../../../vendor/perfect-scrollbar/src/perfect-scrollbar.css" />
<script type="text/javascript" src="../../../vendor/perfect-scrollbar/src/jquery.mousewheel.js"></script>
<script type="text/javascript" src="../../../vendor/perfect-scrollbar/src/perfect-scrollbar.js"></script>
<!--<script type="text/javascript" src="../../../../sdkjs/cell/sdk-all.js"></script>-->
<script type="text/javascript">
window.g_debug_mode = true;
</script>
<script type="text/javascript" src="../../../../sdkjs/common/browser.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/editorscommon.js"></script>
<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/commonDefines.js"></script>
<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/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/commonDefines.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/apiCommon.js"></script>
<script type="text/javascript" src="../../../../sdkjs/common/NumFormat.js"></script>
@ -272,9 +275,8 @@
<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>
<script type="text/javascript" src="../../../../sdkjs/cell/model/ConditionalFormatting.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/clipboard.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/model/autofilters.js"></script>
@ -307,7 +309,6 @@
<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/model/UndoRedo.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/view/StringRender.js"></script>
<script type="text/javascript" src="../../../../sdkjs/cell/view/CellTextRender.js"></script>

View file

@ -187,7 +187,7 @@
"SSE.Controllers.Main.textConfirm": "Confirmation",
"SSE.Controllers.Main.textLoadingDocument": "Loading spreadsheet",
"SSE.Controllers.Main.textNo": "No",
"SSE.Controllers.Main.textNoLicenseTitle": "License expired",
"SSE.Controllers.Main.textNoLicenseTitle": "License expired or not found",
"SSE.Controllers.Main.textPleaseWait": "The operation might take more time than expected. Please wait...",
"SSE.Controllers.Main.textRecalcFormulas": "Calculating formulas...",
"SSE.Controllers.Main.textShape": "Shape",
@ -219,8 +219,9 @@
"SSE.Controllers.Main.uploadImageTitleText": "Uploading Image",
"SSE.Controllers.Main.warnBrowserIE9": "The application has low capabilities on IE9. Use IE10 or higher",
"SSE.Controllers.Main.warnBrowserZoom": "Your browser current zoom setting is not fully supported. Please reset to the default zoom by pressing Ctrl+0.",
"SSE.Controllers.Main.warnNoLicense": "The license expired. You cannot create or edit files.<br>Click the 'Buy now' button to prolong the license.",
"SSE.Controllers.Main.warnNoLicense": "The license could not be found or expired. You cannot edit files.<br>Click 'Buy now' to purchase Enterprise Edition license or 'Contact us' if you use Integration Edition.",
"SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.",
"SSE.Controllers.Main.textContactUs": "Contact us",
"SSE.Controllers.Print.strAllSheets": "All Sheets",
"SSE.Controllers.Print.textWarning": "Warning",
"SSE.Controllers.Print.warnCheckMargings": "Margins are incorrect",
@ -711,6 +712,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",
@ -827,6 +829,8 @@
"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.TextArtSettings.strBackground": "Background color",
"SSE.Views.TextArtSettings.strColor": "Color",
"SSE.Views.TextArtSettings.strFill": "Fill",

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

View file

@ -108,13 +108,13 @@ Ext.define('SSE.controller.Main', {
if (data.doc) {
this.permissions = data.doc.permissions;
var _user = new CUserInfo();
var _user = new Asc.asc_CUserInfo();
_user.put_Id(this.editorConfig.user.id);
_user.put_FirstName(this.editorConfig.user.firstname);
_user.put_LastName(this.editorConfig.user.lastname);
_user.put_FullName(this.editorConfig.user.fullname);
docInfo = new CDocInfo();
docInfo = new Asc.asc_CDocInfo();
docInfo.put_Id(data.doc.key);
docInfo.put_Url(data.doc.url);
docInfo.put_Title(data.doc.title);

View file

@ -1,9 +1,7 @@
module.exports = function(grunt) {
var _ = require('lodash'),
defaultConfig,
packageFile,
revisionHash = '@@REVISION',
revisionTimeStamp = '@@REVISIONDATE';
packageFile;
grunt.loadNpmTasks('grunt-contrib-clean');
@ -55,43 +53,6 @@ module.exports = function(grunt) {
});
}
grunt.registerTask('init-config', 'Initialize build script', function() {
var exec = require('child_process').exec,
done = this.async(),
commandsRef = 0;
function doneTask() {
if (--commandsRef <= 0) {
done(true);
}
}
function doCommand(command, callback) {
commandsRef++;
exec(command, callback);
}
doCommand('hg log -r -1 --template "{node|short}"', function(error, stdout, stderr) {
if (error) {
grunt.log.writeln('Error: ' + error);
} else {
revisionHash = stdout;
}
doneTask();
});
doCommand('hg log -r -1 --template "{date|isodate}"', function(error, stdout, stderr) {
if (error) {
grunt.log.writeln('Error: ' + error);
} else {
revisionTimeStamp = stdout;
}
doneTask();
});
});
grunt.initConfig({
mocha: {
test: {
@ -212,7 +173,7 @@ module.exports = function(grunt) {
' *\n' +
' * <%= pkg.homepage %> \n' +
' *\n' +
' * Version: <%= pkg.version %> (build:<%= pkg.build %>, rev:' + revisionHash + ', date:' + revisionTimeStamp + ')\n' +
' * Version: ' + process.env['PRODUCT_VERSION'] + ' (build:' + process.env['BUILD_NUMBER'] + ')\n' +
' */\n'
},
dist: {
@ -444,9 +405,9 @@ module.exports = function(grunt) {
}
});
grunt.registerTask('deploy-documenteditor', ['init-build-documenteditor', 'init-config', 'deploy-app']);
grunt.registerTask('deploy-spreadsheeteditor', ['init-build-spreadsheeteditor', 'init-config', 'deploy-app']);
grunt.registerTask('deploy-presentationeditor', ['init-build-presentationeditor', 'init-config', 'deploy-app']);
grunt.registerTask('deploy-documenteditor', ['init-build-documenteditor', 'deploy-app']);
grunt.registerTask('deploy-spreadsheeteditor', ['init-build-spreadsheeteditor', 'deploy-app']);
grunt.registerTask('deploy-presentationeditor', ['init-build-presentationeditor', 'deploy-app']);
grunt.registerTask('default', ['deploy-documenteditor', 'deploy-spreadsheeteditor', 'deploy-presentationeditor']);
};

View file

@ -6,7 +6,6 @@
"dependencies": {
"lodash": "^4.0.0",
"grunt": "0.4.5",
"grunt-exec": "0.4.5",
"grunt-replace": "0.7.3",
"grunt-html-minify": "0.3.1",
"grunt-text-replace": "0.3.11",