$(function(){RUN.modcontrols={ checklocation:function(){ var whichone=RUN.modcontrols.whichone regex=whichone?/act=vt(\d+)/:/act=vf(\d+)/ if(document.location.toString().match(regex)) RUN.modcontrols.moveto(whichone,RegExp.$1) else RUN.stream.commands.modcontrols_move(); }, moveto:function(whichone,id){ RUN.modcontrols.getitup('
move '+(whichone?"posts":"topics")+' here?
') }, getitup:function(html){ var html,modb=$('modbox'); if(!modb) { modb=document.createElement('div') modb.id='modbox' document.body.appendChild(modb) } modb.style.display='block' modb.innerHTML=html }, takeitdown:function(){ var modb=$('modbox') if(JAX.event.onPageChangeOld) {JAX.event.onPageChange=JAX.event.onPageChangeOld;JAX.event.onPageChangeOld=null;} else JAX.event.onPageChange=null; if(modb) {modb.innerHTML='';modb.style.display='none';} }, togbutton:function(button){ if(JAX.el.hasClass(button,'selected')) JAX.el.removeClass(button,'selected'); else JAX.el.addClass(button,'selected') } }}); $(function(){JAX.extend(RUN.stream.commands,{ modcontrols_sayhi:function(a){alert('this is a test');}, modcontrols_getitup:function(html){this.busy=true;RUN.modcontrols.getitup(html);}, modcontrols_postsync:function(a){ var pids=a[0]?a[0].split(','):false,pl=pids?pids.length:0 tids=a[1]?a[1].split(','):false,tl=tids?tids.length:0, html="
"+ (tl?"     "+tl+" topic"+(tl>1?"s":"")+(pl?" and
":""):"")+ (pl?"     "+pl+" post"+(pids.length>1?"s":""):"")+ (pl&&tl?"
":"     ")+ "
" JAX.extend(RUN.modcontrols,{tids:tids,tidl:tl,pids:pids,pidl:pl}) if(tl||pl) RUN.modcontrols.getitup(html); else RUN.modcontrols.takeitdown(); }, modcontrols_move:function(a){ var whichone=parseInt(a&&a[0]?a[0]:RUN.modcontrols.whichone) //a[0]: 0 topic 1 post if(!this.busy&&JAX.event.onPageChangeOld) {JAX.event.onPageChangeOld=JAX.event.onPageChange;} RUN.modcontrols.whichone=whichone; JAX.event.onPageChange=RUN.modcontrols.checklocation RUN.modcontrols.getitup("Ok, now browse to the "+(whichone?'topic':'forum')+" you want to move the "+(whichone?RUN.modcontrols.pidl+' posts':RUN.modcontrols.tidl+' topics')+" to..."); }, modcontrols_clearbox:function(){ RUN.modcontrols.takeitdown(); this.busy=false } })})