From e18ebef5854f233ce33035ab5fecfbe58b702edc Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 11 Dec 2025 17:07:42 +0100 Subject: [PATCH] wip #7779 @2 --- js/libs/fluidbook/fluidbook.nav.js | 13 +++++++++---- style/nav-horizontal.less | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index aa4f0399..e08ac8f4 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -134,7 +134,7 @@ FluidbookNav.prototype = { } // Only the Menu should have titles + the locales icon in the horizontal menu - if (navType === 'menu' || id === 'locales') { + if (navType === 'menu' || id === 'locales' || id === 'accessibility') { if (title !== undefined && title !== '') { res += ' ' + this.fluidbook.l10n.__(title) + ''; } @@ -219,18 +219,21 @@ FluidbookNav.prototype = { // All possible icons and default ordering - var all = ["extra", "index", "chapters", "search", "friend", "print", "pdf", 'notes', "bookmark", "archives", "basket", "fullscreen", "sound", "3d", "help", "lang", "extra1", "extra2", "extra3", "extra4", "extra5",]; + var all = ["extra", "index", "chapters", "search", "friend", "print", "pdf", 'notes', "bookmark", "archives", "basket", "fullscreen", "sound", "3d", "help", "extra1", "extra2", "extra3", "extra4", "extra5", "lang", 'accessibility']; // Fallback to default list if navOrder is still empty for some reason if (navOrder.length === 0) { navOrder = all; } - // If the locales icon is included, it should always be placed last in the list for formatting reasons - var localeIconIndex; + // If the locales or accessibility icon is included, it should always be placed last in the list for formatting reasons + let localeIconIndex, a11yIconIndex; if ((localeIconIndex = navOrder.indexOf('lang')) !== -1) { navOrder.push(navOrder.splice(localeIconIndex, 1)[0]); // Push to end of array } + if ((a11yIconIndex = navOrder.indexOf('accessibility')) !== -1) { + navOrder.push(navOrder.splice(a11yIconIndex, 1)[0]); + } var hide = array_diff(all, navOrder); var thisall = navOrder.concat(hide); @@ -351,6 +354,8 @@ FluidbookNav.prototype = { } else if (icon === 'lang' && this.fluidbook.l10n.multilangEnabled) { // Note: the "!" at the beginning of the title/help parameters means that we don't want these strings translated link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language', 'Control+L'); + } else if (icon === 'accessibility' && this.fluidbook.settings.accessibility_menu) { + link = this.addLink(navType, 'nav-accessibility', '#/accessibility', 'accessibility', 'accessibility', 'accessibility', 'Ctrl+Alt+A'); } else if (icon === 'archives' && this.fluidbook.settings.externalArchives) { link = this.addLink(navType, 'nav-archives', '#/archives', 'archives', '!' + this.fluidbook.settings.archivesLabel, '!' + this.fluidbook.settings.archivesLabel, ''); } else if (icon === 'help' && this.fluidbook.settings.help) { diff --git a/style/nav-horizontal.less b/style/nav-horizontal.less index f1843b2f..a2efa0ec 100644 --- a/style/nav-horizontal.less +++ b/style/nav-horizontal.less @@ -30,7 +30,7 @@ } // Locales icon + text link - &_locales { + &_locales, &_accessibility { border-left: 1px solid; margin-right: 1.5em; margin-left: 14px; -- 2.39.5