Re: [DQSD-Users] "df" for word definitions (take 2)

2009-05-02 Thread David Blume
Thanks, Kim,

For anybody who's interested, there's a screenshot of the new search in
action here:

http://dblume.livejournal.com/126591.html

I won't take offense if anybody takes ownership of it and improves it.  :)

--David

On Sat, May 2, 2009 at 1:02 PM, Kim Gräsman  wrote:

> Thanks David!
>
> Committed, and will be part of the next release.
>
> - Kim
>
> On Sat, May 2, 2009 at 06:58, David Blume  wrote:
> > Sorry, all.  I'd left an alert() in there, had the dictionaries in the
> wrong
> > order, and didn't know that there was formatting whitespace hidden in the
> > XML response.  Here's a second cut of the file that takes those points
> into
> > account.
> >
> > --David
> >
> >
> --
> > Register Now & Save for Velocity, the Web Performance & Operations
> > Conference from O'Reilly Media. Velocity features a full day of
> > expert-led, hands-on workshops and two days of sessions from industry
> > leaders in dedicated Performance & Operations tracks. Use code vel09scf
> > and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> > ___
> > To unsubscribe visit:
> > https://lists.sourceforge.net/lists/listinfo/dqsd-users
> > DQSD-Users@lists.sourceforge.net
> > http://sourceforge.net/mailarchive/forum.php?forum_id=8601
> >
> >
>
>
> --
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> ___
> To unsubscribe visit:
> https://lists.sourceforge.net/lists/listinfo/dqsd-users
> DQSD-Users@lists.sourceforge.net
> http://sourceforge.net/mailarchive/forum.php?forum_id=8601
>
--
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf___
To unsubscribe visit:
https://lists.sourceforge.net/lists/listinfo/dqsd-users
DQSD-Users@lists.sourceforge.net
http://sourceforge.net/mailarchive/forum.php?forum_id=8601


Re: [DQSD-Users] "df" for word definitions (take 2)

2009-05-02 Thread Kim Gräsman
Thanks David!

Committed, and will be part of the next release.

- Kim

On Sat, May 2, 2009 at 06:58, David Blume  wrote:
> Sorry, all.  I'd left an alert() in there, had the dictionaries in the wrong
> order, and didn't know that there was formatting whitespace hidden in the
> XML response.  Here's a second cut of the file that takes those points into
> account.
>
> --David
>
> --
> Register Now & Save for Velocity, the Web Performance & Operations
> Conference from O'Reilly Media. Velocity features a full day of
> expert-led, hands-on workshops and two days of sessions from industry
> leaders in dedicated Performance & Operations tracks. Use code vel09scf
> and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
> ___
> To unsubscribe visit:
> https://lists.sourceforge.net/lists/listinfo/dqsd-users
> DQSD-Users@lists.sourceforge.net
> http://sourceforge.net/mailarchive/forum.php?forum_id=8601
>
>

--
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
___
To unsubscribe visit:
https://lists.sourceforge.net/lists/listinfo/dqsd-users
DQSD-Users@lists.sourceforge.net
http://sourceforge.net/mailarchive/forum.php?forum_id=8601


[DQSD-Users] "df" for word definitions (take 2)

2009-05-01 Thread David Blume
Sorry, all.  I'd left an alert() in there, had the dictionaries in the wrong
order, and didn't know that there was formatting whitespace hidden in the
XML response.  Here's a second cut of the file that takes those points into
account.

--David

  DictService from Aonaware
  
Search for word definitions.  Recommended it is used with ":|df" in localaliases.txt, so that "word:" brings up its definition.
Switches:
Examples:

  df idempotent
  idempotent:

  
  ReferenceLanguage
  http://www.aonaware.com/services.htm
  
  http://services.aonaware.com";
method="post">


  
  
  
   http://services.aonaware.com/DictService/DictService.asmx/DefineInDict?dictId="; + dicts[d] + "&word=" + q, false);
  xmlHttp.send();  
  var xmlDoc = xmlHttp.responseXML.documentElement;
  definitions = xmlDoc.getElementsByTagName("WordDefinition")  
  if( definitions.length > 0 )
break;
}
  }
  catch ( e )
  {
alert( "Exception thrown: " + e.description );
return;
  }
  
  var windowW = 440;

  if ( definitions.length > 0 ) {
  var html = "";
  for( var i=0; i < definitions.length; i++ ) {
html += '

' + q + '

'; var body = definitions[i].text.replace( /[\r\n]/gi, "
" ); body = body.replace( / /gi, "  " ); html += '

' + body + '

'; } } else { var html = '
' + q + ' not found

'; } if ( typeof dictPopup == 'undefined' ) dictPopup = window.createPopup(); var dictPopupBody = dictPopup.document.body; // Let's concat on a local variable first for easier debugging - let's also copy over a couple of styles from linked "entry.css" var dictPopupBodyInnerHTML = '
' + html + "
"; // This assignment will reformat the HTML extensively dictPopupBody.innerHTML = dictPopupBodyInnerHTML; dictPopup.document.body.style.border="outset 2px"; dictPopup.document.body.style.padding="1px 1px; background: navy"; dictPopup.document.body.style.background='menu'; dictPopup.document.body.style.overflowY='auto'; dictPopup.document.body.style.fontFamily='Verdana'; dictPopup.document.body.attachEvent('onmouseup',dfCopySelection); // Temporarily show the popup to determine the proper final height for the popup. dictPopup.show(0, 0, windowW, 0); var windowH = dictPopupBody.scrollHeight + 6; dictPopup.hide(); dictPopup.document.all.dfTable.style.width = windowW - 5; windowH = windowH > window.screen.height/2 ? window.screen.height/2 : windowH; dictPopup_x = (buttonalign == "left" ? 0 : document.body.clientWidth - windowW); dictPopup_y = -windowH; dictPopup_width = windowW; dictPopup_height = windowH; if ( typeof dictPopup_ring == 'undefined' ) dictPopup_ring = new Array(); dictPopup_ring.push( { x:dictPopup_x, y:dictPopup_y, width:dictPopup_width, height:dictPopup_height, html:dictPopupBody.innerHTML } ); dictPopup_sp = dictPopup_ring.length - 1; dictPopup.show(dictPopup_x, dictPopup_y, dictPopup_width, dictPopup_height, document.body); } function dfCopySelection() { dictPopup.document.execCommand( "Copy" ); dictPopup.document.selection.empty(); } function dfGoToWord(w) { if ( dictPopup.document.selection.type == "Text" ) { dfCopySelection(); } else { df(w); } } ]]> Copyright (c) 2009 David Blume Distributed under the terms of the GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt) -- Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/