Fandom

Yeni Wiki

MedyaWikia:Monobook.js

67.057pages on
this wiki
Add New Page
Talk0 Share

/*

* Düzenleme Sayfası Özel İşaretler
*/

if (document.URL.indexOf("=edit") > 0 || document.URL.indexOf("=submit") > 0) {

 document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:Onlyifediting.js&action=raw&ctype=text/javascript&dontcountme=s"><\/script>');
}

/*

* addLoadEvent
*/

function addLoadEvent(func) {

 if (window.addEventListener) 
   window.addEventListener("load", func, false);
 else if (window.attachEvent) 
   window.attachEvent("onload", func);

}

/*

* addOnloadHook
*/

//use both names for it, for Wikipedia compatability (just in case)

function addOnloadHook(f) {

 addLoadEvent(f);

}

/*

* Dynamic Navigation Bars (experimental)
*/

// ============================================================ // BEGIN Dynamic Navigation Bars (experimental) // FIXME: currently only works for one nav bar on a page at a time

// set up the words in your language

var NavigationBarHide = 'gizle ▲';
var NavigationBarShow = 'göster ▼';

// 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;

//Honor the User Preferences if ( ( getCookie('WiktionaryUseJSPreferences') != 'true' ) || ( getCookie('WiktionaryPreferencesShowNav') != 'true' ) ) {

        NavigationBarShowDefault = 0;
   } else {
     if ( wgNamespaceNumber == 0 ) NavigationBarShowDefault = 999 ;

}

/*

* toggleNavigationBar
*/

// 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;
               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;
               NavChild = NavChild.nextSibling
           ) {
           if (NavChild.className == 'NavPic') {
               NavChild.style.display = 'block';
           }
           if (NavChild.className == 'NavContent') {
               NavChild.style.display = 'block';
           }
       }
   NavToggle.firstChild.data = NavigationBarHide;
   }

}

//createNavigationBarToggleButton

/* Test if an element has a certain class
 *
 * Description: Uses regular expressions and caching for better performance.
 * Maintainers: User:Mike Dillon, User:R. Koot, User:SG
 */

var hasClass = (function () {
    var reCache = {};
    return function (element, className) {
        return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
    };
})();


// 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);
           var NavToggle2 = null;          
           for (
                 var NavChild = NavFrame.firstChild;
                 NavChild != null;
                 NavChild = NavChild.nextSibling
                ) {
                if ( hasClass( NavChild, 'NavLink' ) ) {
                   NavToggle2 = document.createElement("a");
                   NavToggle2.className = 'NavToggle2';
                   NavToggle2.setAttribute('id', 'NavToggle2' + indexNavigationBar);
                   var NavToggleText2 = document.createTextNode("[değiştir]");
                   NavToggle2.setAttribute('href', NavChild.innerText);
                   NavToggle2.appendChild(NavToggleText2);
                   break;
                }
            }
           for (
                 var NavChild = NavFrame.firstChild;
                 NavChild != null;
                 NavChild = NavChild.nextSibling
                ) {
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if (NavChild.style.display == 'none') {
                        NavToggleText = document.createTextNode(NavigationBarShow);
                        break;
                    }
                }
                if ( hasClass( NavChild, 'NavPic' ) || hasClass( NavChild, 'NavContent' ) ) {
                    if (NavChild.style.display == 'block') {
                        NavToggleText = document.createTextNode(NavigationBarHide);
                        break;
                    }
                }
            }
           NavToggle.appendChild(NavToggleText);
           // Find the NavHead and attach the toggle link (Must be this complicated because Moz's firstChild handling is borked)
           for(
             var j=0; 
             j < NavFrame.childNodes.length; 
             j++
           ) {
             if (NavFrame.childNodes[j].className == "NavHead") {
               NavFrame.childNodes[j].appendChild(NavToggle);
               if (NavToggle2) {
                 NavFrame.childNodes[j].appendChild(NavToggle2);
               }
             }
           }
           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);
       }
   }

}

