MediaWiki:Common.js — различия между версиями

Материал из ЭНЭ
Перейти к: навигация, поиск
Строка 1: Строка 1:
//<source lang="javascript">
+
//See http://ru.wikipedia.org/wiki/project:code //<source lang=javascript>
/* <pre> */
+
var mpTitle = "Заглавная страница";
+
var isMainPage = (document.title.substr(0, document.title.lastIndexOf(" — ")) == mpTitle);
+
var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 || document.location.search.indexOf("oldid=") != -1));
+
  
/** JSconfig (old version, to be replaced soon) ************
+
importScript_ = importScript
  * Global configuration options to enable and disable specific
+
importScript = function (page, proj){
  * script features from [[MediaWiki:Common.js]]
+
  if (!proj) importScript_(page)
* Override these default settings in your [[Special:Mypage/monobook.js]]
+
  else {
* for Example: JSconfig.loadAutoInformationTemplate = false;
+
  if (proj.indexOf('.')==-1) proj += '.wikipedia.org'
*
+
  importScriptURI('http://'+proj+'/w/index.php?action=raw&ctype=text/javascript&title='+encodeURIComponent(page.replace(/ /g,'_')))
*  Maintainer: [[User:Dschwen]]
+
  }
*/
+
 
+
var JSconfig_old =
+
{
+
loadAutoInformationTemplate : true,
+
  specialSearchEnhanced : true,
+
subPagesLink : true,
+
attributeSelf : true,
+
userUploadsLink : true
+
 
}
 
}
  
 +
addLoadEvent = addOnloadHook
  
