MediaWiki

MediaWiki:Vani suggest.js

Revision as of 13:11, 8 April 2008 by Acyuta (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
// This Jquery code is used to give suggestions in the search box for words with diacritics.
// It uses jquery.autocomplete and all its dependencies to fetch suggestions from a php script in the server
// and show it in a suggest box as the visitor types.

document.write('<script type="text/javascript" src="'
 + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.bgiframe.min.js"></' + 'script>');
document.write('<script type="text/javascript" src="'
 + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.dimensions.js"></' + 'script>');
document.write('<script type="text/javascript" src="'
 + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.autocomplete.js"></' + 'script>');
document.write('<script type="text/javascript" src="'
 + 'http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.ajaxQueue.js"></' + 'script>');
document.write('<link rel="stylesheet" type="text/css" href="http://vanipedia.org/w/index.php?title=MediaWiki:Jquery.autocomplete.css" />');

$('document').ready(function () {
	$("#searchInput").autocomplete("/dictionary.php", {
      scroll: true,
      autofill: false,
      selectFirst: false,
      chacheLength: 45,
      maxItemsToShow: 10,
      max: 20,
      minChars: 2,
    });
});