میدیاویکی:Common.js: جیاوازیی نێوان پێداچوونەوەکان

ناوەڕۆکی سڕاو ناوەڕۆکی زیادکراو
remove mobile redirect, not needed anymore
update
ھێڵی ١:
//<source lang="javascript">
 
/* Import more specific scripts if necessary */
 
Line ٩ ⟶ ٧:
*/
function sysopFunctions() {
if ( mw.config.get('wgUserGroups') && !window.disableSysopJS ) {
for ( var g = 0; g < mw.config.get('wgUserGroups').length; ++g ) {
if ( mw.config.get('wgUserGroups')[g] == "sysop" ) {
importScript( "MediaWiki:Sysop.js" );
break;
Line ١٩ ⟶ ١٧:
}
 
addOnloadHook$(document).ready( sysopFunctions );
 
 
/** WikiMiniAtlas *******************************************************
Line ٣١ ⟶ ٢٨:
*/
 
importScriptURImw.loader.load(metaBase+"//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")
var metaBase = "//meta.wikimedia.org";
 
importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")
 
/* بارکردنی پەڕگە */
if( (mw.config.get('wgUserGroups').indexOf("uploader")!=-1)||(mw.config.get('wgUserGroups').indexOf("sysop")!=-1) ){
var link = document.getElementById('t-upload');
var a_link = link.firstChild;
Line ٨٢ ⟶ ٧٧:
 
// In print IE (7?) does not like line-height
appendCSSmw.util.addCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}');
 
// IE overflow bug
appendCSSmw.util.addCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }');
//Import scripts specific to Internet Explorer 6
Line ٩٢ ⟶ ٨٧:
}
}
 
 
/* 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);
};
})();
 
/** Interwiki links to featured articles ***************************************
Line ١٧٥ ⟶ ١٥٦:
 
for ( var i = 0; i < Tables.length; i++ ) {
if ( hasClass$( Tables[i],).hasClass( "collapsible" ) ) {
 
/* only add button and increment count if there is a header row to work with */
Line ٢٠٧ ⟶ ١٨٨:
 
