Widget:Google Books: Difference between revisions

From Cornelis Drebbel
Jump to navigation Jump to search
m (Protected "Widget:Google Books" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
No edit summary
 
(140 intermediate revisions by 2 users not shown)
Line 2: Line 2:
This widget allows you to embed '''[http://code.google.com/apis/books/docs/preview-wizard.html Google Books]''' on your wiki page.
This widget allows you to embed '''[http://code.google.com/apis/books/docs/preview-wizard.html Google Books]''' on your wiki page.


Created by [http://www.mediawikiwidgets.org/User:Arv Arv]
Created by [https://www.mediawikiwidgets.org/User:Arv Arv]


== Using this widget ==
== Using this widget ==
For information on how to use this widget, see [http://www.mediawikiwidgets.org/Google_Books widget description page on MediaWikiWidgets.org].
For information on how to use this widget, see [https://www.mediawikiwidgets.org/Google_Books widget description page on MediaWikiWidgets.org].


== Copy to your site ==
== Copy to your site ==
To use this widget on your site, just install [http://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as '''{{FULLPAGENAME}}''' article.
To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
</noinclude><includeonly><!--{counter name="bookDivID" assign="bookDivID"}--><div id="viewerCanvas<!--{$bookDivID|escape:'html'}-->" style="width: <!--{$width|escape:'html'|default:'600'}-->px; height: <!--{$height|escape:'html'|default:500}-->px"></div>
</noinclude>
<!--{if $bookDivID == 1}--><script type="text/javascript" src="http://www.google.com/jsapi"></script>
 
<includeonly>
<script type="text/javascript" src="//books.google.com/books/previewlib.js">
</script>
<script type="text/javascript">
<script type="text/javascript">
      var widgetbooks = [];
width=<!--{$width|escape:'html'|default:'600'}-->;
      var bookwidgetloaded = false;
height=<!--{$height|escape:'html'|default:'500'}-->;
 
var welk='<!--{$id}-->';
      var showbooks = function() {
GBS_insertEmbeddedViewer(welk,width,height);
        if (!bookwidgetloaded) { return; }
 
        for(var i=0; i<widgetbooks.length; i++) {
              var widget = widgetbooks[i];
              var viewer = new google.books.DefaultViewer(document.getElementById(widget.element));
              viewer.load(widget.id);
        }
      };
 
      google.setOnLoadCallback(function() {
        bookwidgetloaded = true;
        showbooks();
      });
      google.load("books", "0");
</script>
</script>
<!--{/if}--><script type="text/javascript">
</includeonly>
widgetbooks[widgetbooks.length] = { element: 'viewerCanvas<!--{$bookDivID|escape:'quotes'}-->', id: '<!--{$id|escape:'quotes'}-->' };
showbooks();
</script></includeonly>

Latest revision as of 18:53, 15 August 2020

This widget allows you to embed Google Books on your wiki page.

Created by Arv

Using this widget

For information on how to use this widget, see widget description page on MediaWikiWidgets.org.

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:Google Books.