Project

General

Profile

Statistics
| Revision:

root / trunk / scripts / codemirror / mode / htmlembedded / index.html @ 216

History | View | Annotate | Download (1.66 KB)

1
<!doctype html>
2
<html>
3
  <head>
4
    <title>CodeMirror: Html Embedded Scripts mode</title>
5
    <link rel="stylesheet" href="../../lib/codemirror.css">
6
    <script src="../../lib/codemirror.js"></script>
7
    <script src="../xml/xml.js"></script>
8
    <script src="../javascript/javascript.js"></script>
9
    <script src="../css/css.js"></script>
10
    <script src="../htmlmixed/htmlmixed.js"></script>
11
    <script src="htmlembedded.js"></script>
12
    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
13
    <link rel="stylesheet" href="../../doc/docs.css">
14
  </head>
15
  <body>
16
    <h1>CodeMirror: Html Embedded Scripts mode</h1>
17

    
18
<form><textarea id="code" name="code">
19
<%
20
function hello(who) {
21
        return "Hello " + who;
22
}
23
%>
24
This is an example of EJS (embedded javascript)
25
<p>The program says <%= hello("world") %>.</p>
26
<script>
27
        alert("And here is some normal JS code"); // also colored
28
</script>
29
</textarea></form>
30

    
31
    <script>
32
      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
33
        lineNumbers: true,
34
        matchBrackets: true,
35
        mode: "application/x-ejs",
36
        indentUnit: 4,
37
        indentWithTabs: true,
38
        enterMode: "keep",
39
        tabMode: "shift"
40
      });
41
    </script>
42

    
43
    <p>Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
44
    JavaScript, CSS and XML.<br />Other dependancies include those of the scriping language chosen.</p>
45

    
46
    <p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET), 
47
    <code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)</p>
48
  </body>
49
</html>