MediaWiki:Monobook.js: Unterschied zwischen den Versionen

Aus HuskyWiki
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
Zeile 1: Zeile 1:
// Siehe [[MediaWiki:Common.js]]
//================================================================================
//*** moveEditsection: Moving of the editsection links
// Rückmeldungsskript importieren
if (wgNamespaceNumber == 0 && wgIsArticle == true && wgCurRevisionId != false) {
  if (wgUserName == null) {
  document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:If-anon-feedback.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"><\/script>');
  } else {
  document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:If-user-feedback.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"><\/script>');
  }
}
if (wgUserName == null && (wgPageName == "Spezial:Suche" || (wgNamespaceNumber == 0 && wgArticleId == 0)) && navigator.cookieEnabled == true) {
  document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:If-search.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"><\/script>');
}


  // Seitenmenüleistenfunktionen importieren
/*
  document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:If-hideable-portlets.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"><\/script>');
* moveEditsection
  document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:If-hideable-sidebar.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"><\/script>');
* Dieses Script verschiebt die [Bearbeiten]-Buttons vom rechten Fensterrand
* direkt rechts neben die jeweiligen Überschriften.
* This script moves the [edit]-buttons from the right border of the window
* directly right next to the corresponding headings.
  *
* Zum Abschalten die folgende Zeile (ohne führendes Sternchen) in die eigene
* monobook.js (zu finden unter [[Special:Mypage/monobook.js|Benutzer:Name/monobook.js]]) kopieren:
* var oldEditsectionLinks = true;
*
* dbenzhuser (de:Benutzer:Dbenzhuser)
*/
addOnloadHook(function() {
    if (typeof oldEditsectionLinks != 'undefined' && oldEditsectionLinks)  return;
    var spans = document.getElementsByTagName("span");
    for (var i=0; i<spans.length; i++) {
        var span = spans[i];
        if (span.className != "editsection")    continue;
        span.style.fontSize = "x-small";
        span.style.fontWeight = "normal";
        span.style.cssFloat = "none";
        span.style.marginLeft = "0px";
        span.parentNode.appendChild(document.createTextNode(" "));
        span.parentNode.appendChild(span);
    }
});


// Hinweis auf Groß-/Kleinschreibung
//================================================================================
document.write('<style type="text/css">.cNBody {padding-top: 1px !important;}<\/style>');
//*** pageview counter
var caseNotice;
// SEE ALSO [[MediaWiki:Pagecounter.js]]
function CaseNote(x) {
//    Please talk to User:LeonWeber before changing anything or
  if (x != 1) {
//    if there are any issues with this.
  if ($("searchInput").value == "" || ($("lsearchbox") && $("searchInput").value == $("lsearchbox").value)) {
 
    $("searchInput").setAttribute("onkeyup", "CaseNote(1)");
// disable the counter
    $("searchform").innerHTML = $("searchform").innerHTML; // f***ing IE
var disable_counter = 0;
  }
 
  } else if (x > 0 && !caseNotice && $("searchInput").value.search(/^[a-zäöü]/) > -1) {
document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:Pagecounter.js&action=raw&ctype=text/javascript&dontcountme=s&smaxage=3600"></script>');
  var caseNote = document.createElement("div");
  caseNote.style.color = "darkred";
  caseNote.innerHTML = '<span style="font-size: 9px;">Groß-/Kleinschreibung!<\/span>';
  $("searchBody").className = "pBody cNBody";
  $("searchBody").insertBefore(caseNote, $("searchBody").firstChild);
  caseNotice = 1;
  }
}
addOnloadHook(CaseNote);


// Siehe auch
//================================================================================
document.write('<style type="text/css">#showSeeAlso {display: none;}<\/style>');
//*** Add button 'Inverse selection' on [[Special:Undelete]]
function showSeeAlso() {
  if (wgNamespaceNumber == 0 && $("showSeeAlso") && !$("Vorlage_Siehe_auch") && url.indexOf("oldid=") < 0) {
  $("contentSub").style.margin = "0";
  $("contentSub").innerHTML += $("showSeeAlso").innerHTML;
  }
}
addOnloadHook(showSeeAlso);