for ( var i = 0; i < tableIndex; i++ ) {
if ( hasClass$( NavigationBoxes[i],).hasClass( "collapsed" ) || ( tableIndex >= autoCollapse && hasClass$( NavigationBoxes[i],).hasClass( "autocollapse" ) ) ) {
collapseTable( i );
}
else if ( hasClass$( NavigationBoxes[i],).hasClass( "innercollapse" ) ) {
var element = NavigationBoxes[i];
while (element = element.parentNode) {
if ( hasClass$( element,).hasClass( "outercollapse" ) ) {
collapseTable ( i );
break;
Line ٢٢٢ ⟶ ٢٠٣:
}
 
addOnloadHook$(document).ready( createCollapseButtons );
 
 
Line ٢٥٠ ⟶ ٢٣١:
if (NavToggle.firstChild.data == NavigationBarHide) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if ( hasClass$( NavChild,).hasClass( 'NavPic' ) ) {
NavChild.style.display = 'none';
}
if ( hasClass$( NavChild,).hasClass( 'NavContent') ) {
NavChild.style.display = 'none';
}
Line ٢٦٢ ⟶ ٢٤٣:
} else if (NavToggle.firstChild.data == NavigationBarShow) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if (hasClass$(NavChild,).hasClass( 'NavPic')) {
NavChild.style.display = 'block';
}
if (hasClass$(NavChild,).hasClass( 'NavContent')) {
NavChild.style.display = 'block';
}
Line ٢٨١ ⟶ ٢٦٢:
for (var i = 0; NavFrame = divs[i]; i++) {
// if found a navigation bar
if (hasClass$(NavFrame,).hasClass( "NavFrame")) {
 
indexNavigationBar++;
Line ٢٨٩ ⟶ ٢٧٠:
NavToggle.setAttribute('href', 'javascript:toggleNavigationBar(' + indexNavigationBar + ');');
 
var isCollapsed = hasClass$( NavFrame,).hasClass( "collapsed" );
/*
* Check if any children are already hidden. This loop is here for backwards compatibility:
Line ٢٩٨ ⟶ ٢٧٩:
*/
for (var NavChild = NavFrame.firstChild; NavChild != null && !isCollapsed; NavChild = NavChild.nextSibling) {
if ( $(NavChild).hasClass( NavChild, 'NavPic' ) || hasClass$( NavChild,).hasClass( 'NavContent' ) ) {
if ( NavChild.style.display == 'none' ) {
isCollapsed = true;
Line ٣٠٦ ⟶ ٢٨٧:
if (isCollapsed) {
for (var NavChild = NavFrame.firstChild; NavChild != null; NavChild = NavChild.nextSibling) {
if ( $(NavChild).hasClass( NavChild, 'NavPic' ) || hasClass$( NavChild,).hasClass( 'NavContent' ) ) {
NavChild.style.display = 'none';
}
Line ٣١٦ ⟶ ٢٩٧:
// 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 (hasClass$(NavFrame.childNodes[j],).hasClass( "NavHead")) {
NavFrame.childNodes[j].appendChild(NavToggle);
}
Line ٣٢٥ ⟶ ٣٠٦:
}
 
addOnloadHook$(document).ready( createNavigationBarToggleButton );
 
 
Line ٣٣٤ ⟶ ٣١٥:
*/
 
if (mw.config.get('wgPageName') == 'Main_Page' || mw.config.get('wgPageName') == 'Talk:Main_Page')
addOnloadHook$(document).ready(function () {
mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
'Complete list', 'interwiki-completelist', 'Complete list of Wikipedias')
var nstab = document.getElementById('ca-nstab-main')
if (nstab && mw.config.get('wgUserLanguage')=='ckb')
nstab.firstChild.firstChild.nodeValue = 'Main Page'
}
Line ٣٥٢ ⟶ ٣٣٣:
 
ts_alternate_row_colors = false;
 
 
/** IPv6 AAAA connectivity testing **/
 
var __ipv6wwwtest_factor = 100;
var __ipv6wwwtest_done = 0;
if ((wgServer != "https://secure.wikimedia.org") && (Math.floor(Math.random()*__ipv6wwwtest_factor)==42)) {
importScript("MediaWiki:Common.js/IPv6.js");
}
 
/** Magic editintros ****************************************************
Line ٣٧٩ ⟶ ٣٥١:
 
 
if (mw.config.get('wgNamespaceNumber') == 0) {
addOnloadHook$(document).ready( function(){
if (document.getElementById('disambigbox'))
addEditIntro('Template:Disambig_editintro');
});
 
addOnloadHook$(document).ready( function(){
var cats = document.getElementById('mw-normal-catlinks');
if (!cats)
Line ٥١٤ ⟶ ٤٨٦:
 
/* دەستپێک: ھەموو زمانەکانی ویکیپیدیا */
if (mw.config.get('wgPageName') == 'دەستپێک' || mw.config.get('wgPageName') == 'وتووێژ:دەستپێک') {
$(function () {
mw.util.addPortletLink('p-lang', '//meta.wikimedia.org/wiki/List_of_Wikipedias',
Line ٦٨١ ⟶ ٦٥٣:
/* Find the nodes where class="tabbertab" */
if (childNodes[i].className && hasClass$(childNodes[i],).hasClass( this.classTab)) {
/* Create a new object to save info about this tab */
Line ٩٩٥ ⟶ ٩٦٧:
/* Is this DIV the correct class? */
if (divs[i].className && hasClass$(divs[i],).hasClass( tempObj.classMain)) {
if (hasClass$(divs[i],).hasClass( "UseTabBreaks")) {
tabberArgs.spaceTabs = true;
}
Line ١٬٠٧٢ ⟶ ١٬٠٤٤:
tabberArgs = {};
}
/* Taken from: http://simon.incutio.com/archive/2004/05/26/addLoadEvent */
/*oldOnLoad = window.onload;
if (typeof window.onload != 'function') {
window.onload = function() {
tabberAutomatic(tabberArgs);
};
} else {
window.onload = function() {
oldOnLoad();
tabberAutomatic(tabberArgs);
};
}*/
//Use the wiki onload
addOnloadHook$(document).ready( function () {
tabberAutomatic(tabberArgs);
})
}