[DE] Watermark: save language settings
This commit is contained in:
parent
8e37e78638
commit
45a82b8442
|
@ -493,4 +493,5 @@
|
|||
.button-normal-icon(~'x-huge .btn-select-pivot', 55, @toolbar-big-icon-size);
|
||||
.button-normal-icon(~'x-huge .btn-bookmarks', 56, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-blankpage, 57, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-print-area, 58, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-print-area, 58, @toolbar-big-icon-size);
|
||||
.button-normal-icon(btn-watermark, 63, @toolbar-big-icon-size);
|
|
@ -134,6 +134,7 @@
|
|||
<span class="btn-slot text x-huge" id="slot-img-movebkwd"></span>
|
||||
<span class="btn-slot text x-huge" id="slot-img-wrapping"></span>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="group">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-watermark"></span>
|
||||
</div>
|
||||
|
|
|
@ -1018,7 +1018,7 @@ define([
|
|||
|
||||
me.btnWatermark = new Common.UI.Button({
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
iconCls: 'btn-pageorient',
|
||||
iconCls: 'btn-watermark',
|
||||
caption: me.capBtnWatermark,
|
||||
menu: new Common.UI.Menu({
|
||||
cls: 'ppm-toolbar',
|
||||
|
@ -2457,7 +2457,7 @@ define([
|
|||
txtMarginAlign: 'Align to Margin',
|
||||
txtObjectsAlign: 'Align Selected Objects',
|
||||
capBtnWatermark: 'Watermark',
|
||||
textEditWatermark: 'Settings',
|
||||
textEditWatermark: 'Custom Watermark',
|
||||
textRemWatermark: 'Remove Watermark',
|
||||
tipWatermark: 'Edit watermark'
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
|
|||
this.textControls = [];
|
||||
this.imageControls = [];
|
||||
this.fontName = 'Arial';
|
||||
this.lang = 'en';
|
||||
this.isAutoColor = false;
|
||||
|
||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||
|
@ -206,9 +207,7 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
|
|||
menuStyle : 'min-width: 100%;max-height: 210px;',
|
||||
scrollAlwaysVisible: true,
|
||||
data : []
|
||||
}).on('selected', _.bind(function(combo, record) {
|
||||
this.loadWMText(record);
|
||||
}, this));
|
||||
}).on('selected', _.bind(this.onSelectLang, this));
|
||||
this.textControls.push(this.cmbLang);
|
||||
|
||||
this.cmbText = new Common.UI.ComboBox({
|
||||
|
@ -414,19 +413,40 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
|
|||
});
|
||||
this.cmbLang.setData(data);
|
||||
if (data.length) {
|
||||
this.cmbLang.setValue('en', data[0].value);
|
||||
this.loadWMText(this.cmbLang.getSelectedRecord());
|
||||
var item = this.cmbLang.store.findWhere({value: this.lang}) || this.cmbLang.store.at(0);
|
||||
this.cmbLang.setValue(this.lang);
|
||||
this.onSelectLang(this.cmbLang, item.toJSON());
|
||||
} else
|
||||
this.cmbLang.setDisabled(true);
|
||||
},
|
||||
|
||||
loadWMText: function(record) {
|
||||
onSelectLang: function(combo, record) {
|
||||
if (!record) return;
|
||||
|
||||
var data = [];
|
||||
record.wmtext.forEach(function(item) {
|
||||
data.push({value: item});
|
||||
});
|
||||
this.lang = record.value;
|
||||
this.cmbText.setData(data);
|
||||
this.cmbText.setValue(data[0].value);
|
||||
},
|
||||
|
||||
loadWMText: function(lang) {
|
||||
if (!lang) return;
|
||||
|
||||
var data = [];
|
||||
var item = this.cmbLang.store.findWhere({value: lang});
|
||||
if (!item)
|
||||
item = this.cmbLang.store.findWhere({value: lang.split(/[\-\_]/)[0]});
|
||||
if (!item)
|
||||
item = this.cmbLang.store.findWhere({value: 'en'});
|
||||
if (!item)
|
||||
item = this.cmbLang.store.at(0);
|
||||
|
||||
item && item.get('wmtext').forEach(function(item) {
|
||||
data.push({value: item});
|
||||
});
|
||||
this.cmbText.setData(data);
|
||||
this.cmbText.setValue(data[0].value);
|
||||
},
|
||||
|
@ -460,13 +480,16 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
|
|||
this.cmbScale.setValue((val<0) ? -1 : Math.round(val*100), Math.round(val*100) + ' %');
|
||||
} else {
|
||||
this.radioText.setValue(true);
|
||||
val = props.get_Text();
|
||||
val && this.cmbText.setValue(val);
|
||||
!props.get_IsDiagonal() && this.radioHor.setValue(true);
|
||||
this.chTransparency.setValue(props.get_Opacity()<255);
|
||||
|
||||
val = props.get_TextPr();
|
||||
if (val) {
|
||||
var lang = Common.util.LanguageInfo.getLocalLanguageName(val.get_Lang());
|
||||
this.lang = lang[0];
|
||||
this.cmbLang.setValue(lang[1]);
|
||||
this.loadWMText(lang[0]);
|
||||
|
||||
var font = val.get_FontFamily().get_Name();
|
||||
if (font) {
|
||||
var rec = this.cmbFonts.store.findWhere({name: font});
|
||||
|
@ -510,8 +533,10 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
|
|||
}
|
||||
}
|
||||
this.btnTextColor.currentColor = clr;
|
||||
$('.btn-color-value-line', this.btnTextColor.cmpEl).css('background-color', '#' + clr);
|
||||
$('.btn-color-value-line', this.btnTextColor.cmpEl).css('background-color', '#' + ((typeof(clr) == 'object') ? clr.color : clr));
|
||||
}
|
||||
val = props.get_Text();
|
||||
val && this.cmbText.setValue(val);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -540,6 +565,8 @@ define(['text!documenteditor/main/app/template/WatermarkSettings.template',
|
|||
val.put_Underline(this.btnUnderline.pressed);
|
||||
val.put_Strikeout(this.btnStrikeout.pressed);
|
||||
|
||||
val.put_Lang(parseInt(Common.util.LanguageInfo.getLocalLanguageCode(this.lang)));
|
||||
|
||||
var color = new Asc.asc_CColor();
|
||||
if (this.isAutoColor) {
|
||||
color.put_auto(true);
|
||||
|
|
Loading…
Reference in a new issue