var groupArray = '#'+wgUserGroups;
/** Fügt das Bookmarklet zum Markieren aller Versionen auf Special:Undelete ein */
if (groupArray.indexOf("sysop") > 0) {
addOnloadHook(function() {
   document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:If-sidebar-bug.js&amp;action=raw&amp;ctype=text/javascript&amp;dontcountme=s"><\/script>');
  var form        = document.forms["undelete"];
}
  if (!form)  return;
  var elements    = form.elements;
  var resetBtn  = elements["mw-undelete-reset"];
  if (!resetBtn) return;
  var toggleBtn   = document.createElement("input");
  toggleBtn.type = "button";
  toggleBtn.value ="Auswahl umkehren";
  toggleBtn.onclick  = function() {
      for (var i=0; i<elements.length; i++) {
          var input  = elements[i];
          if (input.type != "checkbox")  continue;
          input.checked  = !input.checked;
      }
  }
  resetBtn.parentNode.insertBefore(toggleBtn, resetBtn);
});

Aktuelle Version vom 11. Mai 2008, 23:53 Uhr

//================================================================================
//*** moveEditsection: Moving of the editsection links

/*
 * moveEditsection
 * Dieses Script verschiebt die [Bearbeiten]-Buttons vom rechten Fensterrand
 * direkt rechts neben die jeweiligen Überschriften.
 * This script moves the [edit]-buttons from the right border of the window
 * directly right next to the corresponding headings.
 *
 * Zum Abschalten die folgende Zeile (ohne führendes Sternchen) in die eigene
 * monobook.js (zu finden unter [[Special:Mypage/monobook.js|Benutzer:Name/monobook.js]]) kopieren:
 * var oldEditsectionLinks = true;
 *
 * dbenzhuser (de:Benutzer:Dbenzhuser)
 */
addOnloadHook(function() {
    if (typeof oldEditsectionLinks != 'undefined' && oldEditsectionLinks)   return;
    var spans = document.getElementsByTagName("span");
    for (var i=0; i<spans.length; i++) {
        var span = spans[i];
        if (span.className != "editsection")    continue;
        span.style.fontSize = "x-small";
        span.style.fontWeight = "normal";
        span.style.cssFloat = "none";
        span.style.marginLeft = "0px";
        span.parentNode.appendChild(document.createTextNode(" "));
        span.parentNode.appendChild(span);
    }
});

//================================================================================
//*** pageview counter
// SEE ALSO [[MediaWiki:Pagecounter.js]]
//     Please talk to User:LeonWeber before changing anything or 
//     if there are any issues with this.

// disable the counter
var disable_counter = 0; 

document.write('<script type="text/javascript" src="/w/index.php?title=MediaWiki:Pagecounter.js&action=raw&ctype=text/javascript&dontcountme=s&smaxage=3600"></script>');

//================================================================================
//*** Add button 'Inverse selection' on [[Special:Undelete]]

/** Fügt das Bookmarklet zum Markieren aller Versionen auf Special:Undelete ein */
addOnloadHook(function() {
   var form        = document.forms["undelete"];
   if (!form)  return;
   var elements    = form.elements;
   var resetBtn   = elements["mw-undelete-reset"];
   if (!resetBtn) return;
   var toggleBtn   = document.createElement("input");
   toggleBtn.type  = "button";
   toggleBtn.value ="Auswahl umkehren";
   toggleBtn.onclick   = function() {
       for (var i=0; i<elements.length; i++) {
           var input   = elements[i];
           if (input.type != "checkbox")   continue;
           input.checked   = !input.checked;
       }
   }
   resetBtn.parentNode.insertBefore(toggleBtn, resetBtn);
});