Merge branch 'master' of git@github.com:openlibrary/bookreader into browserlending
authorrajbot <raj@archive.org>
Tue, 15 Feb 2011 21:23:08 +0000 (21:23 +0000)
committerrajbot <raj@archive.org>
Tue, 15 Feb 2011 21:23:08 +0000 (21:23 +0000)
BookReaderIA/datanode/BookReaderJSIA.php
BookReaderIA/inc/BookReader.inc

index 816f871..f02a92e 100644 (file)
@@ -375,20 +375,22 @@ br.getEmbedCode = function(frameWidth, frameHeight, viewParams) {
 br.getOpenLibraryRecord = function(callback) {
     // Try looking up by ocaid first, then by source_record
     
-    var jsonURL = this.olHost + '/query.json?type=/type/edition&*=&ocaid=' + br.bookId;
+    var self = this; // closure
+    
+    var jsonURL = self.olHost + '/query.json?type=/type/edition&*=&ocaid=' + self.bookId;
     $.ajax({
         url: jsonURL,
         success: function(data) {
             if (data && data.length > 0) {
-                callback(br, data[0]);
+                callback(self, data[0]);
             } else {
                 // try sourceid
-                jsonURL = this.olHost + '/query.json?type=/type/edition&*=&source_records=ia:' + br.bookId;
+                jsonURL = self.olHost + '/query.json?type=/type/edition&*=&source_records=ia:' + self.bookId;
                 $.ajax({
                     url: jsonURL,
                     success: function(data) {
                         if (data && data.length > 0) {
-                            callback(br, data[0]);
+                            callback(self, data[0]);
                         }
                     },
                     dataType: 'jsonp'
index 9f3eefc..ffa6615 100644 (file)
@@ -100,7 +100,7 @@ class BookReader
     // 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 = "3.0.1";
+    $version = "3.0.2";
     
     if (BookReader::getDevHost($server)) {
         // On dev host - add time to force reload