All pastes #1948614 Raw Edit

nabber

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