User:Qatter/monobook.js

function getBinomial { var result = Object; var spans = document.getElementsByTagName('span'); for (var i = 0; i < spans.length; i++) { var span = spans[i]; if ('binomial' == span.className) { var parts = span.textContent.split(' '); if (2 == parts.length) { result.genus = parts[0]; result.species = parts[1]; return result; }   }  } }

$(function {   var year = '2008';  var month = '02';  var binomial = getBinomial;  var fishbaseline = '* \n';  addButton('http://en.wikipedia.org/wiki/Image:Herring2.jpg', 'FishBase', , fishbaseline, , 'mw-editbutton-media'); })

////////////////////////////////////////////////////////////////////////////////////////////////////

// Adds a "Replace" tab which pops up two prompt boxes; one for a regexp and one for a replacement function wpTextboxReplace {   var s = prompt("Search regexp:"); if(s){ var r = prompt("Replace /"+s+"/ with:"); if(!r && r != '') return; var txt = document.editform.wpTextbox1; txt.value = txt.value.replace(new RegExp(s, "mg"), r); } } $(function {    if (document.forms.editform) {        addPortletLink('p-cactions', 'javascript:wpTextboxReplace', 'Replace', 'ca-replace', 'Regexp replace for the edit window', 'R', document.getElementById('ca-history'));   } });