Zum Inhalt dieser Seite

Greasemonkey-Skripte

Weiter unten sind die in meiner Firefox-Konfiguration verwendeten und selbst geschriebenen bzw. veränderten Greasemonkey-Skripte aufgeführt.
  • Icon für Abschnitt erweitern/schliessen - erweitert/schliesst den Code-Abschnitt.
  • Icon für Markiervorgang - markiert den Code-Abschnitt, um ihn bequemer kopieren zu können.
  • Icon für Download - lädt das Skript herunter bzw. installiert dieses im Firefox.

Nach oben mediawikilinktoedituser.user.js

Erstellt auf Mediawiki-Benutzerseiten einen Link zu Special:EditUser (die Mediawiki-Erweiterung EditUser muss installiert sein).
Abschnitt erweitern/schliessen  Code markieren  Download Dauerhaft aktiviert  Gespiegelt
// ==UserScript==
// @name         MediaWiki LinkToEditUser
// @namespace    http://openuserjs.org/users/ardiman
// @description  Gives on userpages of mediawikis a link to Special:EditUser (you'll need mw-extension EditUser on that wiki).
// @description:de-DE Erstellt auf Mediawiki-Benutzerseiten einen Link zu Special:EditUser (die Mediawiki-Erweiterung EditUser muss installiert sein).
// @grant        none
// @homepage     https://github.com/ardiman/userscripts/tree/master/mediawikilinktoedituser
// @icon         https://raw.githubusercontent.com/ardiman/userscripts/master/scriptlogo.gif
// @include      /wiki/(Benutzer|User).*/
// @include      /title=(Benutzer|User):.*&action=edit/
// @license      CC BY-NC-SA 3.0; https://creativecommons.org/licenses/by-nc-sa/3.0/
// @supportURL   https://github.com/ardiman/userscripts/issues
// @version      1.0.5
// @date         2014-11-21
// ==/UserScript==
 
var h1First = document.evaluate("//h1[@id='firstHeading']//span", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE , null);
var userName = h1First.snapshotItem(0).innerHTML.replace(/ /g,"+").replace(/“/g,"").replace(/\/.*/g,"");
userName = encodeURI(userName.substring(userName.lastIndexOf(":")+1));
 
var ulMenu = document.evaluate("//div[@id='p-cactions']//div//ul", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE , null);
var liChConf = ulMenu.snapshotItem(0).appendChild(document.createElement('li'));
 
liChConf.innerHTML='<a href="/index.php?title=Special:EditUser&amp;username='+userName+'">Konfiguration</a>';

Nach oben phpbbcountposts.user.js

Nummeriert in phpBB-Foren die Beiträge in einem Thread. Funktioniert nur bei aufsteigender Sortierung der Beiträge.
Abschnitt erweitern/schliessen  Code markieren  Download Dauerhaft aktiviert  Gespiegelt
// ==UserScript==
// @name         phpBB Count Posts
// @namespace    http://openuserjs.org/users/ardiman
// @description  Shows number of post in phpbb-thread.
// @description:de-DE  Nummeriert die Beiträge in phpbb-Thread.
// @grant        GM_getValue
// @grant        GM_setValue
// @homepage     https://github.com/ardiman/userscripts/tree/master/phpbbcountposts
// @icon         https://raw.githubusercontent.com/ardiman/userscripts/master/scriptlogo.gif
// @include      */viewtopic.php*
// @exclude      http://www.camp-firefox.de/forum/*
// @license      CC BY-NC-SA 3.0; https://creativecommons.org/licenses/by-nc-sa/3.0/
// @supportURL   https://github.com/ardiman/userscripts/issues
// @version      1.0.7
// @date         2014-11-21
// ==/UserScript==
 
