sgmod - sky map dev script

turns sky into a map dev

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       sgmod - sky map dev script
// @namespace  woot
// @version    1.1.1
// @description turns sky into a map dev
// @match      https://www.seriousgmod.com/*
// @copyright  2017+, stackoverflow
// ==/UserScript==

var rank = "Map Developer";
var rankStyle = "style14";
var rankBanner = "bannerDev";
var forumName = "Rose♥";
var forumId = "138";
var currentRankStyle = "style19";

setInterval(function() {
   setTitles();
}, 1000);

$(function() {
    setTitles();
});

function setTitles(){
    $(".username:contains('" + forumName + "') > span").removeClass().addClass(rankStyle);
    if($('div[id="memberCard' + forumId + '"] > div[class="userInfo"] > div[class="cardUserBanner"]:contains(' + rank + ')').text() === ""){
         $('div[id="memberCard' + forumId + '"] > div[class="userInfo"] > div[class="cardUserBanner"]').prepend('<em itemprop="title" class="userBanner ' + rankBanner + ' " style="margin-right:5px"><span class="before"></span><strong>' + rank + '</strong><span class="after"></span></em>');
     }
    if($('li[data-author="' + forumName + '"] > div > div > h3[class="userText"]:contains(' + rank + ')').text() === ""){
        var insert = '<em itemprop="title" class="userBanner ' + rankBanner + ' wrapped"><span class="before"></span><strong>' + rank + '</strong><span class="after"></span></em>';
       $('li[data-author="' + forumName + '"] > div > div > h3[class="userText"] > em[class="userTitle"]').after(insert);
    }
    if(window.location.pathname.search(forumId) != -1){
        if($('div[class="userBanners"]:contains('+rank+')').text() === ""){
            $('div[class="userBanners"]').prepend('<em itemprop="title" class="userBanner ' + rankBanner + '"><span class="before"></span><strong>' + rank + '</strong><span class="after"></span></em>');
        }
     }
}