Skip to content

Commit dacaef9

Browse files
authored
Update home.html
1 parent 2704b6d commit dacaef9

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

home.html

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<DOCTYPE html>
22
<html>
33
<head>
4-
<title>Quad-OS</title>
4+
<title>Quad -OS</title>
55
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="apple-touch-icon-57x57.png" />
66
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114.png" />
77
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72.png" />
@@ -134,12 +134,31 @@ <h1>Something</h1>
134134
</div>
135135
<script>
136136
var boxStatus = 1;
137-
var siBoxAllowed = localStorage.getItem("isBoxAllowed");
137+
/*var siBoxAllowed = localStorage.getItem("isBoxAllowed");
138138
if (siBoxAllowed == 1){
139139
document.getElementById("myonoffswitch").checked = true;
140140
} else {
141141
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+
});
143162
function boxNotAllowed() {
144163
document.getElementById("boxButton").style.visibility = "hidden";
145164
boxStatus = 0;

0 commit comments

Comments
 (0)