bootstrap-timepicker-rails 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/README.md +44 -0
- data/Rakefile +29 -0
- data/bootstrap-timepicker-rails.gemspec +19 -0
- data/lib/bootstrap-timepicker-rails.rb +12 -0
- data/lib/bootstrap-timepicker-rails/engine.rb +6 -0
- data/lib/bootstrap-timepicker-rails/railtie.rb +5 -0
- data/lib/bootstrap-timepicker-rails/version.rb +5 -0
- data/vendor/assets/javascripts/bootstrap-timepicker/bootstrap-timepicker.js +377 -0
- data/vendor/assets/stylesheets/timepicker.less +88 -0
- metadata +104 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# Bootstrap Timepicker for Rails
|
2
|
+
This is the gemified version of https://github.com/jdewit/bootstrap-timepicker
|
3
|
+
|
4
|
+
bootstrap-timepicker-rails project integrates Timepicker with Rails 3 assets pipeline.
|
5
|
+
|
6
|
+
https://github.com/jdewit/bootstrap-timepicker
|
7
|
+
|
8
|
+
## Rails > 3.1
|
9
|
+
Include bootstrap-timepicker-rails in Gemfile;
|
10
|
+
|
11
|
+
``` ruby
|
12
|
+
gem 'bootstrap-timepicker-rails'
|
13
|
+
```
|
14
|
+
|
15
|
+
or you can install from latest build;
|
16
|
+
|
17
|
+
``` ruby
|
18
|
+
gem 'bootstrap-timepicker-rails', :require => 'bootstrap-timepicker-rails',
|
19
|
+
:git => 'git://github.com/tispratik/bootstrap-timepicker-rails.git'
|
20
|
+
```
|
21
|
+
|
22
|
+
and run bundle install.
|
23
|
+
|
24
|
+
## Configuration
|
25
|
+
|
26
|
+
Add this line to app/assets/stylesheets/application.css
|
27
|
+
|
28
|
+
``` css
|
29
|
+
*= require bootstrap-timepicker
|
30
|
+
```
|
31
|
+
|
32
|
+
Add this line to app/assets/javascripts/application.js
|
33
|
+
|
34
|
+
``` javascript
|
35
|
+
//= require bootstrap-timepicker
|
36
|
+
```
|
37
|
+
|
38
|
+
## Using bootstrap-timepicker-rails
|
39
|
+
|
40
|
+
Just call timepicker() with any selector.
|
41
|
+
|
42
|
+
```javascript
|
43
|
+
$('.timepicker').timepicker()
|
44
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require File.expand_path('../lib/bootstrap-timepicker-rails/version', __FILE__)
|
3
|
+
|
4
|
+
desc "Update assets"
|
5
|
+
task 'update' do
|
6
|
+
system("rm -rf bootstrap-timepicker-src")
|
7
|
+
system("git clone git://github.com/jdewit/bootstrap-timepicker.git bootstrap-timepicker-src")
|
8
|
+
system("cp bootstrap-timepicker-src/css/timepicker.less vendor/assets/stylesheets/bootstrap-timepicker.less")
|
9
|
+
system("cp bootstrap-timepicker-src/js/bootstrap-timepicker.js vendor/assets/javascripts/bootstrap-timepicker/bootstrap-timepicker.js")
|
10
|
+
system("git status")
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Build the gem"
|
14
|
+
task "build" do
|
15
|
+
system("gem build bootstrap-timepicker-rails.gemspec")
|
16
|
+
end
|
17
|
+
|
18
|
+
desc "Publish the gem"
|
19
|
+
task 'publish' do
|
20
|
+
system("gem push bootstrap-timepicker-rails-#{BootstrapTimepickerRails::Rails::VERSION}.gem")
|
21
|
+
system("git push")
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "Build and publish the gem"
|
25
|
+
task "release" do
|
26
|
+
system("gem build bootstrap-timepicker-rails.gemspec")
|
27
|
+
system("gem push bootstrap-timepicker-rails-#{BootstrapTimepickerRails::Rails::VERSION}.gem")
|
28
|
+
system("git push")
|
29
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/bootstrap-timepicker-rails/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Pratik Khadloya"]
|
6
|
+
gem.email = ["tispratik@gmail.com"]
|
7
|
+
gem.description = %q{Gemified https://github.com/jdewit/bootstrap-timepicker}
|
8
|
+
gem.homepage = "https://github.com/jdewit/bootstrap-timepicker"
|
9
|
+
gem.summary = gem.description
|
10
|
+
|
11
|
+
gem.name = "bootstrap-timepicker-rails"
|
12
|
+
gem.require_paths = ["lib"]
|
13
|
+
gem.files = `git ls-files`.split("\n")
|
14
|
+
gem.version = BootstrapTimepickerRails::Rails::VERSION
|
15
|
+
|
16
|
+
gem.add_dependency "railties", ">= 3.0"
|
17
|
+
gem.add_development_dependency "bundler", ">= 1.0"
|
18
|
+
gem.add_development_dependency "rake"
|
19
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "rails"
|
2
|
+
require "bootstrap-timepicker-rails/version"
|
3
|
+
|
4
|
+
module BootstrapTimepickerRails
|
5
|
+
module Rails
|
6
|
+
if ::Rails.version < "3.1"
|
7
|
+
require "bootstrap-timepicker-rails/railtie"
|
8
|
+
else
|
9
|
+
require "bootstrap-timepicker-rails/engine"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,377 @@
|
|
1
|
+
/* =========================================================
|
2
|
+
* bootstrap-timepicker.js
|
3
|
+
* http://www.github.com/jdewit/bootstrap-timepicker
|
4
|
+
* =========================================================
|
5
|
+
* Copyright 2012
|
6
|
+
*
|
7
|
+
* Created By:
|
8
|
+
* Joris de Wit @joris_dewit
|
9
|
+
* Gilbert @mindeavor
|
10
|
+
*
|
11
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
12
|
+
* you may not use this file except in compliance with the License.
|
13
|
+
* You may obtain a copy of the License at
|
14
|
+
*
|
15
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
16
|
+
*
|
17
|
+
* Unless required by applicable law or agreed to in writing, software
|
18
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
19
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
20
|
+
* See the License for the specific language governing permissions and
|
21
|
+
* limitations under the License.
|
22
|
+
* ========================================================= */
|
23
|
+
|
24
|
+
!function($) {
|
25
|
+
|
26
|
+
"use strict"; // jshint ;_;
|
27
|
+
|
28
|
+
/* TIMEPICKER PUBLIC CLASS DEFINITION
|
29
|
+
* ================================== */
|
30
|
+
var Timepicker = function(element, options) {
|
31
|
+
this.$element = $(element);
|
32
|
+
this.options = $.extend({}, $.fn.timepicker.defaults, options, this.$element.data());
|
33
|
+
this.minuteStep = this.options.minuteStep || this.minuteStep;
|
34
|
+
this.showMeridian = this.options.showMeridian || this.showMeridian;
|
35
|
+
this.disableFocus = this.options.disableFocus || this.disableFocus;
|
36
|
+
this.template = this.options.template || this.template;
|
37
|
+
this.defaultTime = this.options.defaultTime || this.defaultTime;
|
38
|
+
this.open = false;
|
39
|
+
this.init();
|
40
|
+
};
|
41
|
+
|
42
|
+
Timepicker.prototype = {
|
43
|
+
|
44
|
+
constructor: Timepicker
|
45
|
+
|
46
|
+
, init: function () {
|
47
|
+
|
48
|
+
this.$element
|
49
|
+
.on('click', $.proxy(this.show, this))
|
50
|
+
.on('keyup', $.proxy(this.updateFromElementVal, this))
|
51
|
+
;
|
52
|
+
|
53
|
+
this.$widget = $(this.getTemplate()).appendTo('body');
|
54
|
+
|
55
|
+
this.$widget.on('click', $.proxy(this.click, this));
|
56
|
+
|
57
|
+
this.setDefaultTime(this.defaultTime);
|
58
|
+
}
|
59
|
+
|
60
|
+
, show: function(e) {
|
61
|
+
e.stopPropagation();
|
62
|
+
e.preventDefault();
|
63
|
+
|
64
|
+
this.$element.trigger('show');
|
65
|
+
|
66
|
+
$('html').on('click.timepicker.data-api', $.proxy(this.hide, this));
|
67
|
+
|
68
|
+
if (true === this.disableFocus) {
|
69
|
+
this.$element.blur();
|
70
|
+
}
|
71
|
+
|
72
|
+
var pos = $.extend({}, this.$element.offset(), {
|
73
|
+
height: this.$element[0].offsetHeight
|
74
|
+
});
|
75
|
+
|
76
|
+
if (this.options.template === 'modal') {
|
77
|
+
// this.$widget.css({
|
78
|
+
// top: pos.top + pos.height
|
79
|
+
// })
|
80
|
+
|
81
|
+
this.$widget.modal('show');
|
82
|
+
} else {
|
83
|
+
this.$widget.css({
|
84
|
+
top: pos.top + pos.height
|
85
|
+
, left: pos.left
|
86
|
+
})
|
87
|
+
|
88
|
+
if (!this.open) {
|
89
|
+
this.$widget.addClass('open');
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
this.open = true;
|
94
|
+
this.$element.trigger('shown');
|
95
|
+
|
96
|
+
return this;
|
97
|
+
}
|
98
|
+
|
99
|
+
, hide: function(){
|
100
|
+
this.$element.trigger('hide');
|
101
|
+
|
102
|
+
$('html').off('click.timepicker.data-api', $.proxy(this.hide, this));
|
103
|
+
|
104
|
+
if (this.options.template === 'modal') {
|
105
|
+
this.$widget.modal('hide');
|
106
|
+
} else {
|
107
|
+
this.$widget.removeClass('open');
|
108
|
+
}
|
109
|
+
this.open = false;
|
110
|
+
this.$element.trigger('hidden');
|
111
|
+
|
112
|
+
return this;
|
113
|
+
}
|
114
|
+
|
115
|
+
, setValues: function(time) {
|
116
|
+
var meridian, match = time.match(/(AM|PM)/i);
|
117
|
+
if (match) {
|
118
|
+
meridian = match[1];
|
119
|
+
}
|
120
|
+
time = $.trim(time.replace(/(PM|AM)/i, ''));
|
121
|
+
var timeArray = time.split(':');
|
122
|
+
|
123
|
+
this.meridian = meridian;
|
124
|
+
this.hour = parseInt(timeArray[0], 10);
|
125
|
+
this.minute = parseInt(timeArray[1], 10);
|
126
|
+
}
|
127
|
+
|
128
|
+
, setDefaultTime: function(defaultTime){
|
129
|
+
if (defaultTime) {
|
130
|
+
if (defaultTime === 'current') {
|
131
|
+
var dTime = new Date();
|
132
|
+
var hours = dTime.getHours();
|
133
|
+
var minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep;
|
134
|
+
|
135
|
+
var meridian = "AM";
|
136
|
+
if (hours === 0) {
|
137
|
+
hours = 12;
|
138
|
+
} else if (hours > 12) {
|
139
|
+
hours = hours - 12;
|
140
|
+
meridian = "PM";
|
141
|
+
} else {
|
142
|
+
meridian = "AM";
|
143
|
+
}
|
144
|
+
|
145
|
+
this.hour = hours;
|
146
|
+
this.minute = minutes;
|
147
|
+
this.meridian = meridian;
|
148
|
+
} else {
|
149
|
+
this.setValues(defaultTime);
|
150
|
+
}
|
151
|
+
this.update();
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
, formatTime: function(hour, minute, meridian) {
|
156
|
+
hour = hour < 10 ? '0' + hour : hour;
|
157
|
+
minute = minute < 10 ? '0' + minute : minute;
|
158
|
+
|
159
|
+
return hour + ':' + minute + ( this.showMeridian ? ' ' + meridian : '' );
|
160
|
+
}
|
161
|
+
|
162
|
+
, getTime: function() {
|
163
|
+
return this.formatTime(this.hour, this.minute, this.meridian);
|
164
|
+
}
|
165
|
+
|
166
|
+
, setTime: function(time) {
|
167
|
+
this.setValues(time);
|
168
|
+
this.update();
|
169
|
+
}
|
170
|
+
|
171
|
+
, updateElement: function() {
|
172
|
+
var time = this.getTime();
|
173
|
+
|
174
|
+
this.$element.val(time);
|
175
|
+
}
|
176
|
+
|
177
|
+
, updateWidget: function() {
|
178
|
+
this.$widget
|
179
|
+
.find('td.bootstrap-timepicker-hour').text(this.hour).end()
|
180
|
+
.find('td.bootstrap-timepicker-minute').text(this.minute < 10 ? '0' + this.minute : this.minute).end()
|
181
|
+
.find('td.bootstrap-timepicker-meridian').text(this.meridian);
|
182
|
+
}
|
183
|
+
|
184
|
+
, update: function() {
|
185
|
+
this.updateElement();
|
186
|
+
this.updateWidget();
|
187
|
+
}
|
188
|
+
|
189
|
+
, updateFromElementVal: function () {
|
190
|
+
var time = this.$element.val();
|
191
|
+
if (time) {
|
192
|
+
this.setValues(time);
|
193
|
+
this.updateWidget();
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
, click: function(e) {
|
198
|
+
e.stopPropagation();
|
199
|
+
e.preventDefault();
|
200
|
+
|
201
|
+
if (true !== this.disableFocus) {
|
202
|
+
this.$element.focus();
|
203
|
+
}
|
204
|
+
|
205
|
+
var action = $(e.target).closest('a').data('action');
|
206
|
+
if (action) {
|
207
|
+
this[action]();
|
208
|
+
this.update();
|
209
|
+
}
|
210
|
+
|
211
|
+
}
|
212
|
+
|
213
|
+
, incrementHour: function() {
|
214
|
+
if ( this.showMeridian ) {
|
215
|
+
if ( this.hour === 12 ) {
|
216
|
+
this.hour = 1;
|
217
|
+
return this.toggleMeridian();
|
218
|
+
}
|
219
|
+
}
|
220
|
+
if ( this.hour === 23 ) {
|
221
|
+
return this.hour = 0;
|
222
|
+
}
|
223
|
+
this.hour = this.hour + 1;
|
224
|
+
}
|
225
|
+
|
226
|
+
, decrementHour: function() {
|
227
|
+
if ( this.showMeridian ) {
|
228
|
+
if (this.hour === 1) {
|
229
|
+
this.hour = 12;
|
230
|
+
return this.toggleMeridian();
|
231
|
+
}
|
232
|
+
}
|
233
|
+
if (this.hour === 0) {
|
234
|
+
return this.hour = 23;
|
235
|
+
}
|
236
|
+
this.hour = this.hour - 1;
|
237
|
+
}
|
238
|
+
|
239
|
+
, incrementMinute: function() {
|
240
|
+
var newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
|
241
|
+
if (newVal > 59) {
|
242
|
+
this.incrementHour();
|
243
|
+
this.minute = newVal - 60;
|
244
|
+
} else {
|
245
|
+
this.minute = newVal;
|
246
|
+
}
|
247
|
+
}
|
248
|
+
|
249
|
+
, decrementMinute: function() {
|
250
|
+
var newVal = this.minute - this.minuteStep;
|
251
|
+
if (newVal < 0) {
|
252
|
+
this.decrementHour();
|
253
|
+
this.minute = newVal + 60;
|
254
|
+
} else {
|
255
|
+
this.minute = newVal;
|
256
|
+
}
|
257
|
+
}
|
258
|
+
|
259
|
+
, toggleMeridian: function() {
|
260
|
+
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
|
261
|
+
|
262
|
+
this.update();
|
263
|
+
}
|
264
|
+
|
265
|
+
, getTemplate: function() {
|
266
|
+
if (this.options.templates[this.options.template]) {
|
267
|
+
return this.options.templates[this.options.template];
|
268
|
+
}
|
269
|
+
var template;
|
270
|
+
switch(this.options.template) {
|
271
|
+
case 'modal':
|
272
|
+
template = '<div class="bootstrap-timepicker modal hide fade in" style="top: 30%; margin-top: 0; width: 200px; margin-left: -100px;" data-backdrop="false">'+
|
273
|
+
'<div class="modal-header">'+
|
274
|
+
'<a href="#" class="close" data-action="hide">×</a>'+
|
275
|
+
'<h3>Pick a Time</h3>'+
|
276
|
+
'</div>'+
|
277
|
+
'<div class="modal-content">'+
|
278
|
+
'<table>'+
|
279
|
+
'<tr>'+
|
280
|
+
'<td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td>'+
|
281
|
+
'<td class="separator"></td>'+
|
282
|
+
'<td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+
|
283
|
+
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>' : '' ) +
|
284
|
+
'</tr>'+
|
285
|
+
'<tr>'+
|
286
|
+
'<td class="bootstrap-timepicker-hour"></td> '+
|
287
|
+
'<td class="separator">:</td>'+
|
288
|
+
'<td class="bootstrap-timepicker-minute"></td> '+
|
289
|
+
( this.showMeridian ? '<td class="bootstrap-timepicker-meridian"></td>' : '' ) +
|
290
|
+
'</tr>'+
|
291
|
+
'<tr>'+
|
292
|
+
'<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
|
293
|
+
'<td class="separator"></td>'+
|
294
|
+
'<td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+
|
295
|
+
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>' : '' ) +
|
296
|
+
'</tr>'+
|
297
|
+
'</table>'+
|
298
|
+
'</div>'+
|
299
|
+
'<div class="modal-footer">'+
|
300
|
+
'<a href="#" class="btn btn-primary" data-action="hide">Ok</a>'+
|
301
|
+
'</div>'+
|
302
|
+
'</div>';
|
303
|
+
|
304
|
+
break;
|
305
|
+
case 'dropdown':
|
306
|
+
template = '<div class="bootstrap-timepicker dropdown-menu">'+
|
307
|
+
'<table>'+
|
308
|
+
'<tr>'+
|
309
|
+
'<td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td>'+
|
310
|
+
'<td class="separator"></td>'+
|
311
|
+
'<td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+
|
312
|
+
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>' : '' ) +
|
313
|
+
'</tr>'+
|
314
|
+
'<tr>'+
|
315
|
+
'<td class="bootstrap-timepicker-hour"></td> '+
|
316
|
+
'<td class="separator">:</td>'+
|
317
|
+
'<td class="bootstrap-timepicker-minute"></td> '+
|
318
|
+
( this.showMeridian ? '<td class="bootstrap-timepicker-meridian"></td>' : '' ) +
|
319
|
+
'</tr>'+
|
320
|
+
'<tr>'+
|
321
|
+
'<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
|
322
|
+
'<td class="separator"></td>'+
|
323
|
+
'<td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+
|
324
|
+
( this.showMeridian ? '<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>' : '' ) +
|
325
|
+
'</tr>'+
|
326
|
+
'</table>'+
|
327
|
+
'</div>';
|
328
|
+
break;
|
329
|
+
|
330
|
+
}
|
331
|
+
return template;
|
332
|
+
}
|
333
|
+
};
|
334
|
+
|
335
|
+
|
336
|
+
/* TIMEPICKER PLUGIN DEFINITION
|
337
|
+
* =========================== */
|
338
|
+
|
339
|
+
$.fn.timepicker = function (option) {
|
340
|
+
return this.each(function () {
|
341
|
+
var $this = $(this)
|
342
|
+
, data = $this.data('timepicker')
|
343
|
+
, options = typeof option == 'object' && option;
|
344
|
+
if (!data) {
|
345
|
+
$this.data('timepicker', (data = new Timepicker(this, options)));
|
346
|
+
}
|
347
|
+
if (typeof option == 'string') {
|
348
|
+
data[option]();
|
349
|
+
}
|
350
|
+
})
|
351
|
+
}
|
352
|
+
|
353
|
+
$.fn.timepicker.defaults = {
|
354
|
+
minuteStep: 15
|
355
|
+
, disableFocus: false
|
356
|
+
, defaultTime: 'current'
|
357
|
+
, showMeridian: true
|
358
|
+
, template: 'dropdown'
|
359
|
+
, templates: {} // set custom templates
|
360
|
+
}
|
361
|
+
|
362
|
+
$.fn.timepicker.Constructor = Timepicker
|
363
|
+
|
364
|
+
/* TIMEPICKER DATA-API
|
365
|
+
* ================== */
|
366
|
+
|
367
|
+
$(function () {
|
368
|
+
$('body').on('focus.timepicker.data-api', '[data-provide="timepicker"]', function (e) {
|
369
|
+
var $this = $(this);
|
370
|
+
if ($this.data('timepicker')) {
|
371
|
+
return;
|
372
|
+
}
|
373
|
+
e.preventDefault();
|
374
|
+
$this.timepicker($this.data());
|
375
|
+
})
|
376
|
+
})
|
377
|
+
}(window.jQuery);
|
@@ -0,0 +1,88 @@
|
|
1
|
+
/*!
|
2
|
+
* Timepicker for Bootstrap
|
3
|
+
*
|
4
|
+
* Copyright 2012 Joris de Wit, Stefan Petre, Andrew Rowls
|
5
|
+
* Licensed under the Apache License v2.0
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
.bootstrap-timepicker {
|
10
|
+
&.dropdown-menu {
|
11
|
+
top: 0;
|
12
|
+
left: 0;
|
13
|
+
padding: 4px;
|
14
|
+
margin-top: 1px;
|
15
|
+
-webkit-border-radius: 4px;
|
16
|
+
-moz-border-radius: 4px;
|
17
|
+
border-radius: 4px;
|
18
|
+
display: none;
|
19
|
+
|
20
|
+
&.open {
|
21
|
+
display: inline-block;
|
22
|
+
}
|
23
|
+
|
24
|
+
&:before {
|
25
|
+
content: '';
|
26
|
+
border-left: 7px solid transparent;
|
27
|
+
border-right: 7px solid transparent;
|
28
|
+
border-bottom: 7px solid #ccc;
|
29
|
+
border-bottom-color: rgba(0, 0, 0, 0.2);
|
30
|
+
position: absolute;
|
31
|
+
top: -7px;
|
32
|
+
left: 6px;
|
33
|
+
}
|
34
|
+
|
35
|
+
&:after {
|
36
|
+
content: '';
|
37
|
+
border-left: 6px solid transparent;
|
38
|
+
border-right: 6px solid transparent;
|
39
|
+
border-bottom: 6px solid #ffffff;
|
40
|
+
position: absolute;
|
41
|
+
top: -6px;
|
42
|
+
left: 7px;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
&.modal {
|
47
|
+
top: 30%;
|
48
|
+
margin-top: 0;
|
49
|
+
width: 200px;
|
50
|
+
margin-left: -100px;
|
51
|
+
|
52
|
+
.modal-content {
|
53
|
+
padding: 0;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
table {
|
58
|
+
width: 100%;
|
59
|
+
margin: 0;
|
60
|
+
}
|
61
|
+
|
62
|
+
td, th {
|
63
|
+
text-align: center;
|
64
|
+
height: 20px;
|
65
|
+
-webkit-border-radius: 4px;
|
66
|
+
-moz-border-radius: 4px;
|
67
|
+
border-radius: 4px;
|
68
|
+
}
|
69
|
+
|
70
|
+
td.separator {
|
71
|
+
width: 1px;
|
72
|
+
}
|
73
|
+
|
74
|
+
td a {
|
75
|
+
border: 1px transparent solid;
|
76
|
+
display: block;
|
77
|
+
margin: 4px;
|
78
|
+
padding: 4px 0;
|
79
|
+
|
80
|
+
&:hover {
|
81
|
+
background-color: #eee;
|
82
|
+
-webkit-border-radius: 4px;
|
83
|
+
-moz-border-radius: 4px;
|
84
|
+
border-radius: 4px;
|
85
|
+
border-color: #ddd;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
metadata
ADDED
@@ -0,0 +1,104 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bootstrap-timepicker-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Pratik Khadloya
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: railties
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
description: Gemified https://github.com/jdewit/bootstrap-timepicker
|
63
|
+
email:
|
64
|
+
- tispratik@gmail.com
|
65
|
+
executables: []
|
66
|
+
extensions: []
|
67
|
+
extra_rdoc_files: []
|
68
|
+
files:
|
69
|
+
- .gitignore
|
70
|
+
- Gemfile
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- bootstrap-timepicker-rails.gemspec
|
74
|
+
- lib/bootstrap-timepicker-rails.rb
|
75
|
+
- lib/bootstrap-timepicker-rails/engine.rb
|
76
|
+
- lib/bootstrap-timepicker-rails/railtie.rb
|
77
|
+
- lib/bootstrap-timepicker-rails/version.rb
|
78
|
+
- vendor/assets/javascripts/bootstrap-timepicker/bootstrap-timepicker.js
|
79
|
+
- vendor/assets/stylesheets/timepicker.less
|
80
|
+
homepage: https://github.com/jdewit/bootstrap-timepicker
|
81
|
+
licenses: []
|
82
|
+
post_install_message:
|
83
|
+
rdoc_options: []
|
84
|
+
require_paths:
|
85
|
+
- lib
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
94
|
+
requirements:
|
95
|
+
- - ! '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
requirements: []
|
99
|
+
rubyforge_project:
|
100
|
+
rubygems_version: 1.8.22
|
101
|
+
signing_key:
|
102
|
+
specification_version: 3
|
103
|
+
summary: Gemified https://github.com/jdewit/bootstrap-timepicker
|
104
|
+
test_files: []
|