Merge pull request #451 from ONLYOFFICE/feature/de-endnote
Feature/de endnote
This commit is contained in:
commit
4ec5d92ebd
|
@ -46,7 +46,8 @@ define([
|
||||||
'documenteditor/main/app/view/HyperlinkSettingsDialog',
|
'documenteditor/main/app/view/HyperlinkSettingsDialog',
|
||||||
'documenteditor/main/app/view/TableOfContentsSettings',
|
'documenteditor/main/app/view/TableOfContentsSettings',
|
||||||
'documenteditor/main/app/view/BookmarksDialog',
|
'documenteditor/main/app/view/BookmarksDialog',
|
||||||
'documenteditor/main/app/view/CaptionDialog'
|
'documenteditor/main/app/view/CaptionDialog',
|
||||||
|
'documenteditor/main/app/view/NotesRemoveDialog'
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -292,33 +293,37 @@ define([
|
||||||
case 'ins_footnote':
|
case 'ins_footnote':
|
||||||
this.api.asc_AddFootnote();
|
this.api.asc_AddFootnote();
|
||||||
break;
|
break;
|
||||||
|
case 'ins_endnote':
|
||||||
|
this.api.asc_AddEndnote();
|
||||||
|
break;
|
||||||
case 'delele':
|
case 'delele':
|
||||||
Common.UI.warning({
|
(new DE.Views.NotesRemoveDialog({
|
||||||
msg: this.view.confirmDeleteFootnotes,
|
handler: function (dlg, result) {
|
||||||
buttons: ['yes', 'no'],
|
if (result=='ok') {
|
||||||
primary: 'yes',
|
var settings = dlg.getSettings();
|
||||||
callback: _.bind(function (btn) {
|
(settings.footnote || settings.endnote) && me.api.asc_RemoveAllFootnotes(settings.footnote, settings.endnote);
|
||||||
if (btn == 'yes') {
|
|
||||||
this.api.asc_RemoveAllFootnotes();
|
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
}, this)
|
}
|
||||||
});
|
})).show();
|
||||||
break;
|
break;
|
||||||
case 'settings':
|
case 'settings':
|
||||||
|
var isEndNote = me.api.asc_IsCursorInEndnote();
|
||||||
(new DE.Views.NoteSettingsDialog({
|
(new DE.Views.NoteSettingsDialog({
|
||||||
api: me.api,
|
api: me.api,
|
||||||
handler: function (result, settings) {
|
handler: function (result, settings) {
|
||||||
if (settings) {
|
if (settings) {
|
||||||
me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
|
settings.isEndNote ? me.api.asc_SetEndnoteProps(settings.props, settings.applyToAll) :
|
||||||
|
me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
|
||||||
if (result == 'insert')
|
if (result == 'insert')
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
me.api.asc_AddFootnote(settings.custom);
|
settings.isEndNote ? me.api.asc_AddEndnote(settings.custom) : me.api.asc_AddFootnote(settings.custom);
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
},
|
},
|
||||||
props: me.api.asc_GetFootnoteProps()
|
isEndNote: isEndNote,
|
||||||
|
props: isEndNote ? me.api.asc_GetEndnoteProps() : me.api.asc_GetFootnoteProps()
|
||||||
})).show();
|
})).show();
|
||||||
break;
|
break;
|
||||||
case 'prev':
|
case 'prev':
|
||||||
|
@ -333,6 +338,36 @@ define([
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
}, 50);
|
}, 50);
|
||||||
break;
|
break;
|
||||||
|
case 'prev-end':
|
||||||
|
this.api.asc_GotoEndnote(false);
|
||||||
|
setTimeout(function() {
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
|
}, 50);
|
||||||
|
break;
|
||||||
|
case 'next-end':
|
||||||
|
this.api.asc_GotoEndnote(true);
|
||||||
|
setTimeout(function() {
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
|
}, 50);
|
||||||
|
break;
|
||||||
|
case 'to-endnotes':
|
||||||
|
this.api.asc_ConvertFootnoteType(false, true, false);
|
||||||
|
setTimeout(function() {
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
|
}, 50);
|
||||||
|
break;
|
||||||
|
case 'to-footnotes':
|
||||||
|
this.api.asc_ConvertFootnoteType(false, false, true);
|
||||||
|
setTimeout(function() {
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
|
}, 50);
|
||||||
|
break;
|
||||||
|
case 'swap':
|
||||||
|
this.api.asc_ConvertFootnoteType(false, true, true);
|
||||||
|
setTimeout(function() {
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
|
}, 50);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,9 @@ define([
|
||||||
button.on('click', function (b, e) {
|
button.on('click', function (b, e) {
|
||||||
me.fireEvent('links:notes', ['ins_footnote']);
|
me.fireEvent('links:notes', ['ins_footnote']);
|
||||||
});
|
});
|
||||||
|
button.menu.items[7].menu.on('item:click', function (menu, item, e) {//convert
|
||||||
|
me.fireEvent('links:notes', [item.value]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.btnsPrevNote.forEach(function(button) {
|
this.btnsPrevNote.forEach(function(button) {
|
||||||
|
@ -96,6 +99,18 @@ define([
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.btnsPrevEndNote.forEach(function(button) {
|
||||||
|
button.on('click', function (b, e) {
|
||||||
|
me.fireEvent('links:notes', ['prev-end']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.btnsNextEndNote.forEach(function(button) {
|
||||||
|
button.on('click', function (b, e) {
|
||||||
|
me.fireEvent('links:notes', ['next-end']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
this.btnsHyperlink.forEach(function(button) {
|
this.btnsHyperlink.forEach(function(button) {
|
||||||
button.on('click', function (b, e) {
|
button.on('click', function (b, e) {
|
||||||
me.fireEvent('links:hyperlink');
|
me.fireEvent('links:hyperlink');
|
||||||
|
@ -121,6 +136,8 @@ define([
|
||||||
|
|
||||||
this.btnsPrevNote = [];
|
this.btnsPrevNote = [];
|
||||||
this.btnsNextNote = [];
|
this.btnsNextNote = [];
|
||||||
|
this.btnsPrevEndNote = [];
|
||||||
|
this.btnsNextEndNote = [];
|
||||||
this.paragraphControls = [];
|
this.paragraphControls = [];
|
||||||
|
|
||||||
var me = this,
|
var me = this,
|
||||||
|
@ -221,6 +238,7 @@ define([
|
||||||
var _menu = new Common.UI.Menu({
|
var _menu = new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{caption: me.mniInsFootnote, value: 'ins_footnote'},
|
{caption: me.mniInsFootnote, value: 'ins_footnote'},
|
||||||
|
{caption: me.mniInsEndnote, value: 'ins_endnote'},
|
||||||
{caption: '--'},
|
{caption: '--'},
|
||||||
new Common.UI.MenuItem({
|
new Common.UI.MenuItem({
|
||||||
template: _.template([
|
template: _.template([
|
||||||
|
@ -235,8 +253,32 @@ define([
|
||||||
].join('')),
|
].join('')),
|
||||||
stopPropagation: true
|
stopPropagation: true
|
||||||
}),
|
}),
|
||||||
|
new Common.UI.MenuItem({
|
||||||
|
template: _.template([
|
||||||
|
'<div class="menu-zoom" style="height: 25px;" ',
|
||||||
|
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
|
||||||
|
'data-stopPropagation="true"',
|
||||||
|
'<% } %>', '>',
|
||||||
|
'<label class="title">' + me.textGotoEndnote + '</label>',
|
||||||
|
'<button id="id-menu-goto-endnote-next-' + index + '" type="button" style="float:right; margin: 2px 5px 0 0;" class="btn small btn-toolbar"><i class="icon menu__icon btn-nextitem"> </i></button>',
|
||||||
|
'<button id="id-menu-goto-endnote-prev-' + index + '" type="button" style="float:right; margin-top: 2px;" class="btn small btn-toolbar"><i class="icon menu__icon btn-previtem"> </i></button>',
|
||||||
|
'</div>'
|
||||||
|
].join('')),
|
||||||
|
stopPropagation: true
|
||||||
|
}),
|
||||||
{caption: '--'},
|
{caption: '--'},
|
||||||
{caption: me.mniDelFootnote, value: 'delele'},
|
{caption: me.mniDelFootnote, value: 'delele'},
|
||||||
|
{
|
||||||
|
caption: me.mniConvertNote, value: 'convert',
|
||||||
|
menu: new Common.UI.Menu({
|
||||||
|
menuAlign : 'tl-tr',
|
||||||
|
items: [
|
||||||
|
{caption: me.textConvertToEndnotes, value: 'to-endnotes'},
|
||||||
|
{caption: me.textConvertToFootnotes, value: 'to-footnotes'},
|
||||||
|
{caption: me.textSwapNotes, value: 'swap'}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
},
|
||||||
{caption: me.mniNoteSettings, value: 'settings'}
|
{caption: me.mniNoteSettings, value: 'settings'}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
@ -250,6 +292,14 @@ define([
|
||||||
el: $('#id-menu-goto-footnote-next-'+index),
|
el: $('#id-menu-goto-footnote-next-'+index),
|
||||||
cls: 'btn-toolbar'
|
cls: 'btn-toolbar'
|
||||||
}));
|
}));
|
||||||
|
me.btnsPrevEndNote.push(new Common.UI.Button({
|
||||||
|
el: $('#id-menu-goto-endnote-prev-'+index),
|
||||||
|
cls: 'btn-toolbar'
|
||||||
|
}));
|
||||||
|
me.btnsNextEndNote.push(new Common.UI.Button({
|
||||||
|
el: $('#id-menu-goto-endnote-next-'+index),
|
||||||
|
cls: 'btn-toolbar'
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
me.btnsHyperlink.forEach( function(btn) {
|
me.btnsHyperlink.forEach( function(btn) {
|
||||||
|
@ -291,7 +341,7 @@ define([
|
||||||
textUpdatePages: 'Refresh page numbers only',
|
textUpdatePages: 'Refresh page numbers only',
|
||||||
tipNotes: 'Footnotes',
|
tipNotes: 'Footnotes',
|
||||||
mniInsFootnote: 'Insert Footnote',
|
mniInsFootnote: 'Insert Footnote',
|
||||||
mniDelFootnote: 'Delete All Footnotes',
|
mniDelFootnote: 'Delete All Notes',
|
||||||
mniNoteSettings: 'Notes Settings',
|
mniNoteSettings: 'Notes Settings',
|
||||||
textGotoFootnote: 'Go to Footnotes',
|
textGotoFootnote: 'Go to Footnotes',
|
||||||
capBtnInsFootnote: 'Footnotes',
|
capBtnInsFootnote: 'Footnotes',
|
||||||
|
@ -301,7 +351,13 @@ define([
|
||||||
capBtnBookmarks: 'Bookmark',
|
capBtnBookmarks: 'Bookmark',
|
||||||
tipBookmarks: 'Create a bookmark',
|
tipBookmarks: 'Create a bookmark',
|
||||||
capBtnCaption: 'Caption',
|
capBtnCaption: 'Caption',
|
||||||
tipCaption: 'Insert caption'
|
tipCaption: 'Insert caption',
|
||||||
|
mniConvertNote: 'Convert All Notes',
|
||||||
|
textGotoEndnote: 'Go to Endnotes',
|
||||||
|
mniInsEndnote: 'Insert Endnote',
|
||||||
|
textConvertToEndnotes: 'Convert All Footnotes to Endnotes',
|
||||||
|
textConvertToFootnotes: 'Convert All Endnotes to Footnotes',
|
||||||
|
textSwapNotes: 'Swap Footnotes and Endnotes'
|
||||||
}
|
}
|
||||||
}()), DE.Views.Links || {}));
|
}()), DE.Views.Links || {}));
|
||||||
});
|
});
|
|
@ -65,18 +65,19 @@ define([
|
||||||
'<table cols="1" style="width: 100%;">',
|
'<table cols="1" style="width: 100%;">',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td class="padding-small">',
|
'<td class="padding-small">',
|
||||||
'<label class="header">', me.textLocation,'</label>',
|
'<label class="header">', me.textLocation,'</label>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td class="padding-large">',
|
'<td class="padding-small">',
|
||||||
'<label class="input-label" style="margin-top: 4px;">', me.textFootnote,'</label>',
|
'<div id="note-settings-radio-foot" style="margin-top: 4px;display: inline-block"></div>',
|
||||||
'<div id="note-settings-combo-footnote" class="input-group-nr" style="display: inline-block; width:150px;float:right;"></div>',
|
'<div id="note-settings-combo-footnote" class="input-group-nr" style="display: inline-block; width:150px;float:right;"></div>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td>',
|
'<td class="padding-large">',
|
||||||
'<div class="padding-large"></div>',
|
'<div id="note-settings-radio-end" style="margin-top: 4px;display: inline-block"></div>',
|
||||||
|
'<div id="note-settings-combo-endnote" class="input-group-nr" style="display: inline-block; width:150px;float:right;"></div>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
'<tr>',
|
||||||
|
@ -107,11 +108,6 @@ define([
|
||||||
'<div id="note-settings-txt-custom"></div>',
|
'<div id="note-settings-txt-custom"></div>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
|
||||||
'<td>',
|
|
||||||
'<div class="padding-large"></div>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td class="padding-small">',
|
'<td class="padding-small">',
|
||||||
'<label class="header" style="margin-top: 4px;">', me.textApplyTo,'</label>',
|
'<label class="header" style="margin-top: 4px;">', me.textApplyTo,'</label>',
|
||||||
|
@ -133,17 +129,50 @@ define([
|
||||||
this.api = options.api;
|
this.api = options.api;
|
||||||
this.handler = options.handler;
|
this.handler = options.handler;
|
||||||
this.props = options.props;
|
this.props = options.props;
|
||||||
|
this.isEndNote = options.isEndNote || false;
|
||||||
|
|
||||||
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
|
||||||
|
|
||||||
this.FormatType = 1;
|
this._state = {
|
||||||
this.StartValue = 1;
|
footnote: {
|
||||||
|
numbering: Asc.c_oAscFootnoteRestart.Continuous,
|
||||||
|
format: Asc.c_oAscNumberingFormat.Decimal,
|
||||||
|
start: 1
|
||||||
|
},
|
||||||
|
endnote: {
|
||||||
|
numbering: Asc.c_oAscFootnoteRestart.Continuous,
|
||||||
|
format: Asc.c_oAscNumberingFormat.LowerRoman,
|
||||||
|
start: 1
|
||||||
|
}};
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
|
Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
|
this.radioFootnote = new Common.UI.RadioBox({
|
||||||
|
el: $('#note-settings-radio-foot'),
|
||||||
|
name: 'asc-radio-notes',
|
||||||
|
labelText: this.textFootnote,
|
||||||
|
checked: true
|
||||||
|
});
|
||||||
|
this.radioFootnote.on('change', function(field, newValue, eOpts) {
|
||||||
|
if (newValue) {
|
||||||
|
me.changeNoteType(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.radioEndnote = new Common.UI.RadioBox({
|
||||||
|
el: $('#note-settings-radio-end'),
|
||||||
|
labelText: this.textEndnote,
|
||||||
|
name: 'asc-radio-notes'
|
||||||
|
});
|
||||||
|
this.radioEndnote.on('change', function(field, newValue, eOpts) {
|
||||||
|
if (newValue) {
|
||||||
|
me.changeNoteType(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.cmbFootnote = new Common.UI.ComboBox({
|
this.cmbFootnote = new Common.UI.ComboBox({
|
||||||
el: $('#note-settings-combo-footnote'),
|
el: $('#note-settings-combo-footnote'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
|
@ -156,6 +185,18 @@ define([
|
||||||
});
|
});
|
||||||
this.cmbFootnote.setValue(Asc.c_oAscFootnotePos.PageBottom);
|
this.cmbFootnote.setValue(Asc.c_oAscFootnotePos.PageBottom);
|
||||||
|
|
||||||
|
this.cmbEndnote = new Common.UI.ComboBox({
|
||||||
|
el: $('#note-settings-combo-endnote'),
|
||||||
|
cls: 'input-group-nr',
|
||||||
|
menuStyle: 'min-width: 150px;',
|
||||||
|
editable: false,
|
||||||
|
data: [
|
||||||
|
{ displayValue: this.textSectEnd, value: Asc.c_oAscFootnotePos.SectEnd },
|
||||||
|
{ displayValue: this.textPageBottom, value: Asc.c_oAscFootnotePos.PageBottom }
|
||||||
|
]
|
||||||
|
});
|
||||||
|
this.cmbEndnote.setValue(Asc.c_oAscFootnotePos.PageBottom);
|
||||||
|
|
||||||
this.cmbFormat = new Common.UI.ComboBox({
|
this.cmbFormat = new Common.UI.ComboBox({
|
||||||
el: $('#note-settings-combo-format'),
|
el: $('#note-settings-combo-format'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
|
@ -169,10 +210,9 @@ define([
|
||||||
{ displayValue: 'I, II, III,...', value: Asc.c_oAscNumberingFormat.UpperRoman, maskExp: /[IVXLCDM]/, defValue: 'I' }
|
{ displayValue: 'I, II, III,...', value: Asc.c_oAscNumberingFormat.UpperRoman, maskExp: /[IVXLCDM]/, defValue: 'I' }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.cmbFormat.setValue(this.FormatType);
|
this.cmbFormat.setValue(this._state.footnote.format);
|
||||||
this.cmbFormat.on('selected', _.bind(this.onFormatSelect, this));
|
this.cmbFormat.on('selected', _.bind(this.onFormatSelect, this));
|
||||||
|
|
||||||
// this.spnStart = new Common.UI.MetricSpinner({
|
|
||||||
this.spnStart = new Common.UI.CustomSpinner({
|
this.spnStart = new Common.UI.CustomSpinner({
|
||||||
el: $('#note-settings-spin-start'),
|
el: $('#note-settings-spin-start'),
|
||||||
step: 1,
|
step: 1,
|
||||||
|
@ -185,16 +225,17 @@ define([
|
||||||
maskExp: /[0-9]/
|
maskExp: /[0-9]/
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this._arrNumbering = [
|
||||||
|
{ displayValue: this.textContinue, value: Asc.c_oAscFootnoteRestart.Continuous },
|
||||||
|
{ displayValue: this.textEachSection, value: Asc.c_oAscFootnoteRestart.EachSect },
|
||||||
|
{ displayValue: this.textEachPage, value: Asc.c_oAscFootnoteRestart.EachPage }
|
||||||
|
];
|
||||||
this.cmbNumbering = new Common.UI.ComboBox({
|
this.cmbNumbering = new Common.UI.ComboBox({
|
||||||
el: $('#note-settings-combo-numbering'),
|
el: $('#note-settings-combo-numbering'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 150px;',
|
menuStyle: 'min-width: 150px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: this._arrNumbering
|
||||||
{ displayValue: this.textContinue, value: Asc.c_oAscFootnoteRestart.Continuous },
|
|
||||||
{ displayValue: this.textEachSection, value: Asc.c_oAscFootnoteRestart.EachSect },
|
|
||||||
{ displayValue: this.textEachPage, value: Asc.c_oAscFootnoteRestart.EachPage }
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.Continuous);
|
this.cmbNumbering.setValue(Asc.c_oAscFootnoteRestart.Continuous);
|
||||||
|
|
||||||
|
@ -239,9 +280,13 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
_setDefaults: function (props) {
|
_setDefaults: function (props) {
|
||||||
|
|
||||||
|
this.isEndNote ? this.radioEndnote.setValue(true, true) : this.radioFootnote.setValue(true, true);
|
||||||
|
this.changeNoteType(this.isEndNote);
|
||||||
|
|
||||||
if (props) {
|
if (props) {
|
||||||
var val = props.get_Pos();
|
var val = props.get_Pos();
|
||||||
this.cmbFootnote.setValue(val);
|
this.isEndNote ? this.cmbEndnote.setValue(val) : this.cmbFootnote.setValue(val);
|
||||||
|
|
||||||
val = props.get_NumFormat();
|
val = props.get_NumFormat();
|
||||||
this.cmbFormat.setValue(val);
|
this.cmbFormat.setValue(val);
|
||||||
|
@ -258,7 +303,7 @@ define([
|
||||||
getSettings: function () {
|
getSettings: function () {
|
||||||
var props = new Asc.CAscFootnotePr();
|
var props = new Asc.CAscFootnotePr();
|
||||||
|
|
||||||
props.put_Pos(this.cmbFootnote.getValue());
|
props.put_Pos(this.isEndNote ? this.cmbEndnote.getValue() : this.cmbFootnote.getValue());
|
||||||
props.put_NumRestart(this.cmbNumbering.getValue());
|
props.put_NumRestart(this.cmbNumbering.getValue());
|
||||||
|
|
||||||
var val = this.txtCustom.getValue();
|
var val = this.txtCustom.getValue();
|
||||||
|
@ -268,7 +313,7 @@ define([
|
||||||
props.put_NumStart(this.spnStart.getNumberValue());
|
props.put_NumStart(this.spnStart.getNumberValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
return {props: props, applyToAll: (this.cmbApply.getValue()==1), custom: _.isEmpty(val) ? undefined : val};
|
return {props: props, applyToAll: (this.cmbApply.getValue()==1), custom: _.isEmpty(val) ? undefined : val, isEndNote: this.isEndNote};
|
||||||
},
|
},
|
||||||
|
|
||||||
onDlgBtnClick: function(event) {
|
onDlgBtnClick: function(event) {
|
||||||
|
@ -315,7 +360,7 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
this.spnStart.setValue(this.spnStart.getValue());
|
this.spnStart.setValue(this.spnStart.getValue());
|
||||||
this.FormatType = record.value;
|
this._state[this.isEndNote ? 'endnote' : 'footnote'].format = record.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
_10toS: function(value) {
|
_10toS: function(value) {
|
||||||
|
@ -411,6 +456,26 @@ define([
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
changeNoteType: function(isEndNote) {
|
||||||
|
this._state[this.isEndNote ? 'endnote' : 'footnote'].start = this.spnStart.getNumberValue(); // save prev start
|
||||||
|
this._state[this.isEndNote ? 'endnote' : 'footnote'].numbering = this.cmbNumbering.getValue(); // save prev numbering
|
||||||
|
|
||||||
|
this.isEndNote = isEndNote;
|
||||||
|
|
||||||
|
this.cmbFootnote.setDisabled(isEndNote);
|
||||||
|
this.cmbEndnote.setDisabled(!isEndNote);
|
||||||
|
|
||||||
|
var state = this._state[isEndNote ? 'endnote' : 'footnote'],
|
||||||
|
arr = isEndNote ? this._arrNumbering.slice(0,2) : this._arrNumbering;
|
||||||
|
this.cmbNumbering.setData(arr);
|
||||||
|
this.cmbNumbering.setValue(state.numbering);
|
||||||
|
|
||||||
|
this.cmbFormat.setValue(state.format);
|
||||||
|
this.onFormatSelect(this.cmbFormat, this.cmbFormat.getSelectedRecord());
|
||||||
|
|
||||||
|
this.spnStart.setValue(state.start);
|
||||||
|
},
|
||||||
|
|
||||||
textTitle: 'Notes Settings',
|
textTitle: 'Notes Settings',
|
||||||
textLocation: 'Location',
|
textLocation: 'Location',
|
||||||
textFootnote: 'Footnote',
|
textFootnote: 'Footnote',
|
||||||
|
@ -428,7 +493,9 @@ define([
|
||||||
textSection: 'Current section',
|
textSection: 'Current section',
|
||||||
textApply: 'Apply',
|
textApply: 'Apply',
|
||||||
textInsert: 'Insert',
|
textInsert: 'Insert',
|
||||||
textCustom: 'Custom Mark'
|
textCustom: 'Custom Mark',
|
||||||
|
textSectEnd: 'End of section',
|
||||||
|
textEndnote: 'Endnote'
|
||||||
|
|
||||||
}, DE.Views.NoteSettingsDialog || {}))
|
}, DE.Views.NoteSettingsDialog || {}))
|
||||||
});
|
});
|
115
apps/documenteditor/main/app/view/NotesRemoveDialog.js
Normal file
115
apps/documenteditor/main/app/view/NotesRemoveDialog.js
Normal file
|
@ -0,0 +1,115 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* (c) Copyright Ascensio System SIA 2010-2020
|
||||||
|
*
|
||||||
|
* This program is a free software product. You can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||||
|
* version 3 as published by the Free Software Foundation. In accordance with
|
||||||
|
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||||
|
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||||
|
* of any third-party rights.
|
||||||
|
*
|
||||||
|
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||||
|
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
*
|
||||||
|
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
||||||
|
* street, Riga, Latvia, EU, LV-1050.
|
||||||
|
*
|
||||||
|
* The interactive user interfaces in modified source and object code versions
|
||||||
|
* of the Program must display Appropriate Legal Notices, as required under
|
||||||
|
* Section 5 of the GNU AGPL version 3.
|
||||||
|
*
|
||||||
|
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||||
|
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||||
|
* grant you any rights under trademark law for use of our trademarks.
|
||||||
|
*
|
||||||
|
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||||
|
* well as technical writing content are licensed under the terms of the
|
||||||
|
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||||
|
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* NotesRemoveDialog.js
|
||||||
|
*
|
||||||
|
* Created by Julia Radzhabova on 29.07.2020
|
||||||
|
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
define([
|
||||||
|
'common/main/lib/component/Window',
|
||||||
|
'common/main/lib/component/RadioBox'
|
||||||
|
], function () { 'use strict';
|
||||||
|
|
||||||
|
DE.Views.NotesRemoveDialog = Common.UI.Window.extend(_.extend({
|
||||||
|
options: {
|
||||||
|
width: 214,
|
||||||
|
height: 138,
|
||||||
|
header: true,
|
||||||
|
style: 'min-width: 214px;',
|
||||||
|
cls: 'modal-dlg',
|
||||||
|
buttons: ['ok', 'cancel']
|
||||||
|
},
|
||||||
|
|
||||||
|
initialize : function(options) {
|
||||||
|
_.extend(this.options, {
|
||||||
|
title: this.textTitle
|
||||||
|
}, options);
|
||||||
|
|
||||||
|
this.template = [
|
||||||
|
'<div class="box">',
|
||||||
|
'<div id="notes-remove-chk-foot" style="margin-bottom: 5px;"></div>',
|
||||||
|
'<div id="notes-remove-chk-end"></div>',
|
||||||
|
'</div>'
|
||||||
|
].join('');
|
||||||
|
|
||||||
|
this.options.tpl = _.template(this.template)(this.options);
|
||||||
|
|
||||||
|
Common.UI.Window.prototype.initialize.call(this, this.options);
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function() {
|
||||||
|
Common.UI.Window.prototype.render.call(this);
|
||||||
|
|
||||||
|
var $window = this.getChild();
|
||||||
|
$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
|
||||||
|
|
||||||
|
this.chFootnote = new Common.UI.CheckBox({
|
||||||
|
el: $window.find('#notes-remove-chk-foot'),
|
||||||
|
labelText: this.textFoot,
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
|
||||||
|
this.chEndnote = new Common.UI.CheckBox({
|
||||||
|
el: $window.find('#notes-remove-chk-end'),
|
||||||
|
labelText: this.textEnd,
|
||||||
|
value: true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
_handleInput: function(state) {
|
||||||
|
if (this.options.handler) {
|
||||||
|
this.options.handler.call(this, this, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.close();
|
||||||
|
},
|
||||||
|
|
||||||
|
onBtnClick: function(event) {
|
||||||
|
this._handleInput(event.currentTarget.attributes['result'].value);
|
||||||
|
},
|
||||||
|
|
||||||
|
getSettings: function() {
|
||||||
|
return {footnote: this.chFootnote.isChecked(), endnote: this.chEndnote.isChecked()};
|
||||||
|
},
|
||||||
|
|
||||||
|
onPrimary: function() {
|
||||||
|
this._handleInput('ok');
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
textTitle: 'Delete Notes',
|
||||||
|
textFoot: 'Delete All Footnotes',
|
||||||
|
textEnd: 'Delete All Endnotes'
|
||||||
|
}, DE.Views.NotesRemoveDialog || {}))
|
||||||
|
});
|
|
@ -1750,7 +1750,7 @@
|
||||||
"DE.Views.Links.capBtnInsFootnote": "Footnote",
|
"DE.Views.Links.capBtnInsFootnote": "Footnote",
|
||||||
"DE.Views.Links.capBtnInsLink": "Hyperlink",
|
"DE.Views.Links.capBtnInsLink": "Hyperlink",
|
||||||
"DE.Views.Links.confirmDeleteFootnotes": "Do you want to delete all footnotes?",
|
"DE.Views.Links.confirmDeleteFootnotes": "Do you want to delete all footnotes?",
|
||||||
"DE.Views.Links.mniDelFootnote": "Delete All Footnotes",
|
"DE.Views.Links.mniDelFootnote": "Delete All Notes",
|
||||||
"DE.Views.Links.mniInsFootnote": "Insert Footnote",
|
"DE.Views.Links.mniInsFootnote": "Insert Footnote",
|
||||||
"DE.Views.Links.mniNoteSettings": "Notes Settings",
|
"DE.Views.Links.mniNoteSettings": "Notes Settings",
|
||||||
"DE.Views.Links.textContentsRemove": "Remove table of contents",
|
"DE.Views.Links.textContentsRemove": "Remove table of contents",
|
||||||
|
@ -1764,6 +1764,12 @@
|
||||||
"DE.Views.Links.tipContentsUpdate": "Refresh table of contents",
|
"DE.Views.Links.tipContentsUpdate": "Refresh table of contents",
|
||||||
"DE.Views.Links.tipInsertHyperlink": "Add hyperlink",
|
"DE.Views.Links.tipInsertHyperlink": "Add hyperlink",
|
||||||
"DE.Views.Links.tipNotes": "Insert or edit footnotes",
|
"DE.Views.Links.tipNotes": "Insert or edit footnotes",
|
||||||
|
"DE.Views.Links.mniConvertNote": "Convert All Notes",
|
||||||
|
"DE.Views.Links.textGotoEndnote": "Go to Endnotes",
|
||||||
|
"DE.Views.Links.mniInsEndnote": "Insert Endnote",
|
||||||
|
"DE.Views.Links.textConvertToEndnotes": "Convert All Footnotes to Endnotes",
|
||||||
|
"DE.Views.Links.textConvertToFootnotes": "Convert All Endnotes to Footnotes",
|
||||||
|
"DE.Views.Links.textSwapNotes": "Swap Footnotes and Endnotes",
|
||||||
"DE.Views.ListSettingsDialog.textAuto": "Automatic",
|
"DE.Views.ListSettingsDialog.textAuto": "Automatic",
|
||||||
"DE.Views.ListSettingsDialog.textCenter": "Center",
|
"DE.Views.ListSettingsDialog.textCenter": "Center",
|
||||||
"DE.Views.ListSettingsDialog.textLeft": "Left",
|
"DE.Views.ListSettingsDialog.textLeft": "Left",
|
||||||
|
@ -1857,6 +1863,11 @@
|
||||||
"DE.Views.NoteSettingsDialog.textStart": "Start at",
|
"DE.Views.NoteSettingsDialog.textStart": "Start at",
|
||||||
"DE.Views.NoteSettingsDialog.textTextBottom": "Below text",
|
"DE.Views.NoteSettingsDialog.textTextBottom": "Below text",
|
||||||
"DE.Views.NoteSettingsDialog.textTitle": "Notes Settings",
|
"DE.Views.NoteSettingsDialog.textTitle": "Notes Settings",
|
||||||
|
"DE.Views.NoteSettingsDialog.textSectEnd": "End of section",
|
||||||
|
"DE.Views.NoteSettingsDialog.textEndnote": "Endnote",
|
||||||
|
"DE.Views.NotesRemoveDialog.textTitle": "Delete Notes",
|
||||||
|
"DE.Views.NotesRemoveDialog.textFoot": "Delete All Footnotes",
|
||||||
|
"DE.Views.NotesRemoveDialog.textEnd": "Delete All Endnotes",
|
||||||
"DE.Views.PageMarginsDialog.notcriticalErrorTitle": "Warning",
|
"DE.Views.PageMarginsDialog.notcriticalErrorTitle": "Warning",
|
||||||
"DE.Views.PageMarginsDialog.textBottom": "Bottom",
|
"DE.Views.PageMarginsDialog.textBottom": "Bottom",
|
||||||
"DE.Views.PageMarginsDialog.textGutter": "Gutter",
|
"DE.Views.PageMarginsDialog.textGutter": "Gutter",
|
||||||
|
|
Loading…
Reference in a new issue