This repository has been archived by the owner on May 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.html
227 lines (197 loc) · 6.18 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>jQuery Tagz Plugin Demo</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<!-- Stylesheets here -->
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.0/css/smoothness/jquery-ui-1.10.0.custom.min.css" />
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.0/css/bootstrap.min.css" />
<style type="text/css">
.bs-docs-example {
position: relative;
margin: 15px 0;
padding: 39px 19px 14px;
background-color: #fff;
border: 1px solid #ddd;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.bs-docs-example:after {
content: "Example";
position: absolute;
top: -1px;
left: -1px;
padding: 3px 7px;
font-size: 12px;
font-weight: bold;
background-color: #f5f5f5;
border: 1px solid #ddd;
color: #9da0a4;
-webkit-border-radius: 4px 0 4px 0;
-moz-border-radius: 4px 0 4px 0;
border-radius: 4px 0 4px 0;
}
</style>
<link rel="stylesheet" type="text/css" href="css/jquery.tagz.css" />
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCore.css">
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shThemeDefault.css">
</head>
<body>
<!-- Content here -->
<div class="container">
<div class="page-header">
<h1>jQuery Tagz Plugin Demo</h1>
</div>
<h4>Basic</h4>
<p>Simple basic tag input.</p>
<div class="bs-docs-example">
<form>
<input id="normal" type="text">
</form>
</div>
<h6>Code</h6>
<div>
<script type="syntaxhighlighter" class="brush: html"><![CDATA[
<form>
<input id="normal" type="text">
</form>
<script type="text/javascript">
$('#normal').tagz();
</script>
]]></script>
</div>
<h4>With predefined values</h4>
<p>Simple tag input with predefined values.</p>
<div class="bs-docs-example">
<form>
<input id="prepared" type="text" value="Alpha,Bravo,Charlie">
</form>
</div>
<h6>Code</h6>
<div>
<script type="syntaxhighlighter" class="brush: html"><![CDATA[
<form>
<input id="prepared" type="text" value="Alpha,Bravo,Charlie">
</form>
<script type="text/javascript">
$('#normal').tagz();
</script>
]]></script>
</div>
<h4>Read-only:</h4>
<p>Read only tag input field.</p>
<div class="bs-docs-example">
<form>
<input id="readonly" type="text" value="Alpha,Bravo,Charlie">
</form>
</div>
<h6>Code</h6>
<div>
<script type="syntaxhighlighter" class="brush: html"><![CDATA[
<form>
<input id="readonly" type="text" value="Alpha,Bravo,Charlie">
</form>
<script type="text/javascript">
$('#normal').tagz({
readonly: true
});
</script>
]]></script>
</div>
<h4>With jQuery Autocomplete:</h4>
<p>Tag field with jQuery Autocomplete.</p>
<div class="bs-docs-example">
<form>
<input id="autocomplete" type="text">
</form>
</div>
<h6>Code</h6>
<div>
<script type="syntaxhighlighter" class="brush: html"><![CDATA[
<form>
<input id="autocomplete" type="text">
</form>
<script type="text/javascript">
$('#normal').tagz({
autocompleteOptions: {
source: '/api/autocomplete'
}
});
</script>
]]></script>
</div>
<h4>Accept only jQuery Autocomplete values:</h4>
<p>Tag field that accepts only Autocomplete values.</p>
<div class="bs-docs-example">
<form>
<input id="autocompleteOnly" type="text">
</form>
</div>
<h6>Code</h6>
<div>
<script type="syntaxhighlighter" class="brush: html"><![CDATA[
<form>
<input id="autocompleteOnly" type="text">
</form>
<script type="text/javascript">
$('#normal').tagz({
autocompleteOptions: {
source: '/api/autocomplete'
},
autocompleteOnly: true
});
</script>
]]></script>
</div>
<br>
<p class="text-center"><small>Copyright © 2013 <a href="http://dnasir.com">Dzulqarnain Nasir</a></small></p>
</div>
<!-- Scripts here -->
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery-mockjax/1.5.1/jquery.mockjax.js"></script>
<script type="text/javascript" src="js/jquery.tagz.js"></script>
<script type="text/javascript">
// Some Ajax mocking code
$.mockjax({
url: '/api/autocomplete',
contentType: 'text/json',
responseTime: 700,
responseText: ['Alpha', 'Bravo', 'Charlie', 'Delta', 'Echo', 'Foxtrot']
});
$(function(){
// Standard basic setup
$('#normal').tagz();
// Using predefined input values
$('#prepared').tagz();
// Read-only
$('#readonly').tagz({
readonly: true
});
// With jQuery Autocomplete
$('#autocomplete').tagz({
autocompleteOptions: {
source: '/api/autocomplete'
}
});
// Restrict input to jQuery Autocomplete options
$('#autocompleteOnly').tagz({
autocompleteOptions: {
source: '/api/autocomplete'
},
autocompleteOnly: true
});
});
</script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shCore.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushXml.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushJScript.js"></script>
<script type="text/javascript">
SyntaxHighlighter.all();
</script>
</body>
</html>