addLoadEvent(createNavigationBarToggleButton);

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


/*

* Cookies
*/

//Cookie helpers

function setCookie(cookieName, cookieValue) {

var today = new Date();
var expire = new Date();
var nDays = 30;
expire.setTime( today.getTime() + (3600000 * 24 * nDays) );
document.cookie = cookieName + "=" + escape(cookieValue)
                + ";path=/w"
                + ";expires="+expire.toGMTString();
document.cookie = cookieName + "=" + escape(cookieValue)
                + ";path=/wiki"
                + ";expires="+expire.toGMTString();

}

function getCookie(cookieName) {

 var start = document.cookie.indexOf( cookieName + "=" );
 if ( start == -1 ) return "";
 var len = start + cookieName.length + 1;
 if ( ( !start ) &&
   ( cookieName != document.cookie.substring( 0, cookieName.length ) ) )
     {
       return "";
     }
 var end = document.cookie.indexOf( ";", len );
 if ( end == -1 ) end = document.cookie.length;
 return unescape( document.cookie.substring( len, end ) );

}

function deleteCookie(cookieName) {

 if ( getCookie(cookieName) ) {
   document.cookie = name + "=" +
   ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
 }

}

//Remplit la variable mwCustomEditButtons (voir /skins-1.5/commons/wikibits.js) pour ajouter des boutons à la barre d'outils

function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText) {

mwCustomEditButtons[mwCustomEditButtons.length] =
{"imageFile": imageFile,
 "speedTip": speedTip,
 "tagOpen": tagOpen,
 "tagClose": tagClose,
 "sampleText": sampleText};

}

addCustomButton('http://upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png','Üstünü çiz',"","",); addCustomButton('http://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png','Numaralandırma',"\n# eleman 1\n# eleman 2\n# eleman 3","",); addCustomButton('http://upload.wikimedia.org/wikipedia/commons/1/11/Btn_toolbar_liste.png','Liste',"\n* eleman A\n* eleman B\n* eleman C","",);

addCustomButton('http://upload.wikimedia.org/wikipedia/commons/9/9e/Btn_toolbar_gallery.png','Resim galerisi',"\n","",);

addCustomButton('http://upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png','Yorum',"",); addCustomButton('http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png','Yönlendirme',"#REDIRECT ","",'hedefin adı'); addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c6/Button_Kat.png','Kategori',"",'kategori'); addCustomButton('http://upload.wikimedia.org/wikipedia/commons/d/dd/Pulsante_tl.png','Parantez',"Şablon:","",'parantez'); addCustomButton('http://upload.wikimedia.org/wikipedia/meta/c/c9/Button_strike.png','Sil',"","",'silinecek');

