Add scpexplained links to SCP wiki

Adds scpexplained links (http://scpexplained.wikidot.com/) to http://www.scp-wiki.net/ and http://www.scpwiki.com/ for ease of access. Not all SCPs have a corresponding scpexplained article

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         Add scpexplained links to SCP wiki
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  Adds scpexplained links (http://scpexplained.wikidot.com/) to http://www.scp-wiki.net/ and http://www.scpwiki.com/ for ease of access. Not all SCPs have a corresponding scpexplained article
// @author       You
// @include      *scp-wiki.net*
// @include      *scpwiki.com*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var box = document.getElementsByClassName("list-pages-box");
    if (box != null && box.length > 1) {
        box[1].innerHTML = box[1].innerHTML.replace(/(href="(.*)">.*<\/a>)/g, '$1 (<a href="http://scpexplained.wikidot.com$2">Explained</a>)');
     }
    var title = document.getElementById("page-title")
    console.log(title)
    if (title != null) {
        title.innerHTML = title.innerHTML.replace(/(SCP-[0-9]+)/g, '$1 (<a href="http://scpexplained.wikidot.com/$1">Explained</a>)');
     }
    var content = document.getElementById("page-content")
    if (content != null) {
        content.innerHTML = content.innerHTML.replace(/(href="(\/scp-[0-9]+\/*)">SCP-[0-9]+<\/a>)/g, '$1 (<a href="http://scpexplained.wikidot.com$2">Explained</a>)');
    }
})();