]> _ Git - fluidbook-html5.git/commitdiff
fix #3747 @5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 20 Jul 2020 17:14:27 +0000 (19:14 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 20 Jul 2020 17:14:27 +0000 (19:14 +0200)
_index.html
js/libs/fluidbook/fluidbook.pagetransitions.js
js/libs/fluidbook/fluidbook.print.js
js/libs/fluidbook/fluidbook.tabs.js

index be72ec2e1972caa66b1d75ace9d4d5090b55ca40..b57b027e01a46e1952d6ae98dd960b5d886374b3 100644 (file)
@@ -5,7 +5,7 @@
 <html prefix="og: http://ogp.me/ns#" lang="<!-- $lang -->"><!--<![endif]-->
 <head>
     <!-- $base -->
-    <title><!-- $titre --></title>
+    <title aria-live="off"><!-- $titre --></title>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=Edge">
     <!-- $csp -->
@@ -37,7 +37,7 @@
     <!-- $script -->
     <!-- $ga -->
 </head>
-<body data-branch="master" aria-hidden="true">
+<body data-branch="master">
 <!--googleoff: all-->
 <!-- $beginbody -->
 <div style="display:none;" id="svg-container" aria-hidden="true"><!-- $svg --></div>
         </div>
     </div>
     <header role="banner">
-        <nav id="horizontalNav" aria-label="Global"></nav>
+        <nav id="horizontalNav" role="navigation"></nav>
         <nav id="menu" aria-hidden="true"></nav>
         <div id="search"></div>
-        <a id="logo" href="#" aria-hidden="true"></a>
+        <a id="logo" href="#" aria-hidden="true" tabindex="-1"></a>
     </header>
-    <div id="interface"></div>
+    <nav role="navigation" id="interface"></nav>
     <div id="helpView"></div>
     <div id="helpViewOverlay" aria-hidden="true"></div>
     <div id="z" class="nozoom">
@@ -71,8 +71,8 @@
             <div id="flip3dcontainer" aria-hidden="true">
                 <canvas width="1024" height="1024"></canvas>
             </div>
-            <main id="fluidbook">
-                <div id="accessible-contents" aria-live="polite"></div>
+            <div id="fluidbook">
+                <main role="main" id="accessible-contents" aria-live="polite"></main>
                 <div id="edges" aria-hidden="true">
                     <div class="edge left">
                         <div class="top"></div>
                     <div id="searchHighlights" aria-hidden="true"></div>
                     <div id="links"></div>
                 </div>
-            </main>
+            </div>
         </div>
     </div>
     <a id="down" href="#" aria-hidden="true"></a>
-    <footer id="credits"><!-- $credits --></footer>
+    <footer id="credits" role="contentinfo"><!-- $credits --></footer>
 </div>
 <div id="searchHints"></div>
 <div id="viewOverlay" aria-hidden="true"></div>
-<div id="view" aria-hidden="true" aria-live="polite"></div>
-<div id="innerView" aria-hidden="true"></div>
+<div id="view" aria-hidden="true"></div>
+<div id="innerView" aria-hidden="tr ue"></div>
 <div id="pagesContents" aria-hidden="true"><!-- $pagesContents --></div>
 <div id="op" aria-hidden="true"></div>
 <div id="ol" aria-hidden="true"></div>
