User:Geri340/monobook.js

From Wikimedia Commons, the free media repository
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.
//
// Insert a personalized Texttemplate into the Special:Upload edit box.
//
function setSpecialUploadTemplate()
{
 var uploadURL = 'http://commons.wikimedia.org/w/index.php?title=Special:Upload&uselang=ownwork';

 // I upload mostly my own work
 document.getElementById('n-upload').firstChild.href = uploadURL;

 // preload input form
 if(window.location.href == uploadURL)
 {
  var editbox = document.getElementById('wpUploadDescription');
  if( editbox.value == '' )
  {
   editbox.value = "{"+"{Information\n"
                 + "|Description={{de| }} {{en| }}{{sk| }}\n"
                 + "|Source=Own work\n"
                 + "|Date=\n"
                 + "|Author=[[User:Geri340|Geri340]]\n"
                 + "|Permission=See license\n"
                 + "|other_versions=\n"
                 + "}"+"}\n\n"
                 + "== Licensing ==\n"
                 + "{"+"{self|GFDL|cc-by-sa-3.0|author=I, [[User:Geri340|Geri340]]}"+"}";
  }
 }
}

addOnloadHook(setSpecialUploadTemplate);