Stylish Disable/Enable All

4 replies [Last post]
rawny's picture
Joined: 08/08/2008
Posts: 250
User offline. Last seen 1 day 4 hours ago.

Buttons

Left clicking this button will show it's menu, from the menu you can:

  • "Disable all styles"
  • "Restore style states"
  • "Enable all styles"

Clicking Enable/Disable all styles, will take a snapshot of the current enabled/disabled states of your styles and then Enable/Disable all your styles.

Clicking "Restore style states" will restore the first snapshot taken (and remove that snapshot).

This means you can select "Disable all styles", do whatever you like (including clicking "Enable all styles" or clicking "Disable all syles" again) and then click "Restore style states", to restore the enabled/disabled states of your styles to how they were before you first clicked "Disable all styles".

Warning: this button doesn't seem to play nicely with ChoGGi's version of Stylish, in that the restore feature doesn't work, I am yet to solve this issue...

Stylish Disable/Enable All
Compatibility: 

Minefield Firefox 3.0.* Firefox 2.0.* Firefox 1.5.* Flock Thunderbird 3.* Thunderbird 2.*

Author(s): 
rawny
Description & info:

Requires Extension(s): 
Stylish

Behavior

Action Behavior

Left

Shows the menu: - "Disable all styles" - "Restore style states" - "Enable all styles"

Revisions

Revision Operations
05/11/2009 - 00:51 by rawny

Added warning about incompatibility with ChoGGi's version of Stylish.

current revision
05/09/2009 - 12:00 by rawny

Actually updated the real button, before uploading it...

05/09/2009 - 11:58 by rawny

Actually updated the button...

05/09/2009 - 11:57 by rawny

Re-arranged the menu, updated button post information accordingly.

05/09/2009 - 05:28 by rawny

Re-written button for higher efficiency.

05/07/2009 - 14:36 by rawny

Re-formatted list in description.

05/07/2009 - 14:27 by rawny

Re-wrote button completely.

05/04/2009 - 21:34 by rawny

Initial launch.

Code

javascript: Copy To Clipboard
/*
 
    Thanks to Jason Barnabe (np) (a.k.a. the developer of Stylish) for supplying some turning styles on/off demo code.
    This button is partly based on that code.
 
    Rawny ^^
 
*/

Init

javascript: Copy To Clipboard
// ***** IMAGES ***** //
 
var enable_all_img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1F/DJAAAAQB0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AFP3ByUAAAAYdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My4zNqnn4iUAAACQSURBVChTfY/REoIgEEUJSqQVFRFhhcr+/yNphXFyeoi3e2a5e5bln8f+Alwwnyf8uCrcAeL+D/19e0dJIEhFBMc+PVLLGeVoJaKaUlyby8KyvPV2aNXk7ADcU6m4AnRaG1MygSAaANDGGR6om0pRdfPsnlbsuXgQeW1WllzFaAUtqkdUU1RHPtSr7HfidPIHfbmV9ZFCPuwAAAAASUVORK5CYII=";
var disable_all_img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwBQTFRFAAAAozARpjAtnHVw3RcU3TUz4wQG5jEL41EP6FEs4XMwn4xx3ZNP369vmZiXpKeTt7i43pOP3piq6s6PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAumyHKAAAAQB0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AFP3ByUAAAAYdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My4zNqnn4iUAAACISURBVChTXY/bDsMgDENbCoSkXEr6/9+6OaGbtPGA5AN24u31dzboORbUiQtgMqvrROcFMPluRjSx0AQY3O7Karqkbhbl2iSlIiV0zwCRKng37QB2Efz3YQ9gLhS+QM1PRB+L632nmKOHrnljhJyNYDFa+T2C2GLXGcnmGTlsdZRxDfKU++3/Bmzyeh3gYUcUAAAAAElFTkSuQmCC";
var restore_enabled_img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv5+ERgAAAQB0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AFP3ByUAAAAYdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My4zNqnn4iUAAACxSURBVChTHY7bGsIgDINr5zYRd7AtmwwQ3v8lsfW/yJfmIg105bMi3tCf5qH3uOJEKfGEPloQ/ZBqLUoYn1GDdci15D9p9B0+mGrO31aTwnjCOpacSmtZjMnDk7LYzSLM4hCQObfWqiHsBkAiC/6I0+BF5DQJxGqcu8M2q9MSVSJ2C1x3LePSiirLdELfHkH/ZZPwXmz68j6OoBwHLTa9R60JOlweelvQ+7Xt875vl/kfQfMxZmVErfAAAAAASUVORK5CYII=";
var restore_disabled_img = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAwBQTFRFAAAAU1JSb3BxlnqMi4qKmZiXqKirt7i4sNXPxMLF2djX5ejw+Pv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAmEgHOgAAAQB0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AFP3ByUAAAAYdEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My4zNqnn4iUAAACNSURBVChTHY8LDsBABEStYjp273/dduwkgkd87JMqfK0VNbHJYnkBFevBALhz90gRBMJ7N/slX7p/hoUm+2wArFWmhskPBYDnMa8XqlNjpXQB8Jx9hbqgBM4eQw7IzBlZkkK3DHmRyYTC4FPs09NSXvZl6Gy8wloSc3ok7hGkavOcuFaTFcrvt4OkvO//Ac4mtY15/xQAAAAASUVORK5CYII=";
 
