User:Tim Pierce/imagesearch.js

// Adds toolbox links to search Google web, news archive, books, scholar, and images for the title of the page. addOnloadHook(function {    if (wgCanonicalNamespace == "Special")        return;  // no links for special pages    var title = wgTitle;    if (wgCanonicalNamespace != "")        title = title.replace(/^.*\//, "");  // subpage name only    var query = encodeURIComponent(title);     addPortletLink('p-tb', 'http://commons.wikimedia.org/w/index.php?title=Special:Search&search='+query, 'Commons search', 't-commonssearch', 'Search Wikimedia Commons for "'+title+'"', 'C');   addPortletLink('p-tb', 'http://www.flickr.com/search/?l=comm&ss=2&ct=0&mt=all&w=all&adv=1&q='+query, 'Flickr search', 't-flickrsearch', 'Search Flickr for "'+title+'"', 'F');

});