Make embed frame width/height more easily adjustable
authorMichael Ang <mang@archive.org>
Fri, 3 Dec 2010 19:45:49 +0000 (19:45 +0000)
committerMichael Ang <mang@archive.org>
Fri, 3 Dec 2010 19:45:49 +0000 (19:45 +0000)
BookReader/BookReader.js
BookReaderIA/datanode/BookReaderJSIA.php

index de92661..c788ec1 100644 (file)
@@ -5088,8 +5088,10 @@ BookReader.prototype.buildShareDiv = function(jShareDiv)
             params.page = self.getPageNum(self.currentIndex());
         }
         
-        // console.log(params);
-        form.find('.BRframeEmbed').val(self.getEmbedCode(params));
+        // $$$ changeable width/height to be added to share UI
+        var frameWidth = "480px";
+        var frameHeight = "430px";
+        form.find('.BRframeEmbed').val(self.getEmbedCode(frameWidth, frameHeight, params));
     })
     jForm.find('input[name=thispage]').trigger('change');
     jForm.find('input, textarea').bind('focus', function() {
index 9064a41..842aa7f 100644 (file)
@@ -367,8 +367,8 @@ br.getEmbedURL = function(viewParams) {
 // getEmbedCode
 //________
 // Returns the embed code HTML fragment suitable for copy and paste
-br.getEmbedCode = function(viewParams) {
-    return "<iframe src='" + this.getEmbedURL(viewParams) + "' width='480px' height='430px' frameborder='0' ></iframe>";
+br.getEmbedCode = function(frameWidth, frameHeight, viewParams) {
+    return "<iframe src='" + this.getEmbedURL(viewParams) + "' width='" + frameWidth + "' height='" + frameHeight + "' frameborder='0' ></iframe>";
 }
 
 // getOpenLibraryRecord