Skip to content

Commit 619b138

Browse files
committed
Add fallback textarea to all plugin demos (Fixes #214)
1 parent 1673c54 commit 619b138

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

docs/plugins/_index.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Right now, you can only add one plugin of each type (e.g. one SelectTokenCallbac
4444
]));
4545
</script>
4646
<p>This uses both the auto-close brackets and indent plugins. Try typing some brackets / double quotes!</p>
47-
<code-input language="javascript"></code-input>
47+
<code-input language="javascript"><textarea data-code-input-fallback></textarea></code-input>
4848
</body>
4949
</html>
5050
```
@@ -119,7 +119,7 @@ Right now, you can only add one plugin of each type (e.g. one SelectTokenCallbac
119119
]));
120120
</script>
121121
<p>Start typing some HTML tags to see the autocomplete in action. You can click an autocomplete suggestion, or press the Tab key to select the first.</p>
122-
<code-input language="html"></code-input>
122+
<code-input language="html"><textarea data-code-input-fallback></textarea></code-input>
123123
</body>
124124
</html>
125125
```
@@ -148,13 +148,13 @@ Right now, you can only add one plugin of each type (e.g. one SelectTokenCallbac
148148
]));
149149
</script>
150150
<p>Enter newlines to grow vertically:</p>
151-
<code-input class="code-input_autogrow_height" language="Markdown"></code-input>
151+
<code-input class="code-input_autogrow_height" language="Markdown"><textarea data-code-input-fallback></textarea></code-input>
152152
<p>Type to grow horizontally:</p>
153-
<code-input class="code-input_autogrow_width" language="Markdown"></code-input>
153+
<code-input class="code-input_autogrow_width" language="Markdown"><textarea data-code-input-fallback></textarea></code-input>
154154
<p>Grows vertically between 100px and 200px:</p>
155-
<code-input class="code-input_autogrow_height" style="--code-input_autogrow_min-height: 100px; --code-input_autogrow_max-height: 200px;" language="Markdown"></code-input>
155+
<code-input class="code-input_autogrow_height" style="--code-input_autogrow_min-height: 100px; --code-input_autogrow_max-height: 200px;" language="Markdown"><textarea data-code-input-fallback></textarea></code-input>
156156
<p>Grows horizontally between 100px and 200px:</p>
157-
<code-input class="code-input_autogrow_width" style="--code-input_autogrow_min-width: 100px; --code-input_autogrow_max-width: 200px;" language="Markdown"></code-input>
157+
<code-input class="code-input_autogrow_width" style="--code-input_autogrow_min-width: 100px; --code-input_autogrow_max-width: 200px;" language="Markdown"><textarea data-code-input-fallback></textarea></code-input>
158158
</body>
159159
</html>
160160
```
@@ -197,12 +197,12 @@ Right now, you can only add one plugin of each type (e.g. one SelectTokenCallbac
197197
]));
198198
</script>
199199
<p>When focused in the editor: Try Ctrl/Cmd+F, or click <button onclick="find();">this</button> to find. Try Ctrl+H, or click <button onclick="replace();">this</button> to replace.</p>
200-
<code-input language="markdown"># Hickory dickory dock
200+
<code-input language="markdown"><textarea data-code-input-fallback># Hickory dickory dock
201201
Hickory dickory dock.
202202
The mouse ran up the clock.
203203
The clock struck one,
204204
The mouse ran down,
205-
Hickory dickory dock.</code-input>
205+
Hickory dickory dock.</textarea></code-input>
206206
<p><small>When setting the size of <code>code-input</code> elements with this plugin, make sure they are large enough to fit the dialog, at least 500px wide and 170px tall with the default styling. (If you are using the <code>Autogrow</code> plugin, this will be done for you as long as your <code>--code-input_autogrow_max-width</code> and <code>--code-input_autogrow_max-height</code> are large enough.) For technical reasons the dialog cannot overflow the editing area.</small></p>
207207
</body>
208208
</html>
@@ -246,12 +246,12 @@ Hickory dickory dock.</code-input>
246246
]));
247247
</script>
248248
<p>Try Ctrl+G when focused in the editor, or click <button onclick="goToLine()">this button</button></p>
249-
<code-input class="line-numbers" language="markdown"># Hickory dickory dock
249+
<code-input class="line-numbers" language="markdown"><textarea data-code-input-fallback># Hickory dickory dock
250250
Hickory dickory dock.
251251
The mouse ran up the clock.
252252
The clock struck one,
253253
The mouse ran down,
254-
Hickory dickory dock.</code-input>
254+
Hickory dickory dock.</textarea></code-input>
255255
<p><small>When setting the size of <code>code-input</code> elements with this plugin, make sure they are large enough to fit the dialog, at least 300px wide and 150px tall with the default styling. (If you are using the <code>Autogrow</code> plugin, this will be done for you as long as your <code>--code-input_autogrow_max-width</code> and <code>--code-input_autogrow_max-height</code> are large enough.) For technical reasons the dialog cannot overflow the editing area.</small></p>
256256
</body>
257257
</html>
@@ -290,13 +290,13 @@ Hickory dickory dock.</code-input>
290290
]));
291291
</script>
292292
<p>Try Tab or Shift+Tab when selecting or editing text.</p>
293-
<code-input class="line-numbers" language="json">{
293+
<code-input class="line-numbers" language="json"><textarea data-code-input-fallback>{
294294
"hello": "world",
295295
1: 2,
296296
"foo": {
297297
"bar": "baz"
298298
}
299-
}</code-input>
299+
}</textarea></code-input>
300300
</body>
301301
</html>
302302
```
@@ -575,14 +575,14 @@ Hickory dickory dock.</code-input>
575575
]));
576576
</script>
577577
<p>Try selecting some code with a bracket. This is just one demo use of this very flexible plugin, which lets you use more features from your highlighter (here, Prism.js' match-braces plugin)!</p>
578-
<code-input class="match-braces" language="javascript">function hello() {
578+
<code-input class="match-braces" language="javascript"><textarea data-code-input-fallback>function hello() {
579579
let data = {
580580
"array": [
581581
"world"
582582
]
583583
};
584584
console.log(data["array"][0]);
585-
}</code-input>
585+
}</textarea></code-input>
586586
</body>
587587
</html>
588588
```
@@ -625,7 +625,7 @@ See https://github.com/WebCoder49/code-input/issues?q=is%3Aissue%20state%3Aopen%
625625
)
626626
]));
627627
</script>
628-
<code-input class="line-numbers" language="json"></code-input>
628+
<code-input class="line-numbers" language="json"><textarea data-code-input-fallback></textarea></code-input>
629629
<script>
630630
window.addEventListener("load", function() {
631631
document.querySelector("code-input").value += "[\n";
@@ -667,7 +667,7 @@ See https://github.com/WebCoder49/code-input/issues?q=is%3Aissue%20state%3Aopen%
667667
]));
668668
</script>
669669
<p>Start typing code of any language. <strong>Detected language: <span id="language"></span></strong>. Inaccurate language detection should be reported to <a target="_blank" href="https://highlightjs.org">highlight.js</a>, not code-input-js.</p>
670-
<code-input oninput="document.getElementById('language').textContent = this.getAttribute('language');"></code-input>
670+
<code-input><textarea oninput="document.getElementById('language').textContent = this.getAttribute('language');" data-code-input-fallback></textarea></code-input>
671671
<p></p>
672672
</body>
673673
</html>
@@ -701,12 +701,12 @@ See https://github.com/WebCoder49/code-input/issues?q=is%3Aissue%20state%3Aopen%
701701
]));
702702
</script>
703703
<p>The lines are numbered!</p>
704-
<code-input class="line-numbers" language="markdown"># Hickory dickory dock
704+
<code-input class="line-numbers" language="markdown"><textarea data-code-input-fallback># Hickory dickory dock
705705
Hickory dickory dock.
706706
The mouse ran up the clock.
707707
The clock struck one,
708708
The mouse ran down,
709-
Hickory dickory dock.</code-input>
709+
Hickory dickory dock.</textarea></code-input>
710710
</body>
711711
</html>
712712
```

0 commit comments

Comments
 (0)