Google Booksearch Viewer

Extension Information
Extension File Name: 
GBSEmbed.js
Author: 
Richard Wallis
Extension Class Name: 
GBSEmbedJuice
Function Parameters: 
  • ju - instance of juice
  • insert - JuiceInsert for page
  • targetDiv - id of element within insert to contain viewer

 

Dependencies: 

Extension is dependent on one or more ISBN values being stored in a Juice Meta definition named "isbns". This extension will not operate if this value is not present.

Example Code: 
var div = '<div id="GBSPanel" style="display: block; width: 100%">' + 
               
'<br/><h2 class="title">Look Inside</h2>' +
               
'<div id="GBSViewer" style="width: 100%; height: 800px"></div>' +
               
'</div>';
var insert = new JuiceInsert(div,"#details .table","after");
new GBSEmbedJuice(juice,insert,"GBSViewer");

Extension to embed a Google Book Search Viewer in to the page based on meta value of 'isbns'. This extension does a pre-search of Google Book Search, and only is enabled if Google has a full or partial preview available.

Upon construction this extension performs a search via the Google Book Search API. If a full or partial preview is available, the viewer is inserted in to the page.

AttachmentSize
GBSEmbed.js.txt2.36 KB