User:TheDaveRoss/searchFocus.js

Hello, you have come here looking for the meaning of the word User:TheDaveRoss/searchFocus.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:TheDaveRoss/searchFocus.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:TheDaveRoss/searchFocus.js in singular and plural. Everything you need to know about the word User:TheDaveRoss/searchFocus.js you have here. The definition of the word User:TheDaveRoss/searchFocus.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:TheDaveRoss/searchFocus.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
// Suchfeldfokus - from de.wikt, focuses search box on most non-edit pages

url = document.URL;
 var doFocus;
 var exFocus;
 var gotFocus;
 var doNotFocus;
 if (!doNotFocus && mw.config.get('wgAction') != "edit" && mw.config.get('wgAction') != "submit" && !(mw.config.get('wgNamespaceNumber') < 0 && mw.config.get('wgCanonicalSpecialPageName').match(/^eset|^ass|^serogin|^ogin/))) {
  var actionKey;
  $(document).ready(function() {
   doFocus = 1;
  });
  document.onmousedown = function() {gotFocus = 1;};
  document.onkeydown = function(kEvent) {
   if (doFocus && !gotFocus) {
    if (!kEvent) {kEvent = window.event;}
    if ((!actionKey && (kEvent.which == 16 || (kEvent.which > 40 && kEvent.which < 112) || (!kEvent.which && (!kEvent.keyCode || kEvent.keyCode > 40))) || kEvent.keyCode == 16) || (actionKey && (kEvent.which == 86 || kEvent.keyCode == 86 || kEvent.keyCode == 118))) {
     gotFocus = 1;
     if (exFocus || url.indexOf("#") > 0 || mw.config.get('skin') != "monobook") {focusSearch();}
    } else if ((kEvent.which > 32 && kEvent.which < 41) || (kEvent.keyCode > 32 && kEvent.keyCode < 41)) {
     exFocus = 1;
     focusSearch(8);
    } else if (kEvent.which == 17 || kEvent.which == 18 || kEvent.keyCode == 17 || kEvent.keyCode == 18) {
     actionKey = 1;
    } else if (kEvent.which == 9 || kEvent.keyCode == 9) {
     gotFocus = 1;
    }
   }
  };
 }
 function focusSearch(x) {
  if (document.getElementById("searchText") && url.indexOf("&fulltext=") > 0) {
   if (x) {
    document.getElementById("searchText").blur();
   } else {
    document.getElementById("searchText").focus();
    document.getElementById("searchText").select();
   }
  } else {
   if (x) {
    document.getElementById("searchInput").blur();
   } else {
    document.getElementById("searchInput").focus();
    document.getElementById("searchInput").select();
   }
  }
 }