User:PawełS/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:PawełS/monobook.css. |
//SearchBox
document.write('<script type="text/javascript" src=" \
http://pl.wikipedia.org/w/index.php?title=Wikipedysta:Nux/SearchBox.js \
&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// en.wiki[[User:Dschwen/wikiminiatlas2.js]] - please include this line
document.write('<script type="text/javascript" src="'
+ 'http://de.wikipedia.org/w/index.php?title=User:Dschwen/wikiminiatlas2.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// en.wiki[[User:Zocky/AutoComplete.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Zocky/AutoComplete.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
// Przyciski na dole
addOnloadHook(function () {
var tabs = document.getElementById('p-cactions').cloneNode(true);
tabs.id = 'mytabs';
var listitems = tabs.getElementsByTagName('LI');
for (i=0;i<listitems.length;i++) {
if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id;
}
content = document.getElementById("content"); // Find the content div
content.parentNode.insertBefore(tabs, content.nextSibling); // Place tab list right after content div
});
// Adds a "Changes since last load" link to your watchlist.
$(function () {
if (!mw.config.get('wgCanonicalSpecialPageName') || mw.config.get('wgCanonicalSpecialPageName') != "Watchlist") return;
if (!document.forms[0] || !document.forms[0].namespace) return;
var link = document.createElement('a');
link.id = 'listSince';
link.href = '#listSince'; // must have a href to show as link!
var then = +(new Date());
var fixLinkHref = function () {
var url = window.location.href.split('#')[0];
var days = ( +(new Date()) - then )/(1000 * 3600 * 24);
if (url.match(/[?&]days=/))
this.href = url.replace(/([?&]days=)[^&]*/, '$1'+days);
else
this.href = url + (url.indexOf('?') < 0 ? '?':'&') + 'days=' + days;
return true;
};
link.onclick = fixLinkHref;
link.onmousedown = fixLinkHref; // react to middle clicks too
var frag = document.createDocumentFragment();
frag.appendChild(document.createTextNode(' | '));
frag.appendChild(link);
link.appendChild(document.createTextNode('Changes'));
frag.appendChild(document.createTextNode(' since last load.'));
// just one little ID attribute would be _so_ nice...
var nsSelectForm = document.getElementsByTagName('form')[0];
nsSelectForm.parentNode.insertBefore(frag, nsSelectForm);
});
// This script adds "Google search" and "Yahoo! search" links to the toolbox. Requires Wikipedia:WikiProject User scripts/Scripts/addLink.
$(function () {
if (mw.config.get('wgCanonicalNamespace') == "Special")
return; // no links for special pages
var title = mw.config.get('wgTitle');
if (mw.config.get('wgCanonicalNamespace') != "")
title = title.replace(/^.*\//, ""); // subpage name only
var query = encodeURIComponent('"'+title+'"' );
mw.util.addPortletLink('p-tb', 'http://www.google.com.pl/search?ie=utf-8&oe=utf-8&q='+query,
'Googluj', 't-googlesearch', 'Search Google for "'+title+'"', 'G');
});
// Note: This is now just a thin wrapper around mw.util.addPortletLink() from wikibits.js. Please consider using mw.util.addPortletLink() directly instead.
function addLink(where, url, name, id, title, key, after) {
// addLink() accepts either an id or a DOM node, mw.util.addPortletLink() only takes a node
if (after && !after.cloneNode)
after = document.getElementById(after);
return mw.util.addPortletLink(where, url, name, id, title, key, after);
}
//