-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
58 lines (53 loc) · 2.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Code Mirror - PHP Linter</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/codemirror.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/addon/lint/lint.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/codemirror.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/addon/lint/lint.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/mode/xml/xml.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/mode/javascript/javascript.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/mode/css/css.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/mode/htmlmixed/htmlmixed.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/mode/clike/clike.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/mode/php/php.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/addon/selection/active-line.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.30.0/addon/edit/matchbrackets.js"></script>
<!-- JSHINT LIBRARIES -->
<script src="https://rawgit.com/glayzzle/php-parser/master/dist/php-parser.min.js"></script>
<script src="https://rawgit.com/glayzzle/codemirror-linter/master/addon/lint/php-lint.js"></script>
<style type="text/css">
.CodeMirror {
font-size: 15px;
width: 100%, ;
height: 100%;
}
</style>
</head>
<body>
<div id="code"></div>
<script type="text/javascript">
window.onload = function() {
editor = CodeMirror(document.getElementById("code"), {
mode: "application/x-httpd-php-open",
lineWrapping: true,
lineNumbers: true,
lint: {
disableEval: true,
disableExit: true,
disablePHP7: true,
disabledFunctions: ['proc_open', 'system'],
deprecatedFunctions: ['wp_list_cats']
},
gutters: ["CodeMirror-lint-markers"],
styleActiveLine: true,
matchBrackets: true,
value: "<?php\necho 'Hello world';\n$foo = [1, 2, 3]\n\t\n\twp_list_cats($bar);\nproc_open(false);\nexit(0);\neval('evil');\n"
});
};
</script>
<a style="position: absolute; top: 0; right: 0; z-index: 9;" href="https://github.com/glayzzle/codemirror-linter"><img style="border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
</body>
</html>