From bf7b7c0b7d8d13bf4b15f588f4e34dc24611422a Mon Sep 17 00:00:00 2001 From: Michael Ang Date: Fri, 19 Nov 2010 01:56:42 +0000 Subject: [PATCH] New embed UI --- BookReader/BookReader.js | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index 628fb96..8b07bd8 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -189,7 +189,7 @@ BookReader.prototype.init = function() { document.title = this.shortTitle(50); $("#BookReader").empty(); - + this.initToolbar(this.mode, this.ui); // Build inside of toolbar div $("#BookReader").append("
"); $("#BRcontainer").append("
"); @@ -271,7 +271,11 @@ BookReader.prototype.init = function() { // We init the nav bar after the params processing so that the nav slider knows where // it should start (doesn't jump after init) - this.initNavbar(); + if (this.ui == "embed") { + this.initEmbedNavbar(); + } else { + this.initNavbar(); + } this.bindNavigationHandlers(); // Set strings in the UI @@ -3359,6 +3363,24 @@ BookReader.prototype.initNavbar = function() { */ } +// initEmbedNavbar +//______________________________________________________________________________ +// Initialize the navigation bar when embedded +BookReader.prototype.initEmbedNavbar = function() { + $('#BookReader').append( + '
' + + "" + + "Back to" + this.bookTitle + "" // XXX escape + + '
' // Page turn buttons + + '' + + '' + //+ '' + + '
' + + '
' + ); +} + + BookReader.prototype.updateNavPageNum = function(index) { var pageNum = this.getPageNum(index); var pageStr; @@ -3568,6 +3590,9 @@ BookReader.prototype.addChapterFromEntry = function(tocEntryObject) { } BookReader.prototype.initToolbar = function(mode, ui) { + if (ui == "embed") { + return; // No toolbar at top in embed mode + } // $$$mang should be contained within the BookReader div instead of body var readIcon = ''; @@ -3587,7 +3612,7 @@ BookReader.prototype.initToolbar = function(mode, ui) { //+ "" + "" + "" - + "Back to" + this.bookTitle + "" + + "Back to" + this.bookTitle + "" // XXX escape + "
" + "" /* -- 2.20.1