GA threads authorName

Добавляет имя автора в заглавный пост на страницах тредов форума "Глобальная авантюра".

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        GA threads authorName
// @namespace   glav.su
// @description Добавляет имя автора в заглавный пост на страницах тредов форума "Глобальная авантюра".
// @include     http://glav.su/*/threads/*
// @include     https://glav.su/*/threads/*
// @version     1.2
// @grant       none
// ==/UserScript==
var m_id, mch, a_tm = $("div.lContent").find("a")[0];
if( mch = a_tm.toString().match(/https*?:\/\/glav\.su\/forum\/.+?\/(\d+?)-message\/#message\d+/) ){
	m_id = mch[1];
	$.ajax({
		url: mch[0],
		dataType: 'html',
		success: function(data){
			var dt = data.toString().replace(/[\n\r]/mg, '');
			mch = dt.match(new RegExp('<td id="forumMessagesListMessage'+m_id+'AuthorName" class="fItem forumMessagesListMessageAuthorName">.*?(<a.*?<\/a>)')) 
				|| dt.match(new RegExp('<td id="forumMessagesListMessage'+m_id+'Author" class="fItem forumMessagesListDeletedMessageAuthor">.*?(<a.*?<\/a>)'));
			if( mch ){
				$(a_tm).before(mch[1]+'&nbsp;&nbsp;');
			}
		}
	});
}