/** JSconfig ************
 
* Global configuration options to enable/disable and configure
 
* specific script features from [[MediaWiki:Common.js]] and
 
* [[MediaWiki:Monobook.js]]
 
* This framework adds config options (saved as cookies) to [[Special:Preferences]]
 
* For a more permanent change you can override the default settings in your
 
* [[Special:Mypage/monobook.js]]
 
* for Example: JSconfig.keys[loadAutoInformationTemplate] = false;
 
*
 
*  Maintainer: [[User:Dschwen]]
 
*/
 
  
var JSconfig =
+
function ts_parseFloat(n){
{
+
  if (!n) return 0
  prefix : 'jsconfig_',
+
n = parseFloat(n.replace(/\./g, '').replace(/,/, '.'))
  keys : {},
+
  return (isNaN(n) ? 0 : n)
meta : {},
+
}
  
//
 
// Register a new configuration item
 
//  * name          : String, internal name
 
//  * default_value : String or Boolean (type determines configuration widget)
 
//  * description  : String, text appearing next to the widget in the preferences
 
//  * prefpage      : Integer (optional), section in the preferences to insert the widget:
 
//                    0 : User profile
 
//                    1 : Skin
 
//                    2 : Math
 
//                    3 : Files
 
//                    4 : Date and time
 
//                    5 : Editing
 
//                    6 : Recent changes
 
//                    7 : Watchlist
 
//                    8 : Search
 
//                    9 : Misc
 
//
 
// Access keys through JSconfig.keys[name]
 
//
 
registerKey : function( name, default_value, description, prefpage )
 
{
 
  if( typeof(JSconfig.keys[name]) == 'undefined' )
 
  JSconfig.keys[name] = default_value;
 
  else {
 
  
  // all cookies are read as strings,
+
function LinkFA(){
  // convert to the type of the default value
+
var pLang = document.getElementById('p-lang')
  switch( typeof(default_value) )
+
if (!pLang) return
   {
+
var iw = pLang.getElementsByTagName('li')
    case 'boolean' : JSconfig.keys[name] = ( JSconfig.keys[name] == 'true' ); break;
+
for (var i=0; i < iw.length; i++)
    case 'number'  : JSconfig.keys[name] = JSconfig.keys[name]/1; break;
+
   if (document.getElementById(iw[i].className+'-fa')){
 +
    iw[i].className += ' FA'
 +
    iw[i].title = 'Эта статья является избранной в другом языковом разделе'
 +
  }else if (document.getElementById(iw[i].className+'-ga')){
 +
    iw[i].className += ' GA'
 +
    iw[i].title = 'Эта статья является хорошей в другом языковом разделе'
 
   }
 
   }
 +
}
  
  }
 
  
  JSconfig.meta[name] = { 'description' : description, 'page' : prefpage || 0, 'default_value' : default_value };
+
function icqIcons(){
},
+
var a, spans = document.getElementById('content').getElementsByTagName('span')
 +
for (var i=0; a=spans[i]; i++)
 +
  if (a.className == 'ICQ')
 +
    a.style.backgroundImage = "url('http://status.icq.com/online.gif?icq="+a.id+"&img=5&randseed="+Math.floor(Math.random()*10000000)+"')"
 +
}
  
readCookies : function()
 
{
 
  var cookies = document.cookie.split("; ");
 
  var p =JSconfig.prefix.length;
 
  var i;
 
  
  for( var key in cookies )
+
function newSectionLink(){
  {
+
var plus = document.getElementById('ca-addsection')
  if( cookies[key].substring(0,p) == JSconfig.prefix )
+
if (!plus) return
  {
+
var custom = document.getElementById('add-custom-section')
    i = cookies[key].indexOf('=');
+
if (!custom) return
    //alert( cookies[key] + ',' + key + ',' + cookies[key].substring(p,i) );
+
plus.firstChild.setAttribute('href', custom.getElementsByTagName('a')[0].href)
    JSconfig.keys[cookies[key].substring(p,i)] = cookies[key].substring(i+1);
+
}
  }
+
  }
+
},
+
  
writeCookies : function()
 
{
 
  for( var key in JSconfig.keys )
 
  document.cookie = JSconfig.prefix + key + '=' + JSconfig.keys[key] + '; path=/; expires=Thu, 2 Aug 2009 10:10:10 UTC';
 
},
 
  
evaluateForm : function()
+
function editZeroSection(){
{
+
var body = document.getElementById('bodyContent')
  var w_ctrl,wt;
+
if (!body) return
  //alert('about to save JSconfig');
+
var h2s = body.getElementsByTagName('H2')
  for( var key in JSconfig.meta ) {
+
var h2 = h2s[0]
  w_ctrl = document.getElementById( JSconfig.prefix + key )
+
if (!h2) return
  if( w_ctrl )  
+
if (h2.parentNode.id == 'toctitle') h2 = h2s[1]
  {
+
if (!h2) return
    wt = typeof( JSconfig.meta[key].default_value );
+
var span = h2.firstChild
    switch( wt ) {
+
if (!span || span.className != 'editsection') return
    case 'boolean' : JSconfig.keys[key] = w_ctrl.checked; break;
+
var zero = span.cloneNode(true)
    case 'string' : JSconfig.keys[key] = w_ctrl.value; break;
+
body.insertBefore(zero, body.firstChild)
    }
+
var a = zero.getElementsByTagName('a')[0]
  }
+
if (a.href.indexOf('&section=T') == -1 )  a.title = a.title.replace(/:.*$/,': 0')
  }
+
else a.title = 'Править секцию: 0'
 +
a.setAttribute('href', wgScript + '?title='+encodeURIComponent(wgPageName) + '&action=edit&section=0')
 +
}
  
  JSconfig.writeCookies();
 
  return true;
 
},
 
  
setUpForm : function()
+
function mainPage(){
  {  
+
  if (wgArticleId == 23 || wgArticleId == 4401){
   var prefChild = document.getElementById('preferences');
+
   var li = addPortletLink('p-lang', wgArticlePath.replace(/\$1/, 'Википедия:Список_Википедий'), 'Полный список', 'interwiki-completelist')
   if( !prefChild ) return;
+
   if (li) li.style.fontWeight = 'bold'
   prefChild = prefChild.childNodes;
+
   var nstab = document.getElementById('ca-nstab-main') || document.getElementById('ca-current')
 +
  if (nstab && wgUserLanguage == 'ru')  nstab.firstChild.firstChild.nodeValue = 'Заглавная'
 +
}
 +
}
  
  //
 
  // make a list of all preferences sections
 
  //
 
  var tabs = new Array;
 
  var len = prefChild.length;
 
  for( var key = 0; key < len; key++ ) {
 
  if( prefChild[key].tagName &&
 
      prefChild[key].tagName.toLowerCase() == 'fieldset' )
 
    tabs.push(prefChild[key]);
 
  }
 
  
  //
+
//Collapsiblе: [[ВП:СБ]]
  // Create Widgets for all registered config keys
+
  //
+
  var w_div, w_label, w_ctrl, wt;
+
  for( var key in JSconfig.meta ) {
+
  w_div = document.createElement( 'DIV' );
+
  
  w_label = document.createElement( 'LABEL' );
+
var NavigationBarShowDefault = 2
  w_label.appendChild( document.createTextNode( JSconfig.meta[key].description ) )
+
var NavigationBarHide = '[скрыть]'
  w_label.htmlFor = JSconfig.prefix + key;
+
var NavigationBarShow = '[показать]'
  
  wt = typeof( JSconfig.meta[key].default_value );
+
var hasClass = (function (){
 +
var reCache = {}
 +
return function (element, className){
 +
  return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className)
 +
  }
 +
})()
  
  w_ctrl = document.createElement( 'INPUT' );
+
function collapsibleTables(){
  w_ctrl.id = JSconfig.prefix + key;
+
var Table, HRow,  HCell, btn, a, tblIdx = 0, colTables = []
 
+
var allTables = document.getElementsByTagName('table')
   // before insertion into the DOM tree
+
for (var i=0; Table = allTables[i]; i++){
   switch( wt ) {
+
   if (!hasClass(Table, 'collapsible')) continue
    case 'boolean' : w_ctrl.type = 'checkbox'; break;
+
   if (!(HRow=Table.rows[0])) continue
    case 'string'  : w_ctrl.type = 'text'; break;
+
  if (!(HCell=HRow.getElementsByTagName('th')[0])) continue
   }
+
  Table.id = 'collapsibleTable' + tblIdx
 
+
   btn = document.createElement('span')
  w_div.appendChild( w_label );
+
   btn.style.cssText = 'float:right; font-weight:normal; font-size:smaller'
   w_div.appendChild( w_ctrl );
+
   a = document.createElement('a')
   tabs[JSconfig.meta[key].page].appendChild( w_div );
+
   a.id = 'collapseButton' + tblIdx
 
+
   a.href = 'javascript:collapseTable(' + tblIdx + ');'  
   // after insertion into the DOM tree
+
  a.style.color = HCell.style.color
   switch( wt ) {
+
   a.appendChild(document.createTextNode(NavigationBarHide))
    case 'boolean' : w_ctrl.defaultChecked = w_ctrl.checked = JSconfig.keys[key]; break;
+
  btn.appendChild(a)
    case 'string' : w_ctrl.defaultValue = w_ctrl.value = JSconfig.keys[key]; break;
+
  HCell.insertBefore(btn, HCell.childNodes[0])
   }
+
  colTables[tblIdx++] = Table
 
+
  }
+
  addEvent(document.getElementById('preferences').parentNode, 'submit', JSconfig.evaluateForm );
+
 
  }
 
  }
 +
for (var i=0; i < tblIdx; i++)
 +
  if ((tblIdx > NavigationBarShowDefault && hasClass(colTables[i], 'autocollapse')) || hasClass(colTables[i], 'collapsed'))
 +
    collapseTable(i)
 
}
 
}
  
