Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

KoL Wiki Search

Search the KoL Wiki one of two ways: 1) double-click on bold text; 2) shift-click on selected text.






Feb 29, 2008
Tom W.M. Script's author

Minor update: changed the inclusion rules slightly.

 
Feb 16, 2008
Tom W.M. Script's author

I've updated the script -- now you can shift-click on selected text to perform a search. There's also a hidden preference to switch between GM_openInTab and window.open -- visit this URL to set the preference.

 
Feb 16, 2008
Tom W.M. Script's author

That?s a good idea. I think that I?d rather do it in some other way, though?GM_registerMenuCommand has always seemed somewhat usability-challenged to me (plus, there?s speculation on greasemonkey-dev about someday removing it). I?ll look into doing this on alt-click or something similar.

 
Feb 16, 2008
Dani Church User

This is an excellent script! Here's an addition I made which makes it even more useful:

if (window.location.pathname == '/main.html') {
  GM_registerMenuCommand("KoL Wiki search from selection", function() {
    for (var f = 0; f < window.frames.length; f++) {
      if (!window.frames[f].getSelection().isCollapsed) {
        wikiLookup(window.frames[f].getSelection().toString());
        return;
      }
    }
    window.alert("Highlight text first!");
  });
  GM_registerMenuCommand("KoL Wiki search...", function() {
    var term = window.prompt("KoL Wiki search term:");
    if (term) {
      wikiLookup(term);
    }
  });
}

Note that I've taken the original GM_openInTab() call and exported the functionality to a function called wikiLookup(), so that all three calls do the same thing. And personally, in my installation I use window.open(), since that opens in a new tab (with my FF configuration) but also automatically focuses on the new tab.

You could comment on this script if you were logged in.