diff options
| author | matthew <[email protected]> | 2023-11-22 14:11:55 +0000 |
|---|---|---|
| committer | matthew <[email protected]> | 2023-11-22 14:11:55 +0000 |
| commit | a18e0d360d255ce22555cdb62d4bc789366a4b29 (patch) | |
| tree | 183a70b170d267197ab1d9bf1a2a4b121729e191 | |
| parent | 88a0be41f2ea601e648fe746fc1b11be23b45a61 (diff) | |
| download | raylib.com-a18e0d360d255ce22555cdb62d4bc789366a4b29.tar.gz raylib.com-a18e0d360d255ce22555cdb62d4bc789366a4b29.zip | |
Remove jQuery dependencies on cheatsheat
| -rw-r--r-- | cheatsheet/cheatsheet.html | 60 |
1 files changed, 24 insertions, 36 deletions
diff --git a/cheatsheet/cheatsheet.html b/cheatsheet/cheatsheet.html index 3aa3426..b090be6 100644 --- a/cheatsheet/cheatsheet.html +++ b/cheatsheet/cheatsheet.html @@ -19,8 +19,7 @@ <meta property="og:site_name" content="raylib"/> <meta property="og:description" content="Don't miss latest functions added to raylib... check raylib cheatsheet"/> - <!-- Add jQuery library --> - <script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script> + <!-- hightlight.js - Syntax highlighting for the Web --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/docco.min.css"> @@ -87,40 +86,29 @@ </style> <script type="text/javascript"> - $(document).ready(function() { - $.get('raylib_core.c', function(data) { - $('#core pre code').text(data); - $('#core pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - $.get('raylib_shapes.c', function(data) { - $('#shapes pre code').text(data); - $('#shapes pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - $.get('raylib_textures.c', function(data) { - $('#textures pre code').text(data); - $('#textures pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - $.get('raylib_text.c', function(data) { - $('#text pre code').text(data); - $('#text pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - $.get('raylib_models.c', function(data) { - $('#models pre code').text(data); - $('#models pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - $.get('raylib_audio.c', function(data) { - $('#audio pre code').text(data); - $('#audio pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - $.get('raylib_colors.c', function(data) { - $('#colors pre code').text(data); - $('#colors pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - $.get('raylib_structs.c', function(data) { - $('#structs pre code').text(data); - $('#structs pre code').each(function(i, e) {hljs.highlightBlock(e)}); - }, 'text'); - }); + document.addEventListener('DOMContentLoaded', function() { + function addModule(url, targetSelector) { + fetch(url) + .then(response => response.text()) + .then(data => { + document.querySelector(targetSelector).innerHTML = data; + document.querySelectorAll(targetSelector).forEach(function(e) { + hljs.highlightBlock(e); + }); + }) + .catch(error => console.error('Could not get ' + url, error)); + } + + addModule('raylib_core.c', '#core pre code'); + addModule('raylib_shapes.c', '#shapes pre code'); + addModule('raylib_textures.c', '#textures pre code'); + addModule('raylib_text.c', '#text pre code'); + addModule('raylib_models.c', '#models pre code'); + addModule('raylib_audio.c', '#audio pre code'); + addModule('raylib_colors.c', '#colors pre code'); + addModule('raylib_structs.c', '#structs pre code'); + }); + </script> </head> |
