Razgovor o MedijaVikiju:Monobook.js - Wikipedia

# Razgovor o MedijaVikiju:Monobook.js

### From Wikipedia

Ako hocete "dinamic navigation" kao kod njemci, pisite ovaj teks.

// ============================================================

    // BEGIN Dynamic Navigation Bars (experimantal)

    // set up the words in your language
    var NavigationBarHide = '[ Mbylle ]';
    var NavigationBarShow = '[ Trego ]';

    // set up max count of Navigation Bars on page,
    // if there are more, all will be hidden
    // NavigationBarShowDefault = 0; // all bars will be hidden
    // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
    var NavigationBarShowDefault = 1;

    // shows and hides content and picture (if available) of navigation bars
    // Parameters:
    //     indexNavigationBar: the index of navigation bar to be toggled
    function toggleNavigationBar(indexNavigationBar)
    {
       var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
       var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);

       if (!NavFrame || !NavToggle) {
           return false;
       }

       // if shown now
       if (NavToggle.firstChild.data == NavigationBarHide) {
           for (
                   var NavChild = NavFrame.firstChild;
                   NavChild != null;
                   NavChild = NavChild.nextSibling
               ) {
               if (NavChild.className == 'NavPic') {
                   NavChild.style.display = 'none';
               }
               if (NavChild.className == 'NavContent') {
                   NavChild.style.display = 'none';
               }
           }
       NavToggle.firstChild.data = NavigationBarShow;

       // if hidden now
       } else if (NavToggle.firstChild.data == NavigationBarShow) {
           for (
                   var NavChild = NavFrame.firstChild;
                   NavChild != null;
                   NavChild = NavChild.nextSibling
               ) {
               if (NavChild.className == 'NavPic') {
                   NavChild.style.display = 'block';
               }
               if (NavChild.className == 'NavContent') {
                   NavChild.style.display = 'block';
               }
           }
       NavToggle.firstChild.data = NavigationBarHide;
       }
    }

to je bio za ovu stranu. Mozda vas treba jos neke promene kod: МеdijaViki:Monobook.css gledaj :MediaWiki talk:Monobook.css

## [izmijeni] Dynamic Navigation Bars

Dado, evo ti ovde kôd za Dynamic Navigaion Bars. Ubaci ga na kraj od МеdijaViki:Monobook.js i trebalo bi da funkcionise. Neko je vec prije gore stavio jedan slican kôd. Ovaj ovdje je malo opsirniji. --`Elmir` demicx 09:44, 7 april 2006 (CEST)

    // ============================================================
    // BEGIN Dynamic Navigation Bars (experimantal)

    // set up the words in your language
    var NavigationBarHide = ' Sakrij ';
    var NavigationBarShow = ' Otkrij ';

    // set up max count of Navigation Bars on page,
    // if there are more, all will be hidden
    // NavigationBarShowDefault = 0; // all bars will be hidden
    // NavigationBarShowDefault = 1; // on pages with more than 1 bar all bars will be hidden
    var NavigationBarShowDefault = 1;

    // shows and hides content and picture (if available) of navigation bars
    // Parameters:
    //     indexNavigationBar: the index of navigation bar to be toggled
    function toggleNavigationBar(indexNavigationBar)
    {
       var NavToggle = document.getElementById("NavToggle" + indexNavigationBar);
       var NavFrame = document.getElementById("NavFrame" + indexNavigationBar);

       if (!NavFrame || !NavToggle) {
           return false;
       }

       // if shown now
       if (NavToggle.firstChild.data == NavigationBarHide) {
           for (
                   var NavChild = NavFrame.firstChild;
                   NavChild != null;
                   NavChild = NavChild.nextSibling
               ) {
               if (NavChild.className == 'NavPic') {
                   NavChild.style.display = 'none';
               }
               if (NavChild.className == 'NavContent') {
                   NavChild.style.display = 'none';
               }
               if (NavChild.className == 'NavToggle') {
                   NavChild.firstChild.data = NavigationBarShow;
               }
           }
       // if hidden now
       } else if (NavToggle.firstChild.data == NavigationBarShow) {
           for (
                   var NavChild = NavFrame.firstChild;
                   NavChild != null;
                   NavChild = NavChild.nextSibling
               ) {
               if (NavChild.className == 'NavPic') {
                   NavChild.style.display = 'block';
               }
               if (NavChild.className == 'NavContent') {
                   NavChild.style.display = 'block';
               }
               if (NavChild.className == 'NavToggle') {
                   NavChild.firstChild.data = NavigationBarHide;
               }
           }
       }
    }
    // adds show/hide-button to navigation bars
    function createNavigationBarToggleButton()
    {
       var indexNavigationBar = 0;
       // iterate over all < div >-elements
       for(
               var i=0;
               NavFrame = document.getElementsByTagName("div")[i];
               i++
           ) {
           // if found a navigation bar
           if (NavFrame.className == "NavFrame") {

               indexNavigationBar++;
               var NavToggle = document.createElement("a");
               NavToggle.className = 'NavToggle';
               NavToggle.setAttribute('id', 'NavToggle' + indexNavigationBar);
               NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');

               var NavToggleText = document.createTextNode(NavigationBarHide);
               NavToggle.appendChild(NavToggleText);

               // add NavToggle-Button as first div-element
               // in < div class="NavFrame" >
               NavFrame.insertBefore(
                   NavToggle,
                   NavFrame.firstChild
               );
               NavFrame.setAttribute('id', 'NavFrame' + indexNavigationBar);
           }
       }
       // if more Navigation Bars found than Default: hide all
       if (NavigationBarShowDefault < indexNavigationBar) {
           for(
                   var i=1;
                   i<=indexNavigationBar;
                   i++
           ) {
               toggleNavigationBar(i);
           }
       }

    }

    /* prema njemačkoj */
    aOnloadFunctions[aOnloadFunctions.length] = createNavigationBarToggleButton;
    /* addLoadEvent(createNavigationBarToggleButton); */

    // END Dynamic Navigation Bars
    // ============================================================

