mirror of
				https://github.com/MarioSpore/Grinch-AP.git
				synced 2025-10-21 20:21:32 -06:00 
			
		
		
		
	
		
			
	
	
		
			18 lines
		
	
	
		
			662 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			662 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
|   | window.addEventListener('load', () => { | ||
|  |     new Promise((resolve, reject) => { | ||
|  |         let ajax = new XMLHttpRequest(); | ||
|  |         ajax.onreadystatechange = () => { | ||
|  |             if (ajax.readyState !== 4) { return; } | ||
|  |             if (ajax.status !== 200) { reject('Unable to retrieve tutorial markdown file.') } | ||
|  |             resolve(ajax.responseText); | ||
|  |         }; | ||
|  |         ajax.open('GET', 'tutorial.md', true); | ||
|  |         ajax.send(); | ||
|  |     }).then((response) => { | ||
|  |         let markdown = new showdown.Converter(); | ||
|  |         document.getElementById('tutorial-wrapper').innerHTML = markdown.makeHtml(response); | ||
|  |     }).catch((error) => { | ||
|  |         console.log(error); | ||
|  |     }); | ||
|  | }); |