forked from yairEO/tagify
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
972 lines (876 loc) · 47.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
<!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.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(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>");
}, 60);
}
</script>
<style>
p{ line-height:1.4; }
code{ padding:2px 3px; background:lightyellow; }
pre code{ background:none; padding:0; }
.forkLink{ top:1em; right:1em; }
section > .rightSide{
position: sticky;
top: 1em;
align-self: start;
}
.tagify{
min-width:400px;
max-width:600px;
margin: 1.5em 0;
}
/* for disabling the script */
label{ position:fixed; bottom:10px; right:10px; cursor:pointer; font:600 .8em Arial; }
.disabled tags{
max-width:none;
min-width:0;
border:0;
}
.disabled tags tag,
.disabled tags div{ display:none !important; }
.disabled tags + input,
.disabled tags + textarea{ display:initial; 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;
}
/* 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; }
</style>
</head>
<body>
<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><input name='toggleTagify' type='checkbox'> TOGGLE OFF</label>
<form>
<section id='section-basic'>
<aside class='leftSide'>
<h2><a href='#section-basic'>#</a>text input</h2>
<p>
In this example, the field is pre-ocupied with <strong>4</strong> tags, and <em>last</em> tag is the same as the <em>first</em> tag,
and will be <em>removed</em> because the <code>duplicates</code> option flag is set to <code>true</code>.
This input field is also limited to <strong>5</strong> tags only.
</p>
<p>
Note that <code>whitelist</code> & <code>blacklist</code> may be passed to <i>Tagify</i> as <code>data-</code> attributes on the input tag
as a list of tags seperated by the same delimeter defined in the Tagify's configuration. Default is comma (<code>,</code>)
</p>
<h3>HTML</h3>
<xmp><input name='tags' class='some_class_name' placeholder='write some tags' value='css, html, javascript, css' autofocus data-blacklist='.NET,PHP'></xmp>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "basic")</script>
</aside>
<aside class='rightSide'>
<input name='tags' class='some_class_name' placeholder='write some tags' value='css, html, javascript, css' autofocus data-blacklist='.NET,PHP'>
<button class='tags--removeAllBtn' type='button'>Remove all 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>
<xmp><textarea name='tags2' placeholder='Movie names'>The Matrix, Pulp Fiction, Mad Max</textarea></xmp>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "textarea")</script>
</aside>
<aside class='rightSide'>
<textarea name='tags2' placeholder='Movie names'>The Matrix, Pulp Fiction, Mad Max</textarea>
</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>
<xmp><textarea name='mix'>@cartman and @kyle do not know #homer</textarea></xmp>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "mix")</script>
</aside>
<aside class='rightSide'>
<textarea name='mix'>@cartman and @kyle do not know #homer who is #1</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>
<xmp><input name='tags-outside' class='tagify--outside' placeholder='write some tags'></xmp>
<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-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 used (minimum charactes typed which shows the dropdown) to <code>3</code>. The Maximum number of tags is set to <code>6</code>
</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>,</code> & <code> </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>
<xmp><input name='tags3' placeholder='Write some tags' pattern='^[A-Za-z_ ]{1,15}$'></xmp>
<h3>JAVASCRIPT</h3>
<script>renderPRE(document.currentScript, "advance-options")</script>
</aside>
<aside class='rightSide'>
<input name='tags3' placeholder='Write some tags' 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>
</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>
</aside>
<aside class='rightSide'>
<input name='tags-readonly-mix' class='readonlyMix' placeholder="Type something" />
</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]');
toggleTagifyElm.checked = false;
// toggle Tagify on/off
toggleTagifyElm.addEventListener('change', function(){
document.body.classList[this.checked ? 'add' : 'remove']('disabled');
})
</script>
<script data-name="basic">
(function(){
var input = document.querySelector('input[name=tags]'),
// 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", "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"],
blacklist : [".NET", "PHP"] // <-- passed as an attribute in this demo
});
// "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);
// 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);
}
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);
}
})()
</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='mix'>
(function(){
var input = document.querySelector('[name=mix]'),
// init Tagify script on the above inputs
tagify = new Tagify(input, {
mode : 'mix', // <-- Enable mixed-content
pattern : /@|#/, // <-- Tag words which start with @ or # (can be a String instead of Regex)
enforceWhitelist : true,
whitelist : [ // <-- Set the initial whitelist, which will dynamically change as you type (see "input" event below)
{
value : 'cartman',
title : 'Eric Cartman',
class : 'borderd-blue' // <-- Add any attribute you wish, per-tag
},
{
value : 'kyle',
title : 'Kyle Broflovski'
},
{
value: 'Homer'
}
],
dropdown : {
enabled : 1
}
})
var whitelist_1 = [
{
value : 'kenny',
title : 'Kenny McCormick'
},
{
value : 'cartman',
title : 'Eric Cartman'
},
{
value : 'kyle',
title : 'Kyle Broflovski'
},
{
value : 'token',
title : 'Token Black'
},
{
value : 'jimmy',
title : 'Jimmy Valmer'
},
{
value : 'butters',
title : 'Butters Stotch'
},
{
value : 'stan',
title : 'Stan Marsh'
},
{
value : 'randy',
title : 'Randy Marsh'
},
{
value : 'Mr. Garrison',
title : 'POTUS'
},
{
value : 'Mr. Mackey',
title : "M'Kay"
}
]
var whitelist_2 = ['Homer', 'Marge', 'Bart', 'Lisa', 'Maggie', 'Mr. Burns', 'Ned', 'Milhouse', 'Moe'];
// A good place to pull server suggestion list accoring to the prefix/value
tagify.on('input', function(e){
var prefix = e.detail.prefix;
if( prefix ){
if( prefix == '@' )
tagify.settings.whitelist = whitelist_1;
if( prefix == '#' )
tagify.settings.whitelist = whitelist_2;
if( e.detail.value.length > 1 )
tagify.dropdown.show.call(tagify, e.detail.value);
}
console.log('mix-mode "input" event value: ', e.detail)
})
tagify.on('add', function(e){
console.log(e)
})
})()
</script>
<script data-name="outside-of-the-box">
(function(){
var input = document.querySelector('input[name=tags-outside]'),
// init Tagify script on the above inputs
tagify = new Tagify(input);
// add a class to Tagify's input element
tagify.DOM.input.classList.add('tagify__input--outside');
// re-place Tagify's input element outside of the <tags> element (tagify.DOM.scope), just before it
tagify.DOM.scope.parentNode.insertBefore(tagify.DOM.input, tagify.DOM.scope);
})()
</script>
<script data-name="advance-options">
(function(){
var input = document.querySelector('input[name=tags3]'),
tagify = new Tagify(input, {
delimiters : ",| ", // add new tags when a comma or a space character
maxTags : 6,
blacklist : ["fuck", "shit", "pussy"],
keepInvalidTags : true, // do not remove invalid tags (but keep them marked as invalid)
whitelist : ["temple","stun","detective","sign","passion","routine","deck","discriminate","relaxation","fraud","attractive","soft","forecast","point","thank","stage","eliminate","effective","flood","passive","skilled","separation","contact","compromise","reality","district","nationalist","leg","porter","conviction","worker","vegetable","commerce","conception","particle","honor","stick","tail","pumpkin","core","mouse","egg","population","unique","behavior","onion","disaster","cute","pipe","sock","dialect","horse","swear","owner","cope","global","improvement","artist","shed","constant","bond","brink","shower","spot","inject","bowel","homosexual","trust","exclude","tough","sickness","prevalence","sister","resolution","cattle","cultural","innocent","burial","bundle","thaw","respectable","thirsty","exposure","team","creed","facade","calendar","filter","utter","dominate","predator","discover","theorist","hospitality","damage","woman","rub","crop","unpleasant","halt","inch","birthday","lack","throne","maximum","pause","digress","fossil","policy","instrument","trunk","frame","measure","hall","support","convenience","house","partnership","inspector","looting","ranch","asset","rally","explicit","leak","monarch","ethics","applied","aviation","dentist","great","ethnic","sodium","truth","constellation","lease","guide","break","conclusion","button","recording","horizon","council","paradox","bride","weigh","like","noble","transition","accumulation","arrow","stitch","academy","glimpse","case","researcher","constitutional","notion","bathroom","revolutionary","soldier","vehicle","betray","gear","pan","quarter","embarrassment","golf","shark","constitution","club","college","duty","eaux","know","collection","burst","fun","animal","expectation","persist","insure","tick","account","initiative","tourist","member","example","plant","river","ratio","view","coast","latest","invite","help","falsify","allocation","degree","feel","resort","means","excuse","injury","pupil","shaft","allow","ton","tube","dress","speaker","double","theater","opposed","holiday","screw","cutting","picture","laborer","conservation","kneel","miracle","brand","nomination","characteristic","referral","carbon","valley","hot","climb","wrestle","motorist","update","loot","mosquito","delivery","eagle","guideline","hurt","feedback","finish","traffic","competence","serve","archive","feeling","hope","seal","ear","oven","vote","ballot","study","negative","declaration","particular","pattern","suburb","intervention","brake","frequency","drink","affair","contemporary","prince","dry","mole","lazy","undermine","radio","legislation","circumstance","bear","left","pony","industry","mastermind","criticism","sheep","failure","chain","depressed","launch","script","green","weave","please","surprise","doctor","revive","banquet","belong","correction","door","image","integrity","intermediate","sense","formal","cane","gloom","toast","pension","exception","prey","random","nose","predict","needle","satisfaction","establish","fit","vigorous","urgency","X-ray","equinox","variety","proclaim","conceive","bulb","vegetarian","available","stake","publicity","strikebreaker","portrait","sink","frog","ruin","studio","match","electron","captain","channel","navy","set","recommend","appoint","liberal","missile","sample","result","poor","efflux","glance","timetable","advertise","personality","aunt","dog"],
transformTag : transformaTag,
dropdown : {
enabled: 3,
}
})
function transformaTag( value ){
if( value == 'shit' )
return 's✲✲t';
}
tagify.on('add', function(e){
console.log(e.detail)
});
tagify.on('invalid', function(e){
console.log(e, e.detail);
});
})()
</script>
<script data-name="extra-properties">
(function(){
var tagify = new Tagify(document.querySelector('input[name=tags3-1]'), {
delimiters : null,
tagTemplate : function(v, tagData){
// _ESCAPE_START_
return `<tag title='${v}'>
<x title=''></x>
<div>
<img onerror="this.style.visibility = 'hidden'" src='https://lipis.github.io/flag-icon-css/flags/4x3/${tagData.code.toLowerCase()}.svg'>
<span class='tagify__tag-text'>${v}</span>
</div>
</tag>`;
// _ESCAPE_END_
},
enforceWhitelist : true,
whitelist : [
{ value:'Afghanistan', code:'AF' },
{ value:'Åland Islands', code:'AX' },
{ value:'Albania', code:'AL' },
{ value:'Algeria', code:'DZ' },
{ value:'American Samoa', code:'AS' },
{ value:'Andorra', code:'AD' },
{ value:'Angola', code:'AO' },
{ value:'Anguilla', code:'AI' },
{ value:'Antarctica', code:'AQ' },
{ value:'Antigua and Barbuda', code:'AG' },
{ value:'Argentina', code:'AR' },
{ value:'Armenia', code:'AM' },
{ value:'Aruba', code:'AW' },
{ value:'Australia', code:'AU' },
{ value:'Austria', code:'AT' },
{ value:'Azerbaijan', code:'AZ' },
{ value:'Bahamas', code:'BS' },
{ value:'Bahrain', code:'BH' },
{ value:'Bangladesh', code:'BD' },
{ value:'Barbados', code:'BB' },
{ value:'Belarus', code:'BY' },
{ value:'Belgium', code:'BE' },
{ value:'Belize', code:'BZ' },
{ value:'Benin', code:'BJ' },
{ value:'Bermuda', code:'BM' },
{ value:'Bhutan', code:'BT' },
{ value:'Bolivia', code:'BO' },
{ value:'Bosnia and Herzegovina', code:'BA' },
{ value:'Botswana', code:'BW' },
{ value:'Bouvet Island', code:'BV' },
{ value:'Brazil', code:'BR' },
{ value:'British Indian Ocean Territory', code:'IO' },
{ value:'Brunei Darussalam', code:'BN' },
{ value:'Bulgaria', code:'BG' },
{ value:'Burkina Faso', code:'BF' },
{ value:'Burundi', code:'BI' },
{ value:'Cambodia', code:'KH' },
{ value:'Cameroon', code:'CM' },
{ value:'Canada', code:'CA' },
{ value:'Cape Verde', code:'CV' },
{ value:'Cayman Islands', code:'KY' },
{ value:'Central African Republic', code:'CF' },
{ value:'Chad', code:'TD' },
{ value:'Chile', code:'CL' },
{ value:'China', code:'CN' },
{ value:'Christmas Island', code:'CX' },
{ value:'Cocos (Keeling) Islands', code:'CC' },
{ value:'Colombia', code:'CO' },
{ value:'Comoros', code:'KM' },
{ value:'Congo', code:'CG' },
{ value:'Congo, The Democratic Republic of the', code:'CD' },
{ value:'Cook Islands', code:'CK' },
{ value:'Costa Rica', code:'CR' },
{ value:'Cote D\'Ivoire', code:'CI' },
{ value:'Croatia', code:'HR' },
{ value:'Cuba', code:'CU' },
{ value:'Cyprus', code:'CY' },
{ value:'Czech Republic', code:'CZ' },
{ value:'Denmark', code:'DK' },
{ value:'Djibouti', code:'DJ' },
{ value:'Dominica', code:'DM' },
{ value:'Dominican Republic', code:'DO' },
{ value:'Ecuador', code:'EC' },
{ value:'Egypt', code:'EG' },
{ value:'El Salvador', code:'SV' },
{ value:'Equatorial Guinea', code:'GQ' },
{ value:'Eritrea', code:'ER' },
{ value:'Estonia', code:'EE' },
{ value:'Ethiopia', code:'ET' },
{ value:'Falkland Islands (Malvinas)', code:'FK' },
{ value:'Faroe Islands', code:'FO' },
{ value:'Fiji', code:'FJ' },
{ value:'Finland', code:'FI' },
{ value:'France', code:'FR' },
{ value:'French Guiana', code:'GF' },
{ value:'French Polynesia', code:'PF' },
{ value:'French Southern Territories', code:'TF' },
{ value:'Gabon', code:'GA' },
{ value:'Gambia', code:'GM' },
{ value:'Georgia', code:'GE' },
{ value:'Germany', code:'DE' },
{ value:'Ghana', code:'GH' },
{ value:'Gibraltar', code:'GI' },
{ value:'Greece', code:'GR' },
{ value:'Greenland', code:'GL' },
{ value:'Grenada', code:'GD' },
{ value:'Guadeloupe', code:'GP' },
{ value:'Guam', code:'GU' },
{ value:'Guatemala', code:'GT' },
{ value:'Guernsey', code:'GG' },
{ value:'Guinea', code:'GN' },
{ value:'Guinea-Bissau', code:'GW' },
{ value:'Guyana', code:'GY' },
{ value:'Haiti', code:'HT' },
{ value:'Heard Island and Mcdonald Islands', code:'HM' },
{ value:'Holy See (Vatican City State)', code:'VA' },
{ value:'Honduras', code:'HN' },
{ value:'Hong Kong', code:'HK' },
{ value:'Hungary', code:'HU' },
{ value:'Iceland', code:'IS' },
{ value:'India', code:'IN' },
{ value:'Indonesia', code:'ID' },
{ value:'Iran, Islamic Republic Of', code:'IR' },
{ value:'Iraq', code:'IQ' },
{ value:'Ireland', code:'IE' },
{ value:'Isle of Man', code:'IM' },
{ value:'Israel', code:'IL' },
{ value:'Italy', code:'IT' },
{ value:'Jamaica', code:'JM' },
{ value:'Japan', code:'JP' },
{ value:'Jersey', code:'JE' },
{ value:'Jordan', code:'JO' },
{ value:'Kazakhstan', code:'KZ' },
{ value:'Kenya', code:'KE' },
{ value:'Kiribati', code:'KI' },
{ value:'Korea, Democratic People\'S Republic of', code:'KP' },
{ value:'Korea, Republic of', code:'KR' },
{ value:'Kuwait', code:'KW' },
{ value:'Kyrgyzstan', code:'KG' },
{ value:'Lao People\'S Democratic Republic', code:'LA' },
{ value:'Latvia', code:'LV' },
{ value:'Lebanon', code:'LB' },
{ value:'Lesotho', code:'LS' },
{ value:'Liberia', code:'LR' },
{ value:'Libyan Arab Jamahiriya', code:'LY' },
{ value:'Liechtenstein', code:'LI' },
{ value:'Lithuania', code:'LT' },
{ value:'Luxembourg', code:'LU' },
{ value:'Macao', code:'MO' },
{ value:'Macedonia, The Former Yugoslav Republic of', code:'MK' },
{ value:'Madagascar', code:'MG' },
{ value:'Malawi', code:'MW' },
{ value:'Malaysia', code:'MY' },
{ value:'Maldives', code:'MV' },
{ value:'Mali', code:'ML' },
{ value:'Malta', code:'MT' },
{ value:'Marshall Islands', code:'MH' },
{ value:'Martinique', code:'MQ' },
{ value:'Mauritania', code:'MR' },
{ value:'Mauritius', code:'MU' },
{ value:'Mayotte', code:'YT' },
{ value:'Mexico', code:'MX' },
{ value:'Micronesia, Federated States of', code:'FM' },
{ value:'Moldova, Republic of', code:'MD' },
{ value:'Monaco', code:'MC' },
{ value:'Mongolia', code:'MN' },
{ value:'Montserrat', code:'MS' },
{ value:'Morocco', code:'MA' },
{ value:'Mozambique', code:'MZ' },
{ value:'Myanmar', code:'MM' },
{ value:'Namibia', code:'NA' },
{ value:'Nauru', code:'NR' },
{ value:'Nepal', code:'NP' },
{ value:'Netherlands', code:'NL' },
{ value:'Netherlands Antilles', code:'AN' },
{ value:'New Caledonia', code:'NC' },
{ value:'New Zealand', code:'NZ' },
{ value:'Nicaragua', code:'NI' },
{ value:'Niger', code:'NE' },
{ value:'Nigeria', code:'NG' },
{ value:'Niue', code:'NU' },
{ value:'Norfolk Island', code:'NF' },
{ value:'Northern Mariana Islands', code:'MP' },
{ value:'Norway', code:'NO' },
{ value:'Oman', code:'OM' },
{ value:'Pakistan', code:'PK' },
{ value:'Palau', code:'PW' },
{ value:'Palestinian Territory, Occupied', code:'PS' },
{ value:'Panama', code:'PA' },
{ value:'Papua New Guinea', code:'PG' },
{ value:'Paraguay', code:'PY' },
{ value:'Peru', code:'PE' },
{ value:'Philippines', code:'PH' },
{ value:'Pitcairn', code:'PN' },
{ value:'Poland', code:'PL' },
{ value:'Portugal', code:'PT' },
{ value:'Puerto Rico', code:'PR' },
{ value:'Qatar', code:'QA' },
{ value:'Reunion', code:'RE' },
{ value:'Romania', code:'RO' },
{ value:'Russian Federation', code:'RU' },
{ value:'RWANDA', code:'RW' },
{ value:'Saint Helena', code:'SH' },
{ value:'Saint Kitts and Nevis', code:'KN' },
{ value:'Saint Lucia', code:'LC' },
{ value:'Saint Pierre and Miquelon', code:'PM' },
{ value:'Saint Vincent and the Grenadines', code:'VC' },
{ value:'Samoa', code:'WS' },
{ value:'San Marino', code:'SM' },
{ value:'Sao Tome and Principe', code:'ST' },
{ value:'Saudi Arabia', code:'SA' },
{ value:'Senegal', code:'SN' },
{ value:'Serbia and Montenegro', code:'CS' },
{ value:'Seychelles', code:'SC' },
{ value:'Sierra Leone', code:'SL' },
{ value:'Singapore', code:'SG' },
{ value:'Slovakia', code:'SK' },
{ value:'Slovenia', code:'SI' },
{ value:'Solomon Islands', code:'SB' },
{ value:'Somalia', code:'SO' },
{ value:'South Africa', code:'ZA' },
{ value:'South Georgia and the South Sandwich Islands', code:'GS' },
{ value:'Spain', code:'ES' },
{ value:'Sri Lanka', code:'LK' },
{ value:'Sudan', code:'SD' },
{ value:'Suriname', code:'SR' },
{ value:'Svalbard and Jan Mayen', code:'SJ' },
{ value:'Swaziland', code:'SZ' },
{ value:'Sweden', code:'SE' },
{ value:'Switzerland', code:'CH' },
{ value:'Syrian Arab Republic', code:'SY' },
{ value:'Taiwan, Province of China', code:'TW' },
{ value:'Tajikistan', code:'TJ' },
{ value:'Tanzania, United Republic of', code:'TZ' },
{ value:'Thailand', code:'TH' },
{ value:'Timor-Leste', code:'TL' },
{ value:'Togo', code:'TG' },
{ value:'Tokelau', code:'TK' },
{ value:'Tonga', code:'TO' },
{ value:'Trinidad and Tobago', code:'TT' },
{ value:'Tunisia', code:'TN' },
{ value:'Turkey', code:'TR' },
{ value:'Turkmenistan', code:'TM' },
{ value:'Turks and Caicos Islands', code:'TC' },
{ value:'Tuvalu', code:'TV' },
{ value:'Uganda', code:'UG' },
{ value:'Ukraine', code:'UA' },
{ value:'United Arab Emirates', code:'AE' },
{ value:'United Kingdom', code:'GB' },
{ value:'United States', code:'US' },
{ value:'United States Minor Outlying Islands', code:'UM' },
{ value:'Uruguay', code:'UY' },
{ value:'Uzbekistan', code:'UZ' },
{ value:'Vanuatu', code:'VU' },
{ value:'Venezuela', code:'VE' },
{ value:'Viet Nam', code:'VN' },
{ value:'Virgin Islands, British', code:'VG' },
{ value:'Virgin Islands, U.S.', code:'VI' },
{ value:'Wallis and Futuna', code:'WF' },
{ value:'Western Sahara', code:'EH' },
{ value:'Yemen', code:'YE' },
{ value:'Zambia', code:'ZM' },
{ value:'Zimbabwe', code:'ZW' }
],
dropdown : {
enabled: 1, // suggest tags after a single character input
classname : 'extra-properties', // custom class for the suggestions dropdown
itemTemplate : function(tagData){
// _ESCAPE_START_
return `<div class='tagify__dropdown__item ${tagData.class ? tagData.class : ""}'>
<img onerror="this.style.visibility = 'hidden'"
src='https://lipis.github.io/flag-icon-css/flags/4x3/${tagData.code.toLowerCase()}.svg'>
<span>${tagData.value}</span>
</div>`
// _ESCAPE_END_
}
},
mapValueToProp : "code", // map tags' values to this property name, so this property will be the actual value and not the printed value on the screen
})
tagify.on('click', function(e){
console.log(e.detail);
});
tagify.on('remove', function(e){
console.log(e.detail);
});
tagify.on('add', function(e){
console.log( "original Input:", tagify.DOM.originalInput);
console.log( "original Input's value:", tagify.DOM.originalInput.value);
console.log( "event detail:", e.detail);
});
// add the first 2 tags from the "allowedTags" Aray automatically
tagify.addTags(tagify.settings.whitelist.slice(0,2));
})()
</script>
<script data-name='readonly'>
(function(){
var input = document.querySelector('input[name=tags4]'),
tagify = new Tagify(input);
})()
</script>
<script data-name='readonly-mixed'>
(function(){
var input = document.querySelector('input[name=tags-readonly-mix]'),
tagify = new Tagify(input);
tagify.addTags([
{
value : 'foo',
readonly : true,
title : 'read-only tag'
},
{
value : 'bar',
readonly : true,
title : 'read-only tag'
}
])
})()
</script>
<script data-name='jQuery'>
(function(){
var $input = $('input[name=tags-jquery]')
.tagify({
whitelist : [
{"id":1,"value":"some string"}
]
})
.on('add', function(e, tagName){
console.log('JQEURY EVENT: ', 'added', tagName)
})
.on("invalid", function(e, tagName) {
console.log('JQEURY EVENT: ',"invalid", e, ' ', tagName);
});
// get the Tagify instance assigned for this jQuery input object so its methods could be accessed
var jqTagify = $input.data('tagify');
// bind the "click" event on the "remove all tags" button
$('.tags-jquery--removeAllBtn').on('click', jqTagify.removeAllTags.bind(jqTagify))
})()
</script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/themes/prism.min.css">
<script src='https://cdnjs.cloudflare.com/ajax/libs/prism/1.15.0/prism.min.js'></script>
<script>
setTimeout(function(){
Prism.highlightAll();
}, 500)
</script>
</body>
</html>