index 6cfe8cb6c28f53f781aedd54b03aff78fb63ddc1..b7a998d3dc102dae32dc2d8c0cf72bacc3983a67 100644 (file)
@@ -131,7 +131,7 @@ FluidbookPageTransition.prototype = {
         this.transitionning = true;
         var $this = this;
         var turning = this.getTurningPages(pageNr);
-        $("#pages").prepend('<div id="nextDoublePage" class="_3d doublePage ' + turning.nextFromClass + 'start"></div>');
+        $("#pages").prepend('<div id="nextDoublePage" aria-hidden="true" class="_3d doublePage ' + turning.nextFromClass + 'start"></div>');
         var doublePage = $("#nextDoublePage");
         var currentDoublePage = $("#currentDoublePage");
         if (!this.fluidbook.loader.arePreloadedPages(turning.end)) {
@@ -183,7 +183,7 @@ FluidbookPageTransition.prototype = {
         if (turning.dir === -1) {
             cdir = 'bwd';
         }
-        $("#pages").prepend('<div id="nextDoublePage" class="_3dflip ' + cdir + ' doublePage"></div>');
+        $("#pages").prepend('<div id="nextDoublePage" aria-hidden="true" class="_3dflip ' + cdir + ' doublePage"></div>');
         var doublePage = $("#nextDoublePage");
 
         this.pauseNetworkDuringPagesPreload();
@@ -321,7 +321,7 @@ FluidbookPageTransition.prototype = {
         this.transitionning = true;
         var $this = this;
         var turning = this.getTurningPages(pageNr);
-        $("#pages").append('<div id="nextDoublePage" class="doublePage _2d axis_' + this.transitionAxis + ' ' + turning.nextFromClass + '"></div>');
+        $("#pages").append('<div id="nextDoublePage" aria-hidden="true" class="doublePage _2d axis_' + this.transitionAxis + ' ' + turning.nextFromClass + '"></div>');
         var doublePage = $("#nextDoublePage");
         if (!this.fluidbook.loader.arePreloadedPages(turning.end)) {
             this.fluidbook.displayLoader();
@@ -347,7 +347,7 @@ FluidbookPageTransition.prototype = {
         this.transitionning = true;
         var $this = this;
         var turning = this.getTurningPages(pageNr);
-        $("#pages").append('<div id="nextDoublePage" class="doublePage _2d axis_' + this.transitionAxis + ' ' + turning.nextFromClass + '"></div>');
+        $("#pages").append('<div id="nextDoublePage" aria-hidden="true" class="doublePage _2d axis_' + this.transitionAxis + ' ' + turning.nextFromClass + '"></div>');
         var doublePage = $("#nextDoublePage");
         if (this.fluidbook.displayOnePage) {
             this.fluidbook.hidePage('right');
index 2d28319e38ab7191ea995177d5ced2dad120f309..1a7d9426d8d67461054b400cb929aec042d558d5 100644 (file)
@@ -101,9 +101,10 @@ FluidbookPrint.prototype = {
 
         // Double Page
         if (!this.isFirstPage && !this.isLastPage && !this.isSinglePageMode) {
-            view += '<div class="print-option" role="radio">';
+            var label = __('spread');
+            view += '<div class="print-option" role="radio" aria-label="' + label + '">';
             if (!this.compact) {
-                view += '<label for="doublePage">';
+                view += '<label for="doublePage" aria-hidden="true">';
                 view += '<div class="doubleThumb">';
                 view += '<div class="thumb left">';
                 view += this.fluidbook.loader.getThumbImage(this.leftPageNumber, true);
@@ -114,16 +115,17 @@ FluidbookPrint.prototype = {
                 view += '</div>'; // .doubleThumb
                 view += '</label>';
             }
-            view += '<input type="radio" name="pageChoice" value="double" id="doublePage">'
-            view += '<label for="doublePage" class="print-label-text">' + __('spread') + '</label>';
+            view += '<input aria-hidden="true" type="radio" name="pageChoice" value="double" id="doublePage">'
+            view += '<label aria-hidden="true" for="doublePage" class="print-label-text">' + label + '</label>';
             view += '</div>'; // .print-option
         }
 
         // Full Brochure
         if (this.fluidbook.settings.printFullBrochure) {
-            view += '<div class="print-option" role="radio">';
+            var label = __('entire brochure');
+            view += '<div class="print-option" role="radio" aria-label="' + label + '">';
             if (!this.compact) {
-                view += '<label for="allPages">';
+                view += '<label aria-hidden="" for="allPages">';
                 view += '<div class="doubleThumb">';
                 view += '<div class="thumb left">';
                 view += this.fluidbook.loader.getThumbImage(1, true);
@@ -131,26 +133,27 @@ FluidbookPrint.prototype = {
                 view += '</div>'; // .doubleThumb
                 view += '</label>';
             }
-            view += '<input type="radio" name="pageChoice" value="all" id="allPages">'
-            view += '<label for="allPages" class="print-label-text">' + __('entire brochure') + '</label>';
+            view += '<input aria-hidden="true" type="radio" name="pageChoice" value="all" id="allPages">'
+            view += '<label aria-hidden="true" for="allPages" class="print-label-text">' + label + '</label>';
             view += '</div>'; // .print-option
         }
 
         // Bookmarks
         if (this.fluidbook.settings.bookmark) {
+            var label = __('bookmarks');
             var hasBookmarks = this.fluidbook.bookmarks.hasBookmarkedPages(),
                 bookmarksDisabled = hasBookmarks ? '' : 'disabled';
 
-            view += '<div class="print-option bookmarks-option ' + bookmarksDisabled + '" role="radio">';
+            view += '<div class="print-option bookmarks-option ' + bookmarksDisabled + '" role="radio" aria-label="' + label + '">';
             if (!this.compact) {
-                view += '<label for="bookmarkedPages">';
+                view += '<label for="bookmarkedPages" aria-hidden="true">';
                 view += '<div class="doubleThumb bookmarks">';
                 view += this.fluidbook.bookmarks.getPrintPreview();
                 view += '</div>'; // .doubleThumb
                 view += '</label>';
             }
-            view += '<input type="radio" name="pageChoice" value="bookmarks" id="bookmarkedPages" ' + bookmarksDisabled + '>';
-            view += '<label for="bookmarkedPages" class="print-label-text">' + __('bookmarks') + '</label>';
+            view += '<input aria-hidden="true" type="radio" name="pageChoice" value="bookmarks" id="bookmarkedPages" ' + bookmarksDisabled + '>';
+            view += '<label aria-hidden="true" for="bookmarkedPages" class="print-label-text">' + label + '</label>';
             view += '</div>'; // .print-option
         }
 
@@ -167,7 +170,7 @@ FluidbookPrint.prototype = {
             var rangeEnd = Math.min(rangeStart + 1, this.fluidbook.settings.pages);
 
             view += '<div class="print-option page-range-option" role="radio">';
-            view += '<input type="radio" name="pageChoice" value="range" id="pageRange">';
+            view += '<input aria-hidden="true" type="radio" name="pageChoice" value="range" id="pageRange">';
             view += '<label for="pageRange">';
             view += __('From page');
             view += '<input class="page-range-input" type="text" id="pageRangeStart" value="' + this.fluidbook.physicalToVirtual(rangeStart) + '" autocomplete="off">';
@@ -181,7 +184,7 @@ FluidbookPrint.prototype = {
 
         // Action buttons
         view += '<div class="fonctions">';
-        view += '<a id="confirmChoice" href="#" data-mode="' + mode + '">' + this.buttonLabels[mode] + '</a>';
+        view += '<a role="button" id="confirmChoice" href="#" data-mode="' + mode + '">' + this.buttonLabels[mode] + '</a>';
         view += '</div>'; // .fonctions
 
         view += '</div>'; // .content
@@ -196,9 +199,9 @@ FluidbookPrint.prototype = {
             sideMask = side === 'left' ? 'right' : 'left';
         }
         var view = '';
-        view += '<div class="print-option" role="radio">';
+        view += '<div class="print-option" role="radio" aria-label="' + label + '">';
         if (!this.compact) {
-            view += '<label for="' + side + 'Page">';
+            view += '<label for="' + side + 'Page" aria-hidden="true">';
             view += '<div class="doubleThumb">';
             if (addMask && sideMask === 'left') {
                 view += this.getSideMask(sideMask);
@@ -212,14 +215,14 @@ FluidbookPrint.prototype = {
             view += '</div>'; // .doubleThumb
             view += '</label>';
         }
-        view += '<input type="radio" name="pageChoice" value="' + side + '" id="' + side + 'Page">';
-        view += '<label for="' + side + 'Page" class="print-label-text">' + label + '</label>';
+        view += '<input aria-hidden="true" type="radio" name="pageChoice" value="' + side + '" id="' + side + 'Page">';
+        view += '<label aria-hidden="true" for="' + side + 'Page" class="print-label-text">' + label + '</label>';
         view += '</div>'; // .print-option
         return view;
     },
 
     getSideMask: function (side) {
-        return '<div class="thumb ' + side + ' blank"><div class="blank-mask"></div></div>'
+        return '<div aria-hidden="true" class="thumb ' + side + ' blank"><div class="blank-mask"></div></div>'
     },
 
     getSinglePages: function () {
index d1703d8384cf103b049ed2b3ac189380c8d67712..7b8cf6ea1f0103846a1ac39841761e7865fb3454 100644 (file)
@@ -361,7 +361,6 @@ FluidbookTabs.prototype = {
         $(document).on('mouseout', '.tablink[data-labelid]', function () {
             $this.svg.find('[id^="t"].active').removeClass('active');
         });
-
     },
 
     changeVisibility: function (type, visible) {