var cb_img = "data:image/x-ic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f+3tDa/s+8xuzRu8RsAAAA/wAAAP8AAAD/AAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANjc4wvX193A5uLo/d/U2v7Wyc/Z1sbMEAAAAAAAAAD/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA5OPp2eDc4fLVy9H75dnfmwAAAAAAAAAAAAAAAAAAAP8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODd4hTa1tnIzsfK59rQ1Q4AAAAAAAAA/wAAAAAAAAAAAAAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4+Di7NnU1gwAAAAAAAAAAAAAAAAAAAD/AAAA/wAAAAAAAAAAx+OcQcODnEHAA5xB4AOcQeADnEHAA5xBgAGcQQAAnEEAAJxBAACcQeAHnEH4AZxB+BecQfw7nEH8LZxB/nOcQQ==";
 
 
 
// ***** VARS ***** //
 
var service = Components.classes["@userstyles.org/style;1"].getService(Components.interfaces.stylishStyle);
var button = this;
var num = custombuttons.getNumber(this.id);
var snap_name = "SDEA"+num+"_snapshot";
 
 
 
// ***** FUNCTIONS ***** //
 
this.disable_all_styles = function() {
  if (button.firstChild.firstChild.nextSibling.disabled) {
    button.firstChild.firstChild.nextSibling.disabled = false;
    button.firstChild.firstChild.nextSibling.image = restore_enabled_img;
    service.findEnabled(false, service.REGISTER_STYLE_ON_CHANGE, {}).forEach(function(style) {
      style.addMeta(snap_name, "false");
      style.save();
    });
  }
  service.findEnabled(true, service.REGISTER_STYLE_ON_CHANGE, {}).forEach(function(style) {
    if (button.firstChild.firstChild.nextSibling.disabled)
      style.addMeta(snap_name, "true");
    style.enabled = false;
    style.save();
  });
};
 
this.restore_snapshot = function(name) {
  button.firstChild.firstChild.nextSibling.disabled = true;
  button.firstChild.firstChild.nextSibling.image = restore_disabled_img;
  service.findByMeta(name, "true", service.REGISTER_STYLE_ON_CHANGE, {}).forEach(function(style) {
    style.enabled = true;
    style.removeAllMeta(name);
    style.save();
  });
  service.findByMeta(name, "false", service.REGISTER_STYLE_ON_CHANGE, {}).forEach(function(style) {
    style.enabled = false;
    style.removeAllMeta(name);
    style.save();
  });
};
 
this.enable_all_styles = function() {
  if (button.firstChild.firstChild.nextSibling.disabled) {
    button.firstChild.firstChild.nextSibling.disabled = false;
    button.firstChild.firstChild.nextSibling.image = restore_enabled_img;
    service.findEnabled(true, service.REGISTER_STYLE_ON_CHANGE, {}).forEach(function(style) {
      style.addMeta(snap_name, "true");
      style.save();
    });
  }
  service.findEnabled(false, service.REGISTER_STYLE_ON_CHANGE, {}).forEach(function(style) {
    if (button.firstChild.firstChild.nextSibling.disabled)
      style.addMeta(snap_name, "false");
    style.enabled = true;
    style.save();
  });
};
 
 
 
