corrade-nucleus-nucleons – Blame information for rev 24
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | <!DOCTYPE html> |
2 | <html lang="en"> |
||
3 | <head> |
||
4 | <meta charset="UTF-8"> |
||
5 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||
6 | <title>ACE Editor Modelist Demo</title> |
||
7 | <style type="text/css" media="screen"> |
||
8 | body { |
||
9 | overflow: hidden; |
||
10 | } |
||
11 | |||
12 | #editor { |
||
13 | margin: 0; |
||
14 | position: absolute; |
||
15 | top: 0; |
||
16 | bottom: 0; |
||
17 | left: 0; |
||
18 | right: 0; |
||
19 | } |
||
20 | </style> |
||
21 | </head> |
||
22 | <body> |
||
23 | |||
24 | <pre id="editor"></pre> |
||
25 | |||
26 | <!-- load ace --> |
||
27 | <script src="../src/ace.js"></script> |
||
28 | <!-- load ace modelist extension --> |
||
29 | <script src="../src/ext-modelist.js"></script> |
||
30 | <script> |
||
31 | var editor = ace.edit("editor"); |
||
32 | editor.setTheme("ace/theme/twilight"); |
||
33 | (function () { |
||
34 | var modelist = ace.require("ace/ext/modelist"); |
||
35 | // the file path could come from an xmlhttp request, a drop event, |
||
36 | // or any other scriptable file loading process. |
||
37 | // Extensions could consume the modelist and use it to dynamically |
||
38 | // set the editor mode. Webmasters could use it in their scripts |
||
39 | // for site specific purposes as well. |
||
40 | var filePath = "blahblah/weee/some.js"; |
||
41 | var mode = modelist.getModeForPath(filePath).mode; |
||
42 | console.log(mode); |
||
43 | editor.session.setMode(mode); |
||
44 | }()); |
||
45 | </script> |
||
46 | |||
47 | <script src="./show_own_source.js"></script> |
||
48 | </body> |
||
49 | </html> |