cleaned
This commit is contained in:
		
							parent
							
								
									b25804d8a7
								
							
						
					
					
						commit
						7d794d1d7f
					
				@ -1,25 +1,20 @@
 | 
			
		||||
/* Depends on cookies.js (non-free) */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	SHEETS.JS
 | 
			
		||||
	PUBLIC DOMAIN CODE BY DEVEN BLAKE
 | 
			
		||||
 | 
			
		||||
	setStyling(sheet) sets the stylesheet to the file at sheet.
 | 
			
		||||
	e.g. setStyling("sheet.css") will change the stylesheet to "sheet.css"
 | 
			
		||||
	initializesheets() just sets the sheet to the sheet in the cookie, if
 | 
			
		||||
	the user saved their preferences.
 | 
			
		||||
	Needs a <LINK HREF="" ID="styling" REL="stylesheet" /> somewhere on the
 | 
			
		||||
	page in order to work.
 | 
			
		||||
 | 
			
		||||
	You can use setStyling("") to reset it.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
window.setStyling = function(sheet) {
 | 
			
		||||
	document.getElementById('styling').setAttribute('href', sheet);
 | 
			
		||||
	return sheet;
 | 
			
		||||
};
 | 
			
		||||
/* Depends on cookies.js (NON-FREE) */
 | 
			
		||||
/* 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;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user