|
14 | 14 | </title> |
15 | 15 |
|
16 | 16 | <meta name=description content='Learn how to set up CodeMirror in your browser to create a powerful, customizable code editor. This guide includes editable, runnable examples so you can explore syntax highlighting, themes, and extensions in real time.'> |
17 | | - |
| 17 | + |
18 | 18 | <base href='https://ext-code.com/blog/25-10-17/codemirror-in-the-browser/'> |
19 | 19 | <link rel=canonical href='https://ext-code.com/blog/25-10-17/codemirror-in-the-browser/codemirror-in-the-browser.html'> |
20 | 20 |
|
|
37 | 37 |
|
38 | 38 |
|
39 | 39 | <script src='https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js'></script> |
40 | | - |
41 | | - |
42 | | - <script src='https://libs.ext-code.com/js/dom/component/component.js'></script> |
| 40 | + |
| 41 | + |
| 42 | + <script src='https://libs.ext-code.com/js/dom/component/v3.0/component.js'></script> |
43 | 43 |
|
44 | 44 | <script init> |
45 | 45 | console.clear(); |
|
64 | 64 |
|
65 | 65 |
|
66 | 66 | async function init(){ |
67 | | - |
| 67 | + |
68 | 68 | menu = menumod(); |
69 | | - |
| 69 | + |
70 | 70 | mod.base.add({ext,$,datatype,keydown,menu,menumod,ace}); |
71 | 71 |
|
72 | | - |
73 | | - hdr = mod['blog-hdr']; |
| 72 | + |
| 73 | + hdr = mod['blog-hdr']; |
74 | 74 | ex = mod.ex; |
75 | 75 | log = mod['log-mod']; |
76 | 76 |
|
|
108 | 108 | [$,datatype,menumod,keydown,debug] = await promise; |
109 | 109 |
|
110 | 110 | mod.stack.complete; |
111 | | - |
| 111 | + |
112 | 112 | })(); |
113 | | - |
114 | | - </script init> |
115 | 113 |
|
| 114 | + </script init> |
| 115 | + |
116 | 116 |
|
117 | 117 | <link rel=stylesheet href='/blog/css/blog.css'> |
118 | 118 |
|
119 | 119 | <style> |
120 | | - |
| 120 | + |
121 | 121 | html |
122 | 122 | {height:100%;font-family:arial} |
123 | 123 | body |
|
130 | 130 | [component] |
131 | 131 | {display:none} |
132 | 132 |
|
133 | | - .description |
| 133 | + .description |
134 | 134 | {max-width:1000px;text-align:justify;border-left:4px solid #4a90e2;padding:1rem 2rem; |
135 | 135 | background-color:#f9f9f9;font-family:system-ui,sans-serif;font-size:1rem;line-height:1.6;color:#333} |
136 | 136 | .description>p |
137 | 137 | {margin:0} |
138 | 138 | .description > p+p |
139 | 139 | {margin:10px 0} |
140 | | - |
| 140 | + |
141 | 141 | code |
142 | 142 | {font-family:monospace;background:whitesmoke} |
143 | 143 | code.inline |
144 | 144 | {display:inline;padding:5px 10px} |
145 | | - |
| 145 | + |
146 | 146 | a |
147 | 147 | {color:#4a90e2;text-decoration:none;font-weight:500} |
148 | | - a:hover |
| 148 | + a:hover |
149 | 149 | {text-decoration:underline} |
150 | 150 | .link-domain |
151 | 151 | {font-size:0.85rem;color:#777;margin-left:0.25rem} |
152 | | - .link-domain::before |
| 152 | + .link-domain::before |
153 | 153 | {content:'['} |
154 | 154 | .link-domain::after |
155 | 155 | {content:']'} |
156 | 156 | .link-txt |
157 | 157 | {} |
158 | | - |
| 158 | + |
159 | 159 | input |
160 | 160 | {font-size:16px;padding:5px 7px;box-sizing:border-box;} |
161 | 161 | input[type=button] |
162 | 162 | {cursor:pointer} |
163 | | - |
164 | | - |
| 163 | + |
| 164 | + |
165 | 165 | #editor |
166 | 166 | {border:1px solid #ccc;height:300px} |
167 | 167 |
|
168 | 168 | </style> |
169 | 169 |
|
170 | 170 | </head> |
171 | | - |
| 171 | + |
172 | 172 | <body> |
173 | | - |
174 | | - <blog-hdr component=grp1> |
| 173 | + |
| 174 | + <blog-hdr component=grp1> |
175 | 175 | <h1 class=title> |
176 | 176 | CodeMirror In The Browser |
177 | 177 | </h1> |
178 | 178 | <time slot=date datetime=2025-10-29> |
179 | 179 | 29 Oct 2025 |
180 | 180 | </time> |
181 | 181 | </blog-hdr> |
182 | | - |
| 182 | + |
183 | 183 | <div class=description> |
184 | 184 | <p> |
185 | 185 | Learn how to set up CodeMirror in your browser to create a powerful, customizable code editor. |
186 | 186 | This guide includes editable, runnable examples so you can explore syntax highlighting, themes, and extensions in real time. |
187 | 187 | </p> |
188 | 188 | </div> |
189 | | - |
190 | | - |
| 189 | + |
| 190 | + |
191 | 191 | <snippet-html-console id=ex src='ex/ex.html' component></snippet-html-console> |
192 | | - |
193 | | - |
| 192 | + |
| 193 | + |
194 | 194 | <log-mod component></log-mod> |
195 | | - |
| 195 | + |
196 | 196 |
|
197 | 197 | </body> |
198 | | - |
| 198 | + |
199 | 199 |
|
200 | 200 | <script> |
201 | 201 |
|
202 | | - |
| 202 | + |
203 | 203 | function initdom(rootnode){ |
204 | | - |
| 204 | + |
205 | 205 | hdr.initdom(); |
206 | 206 | ex.initdom(); |
207 | 207 | log.initdom(); |
208 | 208 |
|
209 | 209 |
|
210 | 210 | }//initdom |
211 | 211 |
|
212 | | - |
| 212 | + |
213 | 213 | //: |
214 | 214 |
|
215 | 215 |
|
|
0 commit comments