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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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>)');
    }
})();