MediaWiki тепсэлъэхьыгъуэ:Common.js

Page contents not supported in other languages.
Тхыгъэр къыздрахар Уикипедиэ

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* (talk) 23:17, 11 ШыщхьэӀум и 2014 (MSK)

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

Тут надо поправить функцию collapsibleDivs:

function collapsibleDivs(){
 var navIdx = 0, colNavs = [], i, NavFrame
 var content = document.getElementById('content');
 if ( content === null ) {
  return;
 }
 var divs = content.getElementsByTagName('div')
 for (i=0; NavFrame = divs[i]; i++) {
   if (!hasClass(NavFrame, 'NavFrame')) continue
   NavFrame.id = 'NavFrame' + navIdx
   var a = document.createElement('a')
   a.className = 'NavToggle'
   a.id = 'NavToggle' + navIdx
   a.href = 'javascript:collapseDiv(' + navIdx + ');'
   a.appendChild(document.createTextNode(NavigationBarHide))
   for (var j=0; j < NavFrame.childNodes.length; j++)
     if (hasClass(NavFrame.childNodes[j], 'NavHead'))
       NavFrame.childNodes[j].appendChild(a)
   colNavs[navIdx++] = NavFrame
 }
 for (i=0; i < navIdx; i++)
  if ((navIdx > NavigationBarShowDefault && !hasClass(colNavs[i], 'expanded')) || hasClass(colNavs[i], 'collapsed'))
     collapseDiv(i)
}

Нынешний код ломает JavaScript на некоторых страницах, и это его починит.

Спасибо! --Amir E. Aharoni (talk) 00:52, 20 ЩӀышылэм и 2017 (MSK)

Отмечаю: User:Master Shadow, User:Андрей Козлов 123. --Amir E. Aharoni (talk) 01:17, 20 ЩӀышылэм и 2017 (MSK)

MediaWiki developers found that this page probably breaks JavaScript for users (example: not seeing the buttons when editing a page). You probably need to edit this .js page and/or MediaWiki:Gadgets-definition as in the examples at phabricator:T122755. List more pages to check.

If you have questions or need help, please ask at phabricator:T164242. You can login with your wiki account. Best wishes, Nemo 12:49, 14 Накъыгъэм и 2017 (MSK)