"Expand" button opens book in new window (or tab)
[bookreader.git] / BookReader / BookReader.js
index e24a335..aec0785 100644 (file)
@@ -3367,23 +3367,22 @@ BookReader.prototype.initNavbar = function() {
 //______________________________________________________________________________
 // Initialize the navigation bar when embedded
 BookReader.prototype.initEmbedNavbar = function() {
-    // XXX we don't want embed for this link -- just the link to this book
-    var thisLink = this.getEmbedURL(this.paramsFromCurrent());
+    var thisLink = (window.location + '').replace('?ui=embed',''); // IA-specific
     
     $('#BookReader').append(
         '<div id="BRnav">'
         +   "<span id='BRtoolbarbuttons'>"        
-        //+         '<button class="BRicon full"></button>'
+        +         '<button class="BRicon full"></button>'
         +         '<button class="BRicon book_left"></button>'
         +         '<button class="BRicon book_right"></button>'
         +   "</span>"
         +   "<span><a class='logo' href='" + this.logoURL + "' 'target='_blank' ></a></span>"
-        +   "<span id='BRembedreturn'><a href='" + thisLink + "' target='_blank' >" + this.bookTitle + "</a></span>" // XXX escape
+        +   "<span id='BRembedreturn'><a href='" + thisLink + "' target='_blank' ></a></span>"
         + '</div>'
     );
+    $('#BRembedreturn a').text(this.bookTitle);
 }
 
-
 BookReader.prototype.updateNavPageNum = function(index) {
     var pageNum = this.getPageNum(index);
     var pageStr;
@@ -3881,6 +3880,16 @@ BookReader.prototype.bindNavigationHandlers = function() {
         return false;
     });
     
+    jIcons.filter('.full').bind('click', function() {
+        if (self.ui == 'embed') {
+            // $$$ bit of a hack, IA-specific
+            var url = (window.location + '').replace("?ui=embed","");
+            window.open(url);
+        }
+        
+        // Not implemented
+    });
+    
     $('.BRnavCntl').click(
         function(){
             if ($('#BRnavCntlBtm').hasClass('BRdn')) {