Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. ({
  2. previewElement: null,
  3. customizeElement: null,
  4. loadThemeBackup: null,
  5. load: function () {
  6. // disable loadTheme() because it will break our stuff
  7. this.loadThemeBackup = decepti0n.loadTheme;
  8. decepti0n.loadTheme = function () {};
  9. var customizerPlugin = this;
  10. this.previewElement = decepti0n.addCategory("(Preview) Header", [
  11. {
  12. name: "Module",
  13. tooltip: "Click me to edit my styles",
  14. onclick: function () {
  15. customizerPlugin.select(this.element, "module");
  16. }
  17. }
  18. ], null).element;
  19. var header = this.previewElement.querySelector(".dcpheader");
  20. header.onclick = () => this.select(header, "header");
  21. },
  22. select: function (elem, type) {
  23. if (this.customizeElement !== null)
  24. this.customizeElement.remove();
  25. switch (type) {
  26. case "module":
  27. this.customizeElement = decepti0n.addCategory("Properties", [
  28. {
  29. name: "Background",
  30. tooltip: "Set background",
  31. onclick: function () {
  32. var color = prompt("Color: ");
  33. if (color === null || color === "")
  34. return;
  35. decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.background = color;
  36. }
  37. },
  38. {
  39. name: "Text Color",
  40. tooltip: "Set text color",
  41. onclick: function () {
  42. var color = prompt("Color: ");
  43. if (color === null || color === "")
  44. return;
  45. decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.color = color;
  46. }
  47. },
  48. {
  49. name: "Bottom Border Color",
  50. tooltip: "Set border bottom color",
  51. onclick: function () {
  52. var color = prompt("Color: ");
  53. if (color === null || color === "")
  54. return;
  55. decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.borderBottomColor = color;
  56. }
  57. },
  58. {
  59. name: "Bottom Border Height",
  60. tooltip: "Set border bottom height",
  61. onclick: function () {
  62. var height = prompt("Pixels: ");
  63. if (height === null || height === "")
  64. return;
  65. decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.borderBottomWidth = height + "px";
  66. }
  67. }
  68. ], null, true, "properties", false).element;
  69. break;
  70. case "header":
  71. this.customizeElement = decepti0n.addCategory("Properties", [
  72. {
  73. name: "Background",
  74. tooltip: "Set background",
  75. onclick: function () {
  76. var color = prompt("Color: ");
  77. if (color === null || color === "")
  78. return;
  79. decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpheader").style.background = color;
  80. decepti0n.getStyleRule("#dcpclickgui .dcpcategory").style.borderColor = color;
  81. }
  82. },
  83. {
  84. name: "Text Color",
  85. tooltip: "Set text color",
  86. onclick: function () {
  87. var color = prompt("Color: ");
  88. if (color === null || color === "")
  89. return;
  90. decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpheader").style.color = color;
  91. }
  92. }
  93. ], null).element;
  94. break;
  95. }
  96. },
  97. disable: function () {
  98. // restore loadTheme()
  99. decepti0n.loadTheme = this.loadThemeBackup;
  100. if (this.customizeElement !== null)
  101. this.customizeElement.remove();
  102. this.previewElement.remove();
  103. }
  104. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement