User:Π/Scripts/AutoWIGO.js

//

function AutoWIGO { var pollname; switch(wgPageName) { case "Conservapedia:What_is_going_on_at_CP?": pollname="wigo"; break; case "RationalWiki:What_is_going_on_in_the_clogosphere?": pollname="clog"; break; case "RationalWiki:What_is_going_on_in_the_blogosphere?": pollname="blog"; break; case "RationalWiki:What_is_going_on_in_the_world?": pollname="world"; break; case "RationalWiki:What_is_going_on_at_ASK?": pollname="ask"; break; case "Fun:RationalWikiWikiWiki": pollname="RWW"; break; default: return; } if (document.forms['editform'] == null) return; var editarea = document.forms['editform'].elements['wpTextbox1']; var str = editarea.value; var wigos = str.split(" "); if (wigos.length == 0) return; var i; var numbers = []; var j = 0; for (i=0;i"); var pollstart = wigos[i].indexOf("poll="+pollname); var tempi = parseInt(wigos[i].substring(pollstart+5+pollname.length,closetag),10); if (!isNaN(tempi) && (tempi != 0 || temp == "0")) {     numbers[j] = tempi; ++j } }  if (numbers.length > 0) {   var nextnum = Math.max.apply(Math, numbers) + 1; } else { var nextnum = 1; } //add the button if (mwCustomEditButtons) { mwCustomEditButtons.push({       "imageFile": "http://rationalwiki.com/wiki/images/3/3a/Button_WIGO.png",        "speedTip": "WIGO",        "tagOpen": "",        "tagClose": " ",        "sampleText": "LULZ"    }); } }

addOnloadHook(AutoWIGO);

//