JSconfig.readCookies();
+
function collapseTable (idx){
addOnloadHook(JSconfig.setUpForm);
+
var Table = document.getElementById('collapsibleTable' + idx)
 
+
var btn = document.getElementById('collapseButton' + idx)
if (isMainPage && !isDiff)  
+
if (!Table || !btn) return false
{
+
var Rows = Table.rows
document.write('<style type="text/css">/*<![CDATA[*/ #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/</style>');
+
var isShown = (btn.firstChild.data == NavigationBarHide)
 +
btn.firstChild.data = isShown ?  NavigationBarShow : NavigationBarHide
 +
var disp = isShown ? 'none' : Rows[0].style.display
 +
for (var i=1; i < Rows.length; i++)
 +
    Rows[i].style.display = disp
 
}
 
}
  
/* подгрузка файла со скриптами для редактирования  *****************************************
+
function collapsibleDivs(){
  */
+
  var navIdx = 0, colNavs = [], i, NavFrame
  if (document.URL.indexOf("action=edit") > 0 || document.URL.indexOf("action=submit") > 0)
+
  var divs = document.getElementById('content').getElementsByTagName('div')
  {
+
  for (i=0; NavFrame = divs[i]; i++) {
        if (wgCanonicalNamespace != "Special")
+
  if (!hasClass(NavFrame, 'NavFrame')) continue
        {
+
  NavFrame.id = 'NavFrame' + navIdx
                document.write('<script type="text/javascript" src="/index.php?title=MediaWiki:Onlyifediting.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
+
  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)
 +
}
  
 
+
function collapseDiv(idx) {
  function addLoadEvent(func)  
+
  var div = document.getElementById('NavFrame' + idx)
  {
+
  var btn = document.getElementById('NavToggle' + idx)
  if (window.addEventListener)  
+
  if (!div || !btn) return false
  window.addEventListener("load", func, false);
+
var isShown = (btn.firstChild.data == NavigationBarHide)
  else if (window.attachEvent)  
+
  btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide
   window.attachEvent("onload", func);
+
var disp = isShown ? 'none' : 'block'
 +
for (var child = div.firstChild;  child != null;  child = child.nextSibling)
 +
   if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent'))
 +
      child.style.display = disp
 
}
 
}
  
Строка 210: Строка 169:
 
   case 'Search': importScript('MediaWiki:Search.js'); break
 
   case 'Search': importScript('MediaWiki:Search.js'); break
 
   }
 
   }
 +
}else if (wgAction != 'history'){
 +
  addOnloadHook(editZeroSection)
 +
  addOnloadHook(collapsibleDivs)
 +
  addOnloadHook(collapsibleTables)
 +
  addOnloadHook(mainPage)
 +
  importScript('MediaWiki:Wikiminiatlas.js', 'meta.wikimedia.org')
 +
  if (navigator.appName=='Microsoft Internet Explorer' && document.createStyleSheet)
 +
    document.createStyleSheet().addRule('.IPA', 'font-family: "Doulos SIL", "Charis SIL", Gentium, "DejaVu Sans", Code2000, "TITUS Cyberbit Basic", "Arial Unicode MS", "Lucida Sans Unicode", "Chrysanthi Unicode";')
 +
  if (wgNamespaceNumber == 0)
 +
    addOnloadHook(LinkFA)
 +
  else {
 +
    addOnloadHook(icqIcons)
 +
    addOnloadHook(newSectionLink)
 +
  }
 +
  if (wgAction=='edit' || wgAction=='submit') importScript('MediaWiki:Editpage.js')
 +
}
 +
 +
 +
