MediaWiki буйынса фекерләшеү:Common.js

Һуңғы хәбәр: «Announced JavaScript change for badges implementation» темаһында 9 лет назад элек Bene* яҙҙы

/** Interwiki links to featured articles ***************************************

 *
 *  Description: Highlights interwiki links to featured and good articles (or
 *               equivalents) by changing the bullet before the interwiki link
 *               into a star.
 *  Maintainers: User:R. Koot
 */

function LinkFA(){
var pLang = document.getElementById('p-lang')
if (!pLang) return
var list = {
'fa':'Ur pennad eus an dibab',
'ga':'Ur pennad mat'}
var iw = pLang.getElementsByTagName('li')
for (var i=0; i<iw.length; i++)
  for (var s in list)
    if (document.getElementById(iw[i].className+'-'+s)){
      iw[i].className += ' ' + s.toUpperCase()
      iw[i].title = list[s] + ' en ur yezh all eo'
    }

}

addOnloadHook( LinkFA );

Вставьте в страницу, пожалуйста.Vago (фекер алышыу) 09:59, 15 Март (Буранай) 2012 (UTC)

  Эшләнде --Вячеславшулай уҡ Comp1089 aralaşayıq! 10:23, 15 Март (Буранай) 2012 (UTC)
Спасибо. Прошу, переведите
 'fa':'Эта статья является избранной',
 'fl':'Этот список или портал является избранным',
 'ga':'Эта статья является хорошей'}

и измените с

 'fa':'Ur pennad eus an dibab',
 'ga':'Ur pennad mat'}

Vago (фекер алышыу) 12:48, 15 Март (Буранай) 2012 (UTC)

Give search results even when page doesn't exist үҙгәртергә

 
Screenshot of the Earth test search, with this script adding links to Wikidata, Reasonator, Commons, and Wikipedia.

Hello, I propose to enable the tool created by Magnus Manske (creator of MediaWiki) to provide results from other languages and Commons (via Wikidata) when a page doesn't exist here: links are added to Special:Search and noarticletext. This helps to encourage translation and to make readers use your wiki more, because they can be sure to find something even if it's not local (rather than searching directly on the biggest wiki). The Italian and Polish Wikipedias, among others already enabled it by default.
Examples: [1] [2] [3]. More information: Magnus blog.
How to: just add the following line at the end of Common.js.

// Results from Wikidata
// [[File:Wdsearch_script_screenshot.png]]
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Search' ||  ( mw.config.get( 'wgArticleId' ) === 0 && mw.config.get( 'wgCanonicalSpecialPageName' ) === false ) ) {
	importScriptURI("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");
}

--Nemo 11:04, 12 декабрь 2013 (UTC) (comments, translations and last instructions)Яуап бирергә

Announced JavaScript change for badges implementation үҙгәртергә

Hi! I want to let you know that in near future badges will be deployed on Wikidata and the Wikipedias. They help us with displaying the good and featured article icons next to the sitelinks and will replace the javascript hack which is used at the moment together with the Link GA and Link FA templates. To avoid an overlap where the current system and the new feature conflict, I will add a minor fix to your Common.js which adds the class names to the interwiki links. This is part of my task as a global edit interface editor for the Wikidata team. Thanks, Bene* (әңгәмә) 17:48, 11 август 2014 (UTC)Яуап бирергә

Рөстәм Нурыев, ZUFAr: Подозреваю, что нужно заменить функцию «importscript» кодом из русского раздела:

importScript = function ( page, proj ) {
	if ( !proj ) {
		importScript_( page );
	} else {
		if ( proj.indexOf( '.' ) === -1 ) {
			proj += '.wikipedia.org';
		}
		mw.loader.load( '//' + proj + '/w/index.php?title=' + mw.util.wikiUrlencode( page ) + '&action=raw&ctype=text/javascript' );
	}
};

--Kaganer (әңгәмә)

«Common.js» битенә кире ҡайтырға.