mirror of
https://github.com/yhl452493373/frpc-panel.git
synced 2026-04-04 14:27:01 +08:00
add codemirror test page
This commit is contained in:
27
assets/templates/codemirror.html
Normal file
27
assets/templates/codemirror.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link rel="stylesheet" href="../static/lib/codemirror/lib/codemirror.css">
|
||||
<link rel="stylesheet" href="../static/lib/codemirror/theme/base16.css">
|
||||
<script src="../static/lib/codemirror/lib/codemirror.js"></script>
|
||||
<script src="../static/lib/codemirror/mode/properties/properties.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<textarea id="code" name="code"></textarea>
|
||||
<script>
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
|
||||
lineNumbers: true,
|
||||
mode: 'text/x-ini',
|
||||
theme: 'base16'
|
||||
});
|
||||
editor.setValue(`
|
||||
[HTTP:aaa.bbb.com]
|
||||
a = 1
|
||||
b = 2
|
||||
`)
|
||||
console.log(editor.getValue());
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user