Webspace wormhole

  1. Introduction
  2. Tags
  3. Usage
  4. Disclaimer
  5. How it works
  6. author

Introduction

The webspace wormhole is a way of publishing items through webspace.

Unlike a 'real' wormhole, the webspace wormhole can have multiple entry points and exit points. One for sending content and another for receiving. When embedded on your page it is as easy to use as drag and drop.

Once rendered, the wormhole spews out the last piece of content it received from an entry point, after that, when any new content is put into an entry point, it pops out of the exit point.

See the demo here

Tags

Tags are what binds the wormholes in the core of webspace. There can be any number of entry points for a tag and any number of exit points.

Usage

For webholes that send content.

(the one you may drag images to)

When this is embedded all images on your page become draggable.

<script type="text/javascript" src="http://www.kennethhn.dk/webhole/whbundle.js?id=wh_entry&tag=science&type=entry"></script>
<div id="wh_entry"></div>

For webholes that receive content.

This defaults to pushing content anywhere on your screen or browser page.

<script type="text/javascript" src="http://www.kennethhn.dk/webhole/whbundle.js?id=wh_exit&tag=science&type=exit"></script>
<div id="wh_exit"></div>

Change the value of parameter 'tag' to connect to something else. F.ex. if you want to use it for yourself, a tag could be 'kennethholmnielsensprivatetag'. You have no guarantee however, that nobody else will use this tag.

If you want more than one webhole on your page, you have to do something a little more elaborate. You have to manually add the code for each WebHoleEntry or WebHoleExit, you can have as many of each as you want. It is not that complicated. All webholes will be instantiated on window load, which means you place the divs in any order on the page, but the scripts must be loaded in the order presented below. The example here shows you how to have both an entry and an exit on the same page.

<script type="text/javascript" src="http://www.kennethhn.dk/js/prototype.js"></script>
<script type="text/javascript" src="http://www.kennethhn.dk/js/scriptaculous.js?load=effects,dragdrop"></script>
<script type="text/javascript" src="http://www.kennethhn.dk/webhole/wh.js"></script>
<div id="wh_entry"></div>
<div id="wh_exit"></div>
<script type="text/javascript">
Event.observe(window,'load',function(){
    var whEntry = new WebHoleEntry('wh_entry','science');
    var whExit = new WebHoleExit('wh_exit','science');
    whEntry.activate();
    whExit.activate();
});
</script>

It has been tested in IE 7 and Firefox 2

Disclaimer

The author of the Webspace wormhole cannot be held accountable for any content distributed this way.

The user of it should know that any tags used can by coincidence be seen by any other person.

The service only saves the links for the content and as such, cannot be held responsible for the content.

How it works

The wormhole polls a serverside php script that checks the database for the last published content for the tag. The result of the call is a javascript that is embedded onto the page, this is a way of doing cross site scripting (xss).

The wormhole entry also calls a serverside php script that updates the database with the url to the image. This way it is always only the last submitted content that is saved. For a more technical and detailed description of the widget, read the blogpost.

Effects and drag&drop are provided by scriptaculous, utilities are provided by the prototype library.

Kenneth Nielsen