MediaWiki:Common.js

"Wikiibíídiiya" bitsʼą́ą́dę́ę́ʼ

Note: After saving, you may have to bypass your browser's cache to see the changes. Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Mac). Google Chrome: press Ctrl-Shift-R (Command-Shift-R on a Mac). Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5. Konqueror: click Reload or press F5. Opera: clear the cache in Tools → Preferences

$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'C'
}).text('Ch');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'C'
}).text('Ch');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'C nááná...'
}).text('Ch nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'C nááná...'
}).text('Ch nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'D'
}).text('Chʼ');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'D'
}).text('Chʼ');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'D nááná...'
}).text('Chʼ nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'D nááná...'
}).text('Chʼ nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'E'
}).text('D');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'E'
}).text('D');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'E nááná...'
}).text('D nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'E nááná...'
}).text('D nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'F'
}).text('Dl');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'F'
}).text('Dl');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'F nááná...'
}).text('Dl nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'F nááná...'
}).text('Dl nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'G'
}).text('Dz');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'G'
}).text('Dz');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'G nááná...'
}).text('Dz nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'G nááná...'
}).text('Dz nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'H'
}).text('E');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'H'
}).text('E');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'H nááná...'
}).text('E nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'H nááná...'
}).text('E nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'I'
}).text('G');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'I'
}).text('G');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'I nááná...'
}).text('G nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'I nááná...'
}).text('G nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'J'
}).text('Gh');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'J'
}).text('Gh');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'J nááná...'
}).text('Gh nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'J nááná...'
}).text('Gh nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'K'
}).text('H');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'K'
}).text('H');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'K nááná...'
}).text('H nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'K nááná...'
}).text('H nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'L'
}).text('Hw');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'L'
}).text('Hw');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'L nááná...'
}).text('Hw nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'L nááná...'
}).text('Hw nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'M'
}).text('I');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'M'
}).text('I');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'M nááná...'
}).text('I nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'M nááná...'
}).text('I nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'N'
}).text('J');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'N'
}).text('J');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'N nááná...'
}).text('J nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'N nááná...'
}).text('J nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'O'
}).text('K');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'O'
}).text('K');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'O nááná...'
}).text('K nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'O nááná...'
}).text('K nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'P'
}).text('Kʼ');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'P'
}).text('Kʼ');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'P nááná...'
}).text('Kʼ nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'P nááná...'
}).text('Kʼ nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Q'
}).text('Kw');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Q'
}).text('Kw');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Q nááná...'
}).text('Kw nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Q nááná...'
}).text('Kw nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'R'
}).text('L');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'R'
}).text('L');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'R nááná...'
}).text('L nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'R nááná...'
}).text('L nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'S'
}).text('Ł');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'S'
}).text('Ł');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'S nááná...'
}).text('Ł nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'S nááná...'
}).text('Ł nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'T'
}).text('M');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'T'
}).text('M');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'T nááná...'
}).text('M nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'T nááná...'
}).text('M nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'U'
}).text('N');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'U'
}).text('N');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'U nááná...'
}).text('N nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'U nááná...'
}).text('N nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'V'
}).text('O');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'V'
}).text('O');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'V nááná...'
}).text('O nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'V nááná...'
}).text('O nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'W'
}).text('S');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'W'
}).text('S');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'W nááná...'
}).text('S nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'W nááná...'
}).text('S nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'X'
}).text('Sh');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'X'
}).text('Sh');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'X nááná...'
}).text('Sh nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'X nááná...'
}).text('Sh nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Y'
}).text('T');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Y'
}).text('T');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Y nááná...'
}).text('T nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Y nááná...'
}).text('T nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Z'
}).text('Tʼ');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Z'
}).text('Tʼ');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Z nááná...'
}).text('Tʼ nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Z nááná...'
}).text('Tʼ nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'À'
}).text('Tł');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'À'
}).text('Tł');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'À nááná...'
}).text('Tł nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'À nááná...'
}).text('Tł nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Á'
}).text('Tłʼ');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Á'
}).text('Tłʼ');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Á nááná...'
}).text('Tłʼ nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Á nááná...'
}).text('Tłʼ nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Â'
}).text('Ts');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Â'
}).text('Ts');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Â nááná...'
}).text('Ts nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Â nááná...'
}).text('Ts nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Ã'
}).text('Tsʼ');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Ã'
}).text('Tsʼ');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Ã nááná...'
}).text('Tsʼ nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Ã nááná...'
}).text('Tsʼ nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Ä'
}).text('W');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Ä'
}).text('W');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Ä nááná...'
}).text('W nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Ä nááná...'
}).text('W nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Å'
}).text('Y');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Å'
}).text('Y');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Å nááná...'
}).text('Y nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Å nááná...'
}).text('Y nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Æ'
}).text('Z');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Æ'
}).text('Z');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Æ nááná...'
}).text('Z nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Æ nááná...'
}).text('Z nááná...');


$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Ç'
}).text('Zh');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Ç'
}).text('Zh');
$('#mw-subcategories').find('h3').filter(function(){
    return $(this).text() === 'Ç nááná...'
}).text('Zh nááná...');
$('#mw-pages').find('h3').filter(function(){
    return $(this).text() === 'Ç nááná...'
}).text('Zh nááná...');


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

var autoCollapse = 2;
var collapseCaption = ' niiʼoh ';
var expandCaption = ' nílʼį́ ';

var navigationBarHide = '[' + collapseCaption + ']';
var navigationBarShow = '[' + expandCaption + ']';

