МедиаВики бәхәсе:Common.js

Соңгы шәрех: «mw.util.$content» темасында 7 ел элек элек Krinkle язды

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");
}
--[[m:User:Nemo_bis|Nemo]] ~~~~~ ([[w:en:MediaWiki talk:Wdsearch.js|comments, translations and last instructions]])
</div>
<!-- EdwardsBot 0661 -->

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* (бәхәс) 11 авг 2014, 19:22 (UTC)Җавап бирергә

ContentTranslation үзгәртү

Здравствуйте,

Мы включаем здесь новый инструмент ContentTranslation. Я писал об этом здесь: Википедия бәхәсе:Җәмгыять үзәге#ContentTranslation.

Инструмент не может сейчас работать из-за неисправности здесь в Common.js.

Я советую сделать return в начале функции collapsibleSpans если она бежит на странице ContentTranslation. То есть так:

if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'ContentTranslation' ) {
    return;
}

Спасибо! --Amir E. Aharoni (бәхәс) 21 апр 2015, 16:48 (UTC)Җавап бирергә

Кулланучы:Derslek, Кулланучы:Marat Vildanov, Кулланучы:Marat-avgust, помогите пожалуйста :) --Amir E. Aharoni (бәхәс) 22 апр 2015, 16:51 (UTC)Җавап бирергә
Спасибо Marat-avgust, теперь работает! --Amir E. Aharoni (бәхәс) 22 апр 2015, 19:38 (UTC)Җавап бирергә

mw.util.$content үзгәртү

Здравствуйте,

У вас тут проблема с использованием mw.util.$content.

Функцию editZeroSection надо убрать внутрь блока mw.loader.using( 'mediawiki.util', function() {. Кроме того, начало этого блока надо переписать так: mw.loader.using( [ 'mediawiki.util', 'mediawiki.page.startup' ], function() {.

Это должно исправить проблему, которая была сообщена здесь, и другие неисправности. --Amir E. Aharoni (бәхәс) 16 дек 2016, 14:44 (UTC)Җавап бирергә

Fixed. --Krinkle 16 дек 2016, 21:13 (UTC)Җавап бирергә

// $( editZeroSection );

https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array

https://developer.mozilla.org/docs/Web/JavaScript --Чӑваш (бәхәс) 16 дек 2016, 17:20 (UTC)Җавап бирергә

«Common.js» битенә кире кайту.