All pastes #1885056 Raw Edit

nabber

public javascript v1 · immutable
#1885056 ·published 2010-06-17 13:49 UTC
rendered paste body
w=window.innerWidth-15+'px';e=encodeURIComponent;d=document;f=function(q){ k=e(q.replace(/^([^\s]+)\s.*/,"$1")).toLowerCase(); p=e(q.replace(/^[^\s]+\s(.*)/,"$1")); if(k=='help'){  m='javascript:f(document.getElementById("fd").value)';  d.write("<html><head><style type='text\/css'>div{width:"+w+";word-wrap:break-word;}i{color:#aaa;padding:0 0.5em 0;}<\/style><title>Shortcuts help<\/title><\/head><body><h3>Available Shortcuts:<\/h3><div>");  for(i in s) d.write(i+": "+s[i][0]+"<br\/><i>"+s[i][1]+"<\/i><br\/>");  d.write("<br\/><b>Query:<\/b><input id=fd name=y size=16\/><input name=b type=submit value='Enter' onclick='"+m+"'\/><\/div><\/body><\/html>"); d.close(); }else  for(i in s)   if(i==k) location.href=s[i][1].replace(/%s/,p);}q=prompt("Enter 'help' for available shortcuts"); if(q)f(q);