User:AoV2/parsertricks.js

parsertricks = { 'i': 0, 'o': 0, 'b': "", sb: null}; parsertricks.wtxt = function(s){ parsertricks.b += '' + s + ' '; return '' + s + ' '; } parsertricks.init = function(s){ if(parsertricks.sb) return parsertricks.sb.innerHTML = s;	document.getElementById("bodyContent").innerHTML += ' '; parsertricks.sb = document.getElementById("aov-sb"); return parsertricks.init(s); } parsertricks.refresh = function{ url = mw.config.get('wgServer') + mw.config.get('wgScriptPath') + "/api.php?action=parse&format=json&callback=parsertricks.cb&text=" + encodeURIComponent(parsertricks.b); mw.loader.load(url); parsertricks.b = ""; } parsertricks.cb = function(obj){ parsertricks.init(obj.parse.text["*"]); while(parsertricks.o < parsertricks.i) { document.getElementById("aov-" + parsertricks.o + "-b").innerHTML = document.getElementById("aov-" + parsertricks.o + "-a").innerHTML; parsertricks.o++; }	} parsertricks.wlink = function(foo, bar) { return parsertricks.wtxt("" + bar + ""); }