Re: [DQSD-Users] mwd /p stopped working?

2007-10-13 Thread David Blume
Sorry, Everybody,

My last reply to Shawn was premature.  Shawn's "mwd /popup" fix is a fine
interim fix.

The fact that the list of spelling suggestions didn't include correct links
is not a new problem.  What's more important is that support for multiple
entries for a word is broken. (Eg., "mwd /popup register" vs. "mwd
register")

mwd.xml needs some TLC.  I don't actually know any javascript, but I'm
willing to give it a look when I free up in a couple of weeks.

--David

On 10/13/07, Shawn K. Hall <[EMAIL PROTECTED]> wrote:
>
>
> > Anybody else notice that searching m-w.com with "mwd /p %s"
> > (popup) stopped working correctly today?  Please let me know
> > if there's a fix to mwd.xml I can use.
>
> I've attached a fixed version. I don't actually use this search, so let
> me know if it's insufficient.
>
> -Shawn
>
>
>
>
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/___
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] mwd /p stopped working?

2007-10-13 Thread David Blume
Wow!  Thanks so much for the quick reply.  It works well, with a minor
exception.  (It doesn't handle misspellings correctly.  Links in the popup
are not links in that case.)  For example, try "mwd /p missspell"  Still,
I'm delighted to have the popup back.

It's a feature I love so much I once blogged about it.  There's an image of
the old popup window there, too:  http://dblume.livejournal.com/65402.html

Thanks again,
--David

BTW, I now see that the version of mwd.xml I had was

On 10/13/07, Shawn K. Hall <[EMAIL PROTECTED]> wrote:
>
> Hi David,
>
> > Anybody else notice that searching m-w.com with "mwd /p %s"
> > (popup) stopped working correctly today?  Please let me know
> > if there's a fix to mwd.xml I can use.
>
> I've attached a fixed version. I don't actually use this search, so let
> me know if it's insufficient.
>
> -Shawn
>
> -
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> ___
> 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
>
>
>
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/___
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] mwd /p stopped working?

2007-10-13 Thread Shawn K. Hall
Hi David,

> Anybody else notice that searching m-w.com with "mwd /p %s" 
> (popup) stopped working correctly today?  Please let me know 
> if there's a fix to mwd.xml I can use.

I've attached a fixed version. I don't actually use this search, so let
me know if it's insufficient.

-Shawn

  Merriam-Webster Dictionary
  
Search for word definitions.
Switches:

  /popup - Display in popup window instead of regular browser window

Examples:

  mwd idempotent
  mwd /p idempotent

  
  ReferenceLanguage
  http://www.m-w.com/
  
  http://www.m-w.com/cgi-bin/dictionary";
method="post">


  
  
   0) || (mwdDisplayInPopup != 0) )
  {
mwdx(args.q) // Display in popup window
  }
  else
  {
if( nullArgs("mwd",q) )
  return false;

document.mwdf.va.value = args.q;
submitForm(mwdf); // Display in regular browser window
  }
}

function mwdx(q)
{
  var extraArgDelim = '\1';
  var listOption = false;
  var p = q.search( extraArgDelim );
  if ( p >= 0 )
  {
postArgs = unescape( q.substr( p + 1 ) );
listOption = true;
q = q.substr( 0, p );
  }

  try
  {
var xmlHttp = new ActiveXObject("Microsoft.XmlHttp");
if ( listOption )
{
  xmlHttp.open("POST", "http://www.m-w.com/cgi-bin/dictionary";, false);
  xmlHttp.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" );
  xmlHttp.send( postArgs );
}
else
{
  xmlHttp.open("GET", "http://www.m-w.com/dictionary/"; + q, false);
  xmlHttp.send();
}
  }
  catch ( e )
  {
alert( e.description );
return;
  }
  
  if ( q == '' )
  {
if ( typeof dictPopup != 'undefined' && dictPopup_ring.length > 0 )
{
  if ( --dictPopup_sp < 0 )
dictPopup_sp = dictPopup_ring.length - 1;

  var prev = dictPopup_ring[ dictPopup_sp ];
  dictPopup.document.body.innerHTML = prev.html;
  dictPopup.show(prev.x, prev.y, prev.width, prev.height, dictPopup.document.body);
}
else
{
  nullArgs("mwd",q)
}
return;
  }

  var windowW = 500;

  var sBody = xmlHttp.responseText.replace( /[\r\n]/gi, "" );
  var re = /((.+)<\/div><\/div>)/mig;
  var results = re.exec( sBody );
  if ( results != null )
  {
var optionHtml = '';
var entriesFound = parseInt( results[ 2 ], 10 );
if ( isNaN( entriesFound ) )
  entriesFound = 1;

var html = results[ 1 ].replace( /(src="\/)/gi, "src=\"http://www.m-w.com/"; ).replace( /(href="\/)/gi, "href=\"http://www.m-w.com/"; );
var html = html.replace( //gi, "
"); var html = html.replace( //gi, "

"); var html = html.replace( /javascript\:popWin\(\'/gi, "http://www.m-w.com/";); var html = html.replace( /\'\)"\sclass="audio"/gi, "\""); if ( entriesFound == 1 ) html = html.replace( /(Main Entry:)/, '

$1' ); else { html = html.replace( /(Main Entry:)/, '
$1' ); var options = /(/.exec( html ); if ( options != null ) { var allFormVars = html.replace( /.*' ); optionHtml += '
    '; for ( var i = 0; i < options.length; i++ ) if ( options[ i ] != "" ) { var words = /([^[]+)(.*)/.exec( options[ i ] ); var formVars = 'hdwd=' + options[ i ] + '&' + allFormVars; optionHtml += '
  • ' + options[ i ] + '
  • '; } optionHtml += '
'; } html = html.replace( /(To select an entry, click on it\..*)
\./gi,

[DQSD-Users] mwd /p stopped working?

2007-10-13 Thread David Blume
Anybody else notice that searching m-w.com with "mwd /p %s" (popup) stopped
working correctly today?  Please let me know if there's a fix to mwd.xml I
can use.

Thanks!
--David

BTW, I think that aliases.txt should contain ":|mwd /p %s" by default.  The
":" suffix is my favorite search.
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/___
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