]> _ Git - fluidbook-html5.git/commitdiff
wip #7779 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Dec 2025 16:07:42 +0000 (17:07 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 11 Dec 2025 16:07:42 +0000 (17:07 +0100)
js/libs/fluidbook/fluidbook.nav.js
style/nav-horizontal.less

index aa4f0399dfff4bda972ce99a6b4025a0c99b8206..e08ac8f4c77d9881738c21e9fe24cb0be3dabed9 100644 (file)
@@ -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 += ' <span class="menu-item-title">' + this.fluidbook.l10n.__(title) + '</span>';
             }
@@ -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) {
index f1843b2fc108dcb2fc3268151433c222e068d5bd..a2efa0ec422f6fa0e44536205459f258f28a9e2f 100644 (file)
@@ -30,7 +30,7 @@
   }
 
   // Locales icon + text link
-  &_locales {
+  &_locales, &_accessibility {
     border-left: 1px solid;
     margin-right: 1.5em;
     margin-left: 14px;