1
0
src/homepage/js/sheets.js
2021-09-30 21:51:24 -04:00

21 lines
602 B
JavaScript

/* Depends on cookies.js */
/* sheets.js; Deven Blake 2021; Public Domain */
/* sets the sheet to the sheet in the cookie, if the user saved their
* preferences */
window.initializesheets = function() {
var sheet = window.getCookie('sheet');
if(sheet != '') window.setStyling(sheet);
};
/* fetches the current styling value */
window.getStyling = function(){
return document.getElementById('styling').getAttribute('href');
};
/* sets the stylesheet to the file at `sheet` */
window.setStyling = function(sheet){
document.getElementById('styling').setAttribute('href', sheet);
return sheet;
};