(function() {
	var nodes = document.evaluate(
		"//p[@class='author']",
		document,
		null,
		XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
		null);
	var numberspanposition = GM_getValue("counterposition", -1);
	if (numberspanposition === -1) {
		GM_setValue("counterposition", 0);
		numberspanposition = 0;
	}
	var startingpost = parseInt(get_url_param('start','0'))+1;
	if (startingpost === 1) {
		var lnks = document.evaluate("//h2/a[contains(@href,'&start=')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE , null);
		if (lnks.snapshotItem(0) != null) startingpost = parseInt(get_url_param('start',lnks.snapshotItem(0).href))+1;
	}
	for(var i=0; i<nodes.snapshotLength; i++) {
		var authornode = nodes.snapshotItem(i);
		var numberspan = document.createElement("span");
		numberspan.setAttribute("class","gmphpbb_CP_numberspan");
		switch (numberspanposition) {
			case 1:
				numberspan.appendChild(document.createTextNode(" #"+(i+startingpost)));
				authornode.appendChild(numberspan);
				break;
			default:
				numberspan.appendChild(document.createTextNode("#"+(i+startingpost)+" "));
				authornode.insertBefore(numberspan,authornode.firstChild.nextSibling);
				break;
		}
	}
})();
 
function get_url_param( name, searchtype)
{
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regexS = "[\\?&]"+name+"=([^&#]*)";
	var regex = new RegExp( regexS );
	if (searchtype == "0") {
		var results = regex.exec( window.location.href );
	} else {
		var results = regex.exec( searchtype );
	}
 
	if ( results == null )
		return "0";
	else
		return results[1];
}

Nach oben phpbbnewtopics.user.js

Damit wird neben dem Button "Neues Thema" eine Schaltfläche erstellt, die alle neuen Posts in Tabs öffnet.
Abschnitt erweitern/schliessen  Code markieren  Download Dauerhaft aktiviert  Gespiegelt
// ==UserScript==
// @name         phpBB New Topics
// @namespace    http://openuserjs.org/users/ardiman
// @description  Generates button which opens all new topics of phpBB3-boards in tabs.
// @description:de-DE Neben dem Button "Neues Thema" wird eine Schaltfläche erstellt, die alle neuen Posts in Tabs öffnet.
// @grant        GM_openInTab
// @homepage     https://github.com/ardiman/userscripts/tree/master/phpbbnewtopics
// @icon         https://raw.githubusercontent.com/ardiman/userscripts/master/scriptlogo.gif
// @include      */viewforum.php*
// @license      CC BY-NC-SA 3.0; https://creativecommons.org/licenses/by-nc-sa/3.0/
// @supportURL   https://github.com/ardiman/userscripts/issues
// @version      1.0.5
// @date         2014-11-21
// ==/UserScript==
 
(function (){
 
// Konfiguration
var maxlnks = 0;  // 0=open all new threads, 10=open first 10 new threads
var showBtnIf = 1; // 0=button will always be shown, 5=show only, if there are more than 4 new threads
var useTimeout = true; // don't attempt delay on thread-read cookie setting - YMMV - the timeout delay didn't work for me, so =false
var tOut = 800;   // set timeout in milliseconds for opening (cookies won't be stored if too low!)
var oMode = false; // =true: show first *unread* post, =false: show first post/beginning of thread
// Ende der Konfiguration
 
/* x-browser event register */
function addEvent(elm, evType, fn, useCapture) {
    if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true; }
    else if (elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r; }
    else { elm['on' + evType] = fn; }
}
 
/* x-browser open tab */
function openTab(url) {
    if (typeof GM_openInTab != 'undefined') GM_openInTab(url);
    // if (typeof GM_openInTab != 'undefined') chromeWin.openNewTabWith(url,url,null,true);
    else if (typeof PRO_openInTab != 'undefined') PRO_openInTab(url,2);
    else window.open(url);
}
 
var f = 0;
var newposts = new Array();
// alle Links zu neuen Beitraegen finden
var lnks = document.evaluate("//a[contains(@href,'&view=unread#unread')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE , null);
 
for (var i=0; i < lnks.snapshotLength; i++) {
  thisnode = lnks.snapshotItem(i);
  if (oMode) {
    newposts.push(thisnode.href);  // den direkten Link zum ungelesen Beitrag speichern
   } else {
    newposts.push(thisnode.href.replace(/&view=unread#unread/, ""));  // (bereinigten) Link zum Thread speichern
  }
  f++
  // falls nur die ersten x neuen Beitraege geoeffnet werden sollen, dann raus hier:
  if (f+1 > maxlnks && maxlnks > 0) break;
}
 
// Button generieren, sofern noetig
if (f >= showBtnIf) {
  // Zieldiv finden
  var targetnode = document.evaluate("//div[@class='buttons']", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
  // normalerweise ist erster div-Abschnitt mit class=buttons {snapshotItem(0)} derjenige mit dem Button "NeuesThema" -> da soll's also hin
  var btn = targetnode.snapshotItem(0).appendChild(document.createElement('button'));
  if (f > 1) {
    btn.innerHTML = "&Ouml;ffne " + f + " neue Beitr&auml;ge";
   } else {
    btn.innerHTML = "&Ouml;ffne neuen Beitrag";
  }
  btn.style.background='#EEEEEE';
  btn.style.color='#BC2A4D';
  btn.style.fontWeight='bold';
  btn.style.fontSize='0.9em';
  btn.style.height='25px';
  addEvent(btn, "click",
    function(e) {
      if (maxlnks==0) this.style.display = 'none';
      if (e && e.target) e.preventDefault();
      else window.event.returnValue = false;
      if (useTimeout) {
        var i = -1;
        function inner() {
          if(++i < f) openTab(newposts[i]);
          else clearInterval(timer);
        }
        var timer = setInterval(inner, tOut);
      } else {
        for (var i=0; i < newposts.length; i++)
          openTab(newposts[i]);
      }
    }
  , false);
  }
})();
 
 

Nach oben vbnewtopics.user.js

Generiert in vBulletin-Foren einen Button zum automatischen Öffnen neuer Threads.
Abschnitt erweitern/schliessen  Code markieren  Download Dauerhaft aktiviert
// ==UserScript==
// @name           vB New Topics
// @namespace      http://userscripts.org/forums/2/topics/1801
// @description    Open all forum new topics in tabs
// @include        */forumdisplay.php*
// ==/UserScript==
 
/*
  Created by Gollum from an idea/suggestion/request at us.o by @Seph_VIII
  Expanded upon by @Mithrandir(us.o)
      - with help from @Dr. Evil(de ff-user-group)
          ... max links to open, conditional button display, timeout delay, extra button styling, windowOpen fallback for GM_openInTabs
   Gollum: added quick element check for vB board, plus x-browser support - tested in Opera(9.25) and IE7(IEPro), plus option to ignore timeout delay.
*/
 
(function (){
  if (!document.getElementById('threadslist')) // early return for non-vB boards
    return; // plus it's an Opera fix - ensure we're on the REAL document (wtf! something to do with cookie? setter??)
 
// configuration
var maxlnks = 0;  // 0=open all new threads, 10=open first 10 new threads
var showBtnIf = 2; // 0=button will always be shown, 5=show only, if there are more than 4 new threads
var useTimeout = true; // don't attempt delay on thread-read cookie setting - YMMV - the timeout delay didn't work for me, so =false
var tOut = 3000;   // set timeout in milliseconds for opening (cookies won't be stored if too low!)
var oMode = false; // =true: show first *unread* post, =false: show first post/beginning of thread
// end configuration
 
  /* x-browser event register */
  function addEvent(elm, evType, fn, useCapture) {
    if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true; }
    else if (elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r; }
    else { elm['on' + evType] = fn; }
  }
 
  /* x-browser open tab */
  function openTab(url) {
    if (typeof GM_openInTab != 'undefined') GM_openInTab(url);
    else if (typeof PRO_openInTab != 'undefined') PRO_openInTab(url,2);
    else window.open(url);
  }
 
var f = 0;
var newposts = new Array();
var lnks = document.getElementById('threadslist').getElementsByTagName('a');
for (var i=0; i < lnks.length; i++) {
  if (/showthread.php\?goto=newpost/.test(lnks[i].href)) {
    if (oMode) {
      newposts.push(lnks[i].href);
      } else {
      newposts.push(lnks[i].href.replace(/goto=newpost&/, ""));
    }
    f++
    if (f+1 > maxlnks && maxlnks > 0) break;
  }
}
 
if (f >= showBtnIf) {
  var btn = document.getElementById('inlinemodform').getElementsByTagName('td')[0].appendChild(document.createElement('button'));
  btn.innerHTML = "&Ouml;ffne " + f + " neue Beitr&auml;ge"; // de-locale
//  btn.innerHTML = "Open " + f + " new Posts";
  btn.style.marginLeft = '4px';
  btn.style.position = 'relative';
  btn.style.top = '-7px';
  btn.style.background='#DFE0E4';
  btn.style.color='#02176D';
  btn.style.fontWeight='bold';
  btn.style.fontSize='0.9em';
  addEvent(btn, "click",
    function(e) {
      if (maxlnks==0) this.style.display = 'none';
      if (e && e.target) e.preventDefault();
      else window.event.returnValue = false;
      if (useTimeout) {
        var i = -1;
        function inner() {
          if(++i < f) openTab(newposts[i]);
          else clearInterval(timer);
        }
        var timer = setInterval(inner, tOut);
      } else {
        for (var i=0; i < newposts.length; i++)
          openTab(newposts[i]);
      }
    }
  , false);
  }
})();

Nach oben vbulletinfullignore.user.js

Entfernt in vBulletin-Foren Beiträge ignorierter User komplett.
Abschnitt erweitern/schliessen  Code markieren  Download Nur bei Bedarf aktiviert  Gespiegelt
// ==UserScript==
// @name         vBulletin - Full ignore
// @namespace    http://openuserjs.org/users/ardiman
// @description  Stops display of truncated posts from users on your ignore list.
// @description:de-DE  Entfernt gekürzte Beiträge von Benutzern auf der Ignorierliste komplett.
// @grant        GM_addStyle
// @homepage     https://github.com/ardiman/userscripts/tree/master/vbulletinfullignore
// @icon         https://raw.githubusercontent.com/ardiman/userscripts/master/scriptlogo.gif
// @include      */showthread.php*
// @license      CC BY-NC-SA 3.0; https://creativecommons.org/licenses/by-nc-sa/3.0/
// @supportURL   https://github.com/ardiman/userscripts/issues
// @version      1.0.6
// @date         2014-11-21
// ==/UserScript==
 
(function (){
var filterkey = "?userlist=ignore&amp;do=removelist&amp;u=";
 
var allElements, thisElement;
allElements = document.getElementsByTagName('tr');
for (var i = 0; i < allElements.length; i++) {
  thisElement = allElements[i];
  if(thisElement.innerHTML.indexOf(filterkey)!=-1)
    {
    thisElement.parentNode.style.display = 'none';
    }
  }
 
// for new vBulletin 4.x try this:
GM_addStyle('li.postbitignored {display: none !important;}');
}());
Home