if (wgUserGroups)
 +
for (var i=0; i<wgUserGroups.length; i++) switch (wgUserGroups[i]){
 +
case 'editor': importStylesheet('MediaWiki:Gadget-FlaggedRevs.css'); break
 +
case 'sysop': importScript('MediaWiki:Sysop.js'); break
 
}
 
}
  
// русификация кнопок на панели инструментов
+
// Сообщить об ошибке
if (wgAction == 'edit' || wgAction == 'submit')
+
//importScript( "MediaWiki:Wikibugs.js" )
addOnloadHook(function(){
+
if (mwEditButtons.length < 3) return;
+
mwEditButtons[0].imageFile = 'http://wiki.laser.ru/images/9/9a/Button_boldru.png';
+
mwEditButtons[1].imageFile = 'http://wiki.laser.ru/images/8/88/Button_italicru.png';
+
mwEditButtons[2].imageFile = 'http://wiki.laser.ru/images/0/03/Button_internal_link_ukr.png'
+
})
+
  
/* </pre> */
 
 
//</source>
 
//</source>

Версия 17:17, 26 января 2009

//See http://ru.wikipedia.org/wiki/project:code //<source lang=javascript>
 
importScript_ = importScript
importScript = function (page, proj){
 if (!proj) importScript_(page)
 else {
   if (proj.indexOf('.')==-1) proj += '.wikipedia.org'
   importScriptURI('http://'+proj+'/w/index.php?action=raw&ctype=text/javascript&title='+encodeURIComponent(page.replace(/ /g,'_')))
 }
}
 
