Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcuts-bar remove menubar #4279

Merged
merged 1 commit into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions browser/src/control/Control.Notebookbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,6 @@ L.Control.Notebookbar = L.Control.extend({
'id': 'shortcutstoolbox',
'type': 'toolbox',
'children': [
{
'id': 'menu',
'type': 'toolitem',
'text': _('Menu'),
'command': '.uno:Menubar'
},
{
'id': 'save',
'type': 'toolitem',
Expand Down
135 changes: 0 additions & 135 deletions browser/src/control/Control.NotebookbarBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['.uno:shareas'] = this._shareAsControl;
this._toolitemHandlers['.uno:Print'] = this._printControl;
this._toolitemHandlers['.uno:rev-history'] = this._revHistoryControl;
this._toolitemHandlers['.uno:Menubar'] = this._menubarControl;
this._toolitemHandlers['.uno:InsertPageHeader'] = this._headerFooterControl;
this._toolitemHandlers['.uno:InsertPageFooter'] = this._headerFooterControl;
this._toolitemHandlers['.uno:Text'] = this._insertTextBoxControl;
Expand Down Expand Up @@ -864,140 +863,6 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
return false;
},

_menubarControl: function(parentContainer, data, builder) {
var control = builder._unoToolButton(parentContainer, data, builder);

$(control.container).unbind('click.toolbutton');
$(control.container).tooltip({disabled: true});
$(control.container).addClass('sm sm-simple lo-menu');

var disabledMacros = window.enableMacrosExecution === 'false';

var menu = {
text: [
{id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [
{uno: '.uno:SelectAll'},
{name: _('Show Ruler'), id: 'showruler', type: 'action'},
{type: 'separator'},
{name: _UNO('.uno:ChangesMenu', 'text'), id: 'changesmenu', type: 'menu', menu: [
{uno: '.uno:TrackChanges'},
{uno: '.uno:ShowTrackedChanges'},
{type: 'separator'},
{uno: '.uno:AcceptTrackedChanges'},
{uno: '.uno:AcceptAllTrackedChanges'},
{uno: '.uno:RejectAllTrackedChanges'},
{uno: '.uno:PreviousTrackedChange'},
{uno: '.uno:NextTrackedChange'}
]},
{uno: '.uno:SearchDialog'},
{type: 'separator'},
{name: _('Repair'), id: 'repair', type: 'action'},
{name: _UNO('.uno:ToolsMenu', 'text'), id: 'tools', type: 'menu', menu: [
{uno: '.uno:SpellingAndGrammarDialog'},
{uno: '.uno:SpellOnline'},
{uno: '.uno:ThesaurusDialog'},
{uno: '.uno:WordCountDialog'},
{uno: '.uno:LineNumberingDialog'},
{type: 'separator'},
{uno: '.uno:RunMacro', hidden: disabledMacros},
{type: 'separator', hidden: disabledMacros},
{name: _UNO('.uno:AutoFormatMenu', 'text'), type: 'menu', menu: [
{uno: '.uno:OnlineAutoFormat'}]}
]}
]}
],
spreadsheet: [
{id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [
{uno: '.uno:SelectAll'},
{type: 'separator'},
{uno: '.uno:SearchDialog'},
{type: 'separator'},
{name: _('Repair'), id: 'repair', type: 'action'},
{name: _UNO('.uno:ToolsMenu', 'spreadsheet'), id: 'tools', type: 'menu', menu: [
{uno: '.uno:SpellDialog'},
{uno: '.uno:SpellOnline'},
{uno: '.uno:GoalSeekDialog'},
{type: 'separator', hidden: disabledMacros},
{uno: '.uno:RunMacro', hidden: disabledMacros}
]}
]}
],
presentation: [
{id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [
{uno: '.uno:SelectAll'},
{type: 'separator'},
{uno: '.uno:SlideMasterPage'},
{type: 'separator'},
{uno: '.uno:ModifyPage'},
{uno: '.uno:SlideChangeWindow'},
{uno: '.uno:CustomAnimation'},
{uno: '.uno:MasterSlidesPanel'},
{type: 'separator'},
{uno: '.uno:SearchDialog'},
{type: 'separator'},
{name: _('Repair'), id: 'repair', type: 'action'},
{name: _UNO('.uno:ToolsMenu', 'presentation'), id: 'tools', type: 'menu', menu: [
{uno: '.uno:SpellDialog'},
{uno: '.uno:SpellOnline'},
{type: 'separator', hidden: disabledMacros},
{uno: '.uno:RunMacro', hidden: disabledMacros}
]},
]}
],
drawing: [
{id: 'nb-hamburger', name: _('Menu'), type: 'menu', menu: [
{type: 'separator'},
{uno: '.uno:SearchDialog'},
{type: 'separator'},
{name: _('Repair'), id: 'repair', type: 'action'},
{name: _UNO('.uno:ToolsMenu', 'presentation'), id: 'tools', type: 'menu', menu: [
{uno: '.uno:SpellDialog'},
{uno: '.uno:SpellOnline'},
{name: _UNO('.uno:LanguageMenu'), type: 'menu', menu: [
{name: _('None (Do not check spelling)'), id: 'nonelanguage', uno: '.uno:LanguageStatus?Language:string=Default_LANGUAGE_NONE'}]},
]},
]}
]
};

var menubar = L.control.menubar({allowedReadonlyMenus: ['nb-hamburger']});
menubar._map = builder.map;

var docType = builder.map.getDocType();
var menuHtml = menubar._createMenu(menu[docType]);
document.getElementById('Menubar').setAttribute('role', 'menu');

$(control.container).html(menuHtml);

$(control.container).smartmenus({
hideOnClick: true,
showOnClick: true,
hideTimeout: 0,
hideDuration: 0,
hideFunction: null,
showDuration: 0,
showFunction: null,
showTimeout: 0,
collapsibleHideDuration: 0,
collapsibleHideFunction: null,
subIndicatorsPos: 'append',
subIndicatorsText: '›'
});

$(menuHtml[0]).children('a').html('<img class="ui-content unobutton" src="' + L.LOUtil.getImageURL('lc_hamburger.svg') + '" id="Hamburgerimg" alt="Menu">');
$(menuHtml[0]).children('a').click(function () {
$(control.container).smartmenus('menuHideAll');
});

$(control.container).bind('beforeshow.smapi', {self: menubar}, menubar._beforeShow);
$(control.container).bind('click.smapi', {self: menubar}, menubar._onClicked);
$(control.container).bind('select.smapi', {self: menubar}, menubar._onItemSelected);
$(control.container).bind('mouseenter.smapi', {self: menubar}, menubar._onMouseEnter);
$(control.container).bind('mouseleave.smapi', {self: menubar}, menubar._onMouseLeave);
$(control.container).bind('keydown', {self: menubar}, menubar._onKeyDown);
$(control.container).bind('hideAll.smapi', {self: menubar}, menubar._onMouseOut);
},

buildControl: function(parent, data) {
var type = data.type;
var handler = this._controlHandlers[type];
Expand Down
6 changes: 0 additions & 6 deletions browser/src/control/Control.NotebookbarDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ L.Control.NotebookbarDraw = L.Control.NotebookbarImpress.extend({
'id': 'shortcutstoolbox',
'type': 'toolbox',
'children': [
{
'id': 'menu',
'type': 'toolitem',
'text': _('Menu'),
'command': '.uno:Menubar'
},
{
'id': 'save',
'type': 'toolitem',
Expand Down
6 changes: 0 additions & 6 deletions browser/src/control/Control.NotebookbarImpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
'id': 'shortcutstoolbox',
'type': 'toolbox',
'children': [
{
'id': 'menu',
'type': 'toolitem',
'text': _('Menu'),
'command': '.uno:Menubar'
},
{
'id': 'save',
'type': 'toolitem',
Expand Down