MediaWiki-м кӓнгӓшӹмӓш:Common.js

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* (обсуждение) 20:28, 18 Сорла 2014 (UTC)

Перевод содержания тӧрлаташ

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

Тут есть кое-какая неисправность, из-за которой невозможно пользоваться функцией "Перевод содержания" (Content Translation).

Функцию 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 (!$(NavFrame).hasClass( '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 ($(NavFrame.childNodes[j]).hasClass( 'NavHead'))
       NavFrame.childNodes[j].appendChild(a)
   colNavs[navIdx++] = NavFrame
 }
 for (i=0; i < navIdx; i++)
  if ((navIdx > NavigationBarShowDefault && !$(colNavs[i]).hasClass( 'expanded')) || $(colNavs[i]).hasClass( 'collapsed'))
     collapseDiv(i)
}

Спасибо!

(Отмечаю администратора: Пайдаланыше:Санюн Вадик.) --Amir E. Aharoni (обсуждение) 17:58, 29 Шыжа 2016 (UTC)

Dear Krinkle, please update this code as proposed above! --Kaganer (обсуждение) 16:24, 29 Кылме 2016 (UTC)

@Kaganer, @Amir: Done! --Krinkle 21:23, 29 Кылме 2016 (UTC)
Вернуться на страницу «Common.js».