some little script

Hack cursors

当前为 2017-03-23 提交的版本,查看 最新版本

  1. //// ==UserScript==
  2. // @name some little script
  3. // @namespace lilsc
  4. // @description Hack cursors
  5. // @homepage https://eu4.salesforce.com
  6. // @match https://eu4.salesforce.com
  7. // @include /^https://eu4.salesforce.com*
  8. // @version 0.0.1.20170323102239
  9. // ==/UserScript==
  10.  
  11.  
  12. document.body.innerHTML = document.body.innerHTML.replace(/-/g, 'Kaputt');
  13. document.body.innerHTML = document.body.innerHTML.replace(/Cold Caller/g, '');
  14. Element.prototype.remove = function() {
  15. this.parentElement.removeChild(this);
  16. }
  17. NodeList.prototype.remove = HTMLCollection.prototype.remove = function() {
  18. for(var i = this.length - 1; i >= 0; i--) {
  19. if(this[i] && this[i].parentElement) {
  20. this[i].parentElement.removeChild(this[i]);
  21. }
  22. }
  23. }
  24.  
  25.  
  26. table = document.querySelector('.reportTable');
  27. everything = document.body.childNodes;
  28. document.body.style.background="white";
  29. document.body.style.setProperty('display', 'flex', 'important');
  30. document.body.style.setProperty('flex-direction', 'column', 'important');
  31. document.body.style.setProperty('height', '100vh', 'important');
  32. document.body.style.setProperty('align-items', 'center', 'important');
  33. document.body.style.setProperty('justify-content', 'center', 'important');
  34. while(everything.length)
  35. document.body.removeChild(everything[0]);
  36. document.body.append(table);
  37.  
  38. function loadfonts() {
  39. var script = document.createElement("script");
  40. script.src = "https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js";
  41. script.type = "text/javascript";
  42. document.getElementsByTagName("head")[0].appendChild(script);
  43. }
  44. loadfonts();
  45. setTimeout(function () {
  46. WebFont.load({
  47. google: {
  48. families: ['Press Start 2P']
  49. }
  50. })
  51. }, 400)
  52.  
  53. newtable = document.querySelectorAll('tbody *');
  54. for (var i = 0; i < newtable.length; i++) {
  55. newtable[i].style.setProperty('background-color', 'white', 'important');
  56. newtable[i].style.setProperty('font-size', 'large', 'important');
  57. newtable[i].style.setProperty('font-family', '"Press Start 2P"', 'important');
  58. newtable[i].style.setProperty('color', 'black', 'important');
  59. newtable[i].style.setProperty('padding', '15px', 'important');
  60. }
  61. z = document.querySelectorAll('tr.headerRow:nth-child(1)');
  62. for (var i = 0; i < z.length; i++) {
  63. z[i].remove();
  64. }
  65. // z = document.querySelectorAll('tr.grandTotalRow');
  66. // for (var i = 0; i < z.length; i++) {
  67. // z[i].remove();
  68. // }
  69. z = document.querySelectorAll('td.drilldown');
  70. for (var i = 0; i < z.length; i++) {
  71. z[i].remove();
  72. }
  73. z = document.querySelectorAll('tr td:nth-child(2)');
  74. for (var i = 0; i < z.length; i++) {
  75. z[i].remove();
  76. }
  77. z = document.querySelectorAll('br');
  78. for (var i = 0; i < z.length; i++) {
  79. z[i].remove();
  80. }
  81. q = document.createElement('th');
  82. t = document.createTextNode('Dials')
  83. q.appendChild(t)
  84. q.style.setProperty('background-color', 'white', 'important');
  85. q.style.setProperty('font-size', 'large', 'important');
  86. q.style.setProperty('font-family', '"Press Start 2P"', 'important');
  87. q.style.setProperty('color', 'black', 'important');
  88. q.style.setProperty('padding', '15px', 'important');
  89. x = document.querySelector('tr:nth-child(1)')
  90. x.appendChild(q)
  91.  
  92. gifcontainer = document.createElement('img')
  93. gifcontainer.src = 'run3.gif'
  94. gifcontainer.style.height = '100px'
  95. gifcontainer.style.width = 'auto'
  96. document.body.insertBefore(gifcontainer, table);
  97.  
  98.  
  99.  
  100.  
  101.  
  102. values = ['Name','Kaputt', 'Appointment', 'Brutto', 'Netto', 'Grand Total']
  103. players = document.querySelectorAll('tr').length;
  104. playersdata = [];
  105. appointments = [];
  106. netto = [];
  107. for (var i = 1; i < players; i++) {
  108. playersdata.push([]);
  109. appointments.push([]);
  110. netto.push([]);
  111.  
  112. if (i == players-1) {
  113. for (var j = 0; j < 6; j++){
  114. if (j==0){
  115. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('th')[j].querySelector('strong').innerHTML);
  116. }
  117. if (j==1){
  118. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j-1].innerHTML);
  119. appointments[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].innerHTML);
  120. }
  121. if (j==2){
  122. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j-1].innerHTML);
  123. }
  124. if (j==3){
  125. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j-1].innerHTML);
  126. }
  127. if (j==4){
  128. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j-1].innerHTML);
  129. netto[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j-1].innerHTML);
  130. }
  131. if (j==5){
  132. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j-1].querySelector('b').innerHTML);
  133. }
  134. }
  135. }
  136. else{
  137. for (var j = 0; j < 6; j++){
  138. if (j==5){
  139. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].querySelector('b').innerHTML);
  140. }
  141. else{
  142. playersdata[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].innerHTML);
  143. }
  144. if (j==2){
  145. appointments[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].innerHTML);
  146. }
  147. if (j==4){
  148. netto[i-1].push(document.querySelectorAll('tr')[i].querySelectorAll('td')[j].innerHTML);
  149. }
  150. }
  151. }
  152. }
  153.  
  154. localStorage.appointments = appointments;
  155. if (typeof localStorage.appointmentsold == 'undefined') {
  156. localStorage.appointmentsold = localStorage.appointments;
  157. }
  158. if(localStorage.appointments != localStorage.appointmentsold){
  159. var audio = new Audio('http://themushroomkingdom.net/sounds/wav/smb/smb_stage_clear.wav');
  160. audio.play();
  161. localStorage.appointmentsold = localStorage.appointments;
  162. }
  163. localStorage.netto = netto;
  164. if (typeof localStorage.nettoold == 'undefined') {
  165. localStorage.nettoold = localStorage.netto;
  166. }
  167. if(localStorage.netto != localStorage.nettoold){
  168. var audio = new Audio('http://themushroomkingdom.net/sounds/wav/smb/smb_1-up.wav');
  169. audio.play();
  170. localStorage.nettoold = localStorage.netto;
  171. }