addCustomButton('http://upload.wikimedia.org/wikipedia/commons/a/ac/Button_redir_rtl.png','Sağdan sola yazı','
\n',"\n
",'yazı'); addCustomButton('http://upload.wikimedia.org/wikipedia/he/5/5f/Button_center.png','Ortala','
\n',"\n
",'ortala');

addCustomButton('http://upload.wikimedia.org/wikipedia/he/1/13/Button_enter.png','Satır atla',"
","",); addCustomButton('http://upload.wikimedia.org/wikipedia/he/8/80/Button_upper_letter.png','sup',"","",'sup'); addCustomButton('http://upload.wikimedia.org/wikipedia/he/7/70/Button_lower_letter.png','sub',"","",'sub'); addCustomButton('http://upload.wikimedia.org/wikipedia/he/5/58/Button_small.png','küçük',"","",'küçük'); addCustomButton('http://upload.wikimedia.org/wikipedia/he/f/fd/Button_blockquote.png','söz','

\n',"\n
",'söz'); addCustomButton('http://upload.wikimedia.org/wikipedia/commons/2/23/Button_code.png','kod',"","",'kod'); addCustomButton('http://upload.wikimedia.org/wikipedia/commons/b/b8/Button_Globe.png','çeviri',"\n==== Çeviriler ====\n\{\{Üst\}\}\n*\{\{ar\}\}: \{\{çeviri\|ar\|\}\}\n*\{\{de\}\}: \{\{çeviri\|de\|\}\}\n*\{\{fr\}\}: \{\{çeviri\|fr\|\}\}\n\{\{Orta\}\}\n*\{\{en\}\}: \{\{çeviri\|en\|\}\}\n*\{\{es\}\}: \{\{çeviri\|es\|\}\}\n*\{\{it\}\}: \{\{çeviri\|it\|\}\}\n\{\{Alt\}\}\n","",);

function addWarningMessage() {

   if ((wgCurRevisionId == null) || (wgCurRevisionId != false)) return;
   if(!/&action=edit/.test(window.location.href) && !/&action=submit/.test(window.location.href)) return;
   if(/&section=new/.test(window.location.href)) return;
   if(!/SAS/.test(window.location.href) || (wgUserName != null) ) return;
   if(!document.forms.editform) return;
   document.forms.editform.wpSave.onclick = WarningMessage;

}

function WarningMessage() {

 alert('Bu isimde madde oluşturulamaz !'); 
 return false;

}

addOnloadHook(addWarningMessage);

/*

* Collapsible tables *********************************************************
*/

var autoCollapse = 2;
var collapseCaption = "gizle";
var expandCaption = "göster";

function collapseTable( tableIndex )

 {
    var Button = document.getElementById( "collapseButton" + tableIndex );
    var Table = document.getElementById( "collapsibleTable" + tableIndex );

    if ( !Table || !Button ) {
        return false;
    }

    var Rows = Table.rows;

    if ( Button.firstChild.data == collapseCaption ) {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = "none";
        }
        Button.firstChild.data = expandCaption;
    } else {
        for ( var i = 1; i < Rows.length; i++ ) {
            Rows[i].style.display = Rows[0].style.display;
        }
        Button.firstChild.data = collapseCaption;
    }

}

function createCollapseButtons()

{
    var tableIndex = 0;
    var NavigationBoxes = new Object();
    var Tables = document.getElementsByTagName( "table" );

    for ( var i = 0; i < Tables.length; i++ ) {
        if ( hasClass( Tables[i], "collapsible" ) ) {

            /* only add button and increment count if there is a header row to work with */
            var HeaderRow = Tables[i].getElementsByTagName( "tr" )[0];
            if (!HeaderRow) continue;
            var Header = HeaderRow.getElementsByTagName( "th" )[0];
            if (!Header) continue;

            NavigationBoxes[ tableIndex ] = Tables[i];
            Tables[i].setAttribute( "id", "collapsibleTable" + tableIndex );

            var Button     = document.createElement( "span" );
            var ButtonLink = document.createElement( "a" );
            var ButtonText = document.createTextNode( collapseCaption );

            Button.style.styleFloat = "right";
            Button.style.cssFloat = "right";
            Button.style.fontWeight = "normal";
            Button.style.textAlign = "right";
            Button.style.width = "6em";

            ButtonLink.style.color = Header.style.color;
            ButtonLink.setAttribute( "id", "collapseButton" + tableIndex );
            ButtonLink.setAttribute( "href", "javascript:collapseTable(" + tableIndex + ");" );
            ButtonLink.appendChild( ButtonText );

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

            Header.insertBefore( Button, Header.childNodes[0] );
            tableIndex++;
        }
    }

    for ( var i = 0;  i < tableIndex; i++ ) {
        if ( hasClass( NavigationBoxes[i], "collapsed" ) || ( tableIndex >= autoCollapse && hasClass( NavigationBoxes[i], "autocollapse" ) ) ) {
            collapseTable( i );
        }
    }
}

addOnloadHook( createCollapseButtons );

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki