mirror of https://github.com/shadowfacts/type.git
Swift to cdnjs because jsDelivr doesn't have the latest CodeMirror
This commit is contained in:
parent
53b97f8dfb
commit
9cedf2a6bc
12
index.html
12
index.html
|
@ -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>
|
||||
|
|
2
main.js
2
main.js
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue