var updatetime=2000; var useJSLinks=1; var adcounter=0; function IMWindow(uid,uname){ if(!globalsettings.can_im) return alert("You do not have permission to use this feature."); RUN.stream.commands.im([uid,uname,false]) } IMWindow.menu=function(e,uid){ e=JAX.event(e).stopBubbling() var d=document.createElement('div') d.innerHTML="loading" d.style.position='absolute' d.style.left=e.pageX+"px" d.style.top=e.pageY+"px" d.style.zIndex=JAX.el.getHighestZIndex() d.id="immenu" d.className="immenu" document.body.appendChild(d) document.body.onclick=function(e){e=JAX.event(e);if(e.srcElement!=d&&!JAX.el.isChildOf(e.srcElement,d)) d.parentNode.removeChild(d);} RUN.stream.load("?module=privatemessage&im_menu="+uid); } function RUNF(){ var me=this,stream=me.stream=new JAX.ajax if(useJSLinks) JAX.gracefulDegrade(document.body) this.updateDates=function(){ var dates=$$('.autodate'),x,parsed if(!dates) return for(x=0;x" var x,cmd,cmds=[] if(xml.length){ try {cmds=eval("("+xml+")");} catch(e){alert(e);cmds=[];} for(x=0;x=2) { var a=xmlobj.url.substring(1) if(!softurl) { document.location="#"+a; stream.lastURL=a } else { if(document.location.hash.substring(1)==a) document.location="#" } } stream.donext() } stream.lastURL="" stream.setup.method=1 stream.location=function(a,b){ var ad if(adcounter&&adcounter%10==0&&(ad=document.getElementsByTagName('iframe')[0])&&ad.src.match('google')) ad.src+="" adcounter++; a=a.split("?"); a=(a[1]||a[0]); stream.load("?"+a,null,null,null,b||2); stream.busy=true return false; } stream.locationfunc=function(){void(0);RUN.stream.location(this.getAttribute('href'));return false;} stream.loader=function(){ stream.load("?"+stream.lastURL); return true; } stream.updatePage=function(){ //this function makes the back/forward buttons actually do something, using anchors var l if((l=(document.location.hash.substring(1)||""))!=(stream.lastURL)) {stream.location(l,"3")} } stream.donext() setInterval(stream.updatePage,200) // Commands stream.commands={ script:function(a){eval(a[0]);}, error:function(a){alert(a[0]);}, alert:function(a){alert(a[0]);}, update:function(a){ var el=a[0] if(!el.match(/^\W/)) el="#"+el el=$$(el) if(!el) return el.innerHTML=a[1]; if(a[2]) JAX.sfx(el).dehighlight().play() JAX.gracefulDegrade(el); }, removeel:function(a){ var el=$$(a[0]) if(el) el.parentNode.removeChild(el) }, overlay:JAX.overlay, back:function(){history.back();}, goto:function(a){ a=a[0] if(!a.match(/^\W/)) a="#"+a a=$$(a) JAX.scrollTo(JAX.el.getCoordinates(a).y) }, setloc:function(a){document.location="#"+a;stream.lastURL="?"+a;}, appendrows:function(a){ var table=$$(a[0]), span=document.createElement('span'); span.innerHTML=""+a[1]+"
"; var vtbody=span.getElementsByTagName('tbody')[0], table=table.getElementsByTagName('tbody')[0], rows=vtbody.getElementsByTagName('tr'), l=rows.length JAX.gracefulDegrade(vtbody) for(var x=0;xglobalsettings.shoutlimit-1) {x=ss.pop();x.parentNode.removeChild(x);} JAX.sfx(div).dehighlight().play() if(globalsettings.sound_shout) Sound.play("sbblip"); JAX.gracefulDegrade(div) }, im:function(a){ var sb=$$('#im_'+a[0]+' .ims'),test if(!sb) { var win=new JAX.window win.title=a[1]+' '; win.content="
This user may be offline
".replace(/%s/g,a[0]) win.className="im" win.resize=".ims" win.animate=true win=win.create() JAX.gracefulDegrade(win) win.id="im_"+a[0] win.onclick=function(){win.getElementsByTagName('form')[0].im_im.focus();} win.onclick() sb=$$('#im_'+a[0]+' .ims') test=JAX.el.getComputedStyle(sb) sb.style.width=test.width;sb.style.height=test.height; if(a[2]&&globalsettings.sound_im) Sound.play("imnewwindow"); } if(a[2]) { a[3]=parseInt(a[3]) var d=document.createElement('div'),l,x,act=a[2].substring(0,3)=="/me" if(act) {d.className="action";a[2]=a[2].substring(3);a[1]="***"+a[1];} JAX.el.addClass(d,a[3]?"you":"them") if(!a[3]) JAX.el.removeClass($('im_'+a[0]),'offline') d.innerHTML=""+a[1]+" "+(!act?": ":"")+a[2] d.title=a[4] test=(sb.scrollTop==sb.scrollHeight-sb.clientHeight) sb.appendChild(d) if(test) sb.scrollTop=sb.scrollHeight JAX.sfx(d).dehighlight().play() JAX.gracefulDegrade(d) if(!win&&globalsettings.sound_im) Sound.play("imbeep") } }, imtoggleoffline:function(a){ JAX.el.addClass($('im_'+a),'offline') }, window:function(a){ a=a[0] if(a.id&&document.getElementById(a.id)) return; var win=new JAX.window win.title=a.title win.content=a.content win.minimizable=a.minimizable||0 win.useoverlay=a.useoverlay||0 win.animate=a.animate!==undefined?a.animate:true win.resize=a.resize||false win.className=a.className||"" if(a.onclose) win.onclose=eval(a.onclose) if(a.pos) win.pos=a.pos win=win.create() win.id=a.id||"" JAX.gracefulDegrade(win) }, openbuddylist:function(a){ a=a[0] var buddylist=$('buddylist'),win if(!buddylist) { win=new JAX.window win.id='buddylist' win.content=a.content win.title=a.title win.pos="tr 20 20" win.animate=0 win.wait=false win.onclose=function(){document.cookie='buddylist=0';} win.resize=".content" win=win.create() } else { $$(".content",buddylist).innerHTML=a.content } }, closewindow:function(a){ a=$$(a[0]) JAX.window.close(a) }, onlinelist:function(a){ var html="",tmp,link,statusers=$('statusers'),newlink if(!statusers) return for(x=0;x"+file.name+"
";d.appendChild(f);file.upload("/index.php?act=post&uploadflash=1&sessid="+document.cookie.match('sid=([^;]+)')[1]);} u[1].error=function(error,shit){var w=new JAX.window;w.title="error";w.content=shit;w.create();} u[1].progress=function(file,b,c){$('progress_'+this.id+'_'+file.id).style.width=Math.round(b/c*100)+"%";} u[1].response=function(response){$('pdedit').editor.cmd("inserthtml","[attachment]"+response+"[/attachment]");} } } if(useJSLinks&&document.location.toString().indexOf('?')>0) document.location="./#"+document.location.search.substr(1); if(Sound) { Sound.load("sbblip","Sounds/blip.mp3",false); Sound.load("imbeep","Sounds/receive.mp3",false); Sound.load("imnewwindow","Sounds/receive.mp3",false); } document.cookie="buddylist=0" } $(function(){RUN=new RUNF}) $(Sound.addFlash) $(function(){window.loaded=true;window.name=Math.random();window.onfocus=RUN.setWindowActive;window.onfocus();})