User:Peregrine Fisher/monobook.css

From Wikipedia, the free encyclopedia

If a message on your talk page led you here, please be wary of who left it. Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. If this is a .js page, the code will be executed when previewing the page.
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
/*********************************
* This script will add links to the Free Image Search Tool (FIST) to articles, images, and categories.
* Usage : Add
  importScript('User:Magnus Manske/add_fist_links.js');
* to your monobook.js file.
**********************************/
 
addOnloadHook ( add_fist_links ) ;
 
function add2toolbox ( url , title ) {
  var out = '<li>' ;
  out += '<a href="' + url + '">' + title + '</a></li>' ;
  var tools = document.getElementById("p-tb") ;
  tools = tools.getElementsByTagName("ul")[0] ;
  tools.innerHTML += out ;
}
 
function add_fist_links () {
  if ( wgNamespaceNumber == 0 ) { // Article
    add2toolbox ( 'http://tools.wikimedia.de/~magnus/fist.php?doit=1&language=' + wgContentLanguage + 
    '&project=wikipedia&datatype=articles&params[catdepth]=0&params[random]=50&params[ll_max]=5&params[commons_max]=5' +
    '&params[flickr_max]=5&params[include_flickr_id]=1&params[gimp_max]=5&params[forarticles]=all&params[lessthan_images]=3' +
    '&params[jpeg]=1&params[png]=1&params[gif]=1&params[svg]=1&params[min_width]=80&params[min_height]=80&sources[languagelinks]=1' +
    '&sources[commons]=1&sources[flickr]=1&sources[gimp]=1&data=' + wgPageName , 'Find free images');
  } else if ( wgNamespaceNumber == 6 ) { // Image
    add2toolbox ( 'http://tools.wikimedia.de/~magnus/fist.php?doit=1&language=' + wgContentLanguage + 
    '&project=wikipedia&datatype=replaceimages&params[catdepth]=0&params[random]=50&params[ll_max]=5' + 
    '&params[commons_max]=5&params[flickr_max]=5&params[include_flickr_id]=1&params[gimp_max]=5&params[forarticles]=all' + 
    '&params[lessthan_images]=3&params[jpeg]=1&params[png]=1&params[gif]=1&params[svg]=1&params[min_width]=80' + 
    '&params[min_height]=80&sources[languagelinks]=1&sources[commons]=1&sources[flickr]=1&sources[gimp]=1' + 
    '&data=' + wgPageName , 'Alternative images');
  } else if ( wgNamespaceNumber == 14 ) { // Category
    add2toolbox ( 'http://tools.wikimedia.de/~magnus/fist.php?doit=1&language=' + wgContentLanguage + 
    '&project=wikipedia&datatype=categories&params[catdepth]=0&params[random]=50&params[ll_max]=5&params[commons_max]=5' + 
    '&params[flickr_max]=5&params[include_flickr_id]=1&params[gimp_max]=5&params[forarticles]=noimage&params[lessthan_images]=3' + 
    '&params[jpeg]=1&params[png]=1&params[gif]=1&params[svg]=1&params[min_width]=80&params[min_height]=80&sources[languagelinks]=1' + 
    '&sources[commons]=1&sources[flickr]=1&sources[gimp]=1&data=' + wgPageName , 'Find free images');
  }
}