forked from Serhioromano/bootstrap-tags
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
205 lines (200 loc) · 6.18 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
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap tags - pills UI component</title>
<link rel="stylesheet" href="components/bootstrap/docs/assets/css/bootstrap.css"/>
<link rel="stylesheet" href="css/bootstrap-tags.css"/>
</head>
<body>
<div class="container">
<div class="hero-unit">
<h1>Bootstrap Tags Demo</h1>
<p>Bootstrap tags is an UI component to manage values with Ajax</p>
<style type="text/css">
.btn-twitter {
padding-left: 30px;
background: rgba(0, 0, 0, 0) url(https://platform.twitter.com/widgets/images/btn.27237bab4db188ca749164efd38861b0.png) -20px 6px no-repeat;
}
.btn-twitter:hover {
background-position: -20px -18px;
}
</style>
<p>
<a href="https://github.com/Serhioromano/bootstrap-tags" class="btn btn-inverse">Fork on GitHub</a>
<a class="btn btn-success" href="https://github.com/Serhioromano/bootstrap-tags/blob/master/README.md">Documentation</a>
<a href="https://twitter.com/serhioromano" class="btn btn-twitter" data-show-count="false" data-size="large">Follow @serhioromano</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');
</script>
</p>
</div>
<div class="row">
<div class="span4"><h3>Standard demo</h3>
<p>Simple tags with default options</p>
</div>
<div class="span8">
<div id="bs-tags"></div>
<style type="text/css">
#bs-tags .tag-badge {
margin-right: 5px;
margin-bottom: 5px;
font-weight: 100;
font-size: 14px;
line-height: 20px;
}
#bs-tags .tag-icon {
margin-left: 5px;
margin-right: -3px;
}
#bs-tags .tag-badge a.tag-link {
color: #ffffff;
text-decoration: underline;
}
#bs-tags .tag-input {
border: 0 solid;
margin: 0;
padding: 0;
font-weight: 100;
border: 0 solid;
background-color: transparent;
height: 18px;
margin-top: -5px;
color: #ffffff;
outline: none;
}
</style>
</div>
</div>
<div class="row">
<div class="span4"><h3>Custom tags</h3>
<p>This is example how you can customize tags to anything you like</p>
</div>
<div class="span8">
<div id="bs-tags-custom"></div>
<style type="text/css">
#bs-tags-custom .pills-list {
display: block;
}
#bs-tags-custom .tag-badge {
margin-right: 10px;
margin-bottom: 10px;
border-radius: 8px;
border: 2px dashed transparent;
background-color: #f5f5f5;
width: 175px;
line-height: 20px;
padding: 5px;
text-overflow: ellipsis;
position: relative;
}
#bs-tags-custom .tag-badge a.tag-link {
color: #151515;
}
#bs-tags-custom .tag-badge:hover {
border: 2px dashed #c4ca65;
background-color: #e8ee80;
}
#bs-tags-custom .tag-badge:hover a.tag-link {
text-decoration: none;
color: #555b2b;
}
#bs-tags-custom .tag-remove {
position: absolute;
top: -2px;
right: 2px;
}
</style>
</div>
</div>
<div class="row">
<div class="span4"><h3>Tags in a Form</h3>
<p>This is an example of including tags in a form and using a custom function when duplicate tags are added.</p>
</div>
<form >
<div id="bs-tags-form"></div>
<button type="submit" class="btn">Submit</button>
<style type="text/css">
button {
margin-left: 30%;
}
#bs-tags-form .tag-badge {
margin-right: 5px;
margin-bottom: 5px;
font-weight: 100;
font-size: 14px;
line-height: 20px;
}
#bs-tags-form .tag-icon {
margin-left: 5px;
margin-right: -3px;
}
#bs-tags-form .tag-badge a.tag-link {
color: #ffffff;
text-decoration: underline;
}
#bs-tags-form .tag-input {
border: 0 solid;
margin: 0;
padding: 0;
font-weight: 100;
border: 0 solid;
background-color: transparent;
height: 18px;
margin-top: -5px;
color: #ffffff;
outline: none;
}
</style>
</form>
</div>
</div>
<br><br>
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'bootstraptagsinput'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
<script type="text/javascript" src="components/jquery/jquery.js"></script>
<script type="text/javascript" src="components/bootstrap/docs/assets/js/bootstrap.js"></script>
<script type="text/javascript" src="components/jquery-color/jquery.color.js"></script>
<script type="text/javascript" src="js/bootstrap-tags.js"></script>
<script type="text/javascript">
$('#bs-tags').tags({
suggestions: ["Banana", "Durian", "Cocos"],
suggestion_url: "urls/suggestions.json.php",
values_url: 'urls/defaults.json'
});
$('#bs-tags-custom').tags({
double_hilight: '#C4CA65',
only_suggestions: true,
suggestion_url: "urls/user_suggestions.json.php",
templates: {
pill: '<div class="pull-left tag-badge">{0}</div>',
add_pill: '<div class="tag-form"></div>',
input_pill: '<div class="tag-form input-append"></div>',
number: ' <sup><small>{0}</small></sup>',
plus_icon: '<button class="btn"><i class="icon-plus-sign"></i></button>',
delete_icon: '<i class="icon-remove-sign tag-icon"></i>',
ok_icon: '<button class="btn"><i class="icon-ok-sign tag-icon"></i></button>'
},
values_url: 'urls/default_users.json'
});
$('#bs-tags-form').tags({
suggestions: ["Banana", "Durian", "Cocos"],
suggestion_url: "urls/suggestions.json.php",
values_url: 'urls/defaults.json',
onDuplicate: function(original, duplicate){
$(original).hide().fadeIn();
return false;
}
});
</script>
</body>
</html>