From 8dc48c50c39fb754e1ca5d5f5cdbc9f43c0175c4 Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 14:33:25 -0500 Subject: [PATCH 1/5] Update style.css --- stylesheets/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stylesheets/style.css b/stylesheets/style.css index bebd4813..f542ec36 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -858,7 +858,7 @@ pre { #options_div { width: 600px; - height: 300px; + height: 320px; } #alert_div { From 7ac1ccf448c2f5f85e68037473691cb84f3169d2 Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 14:39:20 -0500 Subject: [PATCH 2/5] 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()); From 8fa14518e2de990bb66f11296d3691ef17ba5b5a Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 14:50:01 -0500 Subject: [PATCH 3/5] only disable stylesheets on Applicable pages --- js/disable-styles.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/js/disable-styles.js b/js/disable-styles.js index aff6f034..c44510e4 100644 --- a/js/disable-styles.js +++ b/js/disable-styles.js @@ -4,17 +4,21 @@ var disableStyleSheet = function () { var disableStyles = localStorage['disablestylesheet'] ? true : false; - var i = 0 - while(i Date: Thu, 20 Nov 2014 15:12:40 -0500 Subject: [PATCH 4/5] clean up and added comments --- js/disable-styles.js | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/js/disable-styles.js b/js/disable-styles.js index c44510e4..823d023a 100644 --- a/js/disable-styles.js +++ b/js/disable-styles.js @@ -2,8 +2,9 @@ /* Adds a checkbox in the General options tab to disable and enable board style sheets. */ -var disableStyleSheet = function () { +$(document).ready(function () { var disableStyles = localStorage['disablestylesheet'] ? true : false; + /* only search for and disable board stylesheets if the user is on a page that uses them */ if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog') { var i = 0 @@ -18,22 +19,19 @@ var disableStyleSheet = function () { i++ } } - + /* add the option on all pages so that the user doesn't need to goto a board to toggle it */ if (window.Options && Options.get_tab('general')){ - element = '#disablestyle' - event = 'change' Options.extend_tab('general','') - $(element).find('input').prop('checked', disableStyles) + $('#disablestyle').find('input').prop('checked', disableStyles) } - $(element).on(event, function() { + $('#disablestyle').on('change', function() { if(disableStyles) { - delete localStorage.disablestylesheet; + delete localStorage.disablestylesheet } else { - localStorage.disablestylesheet = true; + localStorage.disablestylesheet = true } - disableStyles =! disableStyles; - if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog') document.styleSheets[sheet].disabled = disableStyles; + disableStyles =! disableStyles + if(active_page == 'ukko' || active_page == 'thread' || active_page == 'index' || active_page == 'catalog') document.styleSheets[sheet].disabled = disableStyles }) -} -$(document).ready(disableStyleSheet()); +}) From 345b0b848fdafdf74b39da485b294edd281252a6 Mon Sep 17 00:00:00 2001 From: wholelotofhs Date: Thu, 20 Nov 2014 15:23:19 -0500 Subject: [PATCH 5/5] Update disable-styles.js --- js/disable-styles.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/disable-styles.js b/js/disable-styles.js index 823d023a..c69f4e2d 100644 --- a/js/disable-styles.js +++ b/js/disable-styles.js @@ -1,5 +1,3 @@ -/* 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. */ $(document).ready(function () {