addLoadEvent = addOnloadHook 
 
 
function ts_parseFloat(n){
 if (!n) return 0
 n = parseFloat(n.replace(/\./g, '').replace(/,/, '.'))
 return (isNaN(n) ? 0 : n)
}
 
 
function LinkFA(){
 var pLang = document.getElementById('p-lang')
 if (!pLang) return
 var iw = pLang.getElementsByTagName('li')
 for (var i=0; i < iw.length; i++)
   if (document.getElementById(iw[i].className+'-fa')){
     iw[i].className += ' FA'
     iw[i].title = 'Эта статья является избранной в другом языковом разделе'
   }else if (document.getElementById(iw[i].className+'-ga')){
     iw[i].className += ' GA'
     iw[i].title = 'Эта статья является хорошей в другом языковом разделе'
   }
}
 
 
function icqIcons(){
 var a, spans = document.getElementById('content').getElementsByTagName('span')
 for (var i=0; a=spans[i]; i++)
   if (a.className == 'ICQ') 
     a.style.backgroundImage = "url('http://status.icq.com/online.gif?icq="+a.id+"&img=5&randseed="+Math.floor(Math.random()*10000000)+"')"
}
 
 
function newSectionLink(){
 var plus = document.getElementById('ca-addsection')
 if (!plus) return
 var custom = document.getElementById('add-custom-section')
 if (!custom) return
 plus.firstChild.setAttribute('href', custom.getElementsByTagName('a')[0].href)
}
 
 
function editZeroSection(){
 var body = document.getElementById('bodyContent')
 if (!body) return
 var h2s = body.getElementsByTagName('H2')
 var h2 = h2s[0]
 if (!h2) return
 if (h2.parentNode.id == 'toctitle') h2 = h2s[1]
 if (!h2) return
 var span = h2.firstChild
 if (!span || span.className != 'editsection') return
 var zero = span.cloneNode(true)
 body.insertBefore(zero, body.firstChild)
 var a = zero.getElementsByTagName('a')[0]
 if (a.href.indexOf('&section=T') == -1 )  a.title = a.title.replace(/:.*$/,': 0')
 else a.title = 'Править секцию: 0'
 a.setAttribute('href', wgScript + '?title='+encodeURIComponent(wgPageName) + '&action=edit&section=0')
}
 
 
function mainPage(){
 if (wgArticleId == 23 || wgArticleId == 4401){
  var li = addPortletLink('p-lang', wgArticlePath.replace(/\$1/, 'Википедия:Список_Википедий'), 'Полный список', 'interwiki-completelist')
  if (li) li.style.fontWeight = 'bold'
  var nstab = document.getElementById('ca-nstab-main') || document.getElementById('ca-current')
  if (nstab && wgUserLanguage == 'ru')  nstab.firstChild.firstChild.nodeValue = 'Заглавная'
 }
}
 
 
//Collapsiblе: [[ВП:СБ]]
 
var NavigationBarShowDefault = 2
var NavigationBarHide = '[скрыть]'
var NavigationBarShow = '[показать]'
 
var hasClass = (function (){
 var reCache = {}
 return function (element, className){
   return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className)
  }
})()
 
