Swift to cdnjs because jsDelivr doesn't have the latest CodeMirror

This commit is contained in:
Shadowfacts 2016-10-01 10:16:34 -04:00
parent 53b97f8dfb
commit 9cedf2a6bc
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 9 additions and 5 deletions

View File

@ -3,16 +3,20 @@
<head>
<meta charset="UTF-8">
<title>typing4</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/codemirror/4.5.0/codemirror.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/codemirror.min.css">
<link rel="stylesheet" href="main.css">
</head>
<body>
<select id="language">
<option value="auto-detect">Auto-Detect</option>
</select>
<textarea id="editor"></textarea>
<script src="https://cdn.jsdelivr.net/codemirror/4.5.0/codemirror.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/localforage/1.4.2/localforage.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/localforage/1.4.2/localforage.min.js"></script>
<script src="languages.js"></script>
<script src="main.js"></script>
</body>

View File

@ -16,7 +16,7 @@ $.get({
let fileExtension = parts[parts.length - 1];
let lang = getLanguageByExtension(fileExtension);
$.get({
url: `https://cdn.jsdelivr.net/codemirror/4.5.0/mode/${lang.file}/${lang.file}.js`,
url: `https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.19.0/mode/${lang.file}/${lang.file}.min.js`,
success: (data) => {
eval(data);
setup(code, lang.mime);