MediaWiki:Common.js: Redaktələr arasındakı fərq
Шариф Ахмет (müzakirə) tərəfindən edilmiş 62379 nömrəli redaktə geri qaytarıldı
Redaktənin izahı yoxdur |
(Шариф Ахмет (müzakirə) tərəfindən edilmiş 62379 nömrəli redaktə geri qaytarıldı) Teq: Geri qaytarma |
||
(4 redaktor tərəfindən edilmiş 62 dəyişiklik göstərilmir) | |||
Sətir 1: | Sətir 1: | ||
/** | |||
* Skriptləri yükləmək üçün lokal skript | |||
*/ | |||
var importScript_ = importScript; | |||
importScript = function ( page, proj ) { | |||
if ( !proj ) { | |||
importScript_( page ); | |||
} else { | |||
if ( proj.indexOf( '.' ) === -1 ) { | |||
proj += '.sheki.org'; | |||
} | |||
mw.loader.using( 'mediawiki.util' ).done( function () { | |||
mw.loader.load( '//' + proj + '/w/index.php?title=' + mw.util.wikiUrlencode( page ) + | |||
'&action=raw&ctype=text/javascript' ); | |||
} ); | |||
} | |||
}; | |||
//runAsEarlyAsPossible from ruwiki | |||
function runAsEarlyAsPossible( callback, $testElement, func ) { | |||
func = func || $; | |||
$testElement = $testElement || $( '#footer' ); | |||
if ( $testElement.length ) { | |||
callback(); | |||
} else { | |||
func( callback ); | |||
} | |||
} | |||
// Switch language variants of messages (from zh) | // Switch language variants of messages (from zh) | ||
function wgULS(latn,arab){ | function wgULS(latn,arab){ | ||
Sətir 44: | Sətir 74: | ||
for (j = 0 ; j < UnitNode.childNodes.length ; j++ ) { | for (j = 0 ; j < UnitNode.childNodes.length ; j++ ) { | ||
var temp = UnitNode.childNodes[j]; | var temp = UnitNode.childNodes[j]; | ||
if (temp.className | if (['center', 'mw-halign-center'].some(function(className) { return temp.classList.contains(className); })) { units.push(temp); } | ||
} | } | ||
var rightlink; | var rightlink; | ||
var commentText; | var commentText; | ||
var wrap; | |||
for (j = 0; j < units.length; j++) { | for (j = 0; j < units.length; j++) { | ||
currentimage = units[j]; | currentimage = units[j]; | ||
wrap = document.createElement('div'); | |||
wrap.id = "ImageGroupsGr" + i + "Im" + j; | |||
currentimage.parentNode.insertBefore(wrap, currentimage); | |||
wrap.appendChild(currentimage); | |||
var leftlink = document.createElement("a"); | var leftlink = document.createElement("a"); | ||
if (commentText !== undefined) { | if (commentText !== undefined) { | ||
Sətir 88: | Sətir 122: | ||
imghead.appendChild(rightlink); | imghead.appendChild(rightlink); | ||
if (units.length > 1) { | if (units.length > 1) { | ||
wrap.insertBefore(imghead,wrap.childNodes[0]); | |||
} | } | ||
if (j !== 0) { | if (j !== 0) { | ||
wrap.style.display = "none"; | |||
} | } | ||
} | } | ||
Sətir 216: | Sətir 250: | ||
* Dynamic Navigation Bars (experimental) | * Dynamic Navigation Bars (experimental) | ||
* | * | ||
* Description: See [[ | * Description: See [[Şəki Ensiklopediyası:NavFrame]]. | ||
* Maintainers: UNMAINTAINED | * Maintainers: UNMAINTAINED | ||
*/ | */ | ||
Sətir 224: | Sətir 258: | ||
// Set up the words in your language | // Set up the words in your language | ||
var navigationBarHide = '[' + collapseCaption + ']'; | var navigationBarHide = '[' + collapseCaption.toLowerCase() + ']'; | ||
var navigationBarShow = '[' + expandCaption + ']'; | var navigationBarShow = '[' + expandCaption.toLowerCase() + ']'; | ||
/** | /** | ||
Sətir 263: | Sətir 297: | ||
event.preventDefault(); | event.preventDefault(); | ||
} | } | ||
/* [[Şablon:Yarımbaşlıq]] üçün */ | |||
function sousTitreH1( $content ) { | |||
$( '#firstHeading > #second_header_h1' ).remove(); | |||
var $span = $content.find( '#second_header_h1' ); | |||
if ( $span.length ) { | |||
$span.prepend( ' ' ); | |||
$( '#firstHeading' ).append( $span ); | |||
} | |||
} | |||
mw.hook( 'wikipage.content' ).add( sousTitreH1 ); | |||
/** | /** | ||
Sətir 376: | Sətir 422: | ||
realTitleBanner.style.display = "none"; | realTitleBanner.style.display = "none"; | ||
} | } | ||
document.title = realTitleText + " - | document.title = realTitleText + " - Şəki Ensiklopediyası"; | ||
} | } | ||
} | } | ||
Sətir 533: | Sətir 579: | ||
var searchEngines = { | var searchEngines = { | ||
mediawiki: { | mediawiki: { | ||
ShortName: " | ShortName: "Şəki Ensiklopediyası", | ||
Template: "/ | Template: "/wiki/index.php?search={searchTerms}" | ||
}, | }, | ||
globalwpsearch: { | globalwpsearch: { | ||
ShortName: " | ShortName: "Vikipediya", | ||
Template: " | Template: "https://vs.aka-online.de/cgi-bin/globalwpsearch.pl?timeout=120&search={searchTerms}" | ||
}, | }, | ||
google: { | google: { | ||
ShortName: "Google", | ShortName: "Google", | ||
Template: " | Template: "https://www.google.cat/search?as_sitesearch=az.wikipedia.org&hl={language}&q={searchTerms}" | ||
}, | }, | ||
wikiwix: { | wikiwix: { | ||
ShortName: "Wikiwix", | ShortName: "Wikiwix", | ||
Template: " | Template: "https://www.wikiwix.com/index.php?action={searchTerms}&lang=az" | ||
}, | }, | ||
yahoo: { | yahoo: { | ||
ShortName: "Yahoo!", | ShortName: "Yahoo!", | ||
Template: " | Template: "https://search.yahoo.com/search?p={searchTerms}&vs=sheki.org" | ||
}, | }, | ||
wlive: { | wlive: { | ||
ShortName: "Windows Live", | ShortName: "Windows Live", | ||
Template: " | Template: "https://search.live.com/results.aspx?q={searchTerms}&q1=site:https://sheki.org" | ||
} | } | ||
}; | }; | ||
Sətir 668: | Sətir 714: | ||
} | } | ||
} | } | ||
if (mw.config.get('wgCanonicalSpecialPageName') == "Search") { | if (mw.config.get('wgCanonicalSpecialPageName') == "Search") { | ||
Sətir 675: | Sətir 720: | ||
if (mw.config.get('wgAction') == "edit" || mw.config.get('wgAction') == "submit") { | if (mw.config.get('wgAction') == "edit" || mw.config.get('wgAction') == "submit") { | ||
importScript('MediaWiki:Editpage.js'); | importScript('MediaWiki:Editpage.js'); | ||
mw.loader.load('ext.gadget.wikificator'); | |||
} | } | ||
Sətir 731: | Sətir 777: | ||
} | } | ||
} | } | ||
//</source> | //</source> | ||
// Results from Wikidata | // Results from Wikidata | ||
Sətir 738: | Sətir 785: | ||
} | } | ||
/** | |||
* Imagemap Highlight | |||
*/ | |||
if ( $( '.imageMapHighlighter' ).length && $( '<canvas>' )[ 0 ].getContext ) { | |||
importScript( 'MediaWiki:Imagemap-Highlight.js' ); | |||
} | |||
/** | |||
* imgToggle | |||
*/ | |||
if ( $( 'div.img_toggle' ).length ) { | |||
mw.loader.load( 'ext.gadget.imgToggle' ); | |||
} | |||
/** | |||
* withJS | |||
* İzah: URL keçidləri ilə MediaViki skriptlərinin işə salınması | |||
* @mənbə: www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL | |||
*/ | |||
(function() { | |||
var extraJS = mw.util.getParamValue('withJS'); | |||
if (extraJS) { | |||
if (extraJS.match(/^Media[VW]iki:[^&<>=%#]*\.js$/)) { | |||
importScript(extraJS); | |||
} else { | |||
mw.notify( 'Yalnız MediaViki ad fəzasındakı səhifələrə icazə verilir.', { title: 'Yanlış "withJS" dəyəri' } ); | |||
} | |||
} | |||
}()); | |||
/** | /** | ||
* Magic editintros | * Magic editintros | ||
* İzah: Yaşayan insanların məqalələrini redaktə edərkən göstərilən xəbərdarlıq qutusu | |||
* | * Müəllif: [[User:RockMFR]] | ||
* | |||
*/ | */ | ||
function addEditIntro( name ) { | function addEditIntro( name ) { | ||
$( '.mw-editsection, #ca-edit, #ca-ve-edit' ).find( 'a' ).each( function ( i, el ) { | $( '.mw-editsection, #ca-edit, #ca-ve-edit' ).find( 'a' ).each( function ( i, el ) { | ||
el.href = $( this ).attr( 'href' ) + '&editintro=' + name; | el.href = $( this ).attr( 'href' ) + '&editintro=' + name; | ||
} ); | |||
} | |||
if ( mw.config.get( 'wgNamespaceNumber' ) === 2 || mw.config.get( 'wgNamespaceNumber' ) === 3) { | |||
$( function () { | |||
if ( document.getElementById( 'userpageedn' ) ) { | |||
addEditIntro( 'Şablon:Editnotice_userpage' ); | |||
} | |||
} ); | } ); | ||
} | } | ||
Sətir 777: | Sətir 846: | ||
return; | return; | ||
} | } | ||
if ( $.inArray( 'Yaşayan insanlar', cats ) !== -1 || $.inArray( 'Yaşayan | if ( $.inArray( 'Yaşayan insanlar', cats ) !== -1 || $.inArray( 'Yaşayan uzunömürlülər', cats ) !== -1 ) { | ||
addEditIntro( 'Template:BLP_editintro' ); | addEditIntro( 'Template:BLP_editintro' ); | ||
} | } | ||
} ); | } ); | ||
} | } | ||
// Web2Cit | |||
mw.loader.load( '//en.wikipedia.org/w/index.php?title=User:Diegodlh/Web2Cit/script.js&action=raw&ctype=text/javascript' ); // Backlink: [[:en:User:Diegodlh/Web2Cit/script.js]] | |||
// Naviqasiya panelində "İnzibatçıların iş bölgüsü" başlığının yerləşdirilməsi | |||
importScript("MediaWiki:SysopDuties.js"); |