Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ({
- previewElement: null,
- customizeElement: null,
- loadThemeBackup: null,
- load: function () {
- // disable loadTheme() because it will break our stuff
- this.loadThemeBackup = decepti0n.loadTheme;
- decepti0n.loadTheme = function () {};
- var customizerPlugin = this;
- this.previewElement = decepti0n.addCategory("(Preview) Header", [
- {
- name: "Module",
- tooltip: "Click me to edit my styles",
- onclick: function () {
- customizerPlugin.select(this.element, "module");
- }
- }
- ], null).element;
- var header = this.previewElement.querySelector(".dcpheader");
- header.onclick = () => this.select(header, "header");
- },
- select: function (elem, type) {
- if (this.customizeElement !== null)
- this.customizeElement.remove();
- switch (type) {
- case "module":
- this.customizeElement = decepti0n.addCategory("Properties", [
- {
- name: "Background",
- tooltip: "Set background",
- onclick: function () {
- var color = prompt("Color: ");
- if (color === null || color === "")
- return;
- decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.background = color;
- }
- },
- {
- name: "Text Color",
- tooltip: "Set text color",
- onclick: function () {
- var color = prompt("Color: ");
- if (color === null || color === "")
- return;
- decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.color = color;
- }
- },
- {
- name: "Bottom Border Color",
- tooltip: "Set border bottom color",
- onclick: function () {
- var color = prompt("Color: ");
- if (color === null || color === "")
- return;
- decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.borderBottomColor = color;
- }
- },
- {
- name: "Bottom Border Height",
- tooltip: "Set border bottom height",
- onclick: function () {
- var height = prompt("Pixels: ");
- if (height === null || height === "")
- return;
- decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpmodule").style.borderBottomWidth = height + "px";
- }
- }
- ], null, true, "properties", false).element;
- break;
- case "header":
- this.customizeElement = decepti0n.addCategory("Properties", [
- {
- name: "Background",
- tooltip: "Set background",
- onclick: function () {
- var color = prompt("Color: ");
- if (color === null || color === "")
- return;
- decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpheader").style.background = color;
- decepti0n.getStyleRule("#dcpclickgui .dcpcategory").style.borderColor = color;
- }
- },
- {
- name: "Text Color",
- tooltip: "Set text color",
- onclick: function () {
- var color = prompt("Color: ");
- if (color === null || color === "")
- return;
- decepti0n.getStyleRule("#dcpclickgui .dcpcategory .dcpheader").style.color = color;
- }
- }
- ], null).element;
- break;
- }
- },
- disable: function () {
- // restore loadTheme()
- decepti0n.loadTheme = this.loadThemeBackup;
- if (this.customizeElement !== null)
- this.customizeElement.remove();
- this.previewElement.remove();
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement