Archive.org release 0.9.3
authorMichael Ang <mang@archive.org>
Mon, 20 Apr 2009 22:19:51 +0000 (15:19 -0700)
committerMichael Ang <mang@archive.org>
Mon, 20 Apr 2009 22:19:51 +0000 (15:19 -0700)
https://bugs.edge.launchpad.net/gnubook/+milestone/0.9.3

First/last page navigation buttons
https://bugs.edge.launchpad.net/gnubook/+bug/294409

GnuBook/GnuBook.css
GnuBook/GnuBook.js
GnuBook/images/book_bottom_icon.png [new file with mode: 0644]
GnuBook/images/book_leftmost_icon.png [new file with mode: 0644]
GnuBook/images/book_rightmost_icon.png [new file with mode: 0644]
GnuBook/images/book_top_icon.png [new file with mode: 0644]
GnuBookIA/index.php

index 39a846d..392208c 100644 (file)
 .GBicon.book_right { background: url(images/book_right_icon.png) no-repeat; }
 .GBicon.book_up { background: url(images/book_up_icon.png) no-repeat; }
 .GBicon.book_down { background: url(images/book_down_icon.png) no-repeat; }
+.GBicon.book_leftmost { background: url(images/book_leftmost_icon.png) no-repeat; }
+.GBicon.book_rightmost { background: url(images/book_rightmost_icon.png) no-repeat; }
+.GBicon.book_top { background: url(images/book_top_icon.png) no-repeat; }
+.GBicon.book_bottom { background: url(images/book_bottom_icon.png) no-repeat; }
 
 .GBicon.play { background: url(images/control_play_icon.png) no-repeat; }
 .GBicon.pause { background: url(images/control_pause_icon.png) no-repeat; }
index 1c86f44..f399b9c 100644 (file)
@@ -18,7 +18,7 @@ This file is part of GnuBook.
     
     The GnuBook source is hosted at http://github.com/openlibrary/bookreader/
 
-    archive.org cvs $Revision: 1.69 $ $Date: 2009-04-01 22:00:51 $
+    archive.org cvs $Revision: 1.72 $ $Date: 2009-04-20 22:05:02 $
 */
 
 // GnuBook()
@@ -159,10 +159,10 @@ GnuBook.prototype.setupKeyListeners = function() {
                 }
                 break;
             case KEY_END:
-                self.end();
+                self.last();
                 break;
             case KEY_HOME:
-                self.home();
+                self.first();
                 break;
             case KEY_LEFT:
                 if (self.keyboardNavigationIsDisabled(e)) {
@@ -915,6 +915,17 @@ GnuBook.prototype.right = function() {
     }
 }
 
+// rightmost()
+//______________________________________________________________________________
+// Flip to the rightmost page
+GnuBook.prototype.rightmost = function() {
+    if ('rl' != this.pageProgression) {
+        gb.last();
+    } else {
+        gb.first();
+    }
+}
+
 // left()
 //______________________________________________________________________________
 // Flip the left page over onto the right.
@@ -928,6 +939,17 @@ GnuBook.prototype.left = function() {
     }
 }
 
+// leftmost()
+//______________________________________________________________________________
+// Flip to the leftmost page
+GnuBook.prototype.leftmost = function() {
+    if ('rl' != this.pageProgression) {
+        gb.first();
+    } else {
+        gb.last();
+    }
+}
+
 // next()
 //______________________________________________________________________________
 GnuBook.prototype.next = function() {
@@ -954,7 +976,7 @@ GnuBook.prototype.prev = function() {
     }
 }
 
