Участник:Morpheios Melas/monobook.js: различия между версиями
Содержимое удалено Содержимое добавлено
если не двигать мышью 50 секунд то счетчик останавливается до первого движения |
Нет описания правки |
||
Строка 1:
document.write('<script type="text/javascript" src="'
+ 'http://ru.wikipedia.org/w/index.php?title=MediaWiki:ExtSearchPanel.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
document.write('<script type="text/javascript" src="'
+ 'http://ru.wikipedia.org/w/index.php?title=MediaWiki:ExtSearch.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
auto_comment = 1;
/* Требуется для разных функций */
function addlilink(tabs, url, name, id, title, key)
{
var na = document.createElement('a');
na.href = url;
na.appendChild(document.createTextNode(name));
var li = document.createElement('li');
if(id) li.id
li.appendChild(na);
tabs.appendChild(li);
if(id)
{
if(key && title)
{
ta[id] = [key, title];
else if(key)
{
ta[id] = [key, ''];
}
else if(title)
{
ta[id] = ['', title];
}
}
}
/* Требуется для разных функций */
function addTab(url, name, id, title, key)
{
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
return addlilink(tabs, url, name, id, title, key);
}
/* Добавление ссылки в панель навигации (над панелью поиска) */
function addToolboxLink(url, name, id)
{
var tb = document.getElementById('p-navigation').getElementsByTagName('ul')[0];
addlilink(tb, url, name, id);
}
gsKateInsertBefore = 'pt-mycontris'; // leave blank to append after "logout"
function KateLink() {
var user = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
user = user.substring(user.indexOf('title=') + 6, user.lastIndexOf('&action=edit'));
user = user.substring(user.indexOf(':') + 1);
var li = document.createElement( 'li' );
li.id = 'pt-kate';
var a = document.createElement( 'a' );
a.appendChild( document.createTextNode( 'счётчик' ) ); // eh, the css makes the text lowercase
a.href = 'http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?dbname=ruwiki_p&user=' + user;
li.appendChild(
if ( ! gsKateInsertBefore ) {
document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
} else {
var before = document.getElementById( gsKateInsertBefore );
before.appendChild( li, before );
}
if (window.addEventListener)
window.addEventListener('load', KateLink, false);
else
if (window.attachEvent)
window.attachEvent('onload', KateLink);
importScript('User:Morpheios Melas/articlecount.js');
|