Type in a command, or "ls dictionary" to search all commands for "dictionary", etc.
|
NAME qdef - Quick Definitions -- get a definition from ninjawords.com in a self-closing window. SYNOPSIS qdef [WORD] -t [OPTIONAL SECONDS] EXAMPLES qdef polysemy << pops open a window with the definition for "polysemy". It automatically closes in 10 seconds. qdef polysemy -t 20 << the same as before, but it waits 20 seconds before closing DESCRIPTION This command loads definitions from the excellent ninjawords.com. It automatically closes the definition window in 10 seconds. To change the length that the window is open, use the -t parameter. NOTES Your browser must be set to allow pop-ups from yubnub.org" The technique this command uses is a short javascript program with a setTimeout event. A YubNub echo command just loads the javascript onto a webpage. Here is the javascript: <script> def=window.open('http://www.ninjawords.com/%s'); /* opens the ninjawords page under the variable 'def' */ setTimeout("def.close()",${t=10}000); /* sets a timer to close 'def' using a default of 10 seconds (10,000 ms) */ history.go(-1); /* returns you to your original page */ </script> This technique could be easily used for any YubNub command that loads a window you only need to view briefly. AUTHOR Brian Armknecht b.a.