|
1 | 1 | <DOCTYPE html>
|
2 | 2 | <html>
|
3 | 3 | <head>
|
4 |
| - <title>Quad-OS</title> |
| 4 | + <title>Quad -OS</title> |
5 | 5 | <link rel="apple-touch-icon-precomposed" sizes="57x57" href="apple-touch-icon-57x57.png" />
|
6 | 6 | <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114.png" />
|
7 | 7 | <link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72.png" />
|
@@ -134,12 +134,31 @@ <h1>Something</h1>
|
134 | 134 | </div>
|
135 | 135 | <script>
|
136 | 136 | var boxStatus = 1;
|
137 |
| - var siBoxAllowed = localStorage.getItem("isBoxAllowed"); |
| 137 | + /*var siBoxAllowed = localStorage.getItem("isBoxAllowed"); |
138 | 138 | if (siBoxAllowed == 1){
|
139 | 139 | document.getElementById("myonoffswitch").checked = true;
|
140 | 140 | } else {
|
141 | 141 | document.getElementById("myonoffswitch").checked = false;
|
142 |
| - } |
| 142 | + }*/ |
| 143 | + $('.onoffswitch-checkbox').on('click', function() { |
| 144 | +var fav, favs = []; |
| 145 | +$('.onoffswitch-checkbox').each(function() { // run through each of the checkboxes |
| 146 | +fav = {id: $(this).attr('id'), value: $(this).prop('checked')}; |
| 147 | + favs.push(fav); |
| 148 | + }); |
| 149 | + localStorage.setItem("favorites", JSON.stringify(favs)); |
| 150 | +}); |
| 151 | + |
| 152 | +$(document).ready(function() { |
| 153 | + var favorites = JSON.parse(localStorage.getItem('favorites')); |
| 154 | + if (!favorites.length) {return}; |
| 155 | + console.debug(favorites); |
| 156 | + |
| 157 | + for (var i=0; i<favorites.length; i++) { |
| 158 | + console.debug(favorites[i].value == 'on'); |
| 159 | + $('#' + favorites[i].id ).prop('checked', favorites[i].value); |
| 160 | + } |
| 161 | +}); |
143 | 162 | function boxNotAllowed() {
|
144 | 163 | document.getElementById("boxButton").style.visibility = "hidden";
|
145 | 164 | boxStatus = 0;
|
|
0 commit comments