SHOW:
|
|
- or go back to the newest paste.
| 1 | // ==UserScript== | |
| 2 | // @name TagPro Wins Until Next Degree | |
| 3 | // @namespace http://www.reddit.com/user/tpcarl/ | |
| 4 | // @description Displays wins needed until next degree on score screen. | |
| 5 | // @include http://tagpro-*.koalabeast.com* | |
| 6 | // @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html | |
| 7 | // @author ben, modified by ballparts | |
| 8 | // @version .1 | |
| 9 | // ==/UserScript== | |
| 10 | ||
| 11 | $('article > div.section.smaller').after( "<center><h3><div><p id='winsneeded'></p></div></h3></center>" );
| |
| 12 | ||
| 13 | url = $('a[href^="/profile"]').attr('href');
| |
| 14 | if(url !== undefined) {
| |
| 15 | var n = url.lastIndexOf('/');
| |
| 16 | var profileNum = url.substring(n + 1); | |
| 17 | profilePage = String('/profile/'+profileNum);
| |
| 18 | - | sessionStorage.setItem('profilePage',profilePage);
|
| 18 | + | localStorage.setItem('profilePage',profilePage);
|
| 19 | ||
| 20 | } | |
| 21 | ||
| 22 | ||
| 23 | if(document.URL.search('profile')<1) {
| |
| 24 | - | $( "#winsneeded" ).load(sessionStorage.getItem('profilePage') + ' article > h3 > div', function(){
|
| 24 | + | $( "#winsneeded" ).load(localStorage.getItem('profilePage') + ' article > h3 > div', function(){
|
| 25 | $('#winsneeded > div:last-child').css({'font-size':'50%'});
| |
| 26 | }); | |
| 27 | ||
| 28 | ||
| 29 | $('#winsneeded').after('<span id="winp">Daily Win %: <span id="inner"></span></span>');
| |
| 30 | element = $('<center><span id="created"></span></center>');
| |
| 31 | $(winp).append(element); | |
| 32 | - | $( element ).load(sessionStorage.getItem('profilePage') + ' td:eq(6)', function(){
|
| 32 | + | $( element ).load(localStorage.getItem('profilePage') + ' td:eq(6)', function(){
|
| 33 | text = $('td').text();
| |
| 34 | $('#inner').append(text);
| |
| 35 | $('#winp').css({'font-size':'80%'});
| |
| 36 | $('center > td').remove()
| |
| 37 | $('h3').css({'margin':'10px'});
| |
| 38 | $('#winsneeded').css({'margin-top':'2px'});
| |
| 39 | $('#winsneeded').css({'margin-bottom':'2px'});
| |
| 40 | }); | |
| 41 | } |