forked from yairEO/tagify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1508 lines (1339 loc) · 71.4 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
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tagify - demo</title>
<meta name="description" content="Converts HTML input/textarea into Tags component">
<meta name="author" content="Yair Even-Or">
<link rel="stylesheet" href="https://cdn.rawgit.com/yairEO/ec9e154c4269b9a0f264fba7f64d7383/raw/e0c395043e809c2def517280850aeec410536abd/vsync_demos.css">
<link rel="stylesheet" href="dist/tagify.css">
<script>
// if IE, add IE tagify's polyfills
!function( d ) {
if( !d.currentScript ){
var s = d.createElement( 'script' );
s.src = 'dist/tagify.polyfills.min.js';
d.head.appendChild( s );
}
}(document)
</script>
<script src="dist/tagify.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="dist/jQuery.tagify.min.js"></script>
<script>
var isIE = !document.currentScript;
function renderPRE(currentScript, codeScriptName){
if( isIE ) return;
setTimeout(function(){
var jsCode = document.querySelector("[data-name='"+ codeScriptName +"']").innerHTML;
// cleanup closure wraper
jsCode = jsCode.replace("(function(){", "" ).replace("})()", "" ).trim();
// escape angled brackets between two _ESCAPE_START_ and _ESCAPE_END_ comments
let textsToEscape = jsCode.match(new RegExp("// _ESCAPE_START_([^]*?)// _ESCAPE_END_", 'mg'));
if (textsToEscape) {
textsToEscape.forEach(function(textToEscape){
jsCode = jsCode.replace(textToEscape, textToEscape.replace(/</g, "<" )
.replace(/>/g, ">" )
.replace("// _ESCAPE_START_", "")
.replace("// _ESCAPE_END_", "")
.trim());
});
}
currentScript.insertAdjacentHTML('afterend', "<pre class='language-js'><code>" + jsCode + "</code></pre>");
}, 500);
}
// detect modern browser and enhance console logs with colors
if( typeof(Intl) )
try{
// console.log = ((_c) => (...args) => args.length > 1 ? _c("%c "+ args[0], 'background:indianred; color:white; border-radius:3px; padding:1px;', ...args.slice(1)) : _c(...args))(console.log);
}
catch(err){}
</script>
<style>
p{ line-height:1.4; }
code{ padding:2px 3px; background:lightyellow; }
pre code{ background:none; padding:0; }
pre[class*=language-]{ max-height:400px; }
.forkLink{ position:absolute; top:.7em; right:50%; transform:translateX(50%); }
body > header{
display: flex;
align-items: center;
background:white;
border-bottom: 1px solid #DDD;
box-shadow: 0 0 6px rgba(0,0,0,.1);
padding: .8em 1em .8em 3em;
}
body > header .liveLink{ color:#333; text-decoration:none; font-size:1.4em; position:relative; line-height:1; }
body > header .liveLink::before{ content:'✎'; text-decoration:none; transform:translateX(-150%); position:absolute; top:1px; left:0; }
body > header .liveLink:hover{ text-decoration: underline; }
section > .rightSide{
position: sticky;
top: 1em;
align-self: start;
}
.tagify{
min-width:400px;
max-width:600px;
margin: 1.5rem 0;
}
label{ cursor:pointer; }
.disabled tags{
max-width:none;
min-width:0;
border:0;
display: none;
}
.disabled tags tag,
.disabled tags div{ display:none !important; }
.disabled tags + input,
.disabled tags + textarea{ display:block !important; width:100%; padding:6px; border:1px inset; }
/************************************/
/* Outside of the box */
.tagify--outside{
border: 0;
padding: 0;
margin: 0;
}
.tagify__input--outside{
display: block;
max-width: 600px;
border: 1px solid #DDD;
margin-top: 1.5em;
line-height: 1.2;
}
/*************************************/
/* Countries' flags */
.tagify__dropdown.extra-properties .tagify__dropdown__item{ color:#777; }
.tagify__dropdown.extra-properties .tagify__dropdown__item:hover{ color:black; background:#F1F1F1; }
.tagify__dropdown.extra-properties .tagify__dropdown__item > img{
display: inline-block;
vertical-align: middle;
height: 20px;
transform: scale(.75);
margin-right: 5px;
border-radius: 2px;
transition: .12s ease-out;
}
.tagify__dropdown.extra-properties .tagify__dropdown__item--active > img,
.tagify__dropdown.extra-properties .tagify__dropdown__item:hover > img{
transform: none;
margin-right: 12px;
}
.tagify.countries .tagify__input{ min-width:175px; }
.tagify.countries tag{ white-space:nowrap; }
.tagify.countries tag img{
display: inline-block;
height: 16px;
margin-right: 3px;
border-radius: 2px;
}
/* .tagify.readonlyMix > tag:not([readonly]) div::before{ background:#d3e2e2; } */
.tagify__input .borderd-blue > div::before{ border:2px solid #8DAFFA; }
.customSuggestionsList{
max-height: 300px;
overflow: auto;
border: 2px solid pink;
}
/*------ customLook ----------*/
.customLook{
--tag-bg: #0052BF;
--tag-hover: #CE0078;
--tag-text-color: #FFF;
--tags-border-color: silver;
--tag-text-color--edit: #111;
--tag-remove-bg: var(--tag-hover);
--tag-pad: .6em 1em;
--tag-inset-shadow-size: 1.3em;
--tag-remove-btn-bg--hover: black;
display: inline-block;
min-width: 0;
border: none;
}
.customLook .tagify__tag{
margin-top: 0;
}
.customLook .tagify__tag > div{
border-radius: 25px;
}
.customLook .tagify__tag:only-of-type .tagify__tag__removeBtn{
display: none;
}
.customLook + button{
color: #0052BF;
font: bold 1.4em/1.65 Arial;
border: 0;
background: none;
box-shadow: 0 0 0 2px inset currentColor;
border-radius: 50%;
width: 1.65em;
height: 1.65em;
cursor: pointer;
outline: none;
transition: .1s ease-out;
margin: 1.5rem 0 0 5px;
vertical-align: top;
}
.customLook + button:hover{
box-shadow: 0 0 0 5px inset currentColor;
}
.customLook .tagify__input{
display: none;
}
/***************************/
header label[for="toggle__tagifyStyleSettings"]{
margin-left: auto;
font-size: 1.5em;
line-height: 1;
}
#toggle__tagifyStyleSettings:checked + .tagifyStyleSettings{
transform: none;
}
.tagifyStyleSettings > label[for="toggle__tagifyStyleSettings"]{
float: right;
}
.tagifyStyleSettings{
position: fixed;
z-index: 999;
top: 0;
right: 0;
background: black;
padding: 1em;
color: white;
border-bottom-left-radius: 6px;
transform: translatex(100.5%);
transition: .45s cubic-bezier(.65,0,.35,1);
}
.tagifyStyleSettings > div{
display: flex;
align-items: center;
margin: 5px 0;
}
.tagifyStyleSettings > div > span{
flex: 1;
margin-right:1em;
}
</style>
</head>
<body>
<header>
<a class='liveLink' href='https://jsbin.com/degobup/6/edit?html,js,output' target="_blank">LIVE Code Playground</a>
<a class='forkLink' title='Go To Repo' href='https://github.com/yairEO/tagify'>
<img src='https://github.githubassets.com/images/modules/logos_page/GitHub-Logo.png' alt='GitHub Repo'>
</a>
<label title='Demo Settings' for='toggle__tagifyStyleSettings'>⚙️</label>
<input hidden type='checkbox' id='toggle__tagifyStyleSettings' />
<div class='tagifyStyleSettings'>
<label for='toggle__tagifyStyleSettings'>⚙️</label>
<label><input name='toggleTagify' type='checkbox'> TOGGLE TAGIFY <em>ON/OFF</em></label>
<br><br>
<h3>CSS Variables:</h3>
<div>
<span class='key'>tag-pad <small>(em)</small></span>
<div style='display:flex; flex:1'>
<input style='flex:1; width:50%;' type="range" name="tag-pad" id='tag-pad-v' min="0" max="1" step="0.01" value="0.3">
<input style='flex:1; width:50%;' type="range" name="tag-pad" id='tag-pad-h' min="0" max="1.5" step="0.01" value="0.5">
</div>
</div>
<div>
<span class='key'>tag-inset-shadow-size <small>(em)</small></span>
<input type="range" name="tag-inset-shadow-size" data-units='em' style='flex:1' min="0" max="2" step="0.1" value="1.1">
</div>
<div>
<span class='key'>tag--min-width</span>
<input type="range" name="tag--min-width" data-units='ch' style='flex:1' min="0" max="20" step="1" value="1">
</div>
<div>
<span class='key'>tag--max-width</span>
<input type="range" name="tag--max-width" data-units='ch' style='flex:1' min="1" max="20" step="1" value="auto">
</div>
<div>
<span class='key'>tag-bg</span>
<input type='color' name='tag-bg' value="#E5E5E5" />
</div>
<div>
<span class='key'>tags-border-color</span>
<input type='color' name='tags-border-color' value="#E5E5E5" />
</div>
<div>
<span class='key'>tags-hover-border-color</span>
<input type='color' name='tags-hover-border-color' value="#CCC" />
</div>
<div>
<span class='key'>tags-focus-border-color</span>
<input type='color' name='tags-focus-border-color' value="#85C8EA" />
</div>
<div>
<span class='key'>tag-text-color</span>
<input type='color' name='tag-text-color' value="black" />
</div>
<div>
<span class='key'>tag-text-color--edit</span>
<input type='color' name='tag-text-color--edit' value="black" />
</div>
<div>
<span class='key'>tag-hover</span>
<input type='color' name='tag-hover' value="#D3E2E2" />
</div>
<div>
<span class='key'>tag-remove-bg</span>
<input type='color' name='tag-remove-bg' value="#D39494" />
</div>
<div>
<span class='key'>tag-remove-btn-bg</span>
<input type='color' name='tag-remove-btn-bg' value="none" />
</div>
<div>
<span class='key'>tag-remove-btn-bg--hover</span>
<input type='color' name='tag-remove-btn-bg--hover' value="#c77777" />
</div>
<div>
<span class='key'>tag-invalid-color</span>
<input type='color' name='tag-invalid-color' value="#D39494" />
</div>
<div>
<span class='key'>tag-invalid-bg</span>
<input type='color' name='tag-invalid-color' value="#D39494" />
</div>
</div>
</header>
<form>
<section id='section-basic'>
<aside class='leftSide'>
<h2><a href='#section-basic'>#</a>Basic example</h2>
<p>
Passing the input element as a parameter to Tagify and it will transform it into a tags-component.
</p>
<p>
The input has a value which Tagify splits into 2 tags.
</p>
<h3>HTML</h3>
<pre class="language-markup"><code><​input name='basic' value='tag1, tag2'></code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "basic")</script>
</aside>
<aside class='rightSide'>
<input name='basic' value='tag1, tag2' autofocus>
</aside>
</section>
<section id='section-input'>
<aside class='leftSide'>
<h2><a href='#section-input'>#</a>text input</h2>
<h3>In this example:</h3>
<ul>
<li>Tagify instance with settings (whitelist sugegstions)</li>
<li>Simulate fetching whitelist (from a server) as the user is typing</li>
<li>Remove all tags from an extrenal button</li>
<li>Listen to Tagify events (add, remove, input, edit, invalid, click, dropdown)</li>
<li>Un-listen to specific event (see <code>onAddTag</code> function)</li>
</ul>
<h3>Intro:</h3>
<p>
The input element is pre-ocupied with <strong>4</strong> tags. The <em>last</em> tag (CSS) has the same value as the <em>first</em> tag,
and will be <em>removed</em>, because the <code>duplicates</code> setting is set to <code>true</code>.
</p>
<p>
Note that <code>whitelist</code> & <code>blacklist</code> may also be set on to <i>Tagify</i> as <code>data-</code> attributes on the input tag itself
as a list of tags seperated by the same delimeter defined in the Tagify's configuration. Default is comma (<code>,</code>)
</p>
<p>As text is typed, the <code>onInput</code> Tagify event is fired, on each key stroke. Reseting the current whitelist and fecthing a new one (from <code>mockAjax()</code>)</p>
<p>In real-life scenarios, a developer might wish to use different <em>whitelists</em> suggested to the user, according to the typed text, asusming the possibilities are too large to load at-once as the inital <em>whitelist</em>.</p>
<h3>HTML</h3>
<pre class="language-markup"><code><​input
name='input'
class='some_class_name' // This class will be copied to the Tagify component
placeholder='write some tags' // This text will be shown after the last tag
value='css, html, javascript, css' // initial values, as String (can also be an Array of Objects)
data-blacklist='.NET,PHP'> // list of invaild tags, which cannot be added
</code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "input")</script>
</aside>
<aside class='rightSide'>
<input name='input' class='some_class_name' placeholder='write some tags' value='css, html, javascript, css' data-blacklist='.NET,PHP'>
<button class='tags--removeAllBtn' type='button'>Remove all these tags ⬆</button>
</aside>
</section>
<section id='section-textarea'>
<aside class='leftSide'>
<h2><a href='#section-textarea'>#</a>textarea</h2>
<p>
In this example, the field is pre-ocupied with 3 tags, and last tag is <strong>not included</strong> in the whitelist,
and will be <em>removed</em> because the <code>enforceWhitelist</code> option flag is set to <code>true</code>
</p>
<h3>HTML</h3>
<pre class="language-markup"><code><textarea name='tags2' placeholder='Movie names'>
The Matrix, Pulp Fiction, Mad Max
</textarea></code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "textarea")</script>
<h3>CSS</h3>
<pre class="language-css"><code><textarea name='tags2' placeholder='Movie names'>
The Matrix, Pulp Fiction, Mad Max
</textarea></code></pre>
</aside>
<aside class='rightSide'>
<textarea name='tags2' placeholder='Movie names'>The Matrix, Pulp Fiction, Mad Max</textarea>
</aside>
</section>
<section id='customLook'>
<aside class='leftSide'>
<h2><a href='#section-different-look'>#</a>Different look</h2>
<p>
No placeholder, and no way of adding tags from within the component, but only
by clicking the (+) button, which is not related to Tagify in anyway, but in this example
it is shown how combining a few simple things make customization easy.
</p>
<p>
This example also shows how to implement minimum-allowed tags
</p>
<h3>HTML</h3>
<pre class="language-markup"><code><textarea name='tags2' placeholder='Movie names'>
The Matrix, Pulp Fiction, Mad Max
</textarea></code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "customLook")</script>
<h3>CSS</h3>
<pre class="language-css"><code>.customLook{
--tag-bg : #0052BF;
--tag-hover : #CE0078;
--tag-text-color : #FFF;
--tags-border-color : silver;
--tag-text-color--edit : #111;
--tag-remove-bg : var(--tag-hover);
--tag-pad : .6em 1em;
--tag-inset-shadow-size : 1.3em;
--tag-remove-btn-bg--hover : black;
display: inline-block;
min-width: 0;
border: none;
}
.customLook .tagify__tag{
margin-top: 0;
}
.customLook .tagify__tag > div{
border-radius: 25px;
}
/* hide the (x) delet-tag button if there's only one tag, to force minimum 1 tag */
.customLook .tagify__tag:only-of-type .tagify__tag__removeBtn{
display: none;
}
.customLook + button{
color: #0052BF;
font: bold 1.4em/1.65 Arial;
border: 0;
background: none;
box-shadow: 0 0 0 2px inset currentColor;
border-radius: 50%;
width: 1.65em;
height: 1.65em;
cursor: pointer;
outline: none;
transition: .1s ease-out;
margin: 1.5rem 0 0 5px;
vertical-align: top;
}
.customLook + button:hover{
box-shadow: 0 0 0 5px inset currentColor;
}
.customLook .tagify__input{
display: none;
}
</code></pre>
</aside>
<aside class='rightSide'>
<input class='customLook' value='[email protected]'><button type="button">+</button>
</aside>
</section>
<section id='section-mix'>
<aside class='leftSide'>
<h2><a href='#section-mix'>#</a>Mix text & tags</h2>
<p>
It is possible to configure Tagify to supoprt mixed content.
A common example would be <em>tagging</em> people while writing a comment on a social website.
</p>
<p>
To allow mix content, simply pass the setting <code>mode : 'mix'</code>
</p>
<p>
In this example, there are a few <em>Southpark</em> character names and a few Simpsons ones.
when the <code>@</code> is typed, following 1 more character, suggestions dropdown will be shown for <i>Southpark</i> suggestion list
and when starting with <code>#</code>, a <i>Simpsons</i> suggestion list
</p>
<p>
Note that tags can only be created if the value matches any of the whitelisted item's value.
</p>
<p>
When a <code>textarea</code> already has mixed-content and it wasn't pre-configured using a whitelist, the tags will ignored, so keep
that in mind when populating a textarea with server data and expecting tags to "magically" appear. Whitelist must be specified because not
everything that starts with <code>@</code> or <code>#</code> (or whatever was defined) is meant to be rendered as a tag.
</p>
<h3>HTML</h3>
<pre class="language-markup"><code><textarea name='mix'>
[[{"id":101, "value":"cartman", "title":"Eric Cartman"}]] and [[kyle]] do not know [[homer simpson]] because he's a relic.
</textarea>
</code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "mix")</script>
</aside>
<aside class='rightSide'>
<textarea name='mix'>[[{"id":101, "value":"cartman", "title":"Eric Cartman"}]] and [[kyle]] do not know [[homer simpson]] because he's a relic.</textarea>
</aside>
</section>
<section id='outside-of-the-box'>
<aside class='leftSide'>
<h2><a href='#outside-of-the-box'>#</a>outside-of-the-box</h2>
<p>
Some cases might require addition of tags from outside of the box and not within.
</p>
<h3>HTML</h3>
<pre class="language-markup"><code>>input name='tags-outside' class='tagify--outside' placeholder='write some tags'></code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "outside-of-the-box")</script>
<h3>CSS</h3>
<pre>
<code class="language-css">.tagify--outside{
border: 0;
padding: 0;
margin: 0;
}
.tagify__input--outside{
display: block;
max-width: 600px;
border: 1px solid #DDD;
margin-top: 1.5em;
margin-bottom: 1em;
}</code></pre>
</aside>
<aside class='rightSide'>
<input name='tags-outside' class='tagify--outside' value='tag1, tag2, tag3' placeholder='write some tags'>
</aside>
</section>
<section id='section-manual-suggestions'>
<aside class='leftSide'>
<h2><a href='#section-manual-suggestions'>#</a>Render suggestions list manually</h2>
<p>
Renders the suggestions list manually, useful for situations where you wish to shown the suggestions list
inside a modal or your own popup implementaion, or even always show it. In this example the list is always shown.
</p>
<h3>HTML</h3>
<pre class="language-markup"><code>>input name='tags-manual-suggestions' placeholder='write some tags'></code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "manualSuggestions")</script>
</aside>
<aside class='rightSide'>
<input name='tags-manual-suggestions' placeholder='write some tags'>
<h3>Please select from the list:</h3>
</aside>
</section>
<section id="section-advance-options">
<aside class='leftSide'>
<h2><a href='#section-advance-options'>#</a>Advance options</h2>
<p>
In this example, the <code>dropdown.enabled</code> <em>setting</em> is set (minimum charactes typed to show the dropdown) to <code>3</code>.
<br>
Maximum number of tags is set to <code>6</code>
</p>
<p>
Each (valid) tag gets a random color, via the <code>transformTag</code> callback which modifies the tag's data object before creating the tag element.
</p>
<p>
HTML5 <code>pattern</code> attribute is automatically used to validate tags.<br>
Also, the <code>delimiters</code> <em>setting</em> using both <code>comma</code> or <code>space</code> as tags seperators.
</p>
<p>
The <code>keepInvalidTags</code> <em>setting</em> flag is switched <em>on</em> to <code>true</code> so invaild tags are not removed but are only marked.
</p>
<h3>HTML</h3>
<pre class="language-markup"><code><input name='tags3' value='[{"value":"point"}, {"value":"soft"}]' pattern='^[A-Za-z_✲ ]{1,15}$'></code></pre>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "advance-options")</script>
</aside>
<aside class='rightSide'>
<input name='tags3' value='[{"value":"point"}, {"value":"soft"}]' pattern='^[A-Za-z_✲ ]{1,15}$'>
</aside>
</section>
<section id="section-extra-properties">
<aside class='leftSide'>
<h2><a href='#section-extra-properties'>#</a>Tags with properties</h2>
<p>
Some cases requires more control per-tag, for exmaple, sending a different value to the server than the textual value
the user sees/enetered. Another example, would be different colors for different tags or tags' groups.
it's possible to add any number of properties per tag, the only constant is the <code>value</code> property which
must be declared per-tag, and that will be the rendered text.
</p>
<p>
The propeties shown in the example below, declared in the <code>allowedTags</code> Array, will be transformed into
HTML attributes for each tag element rendered from the allowed <code>whitelist</code> settings, so naturally
some attributes are in the specs and the made-up ones should technically be prefixed with <code>data-</code>.
</p>
<p>
With this level of control a lot can be done via css. <br>
For the example below, the first two tags have a <code>readonly</code>
property and that will enable the CSS to target that and hide the <code>×</code> button and disable the hover state.
</p>
<h3>HTML</h3>
<xmp><input name='tags3-1' placeholder="Try to add tags from the list"></xmp>
<h3>Javascript</h3>
<script>
renderPRE(document.currentScript, "extra-properties")
</script>
<h3>CSS</h3>
<pre>
<code class="language-css">.tagify__dropdown.extra-properties .tagify__dropdown__item > img{
display: inline-block;
vertical-align: middle;
height: 20px;
transform: scale(.75);
margin-right: 5px;
border-radius: 2px;
transition: .12s ease-out;
}
.tagify__dropdown.extra-properties .tagify__dropdown__item:hover > img{
transform: none;
margin-right: 12px;
}
.tagify.countries .tagify__input{ min-width:175px; }
.tagify.countries tag{ white-space:nowrap; }
.tagify.countries tag img{
display: inline-block;
vertical-align: middle;
height: 16px;
margin-right: 3px;
border-radius: 2px;
}</code></pre>
</aside>
<aside class='rightSide'><input class='countries' name='tags3-1' placeholder="Try to add tags from the list"></aside>
</section>
<section id='section-readonly'>
<aside class='leftSide'>
<h2><a href='#section-readonly'>#</a>Readonly mode</h2>
<p>
If the original input field has a <code>readonly</code> attribute, then, via CSS, there will be no way of manually adding tags because the inline contenteditable element will be hidden.
</p>
<h3>HTML</h3>
<xmp><input name='tags4' readonly value='tag1, tag 2, another tag'></xmp>
<h3>Javascript</h3>
<script>
renderPRE(document.currentScript, "readonly")
</script>
</aside>
<aside class='rightSide'>
<input name='tags4' readonly value='tag1, tag 2, another tag'>
</aside>
</section>
<section id='section-readonly-mixed'>
<aside class='leftSide'>
<h2><a href='#section-readonly'>#</a>Readonly mix</h2>
<p>
Tags that are read-only mixed with removable tags
</p>
<h3>HTML</h3>
<xmp><input name='tags-readonly-mix' class='readonlyMix' placeholder="Type something" /></xmp>
<h3>Javascript</h3>
<script>
renderPRE(document.currentScript, "readonly-mixed")
</script>
</aside>
<aside class='rightSide'>
<input
name='tags-readonly-mix'
class='readonlyMix'
placeholder="Type something"
value='[
{
"value" : "foo",
"readonly" : true,
"title" : "read-only tag"
},
{
"value" : "bar"
},
{
"value" : "Locked tag",
"readonly" : true,
"title" : "Another readonly tag"
}
]' />
</aside>
</section>
<section id='section-mode-select'>
<aside class='leftSide'>
<h2><a href='#section-mode-select'>#</a>single-value select</h2>
<p>
Similar to native <code><Select></code> element, but allows free text as value, if
</p>
<h3>HTML</h3>
<pre class="language-markup"><code><input name='tags-select-mode' class='selectMode' placeholder="Please select" /></code></pre>
<h3>Javascript</h3>
<script>
renderPRE(document.currentScript, "mode-select")
</script>
</aside>
<aside class='rightSide'>
<input name='tags-select-mode' class='selectMode' placeholder="Please select" />
</aside>
</section>
<section id='section-jquery'>
<aside class='leftSide'>
<h2><a href='#section-jquery'>#</a>jQuery plugin version</h2>
<p>
Tagify can also be used as a jQuery plugin
</p>
<h3>HTML</h3>
<xmp>
<input name='tags-jquery' value='try, adding, a tag'>
<button class='tags-jquery--removeAllBtn' type='button'>Remove all tags</button>
</xmp>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "jQuery")</script>
</aside>
<aside class='rightSide'>
<input name='tags-jquery' value='try, adding, a tag'>
<button class='tags-jquery--removeAllBtn' type='button'>Remove all tags</button>
</aside>
</section>
</form>
<!-- Initialize Tagify for both Input and Textaera -->
<script>
document.forms[0].reset();
var toggleTagifyElm = document.querySelector('input[name=toggleTagify]');
var tagifyStyleSettings = document.querySelector('.tagifyStyleSettings');
toggleTagifyElm.checked = false;
// toggle Tagify on/off
toggleTagifyElm.addEventListener('change', function(){
document.body.classList[this.checked ? 'add' : 'remove']('disabled');
})
tagifyStyleSettings.addEventListener('change', onTagifyStyleSettings)
function onTagifyStyleSettings(e){
var value = e.target.value,
name = e.target.name,
units = e.target.dataset.units,
rules;
try{
if( name == 'tag-pad' )
value = `${document.querySelector('#tag-pad-v').value}em ${document.querySelector('#tag-pad-h').value}em`
else if( units )
value += units
rules = [...document.styleSheets[2].cssRules].find(x => x.selectorText == '.tagify');
rules.style.setProperty("--" + name, value)
}
catch(err){
}
}
</script>
<script data-name="basic">
(function(){
var input = document.querySelector('input[name=basic]');
// init Tagify script on the above inputs
new Tagify(input)
})()
</script>
<script data-name="input">
(function(){
var input = document.querySelector('input[name=input]'),
whitelist = ["A# .NET", "A# (Axiom)", "A-0 System", "A+", "A++", "ABAP", "ABC", "ABC ALGOL", "ABSET", "ABSYS", "ACC", "Accent", "Ace DASL", "ACL2", "Avicsoft", "ACT-III", "Action!", "ActionScript", "Ada", "Adenine", "Agda", "Agilent VEE", "Agora", "AIMMS", "Alef", "ALF", "ALGOL 58", "ALGOL 60", "ALGOL 68", "ALGOL W", "Alice", "Alma-0", "AmbientTalk", "Amiga E", "AMOS", "AMPL", "Apex (Salesforce.com)", "APL", "AppleScript", "Arc", "ARexx", "Argus", "AspectJ", "Assembly language", "ATS", "Ateji PX", "AutoHotkey", "Autocoder", "AutoIt", "AutoLISP / Visual LISP", "Averest", "AWK", "Axum", "Active Server Pages", "ASP.NET", "B", "Babbage", "Bash", "BASIC", "bc", "BCPL", "BeanShell", "Batch (Windows/Dos)", "Bertrand", "BETA", "Bigwig", "Bistro", "BitC", "BLISS", "Blockly", "BlooP", "Blue", "Boo", "Boomerang", "Bourne shell (including bash and ksh)", "BREW", "BPEL", "B", "C--", "C++ – ISO/IEC 14882", "C# – ISO/IEC 23270", "C/AL", "Caché ObjectScript", "C Shell", "Caml", "Cayenne", "CDuce", "Cecil", "Cesil", "Céu", "Ceylon", "CFEngine", "CFML", "Cg", "Ch", "Chapel", "Charity", "Charm", "Chef", "CHILL", "CHIP-8", "chomski", "ChucK", "CICS", "Cilk", "Citrine (programming language)", "CL (IBM)", "Claire", "Clarion", "Clean", "Clipper", "CLIPS", "CLIST", "Clojure", "CLU", "CMS-2", "COBOL – ISO/IEC 1989", "CobolScript – COBOL Scripting language", "Cobra", "CODE", "CoffeeScript", "ColdFusion", "COMAL", "Combined Programming Language (CPL)", "COMIT", "Common Intermediate Language (CIL)", "Common Lisp (also known as CL)", "COMPASS", "Component Pascal", "Constraint Handling Rules (CHR)", "COMTRAN", "Converge", "Cool", "Coq", "Coral 66", "Corn", "CorVision", "COWSEL", "CPL", "CPL", "Cryptol", "csh", "Csound", "CSP", "CUDA", "Curl", "Curry", "Cybil", "Cyclone", "Cython", "Java", "Javascript", "M2001", "M4", "M#", "Machine code", "MAD (Michigan Algorithm Decoder)", "MAD/I", "Magik", "Magma", "make", "Maple", "MAPPER now part of BIS", "MARK-IV now VISION:BUILDER", "Mary", "MASM Microsoft Assembly x86", "MATH-MATIC", "Mathematica", "MATLAB", "Maxima (see also Macsyma)", "Max (Max Msp – Graphical Programming Environment)", "Maya (MEL)", "MDL", "Mercury", "Mesa", "Metafont", "Microcode", "MicroScript", "MIIS", "Milk (programming language)", "MIMIC", "Mirah", "Miranda", "MIVA Script", "ML", "Model 204", "Modelica", "Modula", "Modula-2", "Modula-3", "Mohol", "MOO", "Mortran", "Mouse", "MPD", "Mathcad", "MSIL – deprecated name for CIL", "MSL", "MUMPS", "Mystic Programming L"],
// init Tagify script on the above inputs
tagify = new Tagify(input, {
// after 2 characters typed, all matching values from this list will be suggested in a dropdown
whitelist: [].concat(whitelist)
})
// "remove all tags" button event listener
document.querySelector('.tags--removeAllBtn')
.addEventListener('click', tagify.removeAllTags.bind(tagify))
// Chainable event listeners
tagify.on('add', onAddTag)
.on('remove', onRemoveTag)
.on('input', onInput)
.on('edit', onTagEdit)
.on('invalid', onInvalidTag)
.on('click', onTagClick)
.on('focus', onTagifyFocusBlur)
.on('blur', onTagifyFocusBlur)
.on('dropdown:show', onDropdownShow)
.on('dropdown:hide', onDropdownHide)
.on('dropdown:select', onDropdownSelect)
var mockAjax = (function mockAjax(){
var timeout;
return function(duration){
clearTimeout(timeout); // abort last request
return new Promise(function(resolve, reject){
console.log(3434343, whitelist, tagify)
timeout = setTimeout(resolve, duration || 1000, whitelist)
})
}
})()
// tag added callback
function onAddTag(e){
console.log("onAddTag: ", e.detail);
console.log("original input value: ", input.value)
tagify.off('add', onAddTag) // exmaple of removing a custom Tagify event
}
// tag remvoed callback
function onRemoveTag(e){
console.log(e.detail);
console.log("tagify instance value:", tagify.value)
}
// on character(s) added/removed (user is typing/deleting)
function onInput(e){
console.log(e.detail);
console.log("onInput: ", e.detail);
// get new whitelist from some async request (mocked)
tagify.settings.whitelist.length = 0;
mockAjax()
.then(function(result){
/// https://stackoverflow.com/q/30640771/104380
Array.prototype.splice.apply(tagify.settings.whitelist, tagify.settings.whitelist.concat(result))
tagify.dropdown.show.call(tagify, e.detail.value); // render the suggestions dropdown
})
}
function onTagEdit(e){
console.log("onTagEdit: ", e.detail);
}
// invalid tag added callback
function onInvalidTag(e){
console.log("onInvalidTag: ", e.detail);
}
// invalid tag added callback
function onTagClick(e){
console.log(e.detail);
console.log("onTagClick: ", e.detail);
}
function onTagifyFocusBlur(e){
console.log(e.type, "event fired")
}
function onDropdownShow(e){
console.log("onDropdownShow: ", e.detail)
}
function onDropdownHide(e){
console.log("onDropdownHide: ", e.detail)
}
function onDropdownSelect(e){
console.log("onDropdownSelect: ", e.detail)
}
})()
</script>
<script data-name="manualSuggestions">
(function(){
var input = document.querySelector('input[name=tags-manual-suggestions]'),
// init Tagify script on the above inputs
tagify = new Tagify(input, {
whitelist : ["A# .NET", "A# (Axiom)", "A-0 System", "A+", "A++", "ABAP", "ABC", "ABC ALGOL", "ABSET", "ABSYS", "ACC", "Accent", "Ace DASL", "ACL2", "Avicsoft", "ACT-III", "Action!", "ActionScript", "Ada", "Adenine", "Agda", "Agilent VEE", "Agora", "AIMMS", "Alef", "ALF", "ALGOL 58", "ALGOL 60", "ALGOL 68", "ALGOL W", "Alice", "Alma-0", "AmbientTalk", "Amiga E", "AMOS", "AMPL", "Apex (Salesforce.com)", "APL", "AppleScript", "Arc", "ARexx", "Argus", "AspectJ", "Assembly language", "ATS", "Ateji PX", "AutoHotkey", "Autocoder", "AutoIt", "AutoLISP / Visual LISP", "Averest", "AWK", "Axum", "Active Server Pages", "ASP.NET", "B", "Babbage", "Bash", "BASIC", "bc", "BCPL", "BeanShell", "Batch (Windows/Dos)", "Bertrand", "BETA", "Bigwig", "Bistro", "BitC", "BLISS", "Blockly", "BlooP", "Blue", "Boo", "Boomerang", "Bourne shell (including bash and ksh)", "BREW", "BPEL", "B", "C--", "C++ – ISO/IEC 14882", "C# – ISO/IEC 23270", "C/AL", "Caché ObjectScript", "C Shell", "Caml", "Cayenne", "CDuce", "Cecil", "Cesil", "Céu", "Ceylon", "CFEngine", "CFML", "Cg", "Ch", "Chapel", "Charity", "Charm", "Chef", "CHILL", "CHIP-8", "chomski", "ChucK", "CICS", "Cilk", "Citrine (programming language)", "CL (IBM)", "Claire", "Clarion", "Clean", "Clipper", "CLIPS", "CLIST", "Clojure", "CLU", "CMS-2", "COBOL – ISO/IEC 1989", "CobolScript – COBOL Scripting language", "Cobra", "CODE", "CoffeeScript", "ColdFusion", "COMAL", "Combined Programming Language (CPL)", "COMIT", "Common Intermediate Language (CIL)", "Common Lisp (also known as CL)", "COMPASS", "Component Pascal", "Constraint Handling Rules (CHR)", "COMTRAN", "Converge", "Cool", "Coq", "Coral 66", "Corn", "CorVision", "COWSEL", "CPL", "CPL", "Cryptol", "csh", "Csound", "CSP", "CUDA", "Curl", "Curry", "Cybil", "Cyclone", "Cython", "Java", "Javascript", "M2001", "M4", "M#", "Machine code", "MAD (Michigan Algorithm Decoder)", "MAD/I", "Magik", "Magma", "make", "Maple", "MAPPER now part of BIS", "MARK-IV now VISION:BUILDER", "Mary", "MASM Microsoft Assembly x86", "MATH-MATIC", "Mathematica", "MATLAB", "Maxima (see also Macsyma)", "Max (Max Msp – Graphical Programming Environment)", "Maya (MEL)", "MDL", "Mercury", "Mesa", "Metafont", "Microcode", "MicroScript", "MIIS", "Milk (programming language)", "MIMIC", "Mirah", "Miranda", "MIVA Script", "ML", "Model 204", "Modelica", "Modula", "Modula-2", "Modula-3", "Mohol", "MOO", "Mortran", "Mouse", "MPD", "Mathcad", "MSIL – deprecated name for CIL", "MSL", "MUMPS", "Mystic Programming L"],
dropdown: {
position: "manual",
maxItems: Infinity,
enabled: 0,
classname: "customSuggestionsList"
},
enforceWhitelist: true
})
tagify.on("dropdown:show", onSuggestionsListUpdate)
.on("dropdown:hide", onSuggestionsListHide)
renderSuggestionsList()
// ES2015 argument destructuring
function onSuggestionsListUpdate({ detail:suggestionsElm }){
console.log( suggestionsElm )
}
function onSuggestionsListHide(){
console.log("hide dropdown")
}
// https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentElement
function renderSuggestionsList(){
tagify.dropdown.show.call(tagify) // load the list
tagify.DOM.scope.parentNode.appendChild(tagify.DOM.dropdown)
}
})()
</script>
<script data-name="textarea">
(function(){
var input = document.querySelector('textarea[name=tags2]'),
tagify = new Tagify(input, {
enforceWhitelist : true,
whitelist : ["The Shawshank Redemption", "The Godfather", "The Godfather: Part II", "The Dark Knight", "12 Angry Men", "Schindler's List", "Pulp Fiction", "The Lord of the Rings: The Return of the King", "The Good, the Bad and the Ugly", "Fight Club", "The Lord of the Rings: The Fellowship of the Ring", "Star Wars: Episode V - The Empire Strikes Back", "Forrest Gump", "Inception", "The Lord of the Rings: The Two Towers", "One Flew Over the Cuckoo's Nest", "Goodfellas", "The Matrix", "Seven Samurai", "Star Wars: Episode IV - A New Hope", "City of God", "Se7en", "The Silence of the Lambs", "It's a Wonderful Life", "The Usual Suspects", "Life Is Beautiful", "Léon: The Professional", "Spirited Away", "Saving Private Ryan", "La La Land", "Once Upon a Time in the West", "American History X", "Interstellar", "Casablanca", "Psycho", "City Lights", "The Green Mile", "Raiders of the Lost Ark", "The Intouchables", "Modern Times", "Rear Window", "The Pianist", "The Departed", "Terminator 2: Judgment Day", "Back to the Future", "Whiplash", "Gladiator", "Memento", "Apocalypse Now", "The Prestige", "The Lion King", "Alien", "Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb", "Sunset Boulevard", "The Great Dictator", "Cinema Paradiso", "The Lives of Others", "Paths of Glory", "Grave of the Fireflies", "Django Unchained", "The Shining", "WALL·E", "American Beauty", "The Dark Knight Rises", "Princess Mononoke", "Aliens", "Oldboy", "Once Upon a Time in America", "Citizen Kane", "Das Boot", "Witness for the Prosecution", "North by Northwest", "Vertigo", "Star Wars: Episode VI - Return of the Jedi", "Reservoir Dogs", "M", "Braveheart", "Amélie", "Requiem for a Dream", "A Clockwork Orange", "Taxi Driver", "Lawrence of Arabia", "Like Stars on Earth", "Double Indemnity", "To Kill a Mockingbird", "Eternal Sunshine of the Spotless Mind", "Toy Story 3", "Amadeus", "My Father and My Son", "Full Metal Jacket", "The Sting", "2001: A Space Odyssey", "Singin' in the Rain", "Bicycle Thieves", "Toy Story", "Dangal", "The Kid", "Inglourious Basterds", "Snatch", "Monty Python and the Holy Grail", "Hacksaw Ridge", "3 Idiots", "L.A. Confidential", "For a Few Dollars More", "Scarface", "Rashomon", "The Apartment", "The Hunt", "Good Will Hunting", "Indiana Jones and the Last Crusade", "A Separation", "Metropolis", "Yojimbo", "All About Eve", "Batman Begins", "Up", "Some Like It Hot", "The Treasure of the Sierra Madre", "Unforgiven", "Downfall", "Raging Bull", "The Third Man", "Die Hard", "Children of Heaven", "The Great Escape", "Heat", "Chinatown", "Inside Out", "Pan's Labyrinth", "Ikiru", "My Neighbor Totoro", "On the Waterfront", "Room", "Ran", "The Gold Rush", "The Secret in Their Eyes", "The Bridge on the River Kwai", "Blade Runner", "Mr. Smith Goes to Washington", "The Seventh Seal", "Howl's Moving Castle", "Lock, Stock and Two Smoking Barrels", "Judgment at Nuremberg", "Casino", "The Bandit", "Incendies", "A Beautiful Mind", "A Wednesday", "The General", "The Elephant Man", "Wild Strawberries", "Arrival", "V for Vendetta", "Warrior", "The Wolf of Wall Street", "Manchester by the Sea", "Sunrise", "The Passion of Joan of Arc", "Gran Torino", "Rang De Basanti", "Trainspotting", "Dial M for Murder", "The Big Lebowski", "The Deer Hunter", "Tokyo Story", "Gone with the Wind", "Fargo", "Finding Nemo", "The Sixth Sense", "The Thing", "Hera Pheri", "Cool Hand Luke", "Andaz Apna Apna", "Rebecca", "No Country for Old Men", "How to Train Your Dragon", "Munna Bhai M.B.B.S.", "Sholay", "Kill Bill: Vol. 1", "Into the Wild", "Mary and Max", "Gone Girl", "There Will Be Blood", "Come and See", "It Happened One Night", "Life of Brian", "Rush", "Hotel Rwanda", "Platoon", "Shutter Island", "Network", "The Wages of Fear", "Stand by Me", "Wild Tales", "In the Name of the Father", "Spotlight", "Star Wars: The Force Awakens", "The Nights of Cabiria", "The 400 Blows", "Butch Cassidy and the Sundance Kid", "Mad Max: Fury Road", "The Maltese Falcon", "12 Years a Slave", "Ben-Hur", "The Grand Budapest Hotel", "Persona", "Million Dollar Baby", "Amores Perros", "Jurassic Park", "The Princess Bride", "Hachi: A Dog's Tale", "Memories of Murder", "Stalker", "Nausicaä of the Valley of the Wind", "Drishyam", "The Truman Show", "The Grapes of Wrath", "Before Sunrise", "Touch of Evil", "Annie Hall", "The Message", "Rocky", "Gandhi", "Harry Potter and the Deathly Hallows: Part 2", "The Bourne Ultimatum", "Diabolique", "Donnie Darko", "Monsters, Inc.", "Prisoners", "8½", "The Terminator", "The Wizard of Oz", "Catch Me If You Can", "Groundhog Day", "Twelve Monkeys", "Zootopia", "La Haine", "Barry Lyndon", "Jaws", "The Best Years of Our Lives", "Infernal Affairs", "Udaan", "The Battle of Algiers", "Strangers on a Train", "Dog Day Afternoon", "Sin City", "Kind Hearts and Coronets", "Gangs of Wasseypur", "The Help"],
callbacks : {
add : console.log, // callback when adding a tag
remove : console.log // callback when removing a tag
}
});
})()
</script>
<script data-name="customLook">
(function(){
var input = document.querySelector('.customLook'),
tagify = new Tagify(input),
button = input.nextElementSibling; // "add new tag" action-button
button.addEventListener("click", onAddButtonClick)
function onAddButtonClick(){
tagify.addEmptyTag()
}
})()
</script>
<script data-name='mix'>
(function(){
// Define two types of whitelists, each used for the dropdown suggestions menu, depending on the pattern (see seetings below) prefix
var whitelist_1 = [
{ id:100, value:'kenny', title:'Kenny McCormick'},
{ id:101, value:'cartman', title:'Eric Cartman' },
{ id:102, value:'kyle', title:'Kyle Broflovski' },
{ id:103, value:'token', title:'Token Black' },
{ id:104, value:'jimmy', title:'Jimmy Valmer' },
{ id:105, value:'butters', title:'Butters Stotch' },
{ id:106, value:'stan', title:'Stan Marsh' },
{ id:107, value:'randy', title:'Randy Marsh' },
{ id:108, value:'Mr. Garrison', title:'POTUS' },
{ id:109, value:'Mr. Mackey', title:"M'Kay" }
]