-
Notifications
You must be signed in to change notification settings - Fork 24
/
index.html
229 lines (223 loc) · 11 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Popover Picker for Twitter Bootstrap 3</title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link href="dist/css/bootstrap-picker.min.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
footer{
font-style: italic;
background:#f7f7f7;
padding:60px;
text-align: center;
margin-top: 60px;
}
pre{
text-align: left;
}
.form-control, .form-group{
position: relative;
}
p.lead{
max-width: 600px;
margin:0 auto 20px auto;
}
div.lead{
margin:30px 0;
}
a.action-placement{
margin:0 4px 4px 4px;
display:inline-block;
/*border-bottom: 1px dotted #428BCA;*/
text-decoration: none;
}
a.action-placement.active{
color:#5CB85C;
}
.form-group{
text-align: left;
margin-bottom: 30px;
}
.form-group label{
display:block;
margin-bottom: 15px;
}
.lead iframe{
vertical-align: middle;
}
</style>
</head>
<body>
<div class="container" style="text-align: center">
<h1 class="page-header">Bootstrap Popover Picker</h1>
<p class="lead">
Generic jQuery plugin template for building pickers using Bootstrap popovers,
fully customizable with a powerful base API.
</p>
<div class="lead">
<iframe class="inl-bl" src="http://ghbtns.com/github-btn.html?user=mjolnic&repo=bootstrap-popover-picker&type=watch&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="125" height="30"></iframe>
<iframe class="inl-bl" src="http://ghbtns.com/github-btn.html?user=mjolnic&repo=bootstrap-popover-picker&type=fork&count=true&size=large"
allowtransparency="true" frameborder="0" scrolling="0" width="125" height="30"></iframe>
<a class="btn btn-primary" href="https://github.com/mjolnic/bootstrap-popover-picker/archive/1.0.0.zip">
<i class="fa-download fa"></i> Download
</a>
<form style="display:inline-block; margin:0 10px;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="V5R7NXUNJS7KJ">
<button type="submit" name="submit" class="btn btn-warning"><i class="fa fa-heart"></i> Donate</button>
<img alt="" border="0" src="https://www.paypalobjects.com/es_ES/i/scr/pixel.gif" width="1" height="1">
</form>
</div>
<p class="lead">
Looking for a <a href="http://mjolnic.github.io/fontawesome-iconpicker/">Font Awesome Icon Picker?</a>
</p>
<div class="panel panel-default">
<div class="panel-heading">
<h2 class="panel-title">Demos</h2>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-5">
<div class="form-group">
<label>Default</label>
<input data-hide-on-select="true" class="form-control pck pck-auto" value="A" type="text" />
</div>
<div class="form-group">
<label>As a component</label>
<div class="input-group">
<input data-hide-on-select="true" class="form-control pck pck-auto" value="B" type="text" />
<span class="input-group-addon"></span>
</div>
</div>
<div class="form-group">
<label data-title="Inline picker" data-placement="inline" class="pck pck-auto" data-selected="C">
Inline mode, without input:
</label>
</div>
</div>
<div class="col-md-7">
<div class="form-group">
<label>With custom options</label>
<input class="form-control pck pck-opts" value="" type="text" />
</div>
<pre class="well">
$('.pck-opts').picker({
title: 'With custom options',
items: [
'♥', '♠', '♣', '♦',
'★', '☺', '☼', '♫',
],
selectedCustomClass: 'label label-success',
mustAccept:true,
placement:'bottomRight',
showFooter:true,
templates{
search:false,
//... (see the source code of this page)
}
});</pre>
<div class="form-group">
<label>Inside dropdowns</label>
<div class="btn-group">
<button type="button" class="pck pck-dd btn btn-default dropdown-toggle" data-toggle="dropdown">
Dropdown
<span class="caret"></span>
</button>
<div class="dropdown-menu"></div>
</div>
<div class="btn-group">
<button type="button" class="btn btn-primary">Action</button>
<button type="button" class="pck pck-dd btn btn-primary dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu"></div>
</div>
<p class="help-block"><br>
Note: In dropdowns the placement is controlled by the Bootstrap dropdown plugin
</p>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<button class="btn btn-danger action-destroy">Destroy instances</button>
<button class="btn btn-default action-create">Create instances</button>
</div>
</div>
</div>
<footer>
created by Javier Aguilar <a href="http://mjolnic.com" target="_blank">@mjolnic</a>
</footer>
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="dist/js/bootstrap-picker.js"></script>
<script>
$(function() {
$('.action-destroy').on('click', function() {
$.picker.batch('.pck.picker-element', 'destroy');
});
// Live binding of buttons
$(document).on('click', '.action-placement', function(e) {
$('.action-placement').removeClass('active');
$(this).addClass('active');
$('.pck-opts').data('picker').updatePlacement($(this).text());
e.preventDefault();
return false;
});
$('.action-create').on('click', function() {
$('.pck-auto').picker();
$('.pck-dd').each(function() {
var $this = $(this);
$this.picker({
title: 'Dropdown with picker',
container: $(' ~ .dropdown-menu:first', $this)
});
});
$('.pck-opts').picker({
title: 'With custom options',
items: [
'♥', '♠', '♣', '♦',
'★', '☺', '☼', '♫',
],
selectedCustomClass: 'label label-success',
mustAccept: true,
placement: 'bottomRight',
showFooter: true,
// note that this is ignored cause we have an accept button:
hideOnSelect: true,
templates: {
search: false,
footer: '<div class="popover-footer">' +
'<div style="text-align:left; font-size:12px;">Placements: \n\
<a href="#" class=" action-placement">inline</a>\n\
<a href="#" class=" action-placement">topLeftCorner</a>\n\
<a href="#" class=" action-placement">topLeft</a>\n\
<a href="#" class=" action-placement">top</a>\n\
<a href="#" class=" action-placement">topRight</a>\n\
<a href="#" class=" action-placement">topRightCorner</a>\n\
<a href="#" class=" action-placement">rightTop</a>\n\
<a href="#" class=" action-placement">right</a>\n\
<a href="#" class=" action-placement">rightBottom</a>\n\
<a href="#" class=" action-placement">bottomRightCorner</a>\n\
<a href="#" class=" active action-placement">bottomRight</a>\n\
<a href="#" class=" action-placement">bottom</a>\n\
<a href="#" class=" action-placement">bottomLeft</a>\n\
<a href="#" class=" action-placement">bottomLeftCorner</a>\n\
<a href="#" class=" action-placement">leftBottom</a>\n\
<a href="#" class=" action-placement">left</a>\n\
<a href="#" class=" action-placement">leftTop</a>\n\
</div><hr></div>'}
}).data('picker').show();
}).trigger('click');
});
</script>
</body>
</html>