[DE] Added tab leader.

This commit is contained in:
Julia Radzhabova 2017-11-03 16:23:19 +03:00
parent a5c938338f
commit 4bfd4bf211
3 changed files with 50 additions and 29 deletions

View file

@ -139,12 +139,15 @@
<div class="padding-large"> <div class="padding-large">
<div id="paraadv-list-tabs" style="width:180px; height: 94px;"></div> <div id="paraadv-list-tabs" style="width:180px; height: 94px;"></div>
</div> </div>
<div class="padding-large" > <div class="padding-large" style="display: inline-block;margin-right: 7px;">
<label class="input-label padding-small" style="display: block;"><%= scope.textAlign %></label> <label class="input-label"><%= scope.textAlign %></label>
<div id="paragraphadv-radio-left" class="padding-small" style="display: block;"></div> <div id="paraadv-cmb-align"></div>
<div id="paragraphadv-radio-center" class="padding-small" style="display: block;"></div>
<div id="paragraphadv-radio-right" style="display: block;"></div>
</div> </div>
<div class="padding-large" style="display: inline-block;">
<label class="input-label"><%= scope.textLeader %></label>
<div id="paraadv-cmb-leader"></div>
</div>
<div style="margin-bottom: 45px;"></div>
<div> <div>
<button type="button" class="btn btn-text-default" id="paraadv-button-add-tab" style="width:90px;margin-right: 4px;"><%= scope.textSet %></button> <button type="button" class="btn btn-text-default" id="paraadv-button-add-tab" style="width:90px;margin-right: 4px;"><%= scope.textSet %></button>
<button type="button" class="btn btn-text-default" id="paraadv-button-remove-tab" style="width:90px;margin-right: 4px;"><%= scope.textRemove %></button> <button type="button" class="btn btn-text-default" id="paraadv-button-remove-tab" style="width:90px;margin-right: 4px;"><%= scope.textRemove %></button>

View file

