|
43 | 43 | <link rel="stylesheet" href="../plugins/special-chars.css"> |
44 | 44 |
|
45 | 45 | <!--Register templates--> |
| 46 | + |
| 47 | + </head> |
| 48 | + <body> |
| 49 | + <textarea dir="rtl" placeholder="textarea rtl"></textarea> |
| 50 | + <textarea dir="ltr" placeholder="textarea ltr"></textarea> |
| 51 | + <code-input dir="rtl" template="prism" language="markdown" placeholder="prism rtl"></code-input> |
| 52 | + <code-input dir="ltr" template="prism" language="markdown" placeholder="prism ltr"></code-input> |
| 53 | + <code-input dir="rtl" template="hljs" language="markdown" placeholder="hljs rtl"></code-input> |
| 54 | + <code-input dir="ltr" template="hljs" language="markdown" placeholder="hljs ltr"></code-input> |
| 55 | + <code-input dir="rtl" template="prism+" language="markdown" placeholder="prism rtl" class="line-numbers"></code-input> |
| 56 | + <code-input dir="ltr" template="prism+" language="markdown" placeholder="prism ltr" class="line-numbers"></code-input> |
| 57 | + <code-input dir="rtl" template="hljs+" language="markdown" placeholder="hljs rtl"></code-input> |
| 58 | + <code-input dir="ltr" template="hljs+" language="markdown" placeholder="hljs ltr"></code-input> |
| 59 | + |
46 | 60 | <script> |
47 | | - codeInput.registerTemplate("hljs", codeInput.templates.hljs(hljs, [ |
48 | | - /*new codeInput.plugins.AutoCloseBrackets(), |
49 | | - new codeInput.plugins.Autocomplete(function(popupElem, textarea, selectionEnd) { |
50 | | - if(textarea.value.substring(selectionEnd-5, selectionEnd) == "popup") { |
51 | | - // Show popup |
52 | | - popupElem.style.display = "block"; |
53 | | - popupElem.innerHTML = "Here's your popup!"; |
54 | | - } else { |
55 | | - popupElem.style.display = "none"; |
56 | | - } |
57 | | - }), |
58 | | - new codeInput.plugins.Autodetect(), |
59 | | - new codeInput.plugins.FindAndReplace(), |
60 | | - new codeInput.plugins.GoToLine(), |
61 | | - new codeInput.plugins.Indent(true, 2), |
62 | | - new codeInput.plugins.SelectTokenCallbacks(codeInput.plugins.SelectTokenCallbacks.TokenSelectorCallbacks.createClassSynchronisation("in-selection"), false, true, true, true, true, false), |
63 | | - new codeInput.plugins.SpecialChars(true),*/ |
64 | | - ])); |
65 | | - codeInput.registerTemplate("prism", codeInput.templates.prism(Prism, [ |
66 | | - /*new codeInput.plugins.AutoCloseBrackets(), |
67 | | - new codeInput.plugins.Autocomplete(function(popupElem, textarea, selectionEnd) { |
68 | | - if(textarea.value.substring(selectionEnd-5, selectionEnd) == "popup") { |
69 | | - // Show popup |
70 | | - popupElem.style.display = "block"; |
71 | | - popupElem.innerHTML = "Here's your popup!"; |
72 | | - } else { |
73 | | - popupElem.style.display = "none"; |
74 | | - } |
75 | | - }), |
76 | | - new codeInput.plugins.FindAndReplace(), |
77 | | - new codeInput.plugins.GoToLine(), |
78 | | - new codeInput.plugins.Indent(true, 2), |
79 | | - new codeInput.plugins.SelectTokenCallbacks(new codeInput.plugins.SelectTokenCallbacks.TokenSelectorCallbacks(selectBrace, deselectAllBraces), true), |
80 | | - new codeInput.plugins.SpecialChars(true),*/ |
81 | | - ])); |
| 61 | + codeInput.registerTemplate("hljs", codeInput.templates.hljs(hljs, [])); |
| 62 | + codeInput.registerTemplate("prism", codeInput.templates.prism(Prism, [])); |
82 | 63 |
|
83 | 64 | // Attribution: Translated by Oliver Geer with some help from English Wiktionary |
84 | 65 | let findAndReplaceTranslations = { |
|
146 | 127 | //new codeInput.plugins.SpecialChars(true), |
147 | 128 | ])); |
148 | 129 | </script> |
149 | | - </head> |
150 | | - <body> |
151 | | - <textarea dir="rtl" placeholder="textarea rtl"></textarea> |
152 | | - <textarea dir="ltr" placeholder="textarea ltr"></textarea> |
153 | | - <code-input dir="rtl" template="prism" language="markdown" placeholder="prism rtl"></code-input> |
154 | | - <code-input dir="ltr" template="prism" language="markdown" placeholder="prism ltr"></code-input> |
155 | | - <code-input dir="rtl" template="hljs" language="markdown" placeholder="hljs rtl"></code-input> |
156 | | - <code-input dir="ltr" template="hljs" language="markdown" placeholder="hljs ltr"></code-input> |
157 | | - <code-input dir="rtl" template="prism+" language="markdown" placeholder="prism rtl" class="line-numbers"></code-input> |
158 | | - <code-input dir="ltr" template="prism+" language="markdown" placeholder="prism ltr" class="line-numbers"></code-input> |
159 | | - <code-input dir="rtl" template="hljs+" language="markdown" placeholder="hljs rtl"></code-input> |
160 | | - <code-input dir="ltr" template="hljs+" language="markdown" placeholder="hljs ltr"></code-input> |
161 | 130 |
|
162 | 131 | <script> |
163 | 132 | rtl = `# ערך מומלץ ערך מומלץ |
|
183 | 152 | CC-BY-SA hi.wikipedia.org: **ग्लेशियर नेशनल पार्क** अमेरिकी राष्ट्रीय उद्यान है, जो कि कनाडा-संयुक्त राज्य अमेरिका की सीमा पर स्थित है। उद्यान संयुक्त राज्य के उत्तर-पश्चिमी मोंटाना राज्य |
184 | 153 |
|
185 | 154 | में स्थित है और कनाडा की ओर अल्बर्टा और ब्रिटिश कोलम्बिया प्रांतों से सटा हुआ है। उद्यान दस लाख एकड़ RTL: ערך מומלץ ערך מומלץ (4,000 किमी2) से अधिक क्षेत्र में फैला हुआ है और इसमें दो पर्वत श्रृंखला (रॉकी पर्वत की उप-श्रेणियाँ), 130 से अधिक नामित झीलें...`; |
186 | | - window.addEventListener("load", function() { |
187 | | - |
188 | | - const elems = document.querySelectorAll("body > code-input, body > textarea"); |
189 | | - for(let i = 0; i < elems.length; i++) { |
190 | | - let dir = elems[i].getAttribute("dir"); |
191 | | - if(dir == "rtl") elems[i].value = rtl; |
192 | | - else elems[i].value = ltr; |
193 | | - } |
194 | | - }); |
| 155 | + const elems = document.querySelectorAll("body > code-input, body > textarea"); |
| 156 | + for(let i = 0; i < elems.length; i++) { |
| 157 | + let dir = elems[i].getAttribute("dir"); |
| 158 | + if(dir == "rtl") elems[i].value = rtl; |
| 159 | + else elems[i].value = ltr; |
| 160 | + } |
195 | 161 | </script> |
196 | 162 | </body> |
197 | 163 | </html> |
0 commit comments