1
0
src/homepage/js/sheets.js
2022-02-22 22:10:26 -05:00

25 lines
723 B
JavaScript

/* Depends on cookies.js */
/* sheets.js; Deven Blake 2021 */
/* @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt 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;
};
/* @license-end */