Advertisement
wwww

Renaissance Kingdoms Titlebar Mod

Oct 20th, 2013
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Renaissance Kingdoms
  3. // @namespace   weiwen.renaissancekingdoms
  4. // @include     http://www.renaissancekingdoms.com/*
  5. // @version     1
  6. // ==/UserScript==
  7.  
  8. // Styling
  9. function addGlobalStyle(css) {
  10.     var head, style;
  11.     head = document.getElementsByTagName('head')[0];
  12.     if (!head) { return; }
  13.     style = document.createElement('style');
  14.     style.type = 'text/css';
  15.     style.innerHTML = css;
  16.     head.appendChild(style);
  17. }
  18. addGlobalStyle('.zonePubDroiteContenant, .colonneEntiere, #bandeau_jeux { display: none; }')
  19. addGlobalStyle('.colonneContenu { width: 785px !important; }')
  20. addGlobalStyle('.cadre_interieur { width: 950px !important; }')
  21. addGlobalStyle('.toggle { float: left; clear: left; }')
  22. addGlobalStyle('label { float: left; margin: auto; color: rgb(243, 197, 105); clear: right;}')
  23.  
  24. $(document).ready(function() {
  25. $(".zone_aapDeco").html('<input type="checkbox" id="titlebarMod" class="toggle" checked="checked"><label>Titlebar Mod</label>');
  26.  
  27. var timerID = setInterval(updateTitlebar, 60 * 1000);
  28. $("#titlebarMod").change(function() {
  29.     if (this.checked) {
  30.         updateTitlebar();
  31.         timerID = setInterval(updateTitlebar, 60 * 1000);
  32.     } else {
  33.         clearInterval(timerID);
  34.     }
  35. });
  36.  
  37. });
  38.  
  39. function updateTitlebar() {
  40.     var timeLeft = $(".countdown_amount").html();
  41.     var currentAction = $(".elementActivite").html();
  42.     document.title = "("+timeLeft+") "+currentAction;
  43.     //$("#favicon").attr("href","favicon2.png");
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement