All pastes #1886998 Raw Edit

nabber

public javascript v1 · immutable
#1886998 ·published 2010-06-20 12:20 UTC
rendered paste body
w=window.innerWidth-15+'px';e=encodeURIComponent;d=document.documentElement;f=function(q){ k=e(q.replace(/^([^\s]+)\s.*/,"$1")).toLowerCase(); p=e(q.replace(/^[^\s]+\s(.*)/,"$1")); if(k=='help'){  d.innerHTML='<head\/><body><style type="text\/css">div{width:'+w+';word-wrap:break-word;}i{color:#aaa;padding:0 0.5em 0;}<\/style>';  d.innerHTML+='<h3>Available Shortcuts:<\/h3><div>';  for(i in s) d.innerHTML+=i+': '+s[i][0]+'<br\/><i>'+s[i][1]+'<\/i><br\/>';  d.innerHTML+='<br\/><h3>Query:<\/h3><input id="fd" size="16"\/><input type="button" value="Enter" onclick="f(document.getElementById(\'fd\').value);"\/><\/div><\/body>'; }else for(i in s)  if(i==k) location.href=s[i][1].replace(/%s/,p);   alert('Cannot recognize shortcut. Typo?'); };q=prompt("Enter 'help' for available shortcuts"); if(q)f(q);