Return to Unfiction unforum
 a.r.g.b.b 
FAQ FAQ   Search Search 
 
Welcome!
New users, PLEASE read these forum guidelines. New posters, SEARCH before posting and read these rules before posting your killer new campaign. New players may also wish to peruse the ARG Player Tutorial.

All users must abide by the Terms of Service.
Website Restoration Project
This archiving project is a collaboration between Unfiction and Sean Stacey (SpaceBass), Brian Enigma (BrianEnigma), and Laura E. Hall (lehall) with
the Center for Immersive Arts.
Announcements
This is a static snapshot of the
Unfiction forums, as of
July 23, 2017.
This site is intended as an archive to chronicle the history of Alternate Reality Games.
 
The time now is Wed Nov 13, 2024 1:10 am
All times are UTC - 4 (DST in action)
View posts in this forum since last visit
View unanswered posts in this forum
Calendar
 Forum index » Meta » Online Tools
Bookmarklets for ARGs
Moderators: imbri
View previous topicView next topic
Page 1 of 1 [1 Post]  
Author Message
jchillerup
Decorated


Joined: 27 Dec 2003
Posts: 198
Location: Copenhagen, Denmark

Bookmarklets for ARGs

For now, I have only one.

Add the entire code block to a bookmark. Call it ROT13 or whatever you want to. Select some text on a page, click the bookmark, and wooo!

ROT13:
Code:
javascript:var coding = %22abcdefghijklmnopqrstuvwxyzabcdefghijklmABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM%22; function rot13(t) { for (var r = %22%22,i=0;i<t.length;i++) { character = t.charAt(i); position = coding.indexOf(character); if (position > -1) character = coding.charAt(position + 13); r += character; } return r; } S=window.getSelection(); function t(N) { return N.nodeType == N.TEXT_NODE; } function r(N) { if (t(N)) N.data = rot13(N.data); } for (j=0;j<S.rangeCount;++j) { var g=S.getRangeAt(j), e=g.startContainer, f=g.endContainer, E=g.startOffset, F=g.endOffset, m=(e==f); if(!m||!t(e)) { /* rot13 each text node between e and f, not including e and f. */ q=document.createTreeWalker(g.commonAncestorContainer, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, null, false); q.currentNode=e; for(N=q.nextNode(); N && N != f; N = q.nextNode()) r(N); } if (t(f)) f.splitText(F); if (!m) r(f); if (t(e)) { r(k=e.splitText(E)); if(m)f=k; e=k;} if (t(f)) g.setEnd(f,f.data.length); } void 0


A Flash seeking bar (for seeing small details in flash documents):
Code:
javascript:(function(){setTimeout(initFlashControls,100);function initFlashControls(){var count=0;function tt(elem){if(typeof elem.TotalFrames!=%22undefined%22){addFlashControls(elem);++count;}}var i,x;for(i=0;x=document.getElementsByTagName(%22object%22)[i];++i)tt(x);for(i=0;x=document.getElementsByTagName(%22embed%22)[i];++i)tt(x);if(!count)alert(%22No scriptable flash on this page.%22);}function addFlashControls(flash){var controlsDiv=document.createElement(%22div%22);var where=flash;while(where.parentNode.tagName.toLowerCase()==%22object%22)where=where.parentNode;where.parentNode.insertBefore(controlsDiv,where.nextSibling);var table=document.createElement(%22table%22);controlsDiv.appendChild(table);var row=table.insertRow(-1);var pauseButton=document.createElement(%22button%22);pauseButton.appendChild(document.createTextNode(%22Pause%22));var buttonCell=row.insertCell(-1);buttonCell.appendChild(pauseButton);var slider=row.insertCell(-1);slider.width=%22100%%22;var visibleSlider=document.createElement(%22div%22);visibleSlider.style.position=%22relative%22;visibleSlider.style.height=%2210px%22;visibleSlider.style.width=%22100%%22;visibleSlider.style.MozBorderRadius=%224px%22;visibleSlider.style.background=%22#aaa%22;slider.appendChild(visibleSlider);var thumb=document.createElement(%22div%22);thumb.style.position=%22absolute%22;thumb.style.height=%2220px%22;thumb.style.width=%2210px%22;thumb.style.top=%22-5px%22;thumb.style.MozBorderRadius=%224px%22;thumb.style.background=%22#666%22;visibleSlider.appendChild(thumb);var sliderWidth;var paused=false;var dragging=false;table.width=Math.max(parseInt(flash.width)||0,400);addEvent(pauseButton,%22click%22,pauseUnpause);addEvent(slider,%22mousedown%22,drag);addEvent(slider,%22drag%22,function(){return false;});window.setInterval(update,30);function pauseUnpause(){paused=!paused;pauseButton.style.borderStyle=paused?%22inset%22:%22%22;if(paused)flash.StopPlay();else flash.Play();}function update(){sliderWidth=parseInt(getWidth(slider)-getWidth(thumb));if(!paused&&!dragging)thumb.style.left=parseInt(flash.CurrentFrame()/totalFrames()*sliderWidth)+%22px%22;}function dragMousemove(e){var pageX=e.clientX+document.body.scrollLeft;var pos=bounds(0,pageX-getX(slider)-5,sliderWidth);var frame=bounds(1,Math.ceil(totalFrames()*pos/sliderWidth),totalFrames()-2);thumb.style.left=pos+%22px%22;flash.GotoFrame(frame);}function release(e){removeEvent(document,%22mousemove%22,dragMousemove);removeEvent(document,%22mouseup%22,release);if(!paused)flash.Play();dragging=false;}function drag(e){addEvent(document,%22mousemove%22,dragMousemove);addEvent(document,%22mouseup%22,release);dragging=true;dragMousemove(e);}function bounds(min,val,max){return Math.min(Math.max(min,val),max);}function totalFrames(){if(typeof flash.TotalFrames==%22number%22)return flash.TotalFrames;else if(typeof flash.TotalFrames==%22function%22)return flash.TotalFrames();else return 1;}function getWidth(elem){if(document.defaultView&&document.defaultView.getComputedStyle)return parseFloat(document.defaultView.getComputedStyle(elem,null).getPropertyValue(%22width%22));else return parseFloat(elem.offsetWidth);}function getX(elem){if(!elem)return 0;return(elem.offsetLeft)+getX(elem.offsetParent);}function addEvent(elem,eventName,fun){if(elem.addEventListener)elem.addEventListener(eventName,fun,false);else elem.attachEvent(%22on%22+eventName,fun);}function removeEvent(elem,eventName,fun){if(elem.addEventListener)elem.removeEventListener(eventName,fun,false);else elem.detachEvent(%22on%22+eventName,fun);}}})()


Admitted - I did not make these myself. I borrowed them from Another place, but I am working on a Vigenere cracker myself. Stay tuned.
_________________
...

PostPosted: Sun Dec 05, 2004 10:02 am
 View user's profile
 Back to top 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
View previous topicView next topic
 Forum index » Meta » Online Tools
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
You cannot post calendar events in this forum



Powered by phpBB © 2001, 2005 phpBB Group