MediaWiki:Common.js — нұсқалар арасындағы айырмашылық

399 байт өшірілді ,  8 жыл бұрын
update
(update)
/*<source lang="javascript">*/
/*
== Global configuration ==
*/
var isMSIE = ((navigator.appName == 'Microsoft Internet Explorer' ) > 0);
var isNoSpecial = (mw.config.get('wgCanonicalNamespace') != "Special");
var isUpload = ((mw.config.get('wgCanonicalNamespace') == "Special") && (mw.config.get('wgCanonicalSpecialPageName') == "Upload"));
var isEdit = ((document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0) && !document.getElementById('ca-viewsource') > 0);
 
 
// Add Main page layout fix
if mw.config.get('wgTitle') == 'Bas bet') { importScript( "MediaWiki:Mainpage.js" ); }
 
// Add editing stuff (toolbar buttons, template pull-down menu etc) for registered users
// uploadwizard_newusers Switches in a message for non-autoconfirmed users at [[Wikipedia:Aploud qılıw]]
function uploadwizard_newusers() {
if (mw.config.get('wgNamespaceNumber') == 4 && mw.config.get('wgTitle') == "Aploud qılıw" && mw.config.get('wgAction') == "view") {
var oldDiv = document.getElementById("autoconfirmedusers"),
newDiv = document.getElementById("newusers");
if (oldDiv && newDiv) {
for (i = 0; i < mw.config.get('wgUserGroups').length; i++) {
if (mw.config.get('wgUserGroups')[i] == "autoconfirmed") {
oldDiv.style.display = "block";
newDiv.style.display = "none";
}
}
addOnloadHook$(document).ready(uploadwizard_newusers);
 
// WikiMiniAtlas
/*
if (wgServer == "https://secure.wikimedia.org") {
var metaBase = "https://secure.wikimedia.org/wikipedia/meta";
} else {
var metaBase = "http://meta.wikimedia.org";
}
importScriptURI(metaBase+"/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")
*/
/*
 
== Execute function on page load ==
*/
function addLoadEvent( f ) { addOnloadHook( f ); }
 
/*
importScriptURI(metaBase+"//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400")
 
== Test if an element has a certain class ==
*/
var hasClass = (function () {
var reCache = {};
return function (element, className) {
return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
};
})();
 
/*
 
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 */
 
for ( var i = 0; i < tableIndex; i++ ) {
if ( hasClass$( NavigationBoxes[i],).hasClass( "collapsed" ) || ( tableIndex >= autoCollapse && hasClass$( NavigationBoxes[i],).hasClass( "autocollapse" ) ) ) {
collapseTable( i );
}
}
 
addOnloadHook$(document).ready( createCollapseButtons );
 
/*
NavChild = NavChild.nextSibling
) {
if ( hasClass$( NavChild,).hasClass( 'NavPic' ) ) {
NavChild.style.display = 'none';
}
if ( hasClass$( NavChild,).hasClass( 'NavContent') ) {
NavChild.style.display = 'none';
}
NavChild = NavChild.nextSibling
) {
if (hasClass$(NavChild,).hasClass( 'NavPic')) {
NavChild.style.display = 'block';
}
if (hasClass$(NavChild,).hasClass( 'NavContent')) {
NavChild.style.display = 'block';
}
) {
// if found a navigation bar
if (hasClass$(NavFrame,).hasClass( "NavFrame")) {
 
indexNavigationBar++;
NavChild = NavChild.nextSibling
) {
if ( $(NavChild).hasClass( NavChild, 'NavPic' ) || hasClass( $(NavChild,).hasClass( 'NavContent' ) ) {
if (NavChild.style.display == 'none') {
NavToggleText = document.createTextNode(NavigationBarShow);
j++
) {
if (hasClass$(NavFrame.childNodes[j],).hasClass( "NavHead")) {
NavFrame.childNodes[j].appendChild(NavToggle);
}
}
 
addOnloadHook$(document).ready( createNavigationBarToggleButton );
 
/*
}
 
addOnloadHook$(document).ready(DiscussionBistro);
/*
 
}
 
addOnloadHook$(document).ready( LinkFA );
 
// Configuration for "star" logo at the top of Featured Articles
}
 
addOnloadHook$(document).ready(StarFA);
 
/*</source>*/
16

өңдеме