function toggleNavigationBar( indexNavigationBar, event ) {
	var navToggle = document.getElementById( 'NavToggle' + indexNavigationBar );
	var navFrame = document.getElementById( 'NavFrame' + indexNavigationBar );
	var navChild;

	if ( !navFrame || !navToggle ) {
		return false;
	}

	if ( navToggle.firstChild.data === navigationBarHide ) {
		for ( navChild = navFrame.firstChild; navChild !== null; navChild = navChild.nextSibling ) {
			if ( $( navChild ).hasClass( 'NavContent' ) ) {
				navChild.style.display = 'none';
			}
		}
		navToggle.firstChild.data = navigationBarShow;
	
	} else if ( navToggle.firstChild.data === navigationBarShow ) {
		for ( navChild = navFrame.firstChild; navChild !== null; navChild = navChild.nextSibling ) {
			if ( $( navChild ).hasClass( 'NavContent' ) ) {
				navChild.style.display = 'block';
			}
		}
		navToggle.firstChild.data = navigationBarHide;
	}

	event.preventDefault();
}

function createNavigationBarToggleButton( $content ) {
	var i, j, navChild, navToggle, navToggleText, isCollapsed,
		indexNavigationBar = 0;
	var $divs = $content.find( 'div.NavFrame:not(.mw-collapsible)' );
	$divs.each( function ( i, navFrame ) {
		indexNavigationBar++;
		navToggle = document.createElement( 'a' );
		navToggle.className = 'NavToggle';
		navToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar );
		navToggle.setAttribute( 'href', '#' );
		$( navToggle ).on( 'click', $.proxy( toggleNavigationBar, null, indexNavigationBar ) );

		isCollapsed = $( navFrame ).hasClass( 'collapsed' );
		for ( navChild = navFrame.firstChild; navChild !== null && !isCollapsed; navChild = navChild.nextSibling ) {
			if ( $( navChild ).hasClass( 'NavPic' ) || $( navChild ).hasClass( 'NavContent' ) ) {
				if ( navChild.style.display === 'none' ) {
					isCollapsed = true;
				}
			}
		}
		if ( isCollapsed ) {
			for ( navChild = navFrame.firstChild; navChild !== null; navChild = navChild.nextSibling ) {
				if ( $( navChild ).hasClass( 'NavPic' ) || $( navChild ).hasClass( 'NavContent' ) ) {
					navChild.style.display = 'none';
				}
			}
		}
		navToggleText = document.createTextNode( isCollapsed ? navigationBarShow : navigationBarHide );
		navToggle.appendChild( navToggleText );

		for ( j = 0; j < navFrame.childNodes.length; j++ ) {
			if ( $( navFrame.childNodes[j] ).hasClass( 'NavHead' ) ) {
				navToggle.style.color = navFrame.childNodes[j].style.color;
				navFrame.childNodes[j].appendChild( navToggle );
			}
		}
		navFrame.setAttribute( 'id', 'NavFrame' + indexNavigationBar );
	} );
}


/** Main Page layout fixes *********************************************************
 *
 *  Description: Adds an additional link to the complete list of languages available.
 *  Maintainers: [[User:AzaToth]], [[User:R. Koot]], [[User:Alex Smotrov]]
 */

if (mw.config.get('wgPageName') == 'Íiyisíí_Naaltsoos' || mw.config.get('wgPageName') == 'Naaltsoos_baa_yáshtiʼ:Íiyisíí_Naaltsoos') 
    $(function () {
        mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
                 'Saad tʼáá ałtso', 'interwiki-completelist', 'Complete list of Wikipedias')
        var nstab = document.getElementById('ca-nstab-main')
        if (nstab && mw.config.get('wgUserLanguage')=='nv') {
            while (nstab.firstChild) nstab = nstab.firstChild
            nstab.nodeValue = 'íiyisíí naaltsoos'
        }
    }
)

/* switch "talk"-tab for userpages from "baa..." to "bichʼįʼ..." */
if (mw.config.get('wgCanonicalNamespace') == "User")
$(function () {
        var talk = document.getElementById('ca-talk')
        if (talk && mw.config.get('wgUserLanguage')=='nv') {
            while (talk.firstChild) talk = talk.firstChild
            talk.nodeValue = 'bichʼįʼ yádeeshtih nisin'
        }
    }
)
if (mw.config.get('wgCanonicalNamespace') == "User_talk")
$(function () {
        var talk = document.getElementById('ca-talk')
        if (talk && mw.config.get('wgUserLanguage')=='nv') {
            while (talk.firstChild) talk = talk.firstChild
            talk.nodeValue = 'bichʼįʼ yáshtiʼ'
        }
    }
)
if (mw.config.get('wgCanonicalNamespace') == "Talk" || mw.config.get('wgCanonicalNamespace') == "Category_talk" || mw.config.get('wgCanonicalNamespace') == "Template_talk" || mw.config.get('wgCanonicalNamespace') == "Project_talk" || mw.config.get('wgCanonicalNamespace') == "Help_talk" || mw.config.get('wgCanonicalNamespace') == "File_talk" || mw.config.get('wgCanonicalNamespace') == "MediaWiki_talk" || mw.config.get('wgCanonicalNamespace') == "Image_talk")
$(function () {
        var talk = document.getElementById('ca-talk')
        if (talk && mw.config.get('wgUserLanguage')=='nv') {
            while (talk.firstChild) talk = talk.firstChild
            talk.nodeValue = 'baa yáshtiʼ'
        }
    }
)

//</source>