User:Stefan-Xp/monobook.js
Jump to navigation
Jump to search
Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
The accompanying .css page for this skin is at User:Stefan-Xp/monobook.css. |
var ImageAnnotator_zoom_threshold = 0.0; // Oder ein anderer Wert >= 0
importScript( 'User:Flominator/monobook.js' );
// Returns <li><a href="url">name</a></li>
function addlilink(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
var txt = document.createTextNode(name);
na.appendChild(txt);
var li = document.createElement('li');
li.appendChild(na);
return li;
}
// Get's the URL version of the page title.
function get_tidy_title()
{
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
// cut everything up to "title=" from the start and everything past "&action=edit" from the end
editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit'));
return editlk;
}
function add_image_tabs()
{
var imagetitle = get_tidy_title();
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
tabs.appendChild(addlilink('http://en.Wikipedia.org/wiki/' + imagetitle, 'en'));
}
function do_onload()
{
if (document.title.indexOf('Image:') == 0)
add_image_tabs();
if (document.title.indexOf('User:') == 0
|| document.title.indexOf('User talk:') == 0)
add_block_tab();
else if (document.title.indexOf('Block user') == 0) // could stand to be more robust
do_blockip_stuff();
}
if (window.addEventListener)
window.addEventListener("load", do_onload, false);
else if (window.attachEvent)
window.attachEvent("onload", do_onload);
//Vorbelegung für Upload-Formular
//<nowiki>
addOnloadHook(function () {
if (wgPageName != 'Special:Upload') return;
var beschreibung = '{{User:Stefan-Xp/Bild-GFDL Vorlage\n'
+ '|EN = \n'
+ '|DE = \n'
+ '|description = \n<!--Further Descriptions in Other Languanges can be added here-->\n\n'
+ '|LOC = \n'
+ '|DATE = ~~~~~\n'
+ '|CAT = \n'
+ '|OV =\n<gallery>\n\n</gallery>\n'
+ '}}';
;
document.getElementById('wpUploadDescription').value = beschreibung;
});
//</nowiki>