hwm_add_diamond

Отображает 100500 бриллиантов (скрипт-шутка) (by Demin)

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name           hwm_add_diamond
// @author         Demin
// @namespace      Demin
// @description    Отображает 100500 бриллиантов (скрипт-шутка) (by Demin)
// @homepage       https://greasyfork.org/users/1602-demin
// @icon           http://i.imgur.com/LZJFLgt.png
// @version        2.0
// @encoding 	   utf-8
// @include        http://www.heroeswm.ru/*
// @include        http://qrator.heroeswm.ru/*
// @include        http://178.248.235.15/*
// @include        http://www.lordswm.com/*
// @exclude        */rightcol.php*
// @exclude        */ch_box.php*
// @exclude        */chat*
// @exclude        */ticker.html*
// @exclude        */frames*
// @exclude        */brd.php*
// ==/UserScript==

// (c) 2012-2015, demin  ( http://www.heroeswm.ru/pl_info.php?id=15091 )

(function() {

var version = '2.0';


var diamonds = "100,500";


if ( !document.querySelector("body") ) return;

// polychenie nika
var flash_heart = document.querySelector("object > param[value*='heart.swf']");
if ( flash_heart ) flash_heart = flash_heart.parentNode.querySelector("param[name='FlashVars']");
if ( flash_heart ) {
	flash_heart = flash_heart.value.split('|');
	if ( flash_heart[3] ) { var nick = flash_heart[3]; }
}

if ( !nick ) return;

var parent = document.querySelector("img[src*='i/diamond.gif']");
if ( !parent ) return;
while ( parent.tagName != 'TD' ) { parent = parent.parentNode; }
var previous = parent.previousSibling;
while ( previous.tagName != 'TD' ) { previous = previous.previousSibling; }
previous = previous.previousSibling;
var next = parent.nextSibling;
if ( previous && previous.tagName == 'TD' && previous.querySelector("img[src*='i/gem.gif']") && next && next.tagName == 'TD' ) {
	next.innerHTML = diamonds;
}

})();