NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name LNK_siwi_flag // @namespace http://uichat.in.ua/ // @version 0.1 // @description Заміна кодів країн на прапори // @author LnKOx // @match http://biathlonresults.com/ // @grant none // ==/UserScript== (function() { 'use strict'; function prefresh(){ setTimeout(prefresh, 1000); var elems = document.getElementsByClassName('au-target colNat'); var country; for(var i=0; i<elems.length; i++) { country=elems[i].innerHTML; if (country.length==3) { elems[i].style='font-size:0pt; background: url("http://uichat.in.ua/flags/24/'+country+'.png") no-repeat;'; } else { elems[i].style='background: none;'; } } } function shoot_refresh() { setTimeout(shoot_refresh, 500); var npshoot=0; var shootrange = document.getElementsByClassName('colTarget')[0].parentNode.parentNode.parentNode.innerHTML; var myshoot=document.getElementById('myshoot'); myshoot.innerHTML=shootrange; var toremove=myshoot.getElementsByClassName('rtHeader')[0]; toremove.parentNode.removeChild(toremove); var elemshoot = myshoot.getElementsByClassName('au-target colNat'); for(var zq=0; zq<elemshoot.length; zq++) { if (elemshoot[zq].className=="au-target colNat highlight") { elemshoot[zq].parentNode.style="top:"+npshoot+"px"; npshoot=npshoot+21; } else { elemshoot[zq].parentNode.parentNode.removeChild(elemshoot[zq].parentNode); zq--; } } } function addshootdiv() { var d=document.createElement('div'); d.style="position: absolute; z-index:10; background-color: white; width:250px;"; d.id="myshoot"; document.body.appendChild(d); } addshootdiv(); prefresh(); shoot_refresh(); // Your code here... })();