Edenya-Script

Addon Edenya

目前為 2017-03-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Edenya-Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.100009
  5. // @description Addon Edenya
  6. // @author Valkazaar
  7. // @match http://www.edenya.net/_vahal/*
  8. // @grant none
  9. // @include http://www.edenya.net/_vahal/*
  10. // @include https://www.edenya.net/_vahal/*
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var z = localStorage.getItem('EdenyaColor');
  16. if (z === null){
  17. var zz = {'cadre2':'#dda0dd'};
  18. zz['ligneA'] = '#000000';
  19. zz['dialogue'] = '#ffffff';
  20. zz['narration'] = '#ffd700';
  21. zz['cri'] = '#9acd32';
  22. zz['hj'] = '#FFDAB9';
  23. z = localStorage.setItem('EdenyaColor',JSON.stringify(zz));
  24. z = localStorage.getItem('EdenyaColor');
  25. }
  26. z = JSON.parse(z);
  27. for (var item in z){
  28. var x = document.getElementsByClassName(item);
  29. for (var j = 0; j < x.length; j++){
  30. x[j].style.color = z[item];
  31. }
  32. }
  33. var x = document.getElementsByTagName("font");
  34. for (var i = 0;i < x.length;i++)
  35. {
  36. if(x[i].getAttribute('color')!= null)
  37. {
  38. x[i].setAttribute('color',(x[i].getAttribute('color')).replace('#000000','#B09070'));
  39. x[i].setAttribute('color',(x[i].getAttribute('color')).replace('\\"',''));
  40. x[i].setAttribute('color',(x[i].getAttribute('color')).replace('\\"',''));
  41. }
  42. }
  43. var x = document.querySelector(".menu");
  44. if (x != null){
  45. var y = document.createElement("div");
  46. var z = localStorage.getItem('EdenyaShortcut');
  47. if (z === null){
  48. var zz = {'accueil':'https://www.edenya.net/_vahal/'};
  49. z = localStorage.setItem('EdenyaShortcut',JSON.stringify(zz));
  50. z = localStorage.getItem('EdenyaShortcut');
  51. }
  52. var zzz= document.createElement("p");
  53. var zzzz = document.createElement("span");
  54. zzzz.innerHTML = "<a href='#'> Ajouter </a>";
  55. zzzz.setAttribute("onclick", "var nom=prompt('Nom du shortcut ?');z = localStorage.getItem('EdenyaShortcut');z = JSON.parse(z);z[nom]=document.URL;localStorage.setItem('EdenyaShortcut',JSON.stringify(z));location.href = location.href;");
  56. zzz.innerText = "Raccourcis : ";
  57. zzz.appendChild(zzzz);
  58. y.appendChild(zzz);
  59. z = JSON.parse(z);
  60. for(var item in z){
  61. var zzzz =document.createElement("img");
  62. zzzz.setAttribute('src','../images/bad.gif');
  63. zzzz.setAttribute('onclick','z = localStorage.getItem("EdenyaShortcut");z = JSON.parse(z);delete z["'+ item +'"];localStorage.setItem("EdenyaShortcut",JSON.stringify(z));location.href = location.href;');
  64. var zzz= document.createElement("span");
  65. zzz.setAttribute('style','display:block;');
  66. var zz = document.createElement("a");
  67. zz.setAttribute('href',z[item]);
  68. zz.innerText = item + " ";
  69. zzz.appendChild(zz);
  70. zzz.appendChild(zzzz);
  71. y.appendChild(zzz);
  72. }
  73. y.className = "cadre";
  74. y.style = "width:200";
  75. x.appendChild(y);
  76. var z = document.createElement("p");
  77. z.innerText = "Couleurs utilisées :";
  78. y.appendChild(z);
  79. var zz = localStorage.getItem('EdenyaColor');
  80. zz = JSON.parse(zz);
  81. for (var item in zz){
  82. var z= document.createElement("input");
  83. z.setAttribute("id",item);
  84. z.setAttribute("type", "color");
  85. z.setAttribute("class", "bouton");
  86. z.setAttribute("value",zz[item]);
  87. z.setAttribute("style","width:25;padding:0");
  88. z.setAttribute("onChange","z = localStorage.getItem('EdenyaColor');z = JSON.parse(z);z['"+z.getAttribute("id")+"'] = document.getElementById('"+z.getAttribute("id")+"').value; localStorage.setItem('EdenyaColor',JSON.stringify(z));location.href = location.href;");
  89. y.appendChild(z);
  90. }
  91. }
  92. })();