User:Visviva/monobook.js

Hello, you have come here looking for the meaning of the word User:Visviva/monobook.js. In DICTIOUS you will not only get to know all the dictionary meanings for the word User:Visviva/monobook.js, but we will also tell you about its etymology, its characteristics and you will know how to say User:Visviva/monobook.js in singular and plural. Everything you need to know about the word User:Visviva/monobook.js you have here. The definition of the word User:Visviva/monobook.js will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofUser:Visviva/monobook.js, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
/*</pre>
==Show/Hide citations button==
<pre>*/
function addCitesButton() {
   var hideButton = document.getElementById('cites-button');
   if ( hideButton === null ) return; 
   var Button     = document.createElement( 'span' );
   var ButtonLink = document.createElement( 'a' );
   var ButtonText = document.createTextNode( 'hide citations' );

   ButtonLink.setAttribute( 'id', 'hideButton' );
   ButtonLink.setAttribute( 'href', 'javascript:hideCitations();' );
   ButtonLink.setAttribute( 'title', 'hide citations' );
   ButtonLink.appendChild( ButtonText );

   Button.appendChild( document.createTextNode( '[' ) );
   Button.appendChild( ButtonLink );
   Button.appendChild( document.createTextNode( ']' ) );

   hideButton.appendChild( Button );
}

function hideCitations() {
// function addCSSRule(selector,cssText) is in ]
 mw.util.addCSS('ol ul{list-style:none; display:none;}');
 var hideButtonLink = document.getElementById('hideButton');
 hideButtonLink.innerHTML = 'show citations';
 hideButtonLink.title='show citations';
 hideButtonLink.href='javascript:showCitations();';

}

function showCitations() {
 mw.util.addCSS('ol ul{list-style:square; display:inline;}');
 var hideButtonLink = document.getElementById('hideButton');
 hideButtonLink.innerHTML = 'hide citations';
 hideButtonLink.title='hide citations';
 hideButtonLink.href='javascript:hideCitations();';

}

/*</pre>
==Jump functionality (experimental)==
<pre>*/

//Associates jump span id with parent line
//Allows whole line to be highlighted, prevents cutoff at top of screen.

function moveJump() {
 var allLines = document.getElementsByTagName("li");
 for (var i = 0; i < allLines.length; i++) {
    var currentLine=allLines;
    var allNotes = allLines.getElementsByTagName("span");
    var allDeflists = allLines.getElementsByTagName("dl");
    for (var j=0; j < allNotes.length; j++) {
       if (allNotes.className == "jump-target" || allNotes.className == "jump-target-section") {
           var noteInLine = allNotes;
           currentLine.id = noteInLine.id;
           noteInLine.id="";
       } 
    }
 }
}

//Opens target translation table
//Called by onclick handler in superscript "transl." link
//Needs to be rewritten to always open (not just toggle) target bar.

function toggleNavigationBarRemote() {
    var counter=this.className*1;
    toggleNavigationBar(counter);
}

//Sets up onclick functionality for links to translation tables.

function openBoxes() {
  var allSups = document.getElementsByTagName("sup");
  var y = allSups.length;
  var z = 0;
  allTrans = new Array();
  for (var x=y-1; x > 0; x--) {
      if (allSups.title && allSups.title == "translations") {
          z++;
          allTrans.length=z;
          allTrans=allSups;
          allTrans.title=x;
      } 
  }
  var allDivs = document.getElementsByTagName("div");
  var indexNav=0;
  for (var j=0; j < allDivs.length; j++) {
       if (allDivs.className == "NavHead") {
           indexNav++; 
           var spansInNav=allDivs.getElementsByTagName("span");
           var currentNavGloss='';
           for (var q=0; q < spansInNav.length; q++) {
               if ( spansInNav.className == 'jump-target-section' ) {
                   currentNavGloss = spansInNav.id.substr(13);
                   break;
               }
           }
           for (var p=0; p < allTrans.length; p++) {
               var r=1*allTrans.title;
               if (isNaN(r)) {
                   continue;
               }
               var currentLink=allSups.getElementsByTagName("a");
               var currentLinkGloss=currentLink.href.substr(document.URL.length+14);
               if ( currentLinkGloss == currentNavGloss) {
                   allSups.addEventListener("click", toggleNavigationBarRemote, false);
                   allSups.className=indexNav;
               }
           }
        }
    }
}

/*</pre>
==Preload text==
<pre>*/

importScript('MediaWiki:Edit.js');

/*</pre>

==Hooks==

<pre>*/

$( addCitesButton );
$( moveJump );
$( openBoxes );