Skip to content

Instantly share code, notes, and snippets.

@brito
Created February 9, 2011 03:40
Show Gist options
  • Save brito/817840 to your computer and use it in GitHub Desktop.
Save brito/817840 to your computer and use it in GitHub Desktop.
function message(){
return (({
close: function(){
for (var e, i=arguments.length;i;)
if (e = document.getElementById('gravity_magellan_' + arguments[--i]))
try{ document.body.removeChild(e) }catch(e){}
},
next: function(){
debugger;
if (document.createEventObject){
element.fireEvent('onClick',document.createEventObject());
}
else {
var evt=document.createEvent("HTMLEvents");
evt.initEvent('click',true,true);
element.dispatchEvent(evt);
}
return false;
}
})[this]||function(){ return false }).apply({}, arguments);
}
setInterval(function(){
var f = arguments.callee,
h = document.location.hash,
m = h.match(/^#(\w+):([\w,]+)$/)||[],
k = m[1],
a = m[2];
if (f.hash != h && k) {
f.hash = h;
if (message.apply(k, a.split(',')) !== false)
document.location.hash = '';
}
}, 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment