[DE] Convert notes

This commit is contained in:
Julia Radzhabova 2020-08-02 19:39:37 +03:00
parent 6e26464b53
commit ad7da36f24
3 changed files with 42 additions and 2 deletions

View file

@ -350,6 +350,24 @@ define([
Common.NotificationCenter.trigger('edit:complete', me.toolbar); Common.NotificationCenter.trigger('edit:complete', me.toolbar);
}, 50); }, 50);
break; 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;
} }
}, },

View file

@ -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) {
@ -265,7 +268,17 @@ define([
}), }),
{caption: '--'}, {caption: '--'},
{caption: me.mniDelFootnote, value: 'delele'}, {caption: me.mniDelFootnote, value: 'delele'},
{caption: me.mniConvertNote, value: 'convert'}, {
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'}
] ]
}); });
@ -341,7 +354,10 @@ define([
tipCaption: 'Insert caption', tipCaption: 'Insert caption',
mniConvertNote: 'Convert All Notes', mniConvertNote: 'Convert All Notes',
textGotoEndnote: 'Go to Endnote', textGotoEndnote: 'Go to Endnote',
mniInsEndnote: 'Insert Endnote' 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 || {}));
}); });

View file

@ -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 Endnote",
"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",