## [izmijeni] Edittools

/* add menu for selecting subsets of secial characters */ /***** must match MediaWiki:Edittools *****/

function addCharSubsetMenu() {

     var specialchars = document.getElementById('specialchars');

     if (specialchars) {
       var menu = "<select id=\"charsetBox\" style=\"display:inline\" onkeyup=\"chooseCharSubset(selectedIndex)\" onChange=\"chooseCharSubset(selectedIndex)\">";
       menu += "<option>Standard</option>";
       menu += "<option>Wiki</option>";
       menu += "<option>AHD</option>";
       menu += "<option>DMG</option>";
       menu += "<option>IPA</option>";
       menu += "<option>Arapski</option>";
       menu += "<option>Bosanski</option>";
       menu += "<option>Češki</option>";
       menu += "<option>Ćirilica</option>";
       menu += "<option>Esperanto</option>";
       menu += "<option>Estonski</option>";
       menu += "<option>Francuski</option>";
       menu += "<option>Galicijski</option>";
       menu += "<option>Grčki</option>";
       menu += "<option>Havajski</option>";
       menu += "<option>Hrvatski</option>";
       menu += "<option>Islandski</option>";
       menu += "<option>Jidiš</option>";
       menu += "<option>Katalonski</option>";
       menu += "<option>Latinski</option>";
       menu += "<option>Letonski</option>";
       menu += "<option>Mađarski</option>";
       menu += "<option>Malteški</option>";
       menu += "<option>Pinjin</option>";
       menu += "<option>Poljski</option>";
       menu += "<option>Portugalski</option>";
       menu += "<option>Romanski</option>";
       menu += "<option>Rumunski</option>";
       menu += "<option>Skandinavski</option>";
       menu += "<option>Slovački</option>";
       menu += "<option>Srpski</option>";
       menu += "<option>Staroengleski</option>";
       menu += "<option>Španski</option>";
       menu += "<option>Talijanski</option>";
       menu += "<option>Turski</option>";
       menu += "<option>Vijetnamski</option>";
       menu += "</select>";
       specialchars.innerHTML = menu + specialchars.innerHTML;

       /* default subset - try to use a cookie some day */
       chooseCharSubset(0);
     }

}

/* select subsection of special characters */ function chooseCharSubset(s) {

     var l = document.getElementById('specialchars').getElementsByTagName('p');
     for (var i = 0; i < l.length ; i++) {
       l[i].style.display = i == s ? 'inline' : 'none';
       l[i].style.visibility = i == s ? 'visible' : 'hidden';
     }

}

addLoadEvent(addCharSubsetMenu);

//

/*

- /

Preuzeto sa: "http://bs.wikipedia.org../../../m/o/n/Razgovor_o_MedijaVikiju%7EMonobook.js_5f2b.html"

##### Views

- Poruka
- Razgovor
- Trenutna verzija

##### Pretraga