// ***** INITIALISATION ***** //
 
var mPopup = document.createElement("menupopup");
 
var mItem = document.createElement("menuitem");
mItem.setAttribute("label", "Disable all styles");
mItem.setAttribute("image", disable_all_img);
mItem.func = this.disable_all_styles.bind(this);
mItem.setAttribute("oncommand", "this.func();");
mPopup.appendChild(mItem);
 
var mItem = document.createElement("menuitem");
mItem.setAttribute("label", "Restore style states");
mItem.setAttribute("image", restore_disabled_img);
mItem.func = this.restore_snapshot.bind(this);
mItem.setAttribute("oncommand", "this.func('"+snap_name+"');");
mItem.setAttribute("disabled", true);
mPopup.appendChild(mItem);
 
var mItem = document.createElement("menuitem");
mItem.setAttribute("label", "Enable all styles");
mItem.setAttribute("image", enable_all_img);
mItem.func = this.enable_all_styles.bind(this);
mItem.setAttribute("oncommand", "this.func();");
mPopup.appendChild(mItem);
 
mPopup.appendChild(document.createElement("menuseparator"));
 
var cbPopup = document.getElementById("custombuttons-contextpopup").cloneNode(true);
var cbItems = cbPopup.childNodes.length;
 
var subPopup = document.createElement("menupopup");
for(var i = 0; i < cbItems; i++) {
  subPopup.appendChild(cbPopup.firstChild);
}
 
var subMenu = document.createElement("menu");
subMenu.setAttribute("label", "Custom Button");
subMenu.setAttribute("image", cb_img);
subMenu.appendChild(subPopup);
 
mPopup.appendChild(subMenu);
 
this.appendChild(mPopup);
this.type = "menu";
this.setAttribute("class", "menu-iconic");
 
 
 
// ***** ATTRIBUTES ***** //
 
this.setAttribute('author','rawny');
this.setAttribute('version','4 (2009-05-09)');
this.setAttribute('dependency','FF3.0*, CB2 3.0.*');
this.setAttribute('homepage', 'http://custombuttons2.com/forum/buttons/buttons-database/stylish-disableenable-all.html');
this.setAttribute('status','Complete');
this.setAttribute('public',true);

Help

Left clicking this button will show it's menu, from the menu you can:
- Enable all styles
- Disable all styles
- Restore style states
 
Clicking Enable/Disable all styles, will take a snapshot of the current enabled/disabled states of your styles and then Enable/Disable all your styles.
 
Clicking Restore style states will restore the first snapshot taken (and remove that snapshot).
 
This means you can select "Enable all styles", do whatever you like (including clicking "Disable all styles" or clicking "Enable all syles" again) and then click "Restore style states", to restore the enabled/disabled states of your styles to how they were before you first clicked "Enable all styles".

Details

Button Categories: 
Depends on (and Compliments) Extension(s): 

Custom Buttons² v.3.0.0

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729) Pict Firefox Plugin v. 1.0

Posted with the theme Twilight

Top
Joined: 07/27/2008
Posts: 203
User offline. Last seen 2 days 1 hour ago.

Does it enable all previously enabled styles or all of them?

Custom Buttons² v.3.0.1rc1

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)

Posted with the theme Pixture

Top
rawny's picture
Joined: 08/08/2008
Posts: 250
User offline. Last seen 1 day 4 hours ago.

This button just enables or disables all of them.

(A more powerful version is on its way! Grinwink)

Custom Buttons² v.3.0.0

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729) Pict Firefox Plugin v. 1.0

Posted with the theme Twilight

Top
Joined: 07/27/2008
Posts: 203
User offline. Last seen 2 days 1 hour ago.

... waiting ....

Custom Buttons² v.3.0.1rc1

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)

Posted with the theme Pixture

Top
rawny's picture
Joined: 08/08/2008
Posts: 250
User offline. Last seen 1 day 4 hours ago.

I have just re-written the button so that it allows you to restore the enabled/disabled states of your styles to how they were before you used the button to enable/disable all your styles.

Custom Buttons² was not found: find out why...

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729) Pict Firefox Plugin v. 1.0

Posted with the theme AD Lemon Twist

Top