1
0
src/homepage/js/sheets.js

22 lines
607 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;
if((sheet = window.getCookie('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;
};