-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
693 lines (565 loc) · 22.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
<script src="//apps.asenax.com/documenter/documenter.js"></script>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<header body-class="show-menu theme-light documenter-admin">
<a href="../" icon-button documenter-icon-arrow-left></a>
<div title>📄 Documenter</div>
<div class="space"></div>
<input placeholder="Search...">
<button icon-button documenter-icon-fullscreen onclick="document.fullscreenElement == null ? document.documentElement.requestFullscreen() : document.exitFullscreen()"></button>
<button icon-button documenter-icon-contrast onclick="document.body.classList.toggle('theme-dark');document.body.classList.toggle('theme-light')"></button>
<input type="checkbox" switch="🦉" onchange="document.body.classList.remove('theme-dark');document.body.classList.add('theme-light');if(this.checked){ document.body.classList.remove('theme-light');document.body.classList.add('theme-dark'); }" style="font-size:1.42em;">
<a hover href="#">Api</a>
<a button href="#">App</a>
<a href="#logout" icon-button="" documenter-icon-power style="color:#F44" title="Oturumu Kapat"></a>
<div panel="bottom-right">
<button icon-button documenter-icon-more></button>
<panel style="width:200px">
Merhaba Burası Bir Panel
<input type="checkbox" switch="🦉" onchange="document.body.classList.remove('theme-dark');document.body.classList.add('theme-light');if(this.checked){ document.body.classList.remove('theme-light');document.body.classList.add('theme-dark'); }">
</panel>
</div>
</header>
# 💻 Usage
```html
<script src="//hasandelibas.github.io/documenter/documenter.js"></script>
<meta charset="utf8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<header body-class="show-menu theme-light">
<a href="../" icon-button documenter-icon-arrow-left></a>
<div title>📄 Documenter</div>
<div class="space"></div>
<input placeholder="Search...">
<a href="#">Api</a>
<a href="#">App</a>
<button icon-button documenter-icon-more></button>
</header>
```
```html
<!-- disable-style -->
<script src="//apps.asenax.com/documenter/documenter.js?disable-style=true"></script>
<!-- disable-html -->
<script src="//apps.asenax.com/documenter/documenter.js?disable-html=true"></script>
```
# 📄 Documenter
A light document application
+ Mobile Support
+ One File
+ Header Bar
+ Code View with hljs
* **development** : https://apps.asenax.com/documenter/
* **relase** : https://hasandelibas.github.io/documenter/
# ✅ Task
+ #documenter-tab-0
+ documenter.message multiple
+ [back-button] inner html svg
+ .tab-system
+ .enable-error-messages
+ .hide-header
+ .show-header
+ .hide-opener
+ .show-opener
+ Mobile container padding fix
+ Pre Code fix
+ left Menu click fix
+ Make pre code 14px
+ light theme input problem
# 🔨 Options
We can change options in header tag with **body-class** attribute
## hide-menu
* hide-menu
* show-menu
```html
<header body-class="hide-menu">
```
## hide-header
* hide-header
* show-header
```html
<header body-class="hide-header">
```
## bottom-header
* bottom-header
* top-header
```html
<header body-class="bottom-header">
```
<button onclick="document.body.classList.remove('top-header');document.body.classList.add('bottom-header');">bottom-header</button>
<button onclick="document.body.classList.remove('bottom-header');document.body.classList.add('top-header');">top-header</button>
## theme-dark
* theme-light
* theme-dark
<button onclick="document.body.classList.remove('theme-light');document.body.classList.add('theme-dark');">theme-dark</button>
<button onclick="document.body.classList.remove('theme-dark');document.body.classList.add('theme-light');">theme-light</button>
```html
<header body-class="theme-dark">
```
## theme-round
* theme-round <span style="opacity:.4">make inputs and buttos round</span>
<button onclick="document.body.classList.toggle('theme-round');">theme-round</button>
```html
<header body-class="theme-dark">
```
## tab-system
* link-system (default)
* tab-system
```html
<header body-class="tab-system">
```
<button onclick="document.body.classList.add('tab-system');document.querySelector('menu a').click()">.tab-system</button>
## disable-error
* enable-error (default)
* disable-error
```html
<header body-class="disable-error">
```
<button onclick="no_name_function()">Example</button>
## hide-opener
* show-opener (default)
* hide-opener
```html
<header body-class="hide-opener">
```
## documenter-admin
```html
<header body-class="documenter-admin">
```
# HTML Elements
## icons
Example:
```html
<span documenter-icon-arrow-left></span>
```
https://fonts.google.com/icons
<div id="documenter-icon"></div>
<script>
documenter.on("ready",function(){
let data = Object.keys( documenter.icons ).map((key)=> ({text: documenter.icons[key].split("<svg").join('<svg fill="currentColor" style="width:1.5em;height:1.5em" '), code:'documenter-icon-'+key }))
document.querySelector("#documenter-icon").appendChild( documenter.table(data) )
})
</script>
## dropdown
<dropdown name="flag" value="tr" placeholder="Dil Seçiniz" style="min-width:200px;" tabindex="1">
<div value="tr"> <img src="https://flagcdn.com/w80/tr.png" style="aspect-ratio:3/2"> Turkish </div>
<div value="en"> <img src="https://flagcdn.com/w80/gb.png" style="aspect-ratio:3/2"> English </div>
<div value="de"> <img src="https://flagcdn.com/w80/de.png" style="aspect-ratio:3/2"> German </div>
<div value="fr"> <img src="https://flagcdn.com/w80/fr.png" style="aspect-ratio:3/2"> French </div>
<div value="it"> <img src="https://flagcdn.com/w80/it.png" style="aspect-ratio:3/2"> Italian </div>
<div value="es"> <img src="https://flagcdn.com/w80/es.png" style="aspect-ratio:3/2"> Spanish </div>
<div value="pt"> <img src="https://flagcdn.com/w80/pt.png" style="aspect-ratio:3/2"> Portuguese </div>
<div value="zh"> <img src="https://flagcdn.com/w80/cn.png" style="aspect-ratio:3/2"> Mandarin Chinese </div>
<div value="ja"> <img src="https://flagcdn.com/w80/jp.png" style="aspect-ratio:3/2"> Japanese </div>
<div value="ru"> <img src="https://flagcdn.com/w80/ru.png" style="aspect-ratio:3/2"> Russian </div>
<div value="ar"> <img src="https://flagcdn.com/w80/ae.png" style="aspect-ratio:3/2"> Arabic </div>
</dropdown>
```
<dropdown name="flag" value="tr" placeholder="Dil Seçiniz" style="min-width:200px;">
<div value="tr"> <img src="https://flagcdn.com/w80/tr.png" style="aspect-ratio:3/2"> Turkish </div>
<div value="en"> <img src="https://flagcdn.com/w80/gb.png" style="aspect-ratio:3/2"> English </div>
<div value="de"> <img src="https://flagcdn.com/w80/de.png" style="aspect-ratio:3/2"> German </div>
<div value="fr"> <img src="https://flagcdn.com/w80/fr.png" style="aspect-ratio:3/2"> French </div>
<div value="it"> <img src="https://flagcdn.com/w80/it.png" style="aspect-ratio:3/2"> Italian </div>
<div value="es"> <img src="https://flagcdn.com/w80/es.png" style="aspect-ratio:3/2"> Spanish </div>
<div value="pt"> <img src="https://flagcdn.com/w80/pt.png" style="aspect-ratio:3/2"> Portuguese </div>
<div value="zh"> <img src="https://flagcdn.com/w80/cn.png" style="aspect-ratio:3/2"> Mandarin Chinese </div>
<div value="ja"> <img src="https://flagcdn.com/w80/jp.png" style="aspect-ratio:3/2"> Japanese </div>
<div value="ru"> <img src="https://flagcdn.com/w80/ru.png" style="aspect-ratio:3/2"> Russian </div>
<div value="ar"> <img src="https://flagcdn.com/w80/ae.png" style="aspect-ratio:3/2"> Arabic </div>
</dropdown>
```
## dropdown multiple
<dropdown multiple name="flag" value="tr,en" placeholder="Dil Seçiniz" style="min-width:200px;" tabindex="1">
<div value="tr"> <img src="https://flagcdn.com/w80/tr.png" style="aspect-ratio:3/2"> Turkish </div>
<div value="en"> <img src="https://flagcdn.com/w80/gb.png" style="aspect-ratio:3/2"> English </div>
<div value="de"> <img src="https://flagcdn.com/w80/de.png" style="aspect-ratio:3/2"> German </div>
<div value="fr"> <img src="https://flagcdn.com/w80/fr.png" style="aspect-ratio:3/2"> French </div>
<div value="it"> <img src="https://flagcdn.com/w80/it.png" style="aspect-ratio:3/2"> Italian </div>
<div value="es"> <img src="https://flagcdn.com/w80/es.png" style="aspect-ratio:3/2"> Spanish </div>
<div value="pt"> <img src="https://flagcdn.com/w80/pt.png" style="aspect-ratio:3/2"> Portuguese </div>
<div value="zh"> <img src="https://flagcdn.com/w80/cn.png" style="aspect-ratio:3/2"> Mandarin Chinese </div>
<div value="ja"> <img src="https://flagcdn.com/w80/jp.png" style="aspect-ratio:3/2"> Japanese </div>
<div value="ru"> <img src="https://flagcdn.com/w80/ru.png" style="aspect-ratio:3/2"> Russian </div>
<div value="ar"> <img src="https://flagcdn.com/w80/ae.png" style="aspect-ratio:3/2"> Arabic </div>
</dropdown>
```
<dropdown multiple name="flag" value="tr,en" placeholder="Dil Seçiniz" style="min-width:200px;">
<div value="tr"> <img src="https://flagcdn.com/w80/tr.png" style="aspect-ratio:3/2"> Turkish </div>
<div value="en"> <img src="https://flagcdn.com/w80/gb.png" style="aspect-ratio:3/2"> English </div>
<div value="de"> <img src="https://flagcdn.com/w80/de.png" style="aspect-ratio:3/2"> German </div>
<div value="fr"> <img src="https://flagcdn.com/w80/fr.png" style="aspect-ratio:3/2"> French </div>
<div value="it"> <img src="https://flagcdn.com/w80/it.png" style="aspect-ratio:3/2"> Italian </div>
<div value="es"> <img src="https://flagcdn.com/w80/es.png" style="aspect-ratio:3/2"> Spanish </div>
<div value="pt"> <img src="https://flagcdn.com/w80/pt.png" style="aspect-ratio:3/2"> Portuguese </div>
<div value="zh"> <img src="https://flagcdn.com/w80/cn.png" style="aspect-ratio:3/2"> Mandarin Chinese </div>
<div value="ja"> <img src="https://flagcdn.com/w80/jp.png" style="aspect-ratio:3/2"> Japanese </div>
<div value="ru"> <img src="https://flagcdn.com/w80/ru.png" style="aspect-ratio:3/2"> Russian </div>
<div value="ar"> <img src="https://flagcdn.com/w80/ae.png" style="aspect-ratio:3/2"> Arabic </div>
</dropdown>
```
## panel
<div panel="bottom-left">
<button icon-button="" documenter-icon-more></button>
<panel style="width:200px;">
This is an example panel.
Dark Theme: <button icon-button documenter-icon-contrast onclick="document.body.classList.toggle('theme-dark');document.body.classList.toggle('theme-light')"></button>
</panel>
</div>
<div panel="bottom-left">
<button>bottom-left</button>
<panel style="width:200px;">
This is an example panel.
</panel>
</div>
<div panel="bottom-right">
<button>bottom-right</button>
<panel style="width:200px;">
This is an example panel.
</panel>
</div>
<div panel="top-left">
<button>top-left</button>
<panel style="width:200px;">
This is an example panel.
</panel>
</div>
<div panel="top-right">
<button>top-right</button>
<panel style="width:200px;">
This is an example panel.
</panel>
</div>
```
<div panel="bottom-left">
<button icon-button="" documenter-icon-more=""></button>
<panel style="width:200px;">
This is an example panel.
Dark Theme: <button icon-button documenter-icon-contrast onclick="document.body.classList.toggle('theme-dark');document.body.classList.toggle('theme-light')"></button>
</panel>
</div>
```
## [tooltip]
[tooltip-right] : <div button documenter-icon-more="" tooltip-right="[tooltip-right]"></div>
```html
<div button documenter-icon-more="" tooltip-right="[tooltip-right]"></div>
```
[tooltip-bottom] : <div button documenter-icon-more="" tooltip-bottom="[tooltip-bottom]"></div>
```html
<div button documenter-icon-more="" tooltip-bottom="[tooltip-bottom]"></div>
```
[tooltip-left] : <div button documenter-icon-more="" tooltip-left="[tooltip-left]"></div>
```html
<div button documenter-icon-more="" tooltip-left="[tooltip-left]"></div>
```
[tooltip-top] : <div button documenter-icon-more="" tooltip-top="[tooltip-top]"></div>
```html
<div button documenter-icon-more="" tooltip-top="[tooltip-top]"></div>
```
## [mobile-style]
```html
<div mobile-style="margin-top:20px;" desktop-style="padding:4em;" hover-style="color:red;"> Example <div>
```
## [desktop-style]
```html
<div mobile-style="margin-top:20px;" desktop-style="padding:4em;" hover-style="color:red;"> Example <div>
```
## [hover-style]
```html
<div mobile-style="margin-top:20px;" desktop-style="padding:4em;" hover-style="color:red;"> Example <div>
```
## .hover
<div padding hover>.hover</div>
<div padding light>.light</div>
```
<div hover>.hover</div>
<div light>.light</div>
<div class="hover">.hover</div>
<div class="light">.light</div>
```
## input
checkbox: <input type="checkbox">
```html
<input type="checkbox">
```
switch: <input type="checkbox" switch="🦉">
```html
<input type="checkbox" switch="🦉">
```
# ⚙️ documenter
## .loading(number|null)
<button onclick="documenter.loading()"> documenter.loading() </button>
<button onclick="documenter.loading(10)"> documenter.loading(10) </button>
<button onclick="documenter.loading(50)"> documenter.loading(50) </button>
<button onclick="documenter.loading(80)"> documenter.loading(80) </button>
```
documenter.loading()
documenter.loading(10)
documenter.loading(50)
```
## .success()
<button onclick="documenter.loading(100)"> documenter.loading(100) </button>
<button onclick="documenter.success()"> documenter.success() </button>
```
documenter.loading(100)
documenter.success()
```
## .load(url, config)
Like fetch
<button onclick="documenter.load('world_map.pdf').then(e=>e.blob()).then(console.log)"> documenter.load('world_map.pdf') </button>
```
documenter.load("url").then(e=>e.text())
documenter.load("url").then(e=>e.json())
documenter.load("url").then(e=>e.blob())
documenter.load("url",{method:'GET',data:{name:'John'}}).then(e=>e.json())
```
```
documenter.load("documenter.js").then(e=>e.text()).then( console.log )
documenter.load("https://www.getmidas.com/wp-json/midas-api/v1/midas_table_data",{method:"POST"}).then(e=>e.json()).then( console.log )
documenter.load("world_map.pdf").then(e=>e.blob()).then(function(text){
document.download(text,"file.pdf")
})
```
## .post(url, data: FormData | Object | string)
```
documenter.post("url",{name:'John'}).then(e=>e.text())
```
## .submit(HTMLFormElement)
```
documenter.submit(HTMLFormElement)
```
## .download(string|blob,filename)
```
documenter.download("Hello World","test.txt")
```
## .info(string) : HTMLDivElement
<button onclick="documenter.info('Hello World!')"> documenter.info("Hello World!") </button>
<button onclick="documenter.info('Hello!')"> documenter.info("Hello!") </button>
## .message(string) : HTMLDivElement
<button onclick="documenter.message('Hello World!')"> documenter.message("Hello World!") </button>
```
documenter.message("Hello World!")
```
## .modal(text) : HTMLDivElement
<button onclick="documenter.modal('Title <br> This is modal text.')">documenter.modal('Title <br> This is modal text.')</button>
```js
documenter.modal("Title <br> This is modal text."")
```
## .readText() : Promise(e:String)
Select file and read as text.
<button onclick="documenter.readText().then(text=>console.log(text))"> documenter.readText().then(text=>console.log(text)) </button>
```js
documenter.readText().then(text=>console.log(text))
```
## .readImage() : Promise(e:String)
Select file and read as text.
<img id="read-image" src="" style="max-width: 100%;">
<button onclick="documenter.readImage().then(src=>$('#read-image').src=src)"> documenter.readImage().then(src=>$('#read-image').src=src) </button>
```js
documenter.readImage().then(src=>$('#read-image').src=src)
```
## .table( object ) : HTMLTableElement
<div id="table"></div>
<script>
documenter.on("ready",function(){
let table = documenter.table([
{name:"John",surname:"Doe",age:26},
{name:"Mary",surname:"Doe",age:25}
])
document.querySelector("#table").appendChild(table)
})
</script>
<div id="table-props"></div>
<script>
documenter.on("ready",function(){
let table = documenter.table({name:"John",surname:"Doe",age:26})
document.querySelector("#table-props").appendChild(table)
})
</script>
Create table object
```js
let table = documenter.table([
{name:"John",surname:"Doe",age:26},
{name:"Mary",surname:"Doe",age:25}
])
main.appendChild(table)
```
## .render(html) : HTMLDivElement
```js
documenter.render("<div>Hello World!</div>")
```
## .on(event,selector,function)
```
documenter.on("click","pre",function(e){
console.log(this.innerText);
console.log("Event:",e)
})
```
## .on(event,function)
```
documenter.on("ready",function(e){
console.log("I am ready");
})
```
<script>
documenter.on("ready",function(e){
console.log("I am ready");
})
</script>
## .csv.parse(data:string)
```
documenter.csv.parse(string)
```
```
documenter.readText().then(e=>{
main.appendChild(documenter.table( documenter.csv.parse(e) ))
})
```
## .select(selector|Element|Element[])
jQuery like selector
```js
documenter.select("td").parent("table")
documenter.select(el).attr("style","color:red")
documenter.select("tr").list()
documenter.select("table").find("th").map(e=>console.log(e))
```
## .TextInput(element,{language:""})
<div style='outline: var(--front) solid 2px;' id="TextInput">TextInput</div>
Convert element like input element with contenteditable
* single line
* no style
<script>
documenter.on("ready",function(){
documenter.TextInput(document.querySelector("#TextInput"))
})
</script>
```js
documenter.TextInput(el) // only text
```
## .TextArea(element, config={})
<div style='outline: var(--front) solid 2px;' id="TextArea">TextArea</div>
Convert element like with contenteditable
* allowedElements default is all elements
* allowedAttributes is default all
* allowedProperties is default all
* language is default ""
<script>
documenter.on("ready",function(){
documenter.TextArea(document.querySelector("#TextArea"),{
allowedElements : ["br","div","span","img","b","i","u","ul","li","ol","strike","sup","sub"] ,
allowedAttributes: ["style","src","alt"],
allowedProperties: ["font-weight","text-decoration","color"],
language : "en"
})
})
</script>
```js
documenter.TextArea(el, {
allowedElements : ["br","div","span","img","b","i","u","ul","li","ol","strike","sup","sub"],
allowedAttributes: ["style","src","alt"],
allowedProperties: ["font-weight","text-decoration","color"],
language : "en",
}) // only font-weight and color
```
## .TextEditor(textarea, config={})
<textarea style='outline: var(--color) solid 2px;' id="TextEditor"><h1>Hello World</h1><p>This is an example for <b>documenter.TextEditor()</b> function.</p></textarea>
Convert textarea element to TextEditor
<script>
documenter.on("ready",function(){
let textEditor = documenter.TextEditor(document.querySelector("#TextEditor"),{
toolbar : ["formatBlock","bold","italic","underline","strikeThrough","justifyLeft","justifyCenter","justifyRight","justifyFull","insertUnorderedList","insertOrderedList","space"],
head : "<style> html{font-family:system-ui;background:white;} </style>", // default ""
allowedAttributes : ["style","src","alt"], // default all
allowedProperties : ["text-align","font-weight","color"], // default all
language : "en", // default ""
})
window.textEditor = textEditor
let listen=document.createElement("button")
listen.innerText = "Listen"
listen.onclick = function(){
let recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
recognition.language = "tr"
recognition.interimResults = true;
let last = document.createElement("span")
textEditor.body.appendChild(last)
recognition.onresult = (e)=>{
last.innerText = e.results[0][0].transcript;
}
recognition.start()
}
textEditor.toolbar.appendChild( listen )
})
</script>
```js
let textEditor = documenter.TextEditor(document.querySelector("textarea"),{
toolbar : ["formatBlock","bold","italic","underline","strikeThrough","justifyLeft","justifyCenter","justifyRight","justifyFull","insertUnorderedList","insertOrderedList","space"],
head : "<style> html{font-family:system-ui;background:white;} </style>", // default ""
allowedAttributes : ["style","src","alt"], // for all make null
allowedProperties : ["text-align","font-weight","color"], // for all make null
language : "en", // default "en"
})
```
**Global TextEditor options**
```js
documenter.TextEditor.head = "<style>body{}</style>"
documenter.TextEditor.toolbar = ["formatBlock","bold","italic","underline","strikeThrough","justifyLeft","justifyCenter","justifyRight","justifyFull","insertUnorderedList","insertOrderedList","space"]
documenter.TextEditor.allowedProperties = ["font-weight","font-style"]
documenter.TextEditor.allowedAttributes = ["style","src","alt"]
documenter.TextEditor.language = "en"
```
**Custom Toolbar Item ** with ``texteditor.toolbar``
```js
let listen=document.createElement("button")
listen.innerText = "Listen"
listen.onclick = function(){
let recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
recognition.language = "tr"
recognition.interimResults = true;
let last = document.createElement("span")
textEditor.body.appendChild(last)
recognition.onresult = (e)=>{
last.innerText = e.results[0][0].transcript;
}
recognition.start()
}
textEditor.toolbar.appendChild( listen )
```
**Get Value**
```js
textEditor.value // set or get
```
## .lss( css_code )
```js
documenter.lss("
@mobile{
body{
background:#000;
*{
color:#222;
}
h2{
color:#333;
}
}
}
")
```
## svg to base64image
<div flex-x gap>
<textarea input-svg space>
<svg hide-on-desktop="" onclick="document.querySelector('#dropmenu').classList.toggle('active') " xmlns="http://www.w3.org/2000/svg" height="48" viewBox="0 -960 960 960" width="48"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z"></path></svg>
</textarea>
<button button-svg2base64>Convert</button>
</div>
<script>
function svg2base64(svg){
return "background: url(data:image/svg+xml;base64,"+window.btoa(svg) + ")";
}
documenter.on("ready",function(){
$("[button-svg2base64]").onclick = function(){
$("[base64-image] code").innerHTML = svg2base64( $("[input-svg]").value )
}
})
</script>
<div base64-image>
```css
```
</div>