Git Product home page Git Product logo

btfrefresher's Introduction

btfRefresher

Script for adding a refresher in betfair market pages

make a bookmark in your bookmark bar, and replace the URL with this :

javascript:void(function(){var locHref=window.location.href,attachRefresher=function(switchStatus,intervalTime){document.querySelector('.liquidity-slider-marketview').style.display='none';var rfrshBtn=document.querySelector('.mkt-refresh-btn'),matchedValues=document.querySelector('.matched-values'),refresher=document.createElement('div'),valueContainer=document.createElement('div'),value=document.createElement('input'),valueText=document.createElement('span'),switcher=document.createElement('span'),interval=intervalTime||800,MINIMUM=99,intervalRef;refresher.className='refresher';refresher.textContent='Refresher';refresher.style.border='1px solid #E0E6E6';refresher.style['borderRadius']='2px';refresher.style.margin='0 8px';refresher.style.padding='0 2px';refresher.style['lineHeight']='26px';refresher.style.width='150px';switcher.style.display='inline-block';switcher.style.width='20px';switcher.style.padding='0 10px';switcher.style['borderLeft']='1px solid #E0E6E6';switcher.textContent='OFF';switcher.className='off';switcher.style['backgroundColor']='#e0c0c0';switcher.style.cursor='pointer';switcher.style['userSelect']='none';valueContainer.style.display='inline-block';value.disabled=true;value.value=800;value.style.display='inline-block';value.style.width='30px';value.style.height='26px';value.style.padding='0 2px';value.style.border='0';value.style.cursor='pointer';value.style.userSelect='none';value.style.marginRight='3px';valueText.textContent='ms';if(matchedValues!==null){matchedValues.appendChild(refresher);refresher.appendChild(switcher);valueContainer.appendChild(value);valueContainer.appendChild(valueText);refresher.appendChild(valueContainer)}else{return false}function refresherFn(){rfrshBtn.click()};switcher.onclick=function(ev){if(switcher.className==='off'){switcher.className='on';switcher.textContent='ON';switcher.style['backgroundColor']='#c0e0c4';value.textContent=interval;intervalRef=setInterval(refresherFn,interval)}else{switcher.className='off';switcher.textContent='OFF';switcher.style['backgroundColor']='#e0c0c0';clearInterval(intervalRef);intervalRef=undefined}};valueContainer.addEventListener('click',function(ev){console.log('click valueContainer');if(switcher.className==='on'){value.disabled=false;value.select()}});value.onkeydown=function(ev){if(ev.keyCode===13){value.blur()}};value.onblur=function(){value.disabled=true;if((interval!==value.value)&&(value.value>MINIMUM)){interval=value.value;clearInterval(intervalRef);intervalRef=setInterval(refresherFn,interval)}else{value.value=interval}}};attachRefresher();setInterval(function(){if(window.location.href!==locHref){attachRefresher();locHref=window.location.href}},500)}())

btfrefresher's People

Contributors

antouank avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.