Merge branch '2.0'
[GitHub/WoltLab/WCF.git] / wcfsetup / install / files / js / 3rdParty / codemirror / mode / smartymixed / index.html
1 <!doctype html>
2
3 <title>CodeMirror: Smarty mixed mode</title>
4 <meta charset="utf-8"/>
5 <link rel=stylesheet href="../../doc/docs.css">
6
7 <link rel="stylesheet" href="../../lib/codemirror.css">
8 <script src="../../lib/codemirror.js"></script>
9 <script src="../../mode/xml/xml.js"></script>
10 <script src="../../mode/javascript/javascript.js"></script>
11 <script src="../../mode/css/css.js"></script>
12 <script src="../../mode/htmlmixed/htmlmixed.js"></script>
13 <script src="../../mode/smarty/smarty.js"></script>
14 <script src="../../mode/smartymixed/smartymixed.js"></script>
15 <div id=nav>
16 <a href="http://codemirror.net"><img id=logo src="../../doc/logo.png"></a>
17
18 <ul>
19 <li><a href="../../index.html">Home</a>
20 <li><a href="../../doc/manual.html">Manual</a>
21 <li><a href="https://github.com/marijnh/codemirror">Code</a>
22 </ul>
23 <ul>
24 <li><a href="../index.html">Language modes</a>
25 <li><a class=active href="#">Smarty mixed</a>
26 </ul>
27 </div>
28
29 <article>
30 <h2>Smarty mixed mode</h2>
31 <form><textarea id="code" name="code">
32 {**
33 * @brief Smarty mixed mode
34 * @author Ruslan Osmanov
35 * @date 29.06.2013
36 *}
37 <html>
38 <head>
39 <title>{$title|htmlspecialchars|truncate:30}</title>
40 </head>
41 <body class="{$bodyclass}">
42 {* Multiline smarty
43 * comment, no {$variables} here
44 *}
45 {literal}
46 {literal} is just an HTML text.
47 <script type="text/javascript">//<![CDATA[
48 var a = {$just_a_normal_js_object : "value"};
49 var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("code"), {
50 mode : "smartymixed",
51 tabSize : 2,
52 indentUnit : 2,
53 indentWithTabs : false,
54 lineNumbers : true,
55 smartyVersion : 3
56 });
57 // ]]>
58 </script>
59 <style>
60 /* CSS content
61 {$no_smarty} */
62 .some-class { font-weight: bolder; color: "orange"; }
63 </style>
64 {/literal}
65
66 {extends file="parent.tpl"}
67 {include file="template.tpl"}
68
69 {* some example Smarty content *}
70 {if isset($name) && $name == 'Blog'}
71 This is a {$var}.
72 {$integer = 4511}, {$array[] = "a"}, {$stringvar = "string"}
73 {$integer = 4512} {$array[] = "a"} {$stringvar = "string"}
74 {assign var='bob' value=$var.prop}
75 {elseif $name == $foo}
76 {function name=menu level=0}
77 {foreach $data as $entry}
78 {if is_array($entry)}
79 - {$entry@key}
80 {menu data=$entry level=$level+1}
81 {else}
82 {$entry}
83 {* One
84 * Two
85 * Three
86 *}
87 {/if}
88 {/foreach}
89 {/function}
90 {/if}
91 </body>
92 <!-- R.O. -->
93 </html>
94 </textarea></form>
95
96 <script type="text/javascript">
97 var myCodeMirror = CodeMirror.fromTextArea(document.getElementById("code"), {
98 mode : "smartymixed",
99 tabSize : 2,
100 indentUnit : 2,
101 indentWithTabs : false,
102 lineNumbers : true,
103 smartyVersion : 3,
104 matchBrackets : true,
105 });
106 </script>
107
108 <p>The Smarty mixed mode depends on the Smarty and HTML mixed modes. HTML
109 mixed mode itself depends on XML, JavaScript, and CSS modes.</p>
110
111 <p>It takes the same options, as Smarty and HTML mixed modes.</p>
112
113 <p><strong>MIME types defined:</strong> <code>text/x-smarty</code>.</p>
114 </article>