sgmod - sky map dev script

turns sky into a map dev

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

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

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