Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sleep(millis){var njf1=njen(this,arguments,"millis");nj:while(1){switch(njf1.cp){case 0:
  2. njf1._notifier=new EventNotifier();
  3. setTimeout(njf1._notifier,njf1._millis);njf1.pc(1,
  4. njf1._notifier,"wait",[]);case 1:with(njf1)if((rv1=f.apply(c,a))==NJSUS){return fh;}break nj;}}}
  5.  
  6.  
  7. function animate(element,property,endValue,duration,frequency){var njf1=njen(this,arguments,"element","property","endValue","duration","frequency");nj:while(1){switch(njf1.cp){case 0:
  8.  
  9. njf1._frameCount=Math.ceil(njf1._duration/njf1._frequency);
  10. njf1._startValue=parseInt(njf1._element.style[njf1._property],10);
  11. njf1._distance=njf1._endValue-njf1._startValue;
  12. njf1._jumpSize=Math.ceil(njf1._distance/njf1._frameCount);
  13.  
  14.  
  15. njf1._i=0;case 2:njf1.cp=(njf1._i<njf1._frameCount-1)?3:4;break;case 3:
  16. njf1._nextValue=njf1._startValue+(njf1._jumpSize*njf1._i);
  17. njf1._element.style[njf1._property]=njf1._nextValue+"px";njf1.pc(5,null,
  18.  
  19.  
  20. sleep,[njf1._frequency]);case 5:with(njf1)if((rv5=f.apply(c,a))==NJSUS){return fh;}case 1:njf1._i++;njf1.cp=2;break;case 4:
  21.  
  22.  
  23. njf1._element.style[njf1._property]=njf1._endValue+"px";break nj;}}}
  24.  
  25.  
  26. function waitForClick(element){var njf1=njen(this,arguments,"element");nj:while(1){switch(njf1.cp){case 0:
  27. njf1._notifier=new EventNotifier();
  28. njf1._element.onclick=njf1._notifier;njf1.pc(1,
  29. njf1._notifier,"wait",[]);case 1:with(njf1)if((rv1=f.apply(c,a))==NJSUS){return fh;}break nj;}}}
  30.  
  31.  
  32. function run(){var njf1=njen(this,arguments);nj:while(1){switch(njf1.cp){case 0:
  33. njf1._theButton=document.getElementById("theButton");case 1:
  34. njf1.cp=(true)?2:3;break;case 2:
  35. njf1._theButton.innerHTML="go right";njf1.pc(4,null,
  36.  
  37.  
  38. waitForClick,[njf1._theButton]);case 4:with(njf1)if((rv4=f.apply(c,a))==NJSUS){return fh;}
  39. njf1._theButton.innerHTML="-->";njf1.pc(5,null,
  40. animate,[njf1._theButton,"left",200,1000,20]);case 5:with(njf1)if((rv5=f.apply(c,a))==NJSUS){return fh;}
  41.  
  42. njf1._theButton.innerHTML="go left";njf1.pc(6,null,
  43.  
  44.  
  45. waitForClick,[njf1._theButton]);case 6:with(njf1)if((rv6=f.apply(c,a))==NJSUS){return fh;}
  46. njf1._theButton.innerHTML="<--";njf1.pc(7,null,
  47. animate,[njf1._theButton,"left",0,1000,20]);case 7:with(njf1)if((rv7=f.apply(c,a))==NJSUS){return fh;}njf1.cp=1;break;case 3:break nj;}}}
  48.  
  49.  
  50. spawn(run());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement