Use subPrefix in embed code. Needed for multi/user-uploaded items.
authorMichael Ang <mang@archive.org>
Fri, 18 Sep 2009 01:23:08 +0000 (01:23 +0000)
committerMichael Ang <mang@archive.org>
Fri, 18 Sep 2009 01:23:08 +0000 (01:23 +0000)
GnuBook/GnuBook.js

index 6e83b84..e7bb9a7 100644 (file)
@@ -3076,7 +3076,12 @@ GnuBook.prototype.startLocationPolling = function() {
 // Returns a URL for an embedded version of the current book
 GnuBook.prototype.getEmbedURL = function() {
     // We could generate a URL hash fragment here but for now we just leave at defaults
-    return 'http://' + window.location.host + '/stream/'+this.bookId + '?ui=embed';
+    var url = 'http://' + window.location.host + '/stream/'+this.bookId;
+    if (this.subPrefix != this.bookId) { // IA specific logic -- $$$ move to JSIA
+        url += '/' + this.subPrefix;
+    }
+    url += '?ui=embed';
+    return url;
 }
 
 // getEmbedCode