User:Leopard~enwiki/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/* Open a Wiktionary window on double click
document.ondblclick = wiktionary;

function wiktionary()
{
  if ( document.all && navigator.userAgent.indexOf('Opera') == -1 ) {
    var rng = document.selection.createRange();
    var q = new String(rng.text);
  } else { 
    var q = document.getSelection();
  }

  if (q.length > 0) { 
    var q = encodeURI(q);
    var w = window.open("http://bg.wiktionary.org/wiki/" + q, "w",  
               "width=700,height=600,menubar,menubar,resizable,scrollbars,status");
    w.focus();
  }
}
*/