-GnuBook.prototype.home = function() {
+GnuBook.prototype.first = function() {
     if (2 == this.mode) {
         this.jumpToIndex(2);
     }
@@ -963,7 +985,7 @@ GnuBook.prototype.home = function() {
     }
 }
 
-GnuBook.prototype.end = function() {
+GnuBook.prototype.last = function() {
     if (2 == this.mode) {
         this.jumpToIndex(this.lastDisplayableIndex());
     }
@@ -1837,23 +1859,11 @@ GnuBook.prototype.initToolbar = function(mode) {
     jToolbar.append("<span id='GBtoolbarbuttons' style='float: right'>"
         + "<button class='GBicon rollover embed' />"
         + "<form class='GBpageform' action='javascript:' onsubmit='gb.jumpToPage(this.elements[0].value)'> <span class='label'>Page:<input id='GBpagenum' type='text' size='3' onfocus='gb.autoStop();'></input></span></form>"
-        + "<div class='GBtoolbarmode2' style='display: inline'><button class='GBicon rollover book_left' /><button class='GBicon rollover book_right' /></div>"
-        + "<div class='GBtoolbarmode1' style='display: hidden'><button class='GBicon rollover book_up' /> <button class='GBicon rollover book_down' /></div>"
+        + "<div class='GBtoolbarmode2' style='display: inline'><button class='GBicon rollover book_leftmost' /><button class='GBicon rollover book_left' /><button class='GBicon rollover book_right' /><button class='GBicon rollover book_rightmost' /></div>"
+        + "<div class='GBtoolbarmode1' style='display: hidden'><button class='GBicon rollover book_top' /><button class='GBicon rollover book_up' /> <button class='GBicon rollover book_down' /><button class='GBicon rollover book_bottom' /></div>"
         + "<button class='GBicon rollover play' /><button class='GBicon rollover pause' style='display: none' /></span>");
 
-    // Bind the non-changing click handlers
-    jToolbar.find('.embed').bind('click', function(e) {
-        gb.showEmbedCode();
-        return false;
-    });
-    jToolbar.find('.play').bind('click', function(e) {
-        gb.autoToggle();
-        return false;
-    });
-    jToolbar.find('.pause').bind('click', function(e) {
-        gb.autoToggle();
-        return false;
-    });
+    this.bindToolbarNavHandlers(jToolbar);
     
     // Setup tooltips -- later we could load these from a file for i18n
     var titles = { '.logo': 'Go to Archive.org',
@@ -1867,8 +1877,18 @@ GnuBook.prototype.initToolbar = function(mode) {
                    '.book_up': 'Page up',
                    '.book_down': 'Page down',
                    '.play': 'Play',
-                   '.pause': 'Pause'
-                  };                  
+                   '.pause': 'Pause',
+                   '.book_top': 'First page',
+                   '.book_bottom': 'Last page'
+                  };
+    if ('rl' == this.pageProgression) {
+        titles['.book_leftmost'] = 'Last page';
+        titles['.book_rightmost'] = 'First page';
+    } else { // LTR
+        titles['.book_leftmost'] = 'First page';
+        titles['.book_rightmost'] = 'Last page';
+    }
+                  
     for (var icon in titles) {
         jToolbar.find(icon).attr('title', titles[icon]);
     }
@@ -1893,8 +1913,6 @@ GnuBook.prototype.switchToolbarMode = function(mode) {
         $('#GBtoolbar .GBtoolbarmode1').hide();
         $('#GBtoolbar .GBtoolbarmode2').css('display', 'inline').show();
     }
-    
-    this.bindToolbarNavHandlers($('#GBtoolbar'));
 }
 
 // bindToolbarNavHandlers
@@ -1902,29 +1920,60 @@ GnuBook.prototype.switchToolbarMode = function(mode) {
 // Binds the toolbar handlers
 GnuBook.prototype.bindToolbarNavHandlers = function(jToolbar) {
 
-    jToolbar.find('.book_left').unbind('click')
-        .bind('click', function(e) {
-            gb.left();
-            return false;
-         });
+    jToolbar.find('.book_left').bind('click', function(e) {
+        gb.left();
+        return false;
+    });
          
-    jToolbar.find('.book_right').unbind('click')
-        .bind('click', function(e) {
-            gb.right();
-            return false;
-        });
+    jToolbar.find('.book_right').bind('click', function(e) {
+        gb.right();
+        return false;
+    });
         
-    jToolbar.find('.book_up').unbind('click')
-        .bind('click', function(e) {
-            gb.prev();
-            return false;
-        });        
+    jToolbar.find('.book_up').bind('click', function(e) {
+        gb.prev();
+        return false;
+    });        
+        
+    jToolbar.find('.book_down').bind('click', function(e) {
+        gb.next();
+        return false;
+    });
         
-    jToolbar.find('.book_down').unbind('click')
-        .bind('click', function(e) {
-            gb.next();
-            return false;
-        });      
+    jToolbar.find('.embed').bind('click', function(e) {
+        gb.showEmbedCode();
+        return false;
+    });
+
+    jToolbar.find('.play').bind('click', function(e) {
+        gb.autoToggle();
+        return false;
+    });
+
+    jToolbar.find('.pause').bind('click', function(e) {
+        gb.autoToggle();
+        return false;
+    });
+    
+    jToolbar.find('.book_top').bind('click', function(e) {
+        gb.first();
+        return false;
+    });
+
+    jToolbar.find('.book_bottom').bind('click', function(e) {
+        gb.last();
+        return false;
+    });
+    
+    jToolbar.find('.book_leftmost').bind('click', function(e) {
+        gb.leftmost();
+        return false;
+    });
+  
+    jToolbar.find('.book_rightmost').bind('click', function(e) {
+        gb.rightmost();
+        return false;
+    });
 }
 
 // firstDisplayableIndex
diff --git a/GnuBook/images/book_bottom_icon.png b/GnuBook/images/book_bottom_icon.png
new file mode 100644 (file)
index 0000000..19171ba
Binary files /dev/null and b/GnuBook/images/book_bottom_icon.png differ
diff --git a/GnuBook/images/book_leftmost_icon.png b/GnuBook/images/book_leftmost_icon.png
new file mode 100644 (file)
index 0000000..c4070e0
Binary files /dev/null and b/GnuBook/images/book_leftmost_icon.png differ
diff --git a/GnuBook/images/book_rightmost_icon.png b/GnuBook/images/book_rightmost_icon.png
new file mode 100644 (file)
index 0000000..b97aaec
Binary files /dev/null and b/GnuBook/images/book_rightmost_icon.png differ
diff --git a/GnuBook/images/book_top_icon.png b/GnuBook/images/book_top_icon.png
new file mode 100644 (file)
index 0000000..1cd3690
Binary files /dev/null and b/GnuBook/images/book_top_icon.png differ
index 605316d..4949daa 100644 (file)
@@ -23,7 +23,7 @@ $id = $_REQUEST['id'];
 // manually update with Launchpad version number at each checkin so that browsers
 // do not use old cached version
 // see https://bugs.launchpad.net/gnubook/+bug/330748
-$version = "0.9.2";
+$version = "0.9.3";
 
 if ("" == $id) {
     echo "No identifier specified!";