@ -42,7 +42,6 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
'common/main/lib/view/AdvancedSettingsWindow', 'common/main/lib/view/AdvancedSettingsWindow',
'common/main/lib/component/MetricSpinner', 'common/main/lib/component/MetricSpinner',
'common/main/lib/component/CheckBox', 'common/main/lib/component/CheckBox',
'common/main/lib/component/RadioBox',
'common/main/lib/component/ThemeColorPalette', 'common/main/lib/component/ThemeColorPalette',
'common/main/lib/component/ColorButton', 'common/main/lib/component/ColorButton',
'common/main/lib/component/ListView', 'common/main/lib/component/ListView',
@ -410,24 +409,35 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
this.listenTo(this.tabList.store, 'remove', storechanged); this.listenTo(this.tabList.store, 'remove', storechanged);
this.listenTo(this.tabList.store, 'reset', storechanged); this.listenTo(this.tabList.store, 'reset', storechanged);
this.radioLeft = new Common.UI.RadioBox({ this.cmbAlign = new Common.UI.ComboBox({
el: $('#paragraphadv-radio-left'), el : $('#paraadv-cmb-align'),
labelText: this.textTabLeft, style : 'width: 85px;',
name: 'asc-radio-tab', menuStyle : 'min-width: 85px;',
checked: true editable : false,
cls : 'input-group-nr',
data : [
{ value: 1, displayValue: this.textTabLeft },
{ value: 3, displayValue: this.textTabCenter },
{ value: 2, displayValue: this.textTabRight }
]
}); });
this.cmbAlign.setValue(1);
this.radioCenter = new Common.UI.RadioBox({ this.cmbLeader = new Common.UI.ComboBox({
el: $('#paragraphadv-radio-center'), el : $('#paraadv-cmb-leader'),
labelText: this.textTabCenter, style : 'width: 85px;',
name: 'asc-radio-tab' menuStyle : 'min-width: 85px;',
}); editable : false,
cls : 'input-group-nr',
this.radioRight = new Common.UI.RadioBox({ data : [
el: $('#paragraphadv-radio-right'), { value: Asc.c_oAscTabLeader.None, displayValue: this.textNone },
labelText: this.textTabRight, { value: Asc.c_oAscTabLeader.Dot, displayValue: '....................' },
name: 'asc-radio-tab' { value: Asc.c_oAscTabLeader.Hyphen, displayValue: '-----------------' },
{ value: Asc.c_oAscTabLeader.MiddleDot, displayValue: '·················' },
{ value: Asc.c_oAscTabLeader.Underscore,displayValue: '__________' }
]
}); });
this.cmbLeader.setValue(Asc.c_oAscTabLeader.None);
this.btnAddTab = new Common.UI.Button({ this.btnAddTab = new Common.UI.Button({
el: $('#paraadv-button-add-tab') el: $('#paraadv-button-add-tab')
@ -562,7 +572,7 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined) if (this._changedProps.get_Tabs()===null || this._changedProps.get_Tabs()===undefined)
this._changedProps.put_Tabs(new Asc.asc_CParagraphTabs()); this._changedProps.put_Tabs(new Asc.asc_CParagraphTabs());
this.tabList.store.each(function (item, index) { this.tabList.store.each(function (item, index) {
var tab = new Asc.asc_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'), item.get('tabLeader'));
this._changedProps.get_Tabs().add_Tab(tab); this._changedProps.get_Tabs().add_Tab(tab);
}, this); }, this);
} }
@ -663,7 +673,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
rec.set({ rec.set({
tabPos: pos, tabPos: pos,
value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.getCurrentMetricName(), value: parseFloat(pos.toFixed(3)) + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: tab.get_Value() tabAlign: tab.get_Value(),
tabLeader: tab.asc_getLeader()
}); });
arr.push(rec); arr.push(rec);
} }
@ -1054,8 +1065,9 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
}, },
addTab: function(btn, eOpts){ addTab: function(btn, eOpts){
var val = this.numTab.getNumberValue(); var val = this.numTab.getNumberValue(),
var align = this.radioLeft.getValue() ? 1 : (this.radioCenter.getValue() ? 3 : 2); align = this.cmbAlign.getValue(),
leader = this.cmbLeader.getValue();
var store = this.tabList.store; var store = this.tabList.store;
var rec = store.find(function(record){ var rec = store.find(function(record){
@ -1063,13 +1075,15 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
}); });
if (rec) { if (rec) {
rec.set('tabAlign', align); rec.set('tabAlign', align);
rec.set('tabLeader', leader);
this._tabListChanged = true; this._tabListChanged = true;
} else { } else {
rec = new Common.UI.DataViewModel(); rec = new Common.UI.DataViewModel();
rec.set({ rec.set({
tabPos: val, tabPos: val,
value: val + ' ' + Common.Utils.Metric.getCurrentMetricName(), value: val + ' ' + Common.Utils.Metric.getCurrentMetricName(),
tabAlign: align tabAlign: align,
tabLeader: leader
}); });
store.add(rec); store.add(rec);
} }
@ -1110,8 +1124,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
rawData = record; rawData = record;
} }
this.numTab.setValue(rawData.tabPos); this.numTab.setValue(rawData.tabPos);
(rawData.tabAlign==1) ? this.radioLeft.setValue(true) : ((rawData.tabAlign==3) ? this.radioCenter.setValue(true) : this.radioRight.setValue(true)); this.cmbAlign.setValue(rawData.tabAlign);
this.cmbLeader.setValue(rawData.tabLeader);
}, },
hideTextOnlySettings: function(value) { hideTextOnlySettings: function(value) {
@ -1173,6 +1187,8 @@ define([ 'text!documenteditor/main/app/template/ParagraphSettingsAdvanced.tem
tipNone: 'Set No Borders', tipNone: 'Set No Borders',
tipInner: 'Set Horizontal Inner Lines Only', tipInner: 'Set Horizontal Inner Lines Only',
tipOuter: 'Set Outer Border Only', tipOuter: 'Set Outer Border Only',
noTabs: 'The specified tabs will appear in this field' noTabs: 'The specified tabs will appear in this field',
textLeader: 'Leader',
textNone: 'None'
}, DE.Views.ParagraphSettingsAdvanced || {})); }, DE.Views.ParagraphSettingsAdvanced || {}));
}); });

View file

@ -1357,6 +1357,8 @@
"DE.Views.ParagraphSettingsAdvanced.tipRight": "Set right border only", "DE.Views.ParagraphSettingsAdvanced.tipRight": "Set right border only",
"DE.Views.ParagraphSettingsAdvanced.tipTop": "Set top border only", "DE.Views.ParagraphSettingsAdvanced.tipTop": "Set top border only",
"DE.Views.ParagraphSettingsAdvanced.txtNoBorders": "No borders", "DE.Views.ParagraphSettingsAdvanced.txtNoBorders": "No borders",
"DE.Views.ParagraphSettingsAdvanced.textLeader": "Leader",
"DE.Views.ParagraphSettingsAdvanced.textNone": "None",
"DE.Views.RightMenu.txtChartSettings": "Chart settings", "DE.Views.RightMenu.txtChartSettings": "Chart settings",
"DE.Views.RightMenu.txtHeaderFooterSettings": "Header and footer settings", "DE.Views.RightMenu.txtHeaderFooterSettings": "Header and footer settings",
"DE.Views.RightMenu.txtImageSettings": "Image settings", "DE.Views.RightMenu.txtImageSettings": "Image settings",