Dolphins Forever

Replaces swear filter with dolphins

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        Dolphins Forever
// @namespace   + polarity -
// @description Replaces swear filter with dolphins
// @include     http://www.thestudentroom.co.uk/
// @include     http://*.thestudentroom.co.uk/
// @include     http://www.thestudentroom.co.uk/*
// @include     http://thestudentroom.co.uk/*
// @version     1
// @grant       none
// ==/UserScript==

(function()
	{
		var allPosts = document.getElementsByClassName('postcontent restore');
		var uri = 'http://static.tsrfiles.co.uk/images/smilies/dolphin.gif';
		var d = "<img src='" + uri + "'>";
		var mapObj = {
			"\*\*\*": d+d+d,
			"\*\*\*\*": d+d+d+d,
			"\*\*\*\*\*": d+d+d+d+d,
			"\*\*\*\*\*\*": d+d+d+d+d+d,
			"\*\*\*\*\*\*\*": d+d+d+d+d+d+d,
			"\*\*\*\*\*\*\*\*": d+d+d+d+d+d+d+d,
			"\*\*\*\*\*\*\*\*\*": d+d+d+d+d+d+d+d+d,
			"\*\*\*\*\*\*\*\*\*\*": d+d+d+d+d+d+d+d+d+d,
			"\*\*\*\*\*\*\*\*\*\*\*": d+d+d+d+d+d+d+d+d+d+d,
			"\*\*\*\*\*\*\*\*\*\*\*\*": d+d+d+d+d+d+d+d+d+d+d+d
		};
		
		for (var i=0; i<allPosts.length; i++) {
			allPosts[i].innerHTML = allPosts[i].innerHTML.replace(/(\*{3,12})/g, function(matched) {
				return mapObj[matched];
			});
		}
	}
)();