salesforce script

Hack cursors

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

  1. //// ==UserScript==
  2. // @name salesforce script
  3. // @namespace lilsc
  4. // @description Hack cursors
  5. // @homepage https://eu4.salesforce.com
  6. // @match https://eu4.salesforce.com
  7. // @version 0.0.1.20170319164635
  8. // ==/UserScript==
  9. table = document.querySelector('.reportTable');
  10. everything = document.body.childNodes;
  11. document.body.style.background="black";
  12. document.body.style.setProperty('display', 'flex', 'important');
  13. document.body.style.setProperty('height', '100vh', 'important');
  14. document.body.style.setProperty('align-items', 'center', 'important');
  15. document.body.style.setProperty('justify-content', 'center', 'important');
  16. while(everything.length)
  17. document.body.removeChild(everything[0]);
  18. document.body.append(table);
  19.  
  20. function loadfonts() {
  21. var script = document.createElement("script");
  22. script.src = "https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js";
  23. script.type = "text/javascript";
  24. document.getElementsByTagName("head")[0].appendChild(script);
  25. }
  26. loadfonts();
  27.  
  28. newtable = document.querySelectorAll('tbody *');
  29. for (var i = 0; i < newtable.length; i++) {
  30. newtable[i].style.setProperty('background-color', 'white', 'important');
  31. newtable[i].style.setProperty('font-size', 'xx-large', 'important');
  32. newtable[i].style.setProperty('font-family', 'Baloo', 'important');
  33. newtable[i].style.setProperty('color', 'black', 'important');
  34. newtable[i].style.setProperty('padding', '0 15px', 'important');
  35. }
  36. z = document.querySelectorAll('tbody td:nth-child(3)');
  37. for (var i = 0; i < z.length; i++) {
  38. z[i].style.display = 'none';
  39. }
  40. z = document.querySelectorAll('tbody th:nth-child(3)')
  41. for (var i = 0; i < z.length; i++) {
  42. z[i].style.display = 'none';
  43. }
  44. z = document.querySelectorAll('tbody td:first-child')
  45. for (var i = 0; i < z.length; i++) {
  46. z[i].style.display = 'none';
  47. }
  48. z = document.querySelectorAll('tbody td.subTotal, tbody th.subTotalTitle')
  49. for (var i = 0; i < z.length; i++) {
  50. z[i].style.display = 'none';
  51. }
  52. z = document.querySelectorAll('.grandTotal:last-child:not(.grandTotalTitle)')
  53. for (var i = 0; i < z.length; i++) {
  54. z[i].insertAdjacentHTML('beforebegin',
  55. '<td class="nowrapCell grandTotal" align="right" style="background-color: white !important; font-size: xx-large !important; color: black !important;"></td>');
  56. }
  57. document.querySelector('tbody tr:nth-child(2) th:nth-child(4)').innerHTML = 'Kaputt';
  58. document.querySelector('tbody tr:nth-child(1) th:nth-child(5)').innerHTML = 'Dials';
  59. document.querySelector('table').insertAdjacentHTML('beforebegin', "<style>.bubble:before {content: ''; position: absolute; bottom: -140px; right: 0; border-width: 0 0 140px 140px; border-style: solid; border-color: transparent #C91F2C;}.bubble { position: absolute; text-align: center; top:160px; left: 60px; font: 48px Baloo, sans-serif; color: #fff; background: #C91F2C;}.bubble:after { content: ''; position: absolute; bottom: -140px; right: 85px; border-width: 0 0 140px 55px; border-style: solid; border-color: transparent #000;}</style><div><div class='bubble'>I'm on <span id='appointments'><span></div><img style='width:150px;height:150px;border-radius:50%;overflow:hidden;' src='https://media.licdn.com/mpr/mpr/shrinknp_400_400/AAEAAQAAAAAAAAIWAAAAJDBmMTU4MmJmLWY3MTQtNDE0Yi1hZWVjLTZiZjA2ZWIwZWEzOQ.jpg'></div>");
  60. if (document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0]<2) {
  61. document.querySelector('#appointments').innerHTML = document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0] + ' appointment!!!';
  62. }
  63. else {
  64. document.querySelector('#appointments').innerHTML = document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0] + ' appointments!!!';
  65.  
  66. }
  67. document.querySelector('tbody tr:last-child').style.display = 'none';
  68. document.querySelector('.headerDark:nth-child(2)').innerHTML = '';
  69.  
  70. setTimeout(function () {
  71. WebFont.load({
  72. google: {
  73. families: ['Baloo']
  74. }
  75. })
  76. }, 400)
  77. localStorage.appointments = document.querySelector('tbody tr:nth-child(3) td:nth-child(5)').innerHTML[0];
  78. if (typeof localStorage.appointmentsold == 'undefined') {
  79. localStorage.appointmentsold = localStorage.appointments;
  80. }
  81. if(localStorage.appointments != localStorage.appointmentsold){
  82. var audio = new Audio('http://themushroomkingdom.net/sounds/wav/smb/smb_stage_clear.wav');
  83. audio.play();
  84. localStorage.appointmentsold = localStorage.appointments;
  85. }
  86. localStorage.netto = document.querySelector('tbody tr:nth-child(3) td:nth-child(7)').innerHTML[0];
  87. if (typeof localStorage.nettoold == 'undefined') {
  88. localStorage.nettoold = localStorage.netto;
  89. }
  90. if(localStorage.netto != localStorage.nettoold){
  91. var audio = new Audio('http://themushroomkingdom.net/sounds/wav/smb/smb_1-up.wav');
  92. audio.play();
  93. localStorage.nettoold = localStorage.netto;
  94. }
  95.