function collapsibleTables(){
 var Table, HRow,  HCell, btn, a, tblIdx = 0, colTables = []
 var allTables = document.getElementsByTagName('table')
 for (var i=0; Table = allTables[i]; i++){
   if (!hasClass(Table, 'collapsible')) continue
   if (!(HRow=Table.rows[0])) continue
   if (!(HCell=HRow.getElementsByTagName('th')[0])) continue
   Table.id = 'collapsibleTable' + tblIdx
   btn = document.createElement('span')
   btn.style.cssText = 'float:right; font-weight:normal; font-size:smaller'
   a = document.createElement('a')
   a.id = 'collapseButton' + tblIdx
   a.href = 'javascript:collapseTable(' + tblIdx + ');' 
   a.style.color = HCell.style.color
   a.appendChild(document.createTextNode(NavigationBarHide))
   btn.appendChild(a)
   HCell.insertBefore(btn, HCell.childNodes[0])
   colTables[tblIdx++] = Table
 }
 for (var i=0; i < tblIdx; i++)
   if ((tblIdx > NavigationBarShowDefault && hasClass(colTables[i], 'autocollapse')) || hasClass(colTables[i], 'collapsed'))
     collapseTable(i)
}
 
function collapseTable (idx){
 var Table = document.getElementById('collapsibleTable' + idx)
 var btn = document.getElementById('collapseButton' + idx)
 if (!Table || !btn) return false
 var Rows = Table.rows
 var isShown = (btn.firstChild.data == NavigationBarHide)
 btn.firstChild.data = isShown ?  NavigationBarShow : NavigationBarHide
 var disp = isShown ? 'none' : Rows[0].style.display
 for (var i=1; i < Rows.length; i++) 
    Rows[i].style.display = disp
}
 
function collapsibleDivs(){
 var navIdx = 0, colNavs = [], i, NavFrame
 var divs = document.getElementById('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)
}
 
function collapseDiv(idx) {
 var div = document.getElementById('NavFrame' + idx)
 var btn = document.getElementById('NavToggle' + idx)
 if (!div || !btn) return false
 var isShown = (btn.firstChild.data == NavigationBarHide)
 btn.firstChild.data = isShown ? NavigationBarShow : NavigationBarHide 
 var disp = isShown ? 'none' : 'block'
 for (var child = div.firstChild;  child != null;  child = child.nextSibling)
   if (hasClass(child, 'NavPic') || hasClass(child, 'NavContent')) 
      child.style.display = disp
}
 
//Execution
if (wgCanonicalNamespace == 'Special'){
  switch (wgCanonicalSpecialPageName){
   case 'Upload': importScript('MediaWiki:Upload.js'); break
   case 'Search': importScript('MediaWiki:Search.js'); break
  }
}else if (wgAction != 'history'){
  addOnloadHook(editZeroSection)
  addOnloadHook(collapsibleDivs)
  addOnloadHook(collapsibleTables)
  addOnloadHook(mainPage)
  importScript('MediaWiki:Wikiminiatlas.js', 'meta.wikimedia.org')
  if (navigator.appName=='Microsoft Internet Explorer' && document.createStyleSheet)
    document.createStyleSheet().addRule('.IPA', 'font-family: "Doulos SIL", "Charis SIL", Gentium, "DejaVu Sans", Code2000, "TITUS Cyberbit Basic", "Arial Unicode MS", "Lucida Sans Unicode", "Chrysanthi Unicode";')
  if (wgNamespaceNumber == 0)
    addOnloadHook(LinkFA)
  else {
    addOnloadHook(icqIcons)
    addOnloadHook(newSectionLink)
  }
  if (wgAction=='edit' || wgAction=='submit') importScript('MediaWiki:Editpage.js')
}
 
 
if (wgUserGroups)
for (var i=0; i<wgUserGroups.length; i++) switch (wgUserGroups[i]){
 case 'editor': importStylesheet('MediaWiki:Gadget-FlaggedRevs.css'); break
 case 'sysop': importScript('MediaWiki:Sysop.js'); break
}
 
// Сообщить об ошибке
//importScript( "MediaWiki:Wikibugs.js" )
 
//</source>