Google Base   Help | Sign in
  Zac Hanley's items  >  Module

Google Scholar searchbox module

Posted on Jun 29, 2006 5:09 am PDT  -  Contact the poster  -  All items by Zac Hanley  -  Report bad item
Description
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs
title="Google Scholar searchbox"
description="Based on Caleb Eggensperger&#39;s Other Google Searches module but just Google Scholar because that&#39;s all I wanted. You need to allow popups from gmodule.com for it to work."
author="Zac Hanley"
author_email="ortholog+modulefeedback@gmail.com"
screenshot="http://www.ortholog.com/archive/images/Google-Scholar-searchbox-module.jpg"
author_affiliation="ortholog.com"
title_url="http://scholar.google.com/"
height="80"
render_inline="optional" />
<UserPref name="showlogo" display_name="Show Logo?" datatype="bool" default_value="true" />
<Content type="html">
<![CDATA[
<script type="text/javascript">
function buildForm__MODULE_ID__(prefs) {
var prefs = new _IG_Prefs(__MODULE_ID__);
// Indicates whether to show Google Scholar logo
var logo = prefs.getBool("showlogo");

// Start building the form.
document.write("<form method=&#39;get&#39; action=&#39;http://scholar.google.com/scholar&#39; target=&#39;_blank&#39; style=&#39;margin-top:10;&#39;>");

// Change behaviour based on whether user wants logo or not.
if (prefs.getBool("showlogo") == true) {
document.write("<p style=&#39;margin-left:10px;&#39;><a href=&#39;http://scholar.google.com/&#39;><img style=&#39;border:none;text-align:center;&#39; src=&#39;http://scholar.google.com/scholar/scholar_sm.gif&#39; alt=&#39;Google Scholar&#39; width=&#39;105&#39; height=&#39;40&#39; /></a><br>");
}

// Continue the form.
document.write("<input type=&#39;text&#39; name=&#39;q&#39; size=&#39;15&#39; maxlength=&#39;255&#39; value=&#39;&#39; />&nbsp;");

// Change button text based on whether Google Scholar logo displayed.
if (prefs.getBool("showlogo") == true) {
document.write("<input type=&#39;submit&#39; name=&#39;btnG&#39; value=&#39;Search&#39; />");
} else {
document.write("<input type=&#39;submit&#39; name=&#39;btnG&#39; value=&#39;Scholar Search&#39; />");
}

// End the form.
document.write("</p></form>");
}
// Pass the userprefs for this gadget instance to the function
// (allows users to include multiple gadget instances on their page)
buildForm__MODULE_ID__(new _IG_Prefs(__MODULE_ID__));

</script>
]]>
</Content>
</Module>
 
Contact
Name: Zac Hanley
Contact the poster
 
 
This item has been viewed 115703 times.
 
Pictures
 


 

Post your own item | Search Tips | Dissatisfied? Help us improve