padding: 0;
margin: 0;
}
+
body, html {
- background-color:#<!-- $bgcolor -->;
+ background-color: # <!-- $ bgcolor -->;
width: 100%;
height: 100%;
}
<div id="flip3dcontainer" aria-hidden="true">
<canvas width="1024" height="1024"></canvas>
</div>
- <div id="fluidbook">
+ <main id="fluidbook">
+ <div id="accessible-contents"></div>
<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>
- </div>
+ </main>
</div>
</div>
<a id="down" href="#" aria-hidden="true"></a>
<canvas id="pscanvas" width="4096" height="4096" aria-hidden="true"></canvas>
<div id="loader" aria-hidden="true"></div>
<div id="hiddencontents" aria-hidden="true"><!-- $hiddenContents --></div>
-<div id="splash" style="background-color:#<!-- $bgcolor -->;<!-- $splashstyles -->" aria-hidden="true"><!-- $splash --></div>
+<div id="splash" style="background-color:#<!-- $bgcolor -->;<!-- $splashstyles -->" aria-hidden="true">
+ <!-- $splash --></div>
<div id="popinOverlay" aria-hidden="true"></div>
<div id="landingPage"></div>
<div id="loadedcontents" aria-hidden="true"></div>
--- /dev/null
+function FluidbookAccessibility(fluidbook) {
+ this.fluidbook = fluidbook;
+
+ this.init();
+}
+
+FluidbookAccessibility.prototype = {
+ init: function () {
+ var $this = this;
+ this.audiodescription = new FluidbookAudioDescription(this.fluidbook);
+ $(this.fluidbook).on('fluidbook.page.change.end', function (e, data) {
+ $this.endChangePage(data);
+ });
+ },
+
+ endChangePage: function (page) {
+ // Handle audio descriptions
+ if (Modernizr.audio) {
+ this.audiodescription.setupPages();
+ }
+
+ this.updateTexts();
+
+ },
+
+ updateTexts: function () {
+ var $this = this;
+ var texts = [];
+ $.each(this.fluidbook.getDisplayedPages(), function (k, page) {
+ var t = $this.getAccessibleTextOfPage(page);
+ if (t !== false) {
+ texts.push(t);
+ }
+ });
+ $("#accessible-contents").html(texts.join(''));
+ },
+
+ getAccessibleTextOfPage: function (page) {
+ if (this.fluidbook.settings.accessibleTexts === undefined || this.fluidbook.settings.accessibleTexts === null) {
+ return false;
+ }
+ page = parseInt(page);
+ if (this.fluidbook.settings.accessibleTexts[page] === undefined || this.fluidbook.settings.accessibleTexts[page] === null) {
+ return false;
+ }
+ return '<section data-page="' + page + '">' + this.fluidbook.settings.accessibleTexts[page] + '</section>';
+ },
+}
\ No newline at end of file
this.video = new FluidbookVideo(this);
this.bookmarks = new FluidbookBookmarks(this);
this.tooltip = new FluidbookTooltip(this);
- this.audiodescription = new FluidbookAudioDescription(this);
+ this.accessibility = new FluidbookAccessibility(this);
this.sound = new FluidbookSound(this);
this.slideshow = new FluidbookSlideshow(this);
this.printing = new FluidbookPrint(this);
}
return $(pageSide).data('page');
},
+ getDisplayedPages: function () {
+ var res = [];
+ var left = this.getPhysicalPageNumberOfSide('left', true);
+ var right = this.getPhysicalPageNumberOfSide('right', true);
+ if (left !== false) {
+ res.push(left);
+ }
+ if (right !== false) {
+ res.push(right);
+ }
+ return res;
+ },
+
getPageNumberOfSide: function (side, strict) {
if (undefined === strict) {
strict = false;
$("#down").css('opacity', 0);
}
- // Handle audio descriptions
- if (Modernizr.audio) {
- this.fluidbook.audiodescription.setupPages();
- }
+
setTimeout(function () {
$this.transitionning = false;