From 7ac1ccf448c2f5f85e68037473691cb84f3169d2 Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 14:39:20 -0500 Subject: [PATCH] Create disable-styles.js --- js/disable-styles.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 js/disable-styles.js diff --git a/js/disable-styles.js b/js/disable-styles.js new file mode 100644 index 00000000..aff6f034 --- /dev/null +++ b/js/disable-styles.js @@ -0,0 +1,35 @@ +/* This file is dedicated to the public domain; you may do as you wish with it. */ + +/* Adds a checkbox in the General options tab to disable and enable board style sheets. */ + +var disableStyleSheet = function () { + var disableStyles = localStorage['disablestylesheet'] ? true : false; + var i = 0 + while(i' + ' Disable board specific style sheets' + '') + $(element).find('input').prop('checked', disableStyles) + } + + $(element).on(event, function() { + if(disableStyles) { + delete localStorage.disablestylesheet; + } else { + localStorage.disablestylesheet = true; + } + disableStyles =! disableStyles; + document.styleSheets[sheet].disabled = disableStyles; + }) +} +$(document).ready(disableStyleSheet());