diff options
author | Pushkar Joshi | 2012-05-07 11:00:22 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-05-07 11:00:22 -0700 |
commit | e5ae6e0b6e54db0e6efd75d1f14cb791060ed67a (patch) | |
tree | e84d2dc5033c1b5c1b993662660a90af12584b69 /imports/codemirror/mode/smarty/index.html | |
parent | ba890518b5a35d5e6893f9fc72d2eee30ae07e17 (diff) | |
parent | 526e423e4a2734c2b139af23911e912452a4443f (diff) | |
download | ninja-e5ae6e0b6e54db0e6efd75d1f14cb791060ed67a.tar.gz |
Merge branch 'master' into pentool
Diffstat (limited to 'imports/codemirror/mode/smarty/index.html')
-rw-r--r-- | imports/codemirror/mode/smarty/index.html | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/imports/codemirror/mode/smarty/index.html b/imports/codemirror/mode/smarty/index.html new file mode 100644 index 00000000..ad4dccf0 --- /dev/null +++ b/imports/codemirror/mode/smarty/index.html | |||
@@ -0,0 +1,82 @@ | |||
1 | <!doctype html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <title>CodeMirror: Smarty mode</title> | ||
5 | <link rel="stylesheet" href="../../lib/codemirror.css"> | ||
6 | <script src="../../lib/codemirror.js"></script> | ||
7 | <script src="smarty.js"></script> | ||
8 | <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> | ||
9 | <link rel="stylesheet" href="../../doc/docs.css"> | ||
10 | </head> | ||
11 | <body> | ||
12 | <h1>CodeMirror: Smarty mode</h1> | ||
13 | |||
14 | <form><textarea id="code" name="code"> | ||
15 | {extends file="parent.tpl"} | ||
16 | {include file="template.tpl"} | ||
17 | |||
18 | {* some example Smarty content *} | ||
19 | {if isset($name) && $name == 'Blog'} | ||
20 | This is a {$var}. | ||
21 | {$integer = 451}, {$array[] = "a"}, {$stringvar = "string"} | ||
22 | {assign var='bob' value=$var.prop} | ||
23 | {elseif $name == $foo} | ||
24 | {function name=menu level=0} | ||
25 | {foreach $data as $entry} | ||
26 | {if is_array($entry)} | ||
27 | - {$entry@key} | ||
28 | {menu data=$entry level=$level+1} | ||
29 | {else} | ||
30 | {$entry} | ||
31 | {/if} | ||
32 | {/foreach} | ||
33 | {/function} | ||
34 | {/if}</textarea></form> | ||
35 | |||
36 | <script> | ||
37 | var editor = CodeMirror.fromTextArea(document.getElementById("code"), { | ||
38 | lineNumbers: true, | ||
39 | mode: "smarty" | ||
40 | }); | ||
41 | </script> | ||
42 | |||
43 | <br /> | ||
44 | |||
45 | <form><textarea id="code2" name="code2"> | ||
46 | {--extends file="parent.tpl"--} | ||
47 | {--include file="template.tpl"--} | ||
48 | |||
49 | {--* some example Smarty content *--} | ||
50 | {--if isset($name) && $name == 'Blog'--} | ||
51 | This is a {--$var--}. | ||
52 | {--$integer = 451--}, {--$array[] = "a"--}, {--$stringvar = "string"--} | ||
53 | {--assign var='bob' value=$var.prop--} | ||
54 | {--elseif $name == $foo--} | ||
55 | {--function name=menu level=0--} | ||
56 | {--foreach $data as $entry--} | ||
57 | {--if is_array($entry)--} | ||
58 | - {--$entry@key--} | ||
59 | {--menu data=$entry level=$level+1--} | ||
60 | {--else--} | ||
61 | {--$entry--} | ||
62 | {--/if--} | ||
63 | {--/foreach--} | ||
64 | {--/function--} | ||
65 | {--/if--}</textarea></form> | ||
66 | |||
67 | <script> | ||
68 | var editor = CodeMirror.fromTextArea(document.getElementById("code2"), { | ||
69 | lineNumbers: true, | ||
70 | mode: { | ||
71 | name: "smarty", | ||
72 | leftDelimiter: "{--", | ||
73 | rightDelimiter: "--}" | ||
74 | } | ||
75 | }); | ||
76 | </script> | ||
77 | |||
78 | <p>A plain text/Smarty mode which allows for custom delimiter tags (defaults to <b>{</b> and <b>}</b>).</p> | ||
79 | |||
80 | <p><strong>MIME types defined:</strong> <code>text/x-smarty</code></p> | ||
81 | </body> | ||
82 | </html> | ||