[DE] Update footnotes settings.

This commit is contained in:
Julia Radzhabova 2016-12-20 17:34:01 +03:00
parent a2c03c3ea0
commit 6faa69ff4d
4 changed files with 55 additions and 14 deletions

View file

@ -1996,7 +1996,17 @@ define([
if (item.value == 'ins_footnote') if (item.value == 'ins_footnote')
this.api.asc_AddFootnote(); this.api.asc_AddFootnote();
else if (item.value == 'delele') else if (item.value == 'delele')
this.api.deleteFootnotes(); Common.UI.warning({
msg: this.confirmDeleteFootnotes,
buttons: ['yes', 'no'],
primary: 'yes',
callback: _.bind(function(btn) {
if (btn == 'yes') {
this.api.deleteFootnotes();
}
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
}, this)
});
else if (item.value == 'settings') { else if (item.value == 'settings') {
var me = this; var me = this;
(new DE.Views.NoteSettingsDialog({ (new DE.Views.NoteSettingsDialog({
@ -3067,7 +3077,8 @@ define([
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 device fonts, the saved font will be used when it is available.<br>Do you want to continue?', 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 device fonts, the saved font will be used when it is available.<br>Do you want to continue?',
notcriticalErrorTitle: 'Warning', notcriticalErrorTitle: 'Warning',
txtMarginsW: 'Left and right margins are too high for a given page wight', txtMarginsW: 'Left and right margins are too high for a given page wight',
txtMarginsH: 'Top and bottom margins are too high for a given page height' txtMarginsH: 'Top and bottom margins are too high for a given page height',
confirmDeleteFootnotes: 'Do you want to delete all footnotes?'
}, DE.Controllers.Toolbar || {})); }, DE.Controllers.Toolbar || {}));
}); });

View file

@ -50,7 +50,7 @@ define([
DE.Views.NoteSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({ DE.Views.NoteSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
options: { options: {
contentWidth: 300, contentWidth: 300,
height: 335 height: 380
}, },
initialize : function(options) { initialize : function(options) {
@ -79,7 +79,7 @@ define([
'</tr>', '</tr>',
'<tr>', '<tr>',
'<td colspan=2>', '<td colspan=2>',
'<div class="separator horizontal padding-large text-only"></div>', '<div class="padding-large text-only"></div>',
'</td>', '</td>',
'</tr>', '</tr>',
'<tr>', '<tr>',
@ -99,14 +99,20 @@ define([
'</td>', '</td>',
'</tr>', '</tr>',
'<tr>', '<tr>',
'<td colspan=2 class="padding-large">', '<td colspan=2 class="padding-small">',
'<label class="input-label">', me.textNumbering, '</label>', '<label class="input-label">', me.textNumbering, '</label>',
'<div id="note-settings-combo-numbering" class="input-group-nr" style="width:140px;"></div>', '<div id="note-settings-combo-numbering" class="input-group-nr" style="width:140px;"></div>',
'</td>', '</td>',
'</tr>', '</tr>',
'<tr>',
'<td colspan=2 class="padding-large">',
'<label class="input-label">', me.textCustom, '</label>',
'<div id="note-settings-txt-custom"></div>',
'</td>',
'</tr>',
'<tr>', '<tr>',
'<td colspan=2>', '<td colspan=2>',
'<div class="separator horizontal padding-large text-only"></div>', '<div class="padding-large text-only"></div>',
'</td>', '</td>',
'</tr>', '</tr>',
'<tr>', '<tr>',
@ -212,6 +218,18 @@ define([
}); });
this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.section_footnote_RestartContinuous); this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.section_footnote_RestartContinuous);
this.txtCustom = new Common.UI.InputField({
el : $('#note-settings-txt-custom'),
allowBlank : true,
validateOnChange: true,
validateOnBlur: false,
style : 'width: 100px; vertical-align: middle;',
value : ''
}).on ('changing', function (input, value) {
me.cmbFormat.setDisabled(value.length>0);
me.spnStart.setDisabled(value.length>0);
});
this.cmbApply = new Common.UI.ComboBox({ this.cmbApply = new Common.UI.ComboBox({
el: $('#note-settings-combo-apply'), el: $('#note-settings-combo-apply'),
cls: 'input-group-nr', cls: 'input-group-nr',
@ -253,6 +271,11 @@ define([
this.cmbNumbering.setValue(val); this.cmbNumbering.setValue(val);
/* /*
val = props.get_Custom();
this.txtCustom.setValue(val);
this.cmbFormat.setDisabled(!_.isEmpty(val));
this.spnStart.setDisabled(!_.isEmpty(val));
val = props.get_ApplyTo(); val = props.get_ApplyTo();
this.cmbApply.setValue(val); this.cmbApply.setValue(val);
*/ */
@ -265,13 +288,17 @@ define([
props.put_Pos(this.cmbFootnote.getValue()); props.put_Pos(this.cmbFootnote.getValue());
props.put_NumRestart(this.cmbNumbering.getValue()); props.put_NumRestart(this.cmbNumbering.getValue());
var val = this.cmbFormat.getValue(); var val = this.txtCustom.getValue();
if (_.isEmpty(val)) {
props.put_NumFormat(val); val = this.cmbFormat.getValue();
// if (val==1) props.put_NumFormat(val);
// if (val==1)
props.put_NumStart(this.spnStart.getNumberValue()); props.put_NumStart(this.spnStart.getNumberValue());
// else // else
// props.put_NumStart(this.txtStart.getValue()); // props.put_NumStart(this.txtStart.getValue());
} else {
// props.set_Custom(val);
}
// props.put_ApplyTo(this.cmbApply.getValue()); // props.put_ApplyTo(this.cmbApply.getValue());
@ -368,7 +395,8 @@ define([
textSection: 'Current section', textSection: 'Current section',
textApply: 'Apply', textApply: 'Apply',
textInsert: 'Insert', textInsert: 'Insert',
textCancel: 'Cancel' textCancel: 'Cancel',
textCustom: 'Custom Mark'
}, DE.Views.NoteSettingsDialog || {})) }, DE.Views.NoteSettingsDialog || {}))
}); });

View file

@ -1298,7 +1298,6 @@ define([
new Common.UI.Menu({ new Common.UI.Menu({
items: [ items: [
{ caption: this.mniInsFootnote, value: 'ins_footnote' }, { caption: this.mniInsFootnote, value: 'ins_footnote' },
{ caption: this.mniDelFootnote, value: 'delele' },
{ caption: '--' }, { caption: '--' },
this.mnuGotoFootnote = new Common.UI.MenuItem({ this.mnuGotoFootnote = new Common.UI.MenuItem({
template: _.template([ template: _.template([
@ -1314,6 +1313,7 @@ define([
stopPropagation: true stopPropagation: true
}), }),
{ caption: '--' }, { caption: '--' },
{ caption: this.mniDelFootnote, value: 'delele' },
{ caption: this.mniNoteSettings, value: 'settings' } { caption: this.mniNoteSettings, value: 'settings' }
] ]
}) })

View file

@ -302,6 +302,7 @@
"DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled", "DE.Controllers.Statusbar.textTrackChanges": "The document is opened with the Track Changes mode enabled",
"DE.Controllers.Statusbar.zoomText": "Zoom {0}%", "DE.Controllers.Statusbar.zoomText": "Zoom {0}%",
"DE.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?", "DE.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?",
"DE.Controllers.Toolbar.confirmDeleteFootnotes": "Do you want to delete all footnotes?",
"DE.Controllers.Toolbar.notcriticalErrorTitle": "Warning", "DE.Controllers.Toolbar.notcriticalErrorTitle": "Warning",
"DE.Controllers.Toolbar.textAccent": "Accents", "DE.Controllers.Toolbar.textAccent": "Accents",
"DE.Controllers.Toolbar.textBracket": "Brackets", "DE.Controllers.Toolbar.textBracket": "Brackets",
@ -1133,6 +1134,7 @@
"DE.Views.NoteSettingsDialog.textApply": "Apply", "DE.Views.NoteSettingsDialog.textApply": "Apply",
"DE.Views.NoteSettingsDialog.textInsert": "Insert", "DE.Views.NoteSettingsDialog.textInsert": "Insert",
"DE.Views.NoteSettingsDialog.textCancel": "Cancel", "DE.Views.NoteSettingsDialog.textCancel": "Cancel",
"DE.Views.NoteSettingsDialog.textCustom": "Custom Mark",
"DE.Views.PageMarginsDialog.cancelButtonText": "Cancel", "DE.Views.PageMarginsDialog.cancelButtonText": "Cancel",
"DE.Views.PageMarginsDialog.notcriticalErrorTitle": "Warning", "DE.Views.PageMarginsDialog.notcriticalErrorTitle": "Warning",
"DE.Views.PageMarginsDialog.okButtonText": "Ok", "DE.Views.PageMarginsDialog.okButtonText": "Ok",