[DE] Change bullet settings

This commit is contained in:
Julia Radzhabova 2022-10-11 18:48:23 +03:00
parent dad68054db
commit 3023a140d9
2 changed files with 29 additions and 40 deletions

View file

@ -139,13 +139,8 @@ define([
'<table cols="2" style="width: 100%;">', '<table cols="2" style="width: 100%;">',
'<tr>', '<tr>',
'<td style="padding-right: 5px;">', '<td style="padding-right: 5px;">',
'<% if (type == 0) { %>', '<label class="input-label">' + this.txtType + '</label>',
'<label class="input-label">' + this.txtBullet + '</label>', '<div id="id-dlg-numbering-format" class="input-group-nr" style="width: 100%;margin-bottom: 10px;"></div>',
'<button type="button" class="btn btn-text-default" id="id-dlg-bullet-font" style="width: 100%;margin-bottom: 10px;">' + this.txtFont + '</button>',
'<% } else { %>',
'<label class="input-label">' + this.txtType + '</label>',
'<div id="id-dlg-numbering-format" class="input-group-nr" style="width: 100%;margin-bottom: 10px;"></div>',
'<% } %>',
'</td>', '</td>',
'<td style="padding-left: 5px;">', '<td style="padding-left: 5px;">',
'<label class="input-label">' + this.txtAlign + '</label>', '<label class="input-label">' + this.txtAlign + '</label>',
@ -155,7 +150,7 @@ define([
'<tr>', '<tr>',
'<td colspan="2">', '<td colspan="2">',
'<label class="input-label" style="display: block;">' + this.txtSize + '</label>', '<label class="input-label" style="display: block;">' + this.txtSize + '</label>',
'<div id="id-dlg-bullet-size" class="input-group-nr" style="width: 120px;display: inline-block;margin-bottom: 10px;vertical-align: middle;"></div>', '<div id="id-dlg-bullet-size" class="input-group-nr" style="width: 129px;display: inline-block;margin-bottom: 10px;vertical-align: middle;"></div>',
'<div id="id-dlg-numbering-bold" style="display: inline-block;margin-left: 4px;margin-bottom: 10px;vertical-align: middle;"></div>', '<div id="id-dlg-numbering-bold" style="display: inline-block;margin-left: 4px;margin-bottom: 10px;vertical-align: middle;"></div>',
'<div id="id-dlg-numbering-italic" style="display: inline-block;margin-left: 4px;margin-bottom: 10px;vertical-align: middle;"></div>', '<div id="id-dlg-numbering-italic" style="display: inline-block;margin-left: 4px;margin-bottom: 10px;vertical-align: middle;"></div>',
'<div id="id-dlg-bullet-color" style="display: inline-block;margin-left: 4px;margin-bottom: 10px;vertical-align: middle;"></div>', '<div id="id-dlg-bullet-color" style="display: inline-block;margin-left: 4px;margin-bottom: 10px;vertical-align: middle;"></div>',
@ -266,11 +261,6 @@ define([
this.btnColor.menu.items[1].on('toggle', _.bind(this.onAutoColor, this)); this.btnColor.menu.items[1].on('toggle', _.bind(this.onAutoColor, this));
this.colors = this.btnColor.getPicker(); this.colors = this.btnColor.getPicker();
this.btnEdit = new Common.UI.Button({
el: $window.find('#id-dlg-bullet-font')
});
this.btnEdit.on('click', _.bind(this.onEditBullet, this));
var itemsTemplate = var itemsTemplate =
[ [
'<% _.each(items, function(item) { %>', '<% _.each(items, function(item) { %>',
@ -288,7 +278,7 @@ define([
'</ul>', '</ul>',
'</div>' '</div>'
]); ]);
var items = [ this._arrNumbers = [
{ displayValue: this.txtNone, value: Asc.c_oAscNumberingFormat.None }, { displayValue: this.txtNone, value: Asc.c_oAscNumberingFormat.None },
{ displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal }, { displayValue: '1, 2, 3,...', value: Asc.c_oAscNumberingFormat.Decimal },
{ displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter }, { displayValue: 'a, b, c,...', value: Asc.c_oAscNumberingFormat.LowerLetter },
@ -297,11 +287,22 @@ define([
{ displayValue: 'I, II, III,...', value: Asc.c_oAscNumberingFormat.UpperRoman } { displayValue: 'I, II, III,...', value: Asc.c_oAscNumberingFormat.UpperRoman }
]; ];
if (Common.Locale.getDefaultLanguage() === 'ru') { if (Common.Locale.getDefaultLanguage() === 'ru') {
items = items.concat([ this._arrNumbers = this._arrNumbers.concat([
{ displayValue: 'а, б, в,...', value: Asc.c_oAscNumberingFormat.RussianLower }, { displayValue: 'а, б, в,...', value: Asc.c_oAscNumberingFormat.RussianLower },
{ displayValue: 'А, Б, В,...', value: Asc.c_oAscNumberingFormat.RussianUpper } { displayValue: 'А, Б, В,...', value: Asc.c_oAscNumberingFormat.RussianUpper }
]); ]);
} }
this._arrBullets = [
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "·", font: 'Symbol' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "o", font: 'Courier New' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "§", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "v", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "Ø", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "ü", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "¨", font: 'Symbol' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "", font: 'Arial' },
{ displayValue: this.txtNewBullet, value: -1 }
];
this.cmbFormat = new Common.UI.ComboBoxCustom({ this.cmbFormat = new Common.UI.ComboBoxCustom({
el : $window.find('#id-dlg-numbering-format'), el : $window.find('#id-dlg-numbering-format'),
menuStyle : 'min-width: 100%;max-height: 220px;', menuStyle : 'min-width: 100%;max-height: 220px;',
@ -310,7 +311,7 @@ define([
template : _.template(template.join('')), template : _.template(template.join('')),
itemsTemplate: _.template(itemsTemplate.join('')), itemsTemplate: _.template(itemsTemplate.join('')),
takeFocusOnClose: true, takeFocusOnClose: true,
data : items, data : this.type==0 ? this._arrBullets : this._arrNumbers,
updateFormControl: function(record) { updateFormControl: function(record) {
var formcontrol = $(this.el).find('.form-control'); var formcontrol = $(this.el).find('.form-control');
if (record) { if (record) {
@ -598,11 +599,11 @@ define([
}, },
getFocusedComponents: function() { getFocusedComponents: function() {
return [this.btnEdit, this.cmbFormat, this.cmbAlign, this.cmbSize, this.btnColor, this.levelsList]; return [this.cmbFormat, this.cmbAlign, this.cmbSize, this.btnColor, this.levelsList];
}, },
getDefaultFocusableComponent: function () { getDefaultFocusableComponent: function () {
return this.type > 0 ? this.cmbFormat : this.cmbAlign; return this.cmbFormat;
}, },
onAnimateAfter: function() { onAnimateAfter: function() {
@ -754,17 +755,7 @@ define([
if (this.type==2) { if (this.type==2) {
var store = this.cmbFormat.store; var store = this.cmbFormat.store;
store.push([ store.push(this._arrBullets);
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "·", font: 'Symbol' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "o", font: 'Courier New' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "§", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "v", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "Ø", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "ü", font: 'Wingdings' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "¨", font: 'Symbol' },
{ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: "", font: 'Arial' },
{ displayValue: this.txtNewBullet, value: -1 }
]);
this.cmbFormat.setData(store.models); this.cmbFormat.setData(store.models);
this.levelsList.selectByIndex(this.level); this.levelsList.selectByIndex(this.level);
} else } else
@ -829,15 +820,14 @@ define([
} }
this.btnColor.setColor(color); this.btnColor.setColor(color);
if (this.type>0) { if (format == Asc.c_oAscNumberingFormat.Bullet) {
if (format == Asc.c_oAscNumberingFormat.Bullet) { if (!this.cmbFormat.store.findWhere({value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font}))
if (!this.cmbFormat.store.findWhere({value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font})) this.cmbFormat.store.add({ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font }, {at: this.cmbFormat.store.length-1});
this.cmbFormat.store.add({ displayValue: this.txtSymbol + ': ', value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font }, {at: this.cmbFormat.store.length-1}); this.cmbFormat.setData(this.cmbFormat.store.models);
this.cmbFormat.setData(this.cmbFormat.store.models); this.cmbFormat.selectRecord(this.cmbFormat.store.findWhere({value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font}));
this.cmbFormat.selectRecord(this.cmbFormat.store.findWhere({value: Asc.c_oAscNumberingFormat.Bullet, symbol: this.bulletProps.symbol, font: this.bulletProps.font})); } else
} else this.cmbFormat.setValue((format!==undefined) ? format : '');
this.cmbFormat.setValue((format!==undefined) ? format : '');
}
if (this.type===1) { if (this.type===1) {
this.makeFormatStr(levelProps); this.makeFormatStr(levelProps);
} else if (this.type===2) { } else if (this.type===2) {
@ -1071,7 +1061,6 @@ define([
txtSize: 'Size', txtSize: 'Size',
txtColor: 'Color', txtColor: 'Color',
txtBullet: 'Bullet', txtBullet: 'Bullet',
txtFont: 'Font and Symbol',
txtAlign: 'Alignment', txtAlign: 'Alignment',
textLeft: 'Left', textLeft: 'Left',
textCenter: 'Center', textCenter: 'Center',

View file

@ -2164,7 +2164,7 @@
"DE.Views.ListSettingsDialog.txtAlign": "Alignment", "DE.Views.ListSettingsDialog.txtAlign": "Alignment",
"DE.Views.ListSettingsDialog.txtBullet": "Bullet", "DE.Views.ListSettingsDialog.txtBullet": "Bullet",
"DE.Views.ListSettingsDialog.txtColor": "Color", "DE.Views.ListSettingsDialog.txtColor": "Color",
"DE.Views.ListSettingsDialog.txtFont": "Font and Symbol", "del_DE.Views.ListSettingsDialog.txtFont": "Font and Symbol",
"DE.Views.ListSettingsDialog.txtLikeText": "Like a text", "DE.Views.ListSettingsDialog.txtLikeText": "Like a text",
"DE.Views.ListSettingsDialog.txtNewBullet": "New bullet", "DE.Views.ListSettingsDialog.txtNewBullet": "New bullet",
"DE.Views.ListSettingsDialog.txtNone": "None", "DE.Views.ListSettingsDialog.txtNone": "None",