// Установка всплывающих окошек от [[en:User:Lupin/popups.js]]
// Проверять хорошо на мелких статьях (пример: [[Бухта (география)|Бухта]])
/*
mw.loader.load(
'https://en.wikipedia.org/w/index.php?title=User:Lupin/popups.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s');
popupDelay = 1.5; // задержка в секундах перед всплытием окна
popupStructure = 'fancy'; // улучшенная структура всплывающего окна
imagePopupsForImages = false; // не всплывают картинки
popupMaxWidth = 400; // расширена ширина всплывающего окна
popupMaxPreviewSentences = 10; // больше предложений в окне
popupMaxPreviewCharacters = 666; // больше символов в окне
popupPreviewFirstParOnly = false; // цитируется не только первый абзац
*/
/*
function toggleReferenceBlockFormat(event)
{
event = event || window.event;
event.preventDefault();
var classes = event.target.className.match(/(^|\s)(reference\-[^\-]+\-format)(\s|$)/);
var format = classes && classes.length ? classes[2] : '';
if (format)
{
var nodes = getElementsByClassName(document, 'div', 'reference-description-box');
for (var index = 0, count = nodes.length; index < count; index++)
{
var node = nodes[index];
var classes = node.className.split(/\s+/);
if (classes.indexOf(format) != -1)
{
node.style.display = 'block';
}
else
{
node.style.display = 'none';
}
}
}
return false;
}
addOnloadHook(
function()
{
var formats = [
'reference-list-format', 'список', '',
'reference-wiki-format', 'вики', '',
'reference-bibtex-format', 'BibTeX', '',
'reference-isbd-format', 'ISBD', '',
'reference-iso690-format', 'ISO\u00a0690', '',
];
var container = getElementsByClassName(document, 'p', 'reference-format-list')[0];
if (container && formats.length)
{
container.style.display = 'block';
for (var index = 0, count = formats.length; index < count;)
{
var node = document.createElement('a');
node.setAttribute('href', '#' + Math.random().toString());
node.setAttribute('class', formats[index++] + ' reference-format-switcher');
node.appendChild(document.createTextNode(formats[index++]));
node.setAttribute('title', formats[index++]);
addHandler(node, 'click', toggleReferenceBlockFormat);
container.appendChild(node);
if (index < count)
{
container.appendChild(document.createTextNode(', '));
}
else
{
container.appendChild(document.createTextNode('.'));
}
}
toggleReferenceBlockFormat(formats[0]);
}
}
);
*/