// ==UserScript== // @name hwm_battlelinks // @author Demin // @namespace Demin // @description Быстрые ссылки на итоги боя; начало, конец, чат боя (by Demin) // @homepage https://greasyfork.org/users/1602-demin // @icon http://i.imgur.com/LZJFLgt.png // @version 3.6 // @encoding utf-8 // @include http://*heroeswm.ru/* // @include http://178.248.235.15/* // @include http://*lordswm.com/* // @include http://*hwmguide.ru/* // @exclude */rightcol.php* // @exclude */ch_box.php* // @exclude */chat* // @exclude */ticker.html* // @exclude */frames* // @exclude */brd.php* // @exclude */auction.php* // @grant GM_deleteValue // @grant GM_getValue // @grant GM_listValues // @grant GM_setValue // @grant GM_addStyle // @grant GM_log // @grant GM_openInTab // @grant GM_xmlhttpRequest // @downloadURL https://update.greasyfork.icu/scripts/1231/hwm_battlelinks.user.js // @updateURL https://update.greasyfork.icu/scripts/1231/hwm_battlelinks.meta.js // ==/UserScript== // (c) 2010-2015, demin ( http://www.heroeswm.ru/pl_info.php?id=15091 ) (function() { setTimeout(function() { var version = '3.6'; var blank = ' target="_blank"'; //var blank = ''; if (typeof GM_deleteValue != 'function') { this.GM_getValue=function (key,def) {return localStorage[key] || def;}; this.GM_setValue=function (key,value) {return localStorage[key]=value;}; this.GM_deleteValue=function (key) {return delete localStorage[key];}; this.GM_addStyle=function (key) { var style = document.createElement('style'); style.textContent = key; document.querySelector("head").appendChild(style); } this.GM_xmlhttpRequest=function (details) { function setupEvent(xhr, url, eventName, callback) { xhr[eventName] = function() { var isComplete = xhr.readyState == 4; var responseState = { responseText: xhr.responseText, readyState: xhr.readyState, responseHeaders: isComplete ? xhr.getAllResponseHeaders() : "", status: isComplete ? xhr.status : 0, statusText: isComplete ? xhr.statusText : "", finalUrl: isComplete ? url : "" }; callback(responseState); }; } var xhr = new XMLHttpRequest(); var eventNames = ["onload", "onerror", "onreadystatechange"]; for (var i = 0; i < eventNames.length; i++) { var eventName = eventNames[i]; if (eventName in details) { setupEvent(xhr, details.url, eventName, details[eventName]); } } xhr.open(details.method, details.url); if (details.overrideMimeType) { xhr.overrideMimeType(details.overrideMimeType); } if (details.headers) { for (var header in details.headers) { xhr.setRequestHeader(header, details.headers[header]); } } xhr.send(details.data ? details.data : null); } } var script_num = 92536; var script_name = 'hwm_battlelinks: Быстрые ссылки на итоги боя; начало, конец, чат боя (by Demin)'; // see down var url_cur = location.href; var url = 'http://'+location.hostname+'/'; var a = document.querySelectorAll("a[href*='warid=']"); var warid = /warid=(\d+)/; var ai, warid_ai, bt; if ( url=='http://www.heroeswm.ru/' || url=='http://qrator.heroeswm.ru/' || url=='http://178.248.235.15/' || url=='http://www.lordswm.com/' ) { update_n(version,script_num,script_name); } else { url = 'http://www.heroeswm.ru/'; } for ( var i=a.length; i--; ) { ai = a[i]; if ( warid_ai = warid.exec(ai) ) { warid_ai = warid_ai[1]; bt = document.createElement('span'); bt.innerHTML = ' [#'+ ' chat'+ ' $'+ ' E]'; ai.parentNode.insertBefore(bt, ai.nextSibling); addEvent(ai, "click", show_result); } } function show_result(event) { event = event || window.event; event.preventDefault ? event.preventDefault() : (event.returnValue=false); var ai = event.target || event.srcElement; while ( !warid.exec(ai.href) ) { ai = ai.parentNode; } // for home page (once) && pl_info page (in battle) (twice) warid_ai = warid.exec(ai.href)[1]; GM_addStyle('\ #war_result table, #war_result td {background-image: none; text-align: left; border: 0px; margin: 0px; padding: 0px; line-height: 16px; border-collapse: separate;}\ #war_result td, #war_result a, #war_result b {FONT-SIZE: 9pt; COLOR: #592C08; FONT-FAMILY: verdana, geneva, arial cyr;}\ #war_result font {FONT-SIZE: 9pt; FONT-FAMILY: verdana, geneva, arial cyr}\ '); var newdiv = $('war_result'); if ( !newdiv ) { newdiv = document.createElement('div'); newdiv.setAttribute('id', 'war_result'); with ( newdiv.style ) { position = 'absolute'; borderStyle = 'solid'; borderColor = '#000000'; borderWidth = '2px'; padding = '0px'; zIndex = '3'; } } newdiv.style.left = event.pageX + 5; newdiv.style.top = event.pageY + 5; newdiv.innerHTML = '
| warid: '+warid_ai+ ' [#'+ ' chat'+ ' $'+ ' E]'+ ' | '+ ' | [x] |
'+loaders()+' | ||