User:Körnerbrötchen/monobook.css

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.
var autoAppend=true;

// addFlickrOK tagger (initially developed by Patstuart)
function flickrOK (){
  var needAppend;
  if (autoAppend)
    needAppend=document.editform.wpTextbox1.value;
  document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(/({{User:FlickreviewR.*}})|({{(F|f)lickrr?eview}})/g, '{{'+'flickrreview|Koernerbroetchen|{{sub'+'st:CURRENTDAY}}-{{sub'+'st:CURRENTMONTHNAME}}-{{sub'+'st:CURRENTYEAR}}}}');
  if (autoAppend && needAppend==document.editform.wpTextbox1.value)
    document.editform.wpTextbox1.value+='{'+'{flickrreview|Koernerbroetchen|{{sub'+'st:CURRENTDAY}}-{{sub'+'st:CURRENTMONTHNAME}}-{{sub'+'st:CURRENTYEAR}}}}'    
  document.editform.wpSummary.value = '[[Commons:Flickr images|Flickrreview]] passed';
  document.editform.wpMinoredit.checked = true;
  document.editform.submit();
}

function addFunction(functionNameString, buttonDisplayName, checkNameSpaceFlag)
{
  if (document.URL.indexOf("functionName")>-1)
  {
    var functionNameTmp = document.URL.substring(document.URL.indexOf("functionName")+13);
    if (functionNameTmp==functionNameString)
    {
      document.write("<script type='text/javascript'>addOnloadHook(function() {eval('"+functionNameString+"()');})</SCRIPT>");
      return;
    }
  }

  if (checkNameSpaceFlag)
    document.write('<script type="text/javascript">addOnloadHook(' +
      'function (){ '+
        'if (wgNamespaceNumber == 6 && document.editform) '+
           'addPortletLink("p-cactions", "javascript:'+functionNameString+'()", "' +buttonDisplayName+'", ""); ' +
        'else if(wgCanonicalNamespace == "Image")'+
           'addPortletLink("p-cactions", "../w/index.php?title='+escape(wgPageName)+'&action=edit&functionName='+functionNameString+'", "' +buttonDisplayName+'", ""); ' +
      '});'
      +'</SCRIPT>');
  else 
    document.write('<script type="text/javascript">addOnloadHook(' +
      'function (){ '+
        'if (document.editform) '+
           'addPortletLink("p-cactions", "javascript:'+functionNameString+'()", "' +buttonDisplayName+'", ""); ' +
        'else '+
           'addPortletLink("p-cactions", "../w/index.php?title='+escape(wgPageName)+'&action=edit&functionName='+functionNameString+'", "' +buttonDisplayName+'", ""); ' +
      '});'
      +'</SCRIPT>');  
}

function addImageFunction(functionNameString, buttonDisplayName)
{
  if (wgCanonicalNamespace=="Image")
    addFunction(functionNameString, buttonDisplayName, true);
}
addImageFunction("flickrOK", "{"+"{flickrreview}}");