bootstrap_form_extensions 1.2.1 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/app/assets/javascripts/bootstrap_form_extensions/index.js +0 -1
  3. data/app/assets/javascripts/bootstrap_form_extensions/select_or_new.js +1 -1
  4. data/app/assets/stylesheets/bootstrap_form_extensions/index.css +0 -1
  5. data/app/assets/stylesheets/bootstrap_form_extensions/select_or_new.css +5 -2
  6. data/app/views/bootstrap_form_extensions/_submit_bar.html.erb +18 -13
  7. data/lib/bootstrap_form_extensions.rb +0 -3
  8. data/lib/bootstrap_form_extensions/arrayed_field.rb +8 -8
  9. data/lib/bootstrap_form_extensions/helpers.rb +0 -7
  10. data/lib/bootstrap_form_extensions/select_or_new.rb +3 -2
  11. data/lib/bootstrap_form_extensions/version.rb +1 -1
  12. data/test/arrayed_field_test.rb +9 -9
  13. data/test/dummy/app/models/thing.rb +0 -2
  14. data/test/dummy/config/application.rb +0 -3
  15. data/test/dummy/db/migrate/20150918185031_create_things.rb +1 -1
  16. data/test/dummy/db/migrate/20150924203053_add_timespan.rb +1 -1
  17. data/test/dummy/db/migrate/20150929213249_add_arrayed_field.rb +1 -1
  18. data/test/dummy/db/migrate/20151006171627_add_another_arrayed_field.rb +1 -1
  19. data/test/dummy/db/migrate/20151006181943_add_json_field.rb +1 -1
  20. data/test/dummy/db/migrate/20151007213131_add_scheduler_field.rb +1 -1
  21. data/test/dummy/db/migrate/20151106165522_add_category.rb +1 -1
  22. data/test/dummy/db/migrate/20151119160842_add_duration.rb +1 -1
  23. data/test/dummy/db/schema.rb +9 -10
  24. data/test/dummy/db/test.sqlite3 +0 -0
  25. data/test/dummy/log/test.log +4161 -843
  26. data/test/duration_test.rb +1 -1
  27. data/test/javascripts/arrayed_field_spec.js +15 -15
  28. data/test/javascripts/scheduler_spec.js +2 -2
  29. data/test/javascripts/select_or_new_spec.js +7 -7
  30. data/test/scheduler_test.rb +1 -1
  31. data/test/select_or_new_test.rb +4 -4
  32. data/test/submit_bar_test.rb +19 -14
  33. data/test/test_helper.rb +1 -1
  34. metadata +50 -77
  35. data/app/assets/javascripts/bootstrap_form_extensions/bootstrap-timepicker.min.js +0 -5
  36. data/app/assets/javascripts/bootstrap_form_extensions/time_picker.js +0 -61
  37. data/app/assets/stylesheets/bootstrap_form_extensions/bootstrap-timepicker.min.css +0 -10
  38. data/app/assets/stylesheets/bootstrap_form_extensions/common.css +0 -11
  39. data/app/assets/stylesheets/bootstrap_form_extensions/submit_bar.css +0 -4
  40. data/lib/bootstrap_form_extensions/date_time_pickers.rb +0 -83
  41. data/test/date_time_pickers_test.rb +0 -50
  42. data/test/dummy/db/migrate/20151030194330_add_date_time.rb +0 -7
  43. data/test/javascripts/time_picker_spec.js +0 -42
@@ -8,7 +8,7 @@ class DurationTest < ActionView::TestCase
8
8
  end
9
9
 
10
10
  test "duration" do
11
- expected = '<div class="form-group duration-group" data-duration="true"><label class="control-label col-sm-2" for="thing_duration_in_seconds2">Duration in seconds2</label><div class="col-sm-10 form-inline"><input class="duration-seconds" data-formatted="1:37:23.476" type="hidden" value="5843.476" name="thing[duration_in_seconds2]" id="thing_duration_in_seconds2" /><input type="number" name="thing[hours]" id="thing_hours" value="1" class="form-control hours" min="0" pattern="[0-9]*" />:<input type="number" name="thing[minutes]" id="thing_minutes" value="37" class="form-control minutes" min="0" pattern="[0-9]*" max="59" />:<input type="number" name="thing[seconds]" id="thing_seconds" value="23" class="form-control seconds" min="0" pattern="[0-9]*" max="59" />.<input type="number" name="thing[milliseconds]" id="thing_milliseconds" value="476" class="form-control milliseconds" min="0" pattern="[0-9]*" max="999" /></div></div>'
11
+ expected = '<div class="form-group duration-group" data-duration="true"><label class="control-label col-2" for="thing_duration_in_seconds2">Duration in seconds2</label><div class="col-10 form-inline"><input class="duration-seconds" data-formatted="1:37:23.476" type="hidden" value="5843.476" name="thing[duration_in_seconds2]" id="thing_duration_in_seconds2" /><input type="number" name="thing[hours]" id="thing_hours" value="1" class="form-control hours" min="0" pattern="[0-9]*" />:<input type="number" name="thing[minutes]" id="thing_minutes" value="37" class="form-control minutes" min="0" pattern="[0-9]*" max="59" />:<input type="number" name="thing[seconds]" id="thing_seconds" value="23" class="form-control seconds" min="0" pattern="[0-9]*" max="59" />.<input type="number" name="thing[milliseconds]" id="thing_milliseconds" value="476" class="form-control milliseconds" min="0" pattern="[0-9]*" max="999" /></div></div>'
12
12
  assert_equal expected, @builder.duration(:duration_in_seconds2)
13
13
  end
14
14
 
@@ -40,36 +40,36 @@ describe("ArrayedField", function() {
40
40
  var fixture = function() {
41
41
  return '<div data-arrayed-field="true">'
42
42
  +' <div class="blueprint-for-arrayed-field" style="display:none;">'
43
- +' <div class="row voffset1">'
44
- +' <div class="col-sm-11">'
43
+ +' <div class="row mt-1">'
44
+ +' <div class="col-11">'
45
45
  +' <input type="url" id="" class="form-control" data-name="thing[urls][]" />'
46
46
  +' </div>'
47
- +' <div class="col-sm-1">'
48
- +' <a class="btn btn-default remove-arrayed-field-row" href="javascript:void(0);"><i class="glyphicon glyphicon-trash"></i></a>'
47
+ +' <div class="col-1">'
48
+ +' <a class="btn btn-default remove-arrayed-field-row" href="javascript:void(0);">&times;</a>'
49
49
  +' </div>'
50
50
  +' </div>'
51
51
  +' </div>'
52
52
  +' <div class="arrayed-field-rows">'
53
- +' <div class="row voffset1">'
54
- +' <div class="col-sm-11">'
53
+ +' <div class="row mt-1">'
54
+ +' <div class="col-11">'
55
55
  +' <input type="url" id="" class="form-control" name="thing[urls][]" />'
56
56
  +' </div>'
57
- +' <div class="col-sm-1">'
58
- +' <a class="btn btn-default remove-arrayed-field-row" href="javascript:void(0);"><i class="glyphicon glyphicon-trash"></i></a>'
57
+ +' <div class="col-1">'
58
+ +' <a class="btn btn-default remove-arrayed-field-row" href="javascript:void(0);">&times;</a>'
59
59
  +' </div>'
60
60
  +' </div>'
61
- +' <div class="row voffset1">'
62
- +' <div class="col-sm-11">'
61
+ +' <div class="row mt-1">'
62
+ +' <div class="col-11">'
63
63
  +' <input type="url" id="" class="form-control" name="thing[urls][]" />'
64
64
  +' </div>'
65
- +' <div class="col-sm-1">'
66
- +' <a class="btn btn-default remove-arrayed-field-row" href="javascript:void(0);"><i class="glyphicon glyphicon-trash"></i></a>'
65
+ +' <div class="col-1">'
66
+ +' <a class="btn btn-default remove-arrayed-field-row" href="javascript:void(0);">&times;</a>'
67
67
  +' </div>'
68
68
  +' </div>'
69
69
  +' </div>'
70
- +' <div class="row voffset1">'
71
- +' <div class="col-sm-12">'
72
- +' <a class="btn btn-default add-arrayed-field-row" href="javascript:void(0);"><i class="glyphicon glyphicon-plus"></i></a>'
70
+ +' <div class="row mt-1">'
71
+ +' <div class="col-12">'
72
+ +' <a class="btn btn-default add-arrayed-field-row" href="javascript:void(0);">+</a>'
73
73
  +' </div>'
74
74
  +' </div>'
75
75
  +'</div>'
@@ -39,8 +39,8 @@ describe("Scheduler", function() {
39
39
  var $element
40
40
  var fixture = function() {
41
41
  return '<div class="form-group" data-scheduler="true">'
42
- +' <label class="control-label col-sm-2" for="thing_schedule">Schedule</label>'
43
- +' <div class="col-sm-10">'
42
+ +' <label class="control-label col-2" for="thing_schedule">Schedule</label>'
43
+ +' <div class="col-10">'
44
44
  +' <input class="scheduler-hidden-field" id="thing_schedule" name="thing[schedule]" type="hidden" value="[[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true]]">'
45
45
  +' <table class="scheduler-badge">'
46
46
  +' <tbody>'
@@ -39,18 +39,18 @@ describe("SelectOrNew", function() {
39
39
  var $element, $select, $input, $inputGroup
40
40
  var fixture = function() {
41
41
  return '<div class="form-group" data-select-or-new="true">'
42
- +' <label class="control-label col-sm-2" for="thing_category">Category</label>'
43
- +' <div class="col-sm-10">'
44
- +' <select class="form-control" id="thing_category" name="thing[category]">'
42
+ +' <label class="control-label col-2" for="thing_category">Category</label>'
43
+ +' <div class="col-10">'
44
+ +' <select class="form-control" name="thing[category]" id="thing_category">'
45
45
  +' <option value="">Please select</option>'
46
46
  +' <option value="1">One</option>'
47
47
  +' <option value="2">Two</option>'
48
48
  +' <option value="0">New...</option>'
49
49
  +' </select>'
50
50
  +' <div class="input-group" style="display: none;">'
51
- +' <input class="form-control" id="thing_new_category" name="thing[new_category]" placeholder="New..." type="text">'
52
- +' <div class="input-group-addon select-or-new-cancel">'
53
- +' <i class="text-danger glyphicon glyphicon-remove"></i>'
51
+ +' <input type="text" name="thing[new_category]" id="thing_new_category" value="New Category" class="form-control" placeholder="New...">'
52
+ +' <div class="input-group-append select-or-new-cancel">'
53
+ +' <button class="btn btn-outline-danger" type="button">×</button>'
54
54
  +' </div>'
55
55
  +' </div>'
56
56
  +' </div>'
@@ -64,7 +64,7 @@ describe("SelectOrNew", function() {
64
64
  $select = $element.find('select')
65
65
  $input = $element.find('input')
66
66
  $inputGroup = $element.find('div.input-group')
67
- $cancelNew = $element.find('div.select-or-new-cancel')
67
+ $cancelNew = $element.find('div.select-or-new-cancel button')
68
68
 
69
69
  $element.bootstrapSelectOrNew()
70
70
  })
@@ -8,7 +8,7 @@ class SchedulerTest < ActionView::TestCase
8
8
  end
9
9
 
10
10
  test "scheduler" do
11
- expected = '<div class="form-group" data-scheduler="true"><label class="control-label col-sm-2" for="thing_schedule">Schedule</label><div class="col-sm-10"><input value="[[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true]]" class="scheduler-hidden-field" type="hidden" name="thing[schedule]" id="thing_schedule" /><table class="scheduler-badge"><tbody><tr><td class="off" data-day="0" data-hour="0">&nbsp;</td><td class="on" data-day="0" data-hour="1">&nbsp;</td><td class="on" data-day="0" data-hour="2">&nbsp;</td><td class="on" data-day="0" data-hour="3">&nbsp;</td><td class="on" data-day="0" data-hour="4">&nbsp;</td><td class="on" data-day="0" data-hour="5">&nbsp;</td><td class="on" data-day="0" data-hour="6">&nbsp;</td><td class="on" data-day="0" data-hour="7">&nbsp;</td><td class="on" data-day="0" data-hour="8">&nbsp;</td><td class="on" data-day="0" data-hour="9">&nbsp;</td><td class="on" data-day="0" data-hour="10">&nbsp;</td><td class="on" data-day="0" data-hour="11">&nbsp;</td><td class="on" data-day="0" data-hour="12">&nbsp;</td><td class="on" data-day="0" data-hour="13">&nbsp;</td><td class="on" data-day="0" data-hour="14">&nbsp;</td><td class="on" data-day="0" data-hour="15">&nbsp;</td><td class="on" data-day="0" data-hour="16">&nbsp;</td><td class="on" data-day="0" data-hour="17">&nbsp;</td><td class="on" data-day="0" data-hour="18">&nbsp;</td><td class="on" data-day="0" data-hour="19">&nbsp;</td><td class="on" data-day="0" data-hour="20">&nbsp;</td><td class="on" data-day="0" data-hour="21">&nbsp;</td><td class="on" data-day="0" data-hour="22">&nbsp;</td><td class="on" data-day="0" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="1" data-hour="0">&nbsp;</td><td class="on" data-day="1" data-hour="1">&nbsp;</td><td class="on" data-day="1" data-hour="2">&nbsp;</td><td class="on" data-day="1" data-hour="3">&nbsp;</td><td class="on" data-day="1" data-hour="4">&nbsp;</td><td class="on" data-day="1" data-hour="5">&nbsp;</td><td class="on" data-day="1" data-hour="6">&nbsp;</td><td class="on" data-day="1" data-hour="7">&nbsp;</td><td class="on" data-day="1" data-hour="8">&nbsp;</td><td class="on" data-day="1" data-hour="9">&nbsp;</td><td class="on" data-day="1" data-hour="10">&nbsp;</td><td class="on" data-day="1" data-hour="11">&nbsp;</td><td class="on" data-day="1" data-hour="12">&nbsp;</td><td class="on" data-day="1" data-hour="13">&nbsp;</td><td class="on" data-day="1" data-hour="14">&nbsp;</td><td class="on" data-day="1" data-hour="15">&nbsp;</td><td class="on" data-day="1" data-hour="16">&nbsp;</td><td class="on" data-day="1" data-hour="17">&nbsp;</td><td class="on" data-day="1" data-hour="18">&nbsp;</td><td class="on" data-day="1" data-hour="19">&nbsp;</td><td class="on" data-day="1" data-hour="20">&nbsp;</td><td class="on" data-day="1" data-hour="21">&nbsp;</td><td class="on" data-day="1" data-hour="22">&nbsp;</td><td class="on" data-day="1" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="2" data-hour="0">&nbsp;</td><td class="on" data-day="2" data-hour="1">&nbsp;</td><td class="on" data-day="2" data-hour="2">&nbsp;</td><td class="on" data-day="2" data-hour="3">&nbsp;</td><td class="on" data-day="2" data-hour="4">&nbsp;</td><td class="on" data-day="2" data-hour="5">&nbsp;</td><td class="on" data-day="2" data-hour="6">&nbsp;</td><td class="on" data-day="2" data-hour="7">&nbsp;</td><td class="on" data-day="2" data-hour="8">&nbsp;</td><td class="on" data-day="2" data-hour="9">&nbsp;</td><td class="on" data-day="2" data-hour="10">&nbsp;</td><td class="on" data-day="2" data-hour="11">&nbsp;</td><td class="on" data-day="2" data-hour="12">&nbsp;</td><td class="on" data-day="2" data-hour="13">&nbsp;</td><td class="on" data-day="2" data-hour="14">&nbsp;</td><td class="on" data-day="2" data-hour="15">&nbsp;</td><td class="on" data-day="2" data-hour="16">&nbsp;</td><td class="on" data-day="2" data-hour="17">&nbsp;</td><td class="on" data-day="2" data-hour="18">&nbsp;</td><td class="on" data-day="2" data-hour="19">&nbsp;</td><td class="on" data-day="2" data-hour="20">&nbsp;</td><td class="on" data-day="2" data-hour="21">&nbsp;</td><td class="on" data-day="2" data-hour="22">&nbsp;</td><td class="on" data-day="2" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="3" data-hour="0">&nbsp;</td><td class="on" data-day="3" data-hour="1">&nbsp;</td><td class="on" data-day="3" data-hour="2">&nbsp;</td><td class="on" data-day="3" data-hour="3">&nbsp;</td><td class="on" data-day="3" data-hour="4">&nbsp;</td><td class="on" data-day="3" data-hour="5">&nbsp;</td><td class="on" data-day="3" data-hour="6">&nbsp;</td><td class="on" data-day="3" data-hour="7">&nbsp;</td><td class="on" data-day="3" data-hour="8">&nbsp;</td><td class="on" data-day="3" data-hour="9">&nbsp;</td><td class="on" data-day="3" data-hour="10">&nbsp;</td><td class="on" data-day="3" data-hour="11">&nbsp;</td><td class="on" data-day="3" data-hour="12">&nbsp;</td><td class="on" data-day="3" data-hour="13">&nbsp;</td><td class="on" data-day="3" data-hour="14">&nbsp;</td><td class="on" data-day="3" data-hour="15">&nbsp;</td><td class="on" data-day="3" data-hour="16">&nbsp;</td><td class="on" data-day="3" data-hour="17">&nbsp;</td><td class="on" data-day="3" data-hour="18">&nbsp;</td><td class="on" data-day="3" data-hour="19">&nbsp;</td><td class="on" data-day="3" data-hour="20">&nbsp;</td><td class="on" data-day="3" data-hour="21">&nbsp;</td><td class="on" data-day="3" data-hour="22">&nbsp;</td><td class="on" data-day="3" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="4" data-hour="0">&nbsp;</td><td class="on" data-day="4" data-hour="1">&nbsp;</td><td class="on" data-day="4" data-hour="2">&nbsp;</td><td class="on" data-day="4" data-hour="3">&nbsp;</td><td class="on" data-day="4" data-hour="4">&nbsp;</td><td class="on" data-day="4" data-hour="5">&nbsp;</td><td class="on" data-day="4" data-hour="6">&nbsp;</td><td class="on" data-day="4" data-hour="7">&nbsp;</td><td class="on" data-day="4" data-hour="8">&nbsp;</td><td class="on" data-day="4" data-hour="9">&nbsp;</td><td class="on" data-day="4" data-hour="10">&nbsp;</td><td class="on" data-day="4" data-hour="11">&nbsp;</td><td class="on" data-day="4" data-hour="12">&nbsp;</td><td class="on" data-day="4" data-hour="13">&nbsp;</td><td class="on" data-day="4" data-hour="14">&nbsp;</td><td class="on" data-day="4" data-hour="15">&nbsp;</td><td class="on" data-day="4" data-hour="16">&nbsp;</td><td class="on" data-day="4" data-hour="17">&nbsp;</td><td class="on" data-day="4" data-hour="18">&nbsp;</td><td class="on" data-day="4" data-hour="19">&nbsp;</td><td class="on" data-day="4" data-hour="20">&nbsp;</td><td class="on" data-day="4" data-hour="21">&nbsp;</td><td class="on" data-day="4" data-hour="22">&nbsp;</td><td class="on" data-day="4" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="5" data-hour="0">&nbsp;</td><td class="on" data-day="5" data-hour="1">&nbsp;</td><td class="on" data-day="5" data-hour="2">&nbsp;</td><td class="on" data-day="5" data-hour="3">&nbsp;</td><td class="on" data-day="5" data-hour="4">&nbsp;</td><td class="on" data-day="5" data-hour="5">&nbsp;</td><td class="on" data-day="5" data-hour="6">&nbsp;</td><td class="on" data-day="5" data-hour="7">&nbsp;</td><td class="on" data-day="5" data-hour="8">&nbsp;</td><td class="on" data-day="5" data-hour="9">&nbsp;</td><td class="on" data-day="5" data-hour="10">&nbsp;</td><td class="on" data-day="5" data-hour="11">&nbsp;</td><td class="on" data-day="5" data-hour="12">&nbsp;</td><td class="on" data-day="5" data-hour="13">&nbsp;</td><td class="on" data-day="5" data-hour="14">&nbsp;</td><td class="on" data-day="5" data-hour="15">&nbsp;</td><td class="on" data-day="5" data-hour="16">&nbsp;</td><td class="on" data-day="5" data-hour="17">&nbsp;</td><td class="on" data-day="5" data-hour="18">&nbsp;</td><td class="on" data-day="5" data-hour="19">&nbsp;</td><td class="on" data-day="5" data-hour="20">&nbsp;</td><td class="on" data-day="5" data-hour="21">&nbsp;</td><td class="on" data-day="5" data-hour="22">&nbsp;</td><td class="on" data-day="5" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="6" data-hour="0">&nbsp;</td><td class="on" data-day="6" data-hour="1">&nbsp;</td><td class="on" data-day="6" data-hour="2">&nbsp;</td><td class="on" data-day="6" data-hour="3">&nbsp;</td><td class="on" data-day="6" data-hour="4">&nbsp;</td><td class="on" data-day="6" data-hour="5">&nbsp;</td><td class="on" data-day="6" data-hour="6">&nbsp;</td><td class="on" data-day="6" data-hour="7">&nbsp;</td><td class="on" data-day="6" data-hour="8">&nbsp;</td><td class="on" data-day="6" data-hour="9">&nbsp;</td><td class="on" data-day="6" data-hour="10">&nbsp;</td><td class="on" data-day="6" data-hour="11">&nbsp;</td><td class="on" data-day="6" data-hour="12">&nbsp;</td><td class="on" data-day="6" data-hour="13">&nbsp;</td><td class="on" data-day="6" data-hour="14">&nbsp;</td><td class="on" data-day="6" data-hour="15">&nbsp;</td><td class="on" data-day="6" data-hour="16">&nbsp;</td><td class="on" data-day="6" data-hour="17">&nbsp;</td><td class="on" data-day="6" data-hour="18">&nbsp;</td><td class="on" data-day="6" data-hour="19">&nbsp;</td><td class="on" data-day="6" data-hour="20">&nbsp;</td><td class="on" data-day="6" data-hour="21">&nbsp;</td><td class="on" data-day="6" data-hour="22">&nbsp;</td><td class="on" data-day="6" data-hour="23">&nbsp;</td></tr></tbody></table></div></div>'
11
+ expected = '<div class="form-group" data-scheduler="true"><label class="control-label col-2" for="thing_schedule">Schedule</label><div class="col-10"><input value="[[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],[false,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true]]" class="scheduler-hidden-field" type="hidden" name="thing[schedule]" id="thing_schedule" /><table class="scheduler-badge"><tbody><tr><td class="off" data-day="0" data-hour="0">&nbsp;</td><td class="on" data-day="0" data-hour="1">&nbsp;</td><td class="on" data-day="0" data-hour="2">&nbsp;</td><td class="on" data-day="0" data-hour="3">&nbsp;</td><td class="on" data-day="0" data-hour="4">&nbsp;</td><td class="on" data-day="0" data-hour="5">&nbsp;</td><td class="on" data-day="0" data-hour="6">&nbsp;</td><td class="on" data-day="0" data-hour="7">&nbsp;</td><td class="on" data-day="0" data-hour="8">&nbsp;</td><td class="on" data-day="0" data-hour="9">&nbsp;</td><td class="on" data-day="0" data-hour="10">&nbsp;</td><td class="on" data-day="0" data-hour="11">&nbsp;</td><td class="on" data-day="0" data-hour="12">&nbsp;</td><td class="on" data-day="0" data-hour="13">&nbsp;</td><td class="on" data-day="0" data-hour="14">&nbsp;</td><td class="on" data-day="0" data-hour="15">&nbsp;</td><td class="on" data-day="0" data-hour="16">&nbsp;</td><td class="on" data-day="0" data-hour="17">&nbsp;</td><td class="on" data-day="0" data-hour="18">&nbsp;</td><td class="on" data-day="0" data-hour="19">&nbsp;</td><td class="on" data-day="0" data-hour="20">&nbsp;</td><td class="on" data-day="0" data-hour="21">&nbsp;</td><td class="on" data-day="0" data-hour="22">&nbsp;</td><td class="on" data-day="0" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="1" data-hour="0">&nbsp;</td><td class="on" data-day="1" data-hour="1">&nbsp;</td><td class="on" data-day="1" data-hour="2">&nbsp;</td><td class="on" data-day="1" data-hour="3">&nbsp;</td><td class="on" data-day="1" data-hour="4">&nbsp;</td><td class="on" data-day="1" data-hour="5">&nbsp;</td><td class="on" data-day="1" data-hour="6">&nbsp;</td><td class="on" data-day="1" data-hour="7">&nbsp;</td><td class="on" data-day="1" data-hour="8">&nbsp;</td><td class="on" data-day="1" data-hour="9">&nbsp;</td><td class="on" data-day="1" data-hour="10">&nbsp;</td><td class="on" data-day="1" data-hour="11">&nbsp;</td><td class="on" data-day="1" data-hour="12">&nbsp;</td><td class="on" data-day="1" data-hour="13">&nbsp;</td><td class="on" data-day="1" data-hour="14">&nbsp;</td><td class="on" data-day="1" data-hour="15">&nbsp;</td><td class="on" data-day="1" data-hour="16">&nbsp;</td><td class="on" data-day="1" data-hour="17">&nbsp;</td><td class="on" data-day="1" data-hour="18">&nbsp;</td><td class="on" data-day="1" data-hour="19">&nbsp;</td><td class="on" data-day="1" data-hour="20">&nbsp;</td><td class="on" data-day="1" data-hour="21">&nbsp;</td><td class="on" data-day="1" data-hour="22">&nbsp;</td><td class="on" data-day="1" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="2" data-hour="0">&nbsp;</td><td class="on" data-day="2" data-hour="1">&nbsp;</td><td class="on" data-day="2" data-hour="2">&nbsp;</td><td class="on" data-day="2" data-hour="3">&nbsp;</td><td class="on" data-day="2" data-hour="4">&nbsp;</td><td class="on" data-day="2" data-hour="5">&nbsp;</td><td class="on" data-day="2" data-hour="6">&nbsp;</td><td class="on" data-day="2" data-hour="7">&nbsp;</td><td class="on" data-day="2" data-hour="8">&nbsp;</td><td class="on" data-day="2" data-hour="9">&nbsp;</td><td class="on" data-day="2" data-hour="10">&nbsp;</td><td class="on" data-day="2" data-hour="11">&nbsp;</td><td class="on" data-day="2" data-hour="12">&nbsp;</td><td class="on" data-day="2" data-hour="13">&nbsp;</td><td class="on" data-day="2" data-hour="14">&nbsp;</td><td class="on" data-day="2" data-hour="15">&nbsp;</td><td class="on" data-day="2" data-hour="16">&nbsp;</td><td class="on" data-day="2" data-hour="17">&nbsp;</td><td class="on" data-day="2" data-hour="18">&nbsp;</td><td class="on" data-day="2" data-hour="19">&nbsp;</td><td class="on" data-day="2" data-hour="20">&nbsp;</td><td class="on" data-day="2" data-hour="21">&nbsp;</td><td class="on" data-day="2" data-hour="22">&nbsp;</td><td class="on" data-day="2" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="3" data-hour="0">&nbsp;</td><td class="on" data-day="3" data-hour="1">&nbsp;</td><td class="on" data-day="3" data-hour="2">&nbsp;</td><td class="on" data-day="3" data-hour="3">&nbsp;</td><td class="on" data-day="3" data-hour="4">&nbsp;</td><td class="on" data-day="3" data-hour="5">&nbsp;</td><td class="on" data-day="3" data-hour="6">&nbsp;</td><td class="on" data-day="3" data-hour="7">&nbsp;</td><td class="on" data-day="3" data-hour="8">&nbsp;</td><td class="on" data-day="3" data-hour="9">&nbsp;</td><td class="on" data-day="3" data-hour="10">&nbsp;</td><td class="on" data-day="3" data-hour="11">&nbsp;</td><td class="on" data-day="3" data-hour="12">&nbsp;</td><td class="on" data-day="3" data-hour="13">&nbsp;</td><td class="on" data-day="3" data-hour="14">&nbsp;</td><td class="on" data-day="3" data-hour="15">&nbsp;</td><td class="on" data-day="3" data-hour="16">&nbsp;</td><td class="on" data-day="3" data-hour="17">&nbsp;</td><td class="on" data-day="3" data-hour="18">&nbsp;</td><td class="on" data-day="3" data-hour="19">&nbsp;</td><td class="on" data-day="3" data-hour="20">&nbsp;</td><td class="on" data-day="3" data-hour="21">&nbsp;</td><td class="on" data-day="3" data-hour="22">&nbsp;</td><td class="on" data-day="3" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="4" data-hour="0">&nbsp;</td><td class="on" data-day="4" data-hour="1">&nbsp;</td><td class="on" data-day="4" data-hour="2">&nbsp;</td><td class="on" data-day="4" data-hour="3">&nbsp;</td><td class="on" data-day="4" data-hour="4">&nbsp;</td><td class="on" data-day="4" data-hour="5">&nbsp;</td><td class="on" data-day="4" data-hour="6">&nbsp;</td><td class="on" data-day="4" data-hour="7">&nbsp;</td><td class="on" data-day="4" data-hour="8">&nbsp;</td><td class="on" data-day="4" data-hour="9">&nbsp;</td><td class="on" data-day="4" data-hour="10">&nbsp;</td><td class="on" data-day="4" data-hour="11">&nbsp;</td><td class="on" data-day="4" data-hour="12">&nbsp;</td><td class="on" data-day="4" data-hour="13">&nbsp;</td><td class="on" data-day="4" data-hour="14">&nbsp;</td><td class="on" data-day="4" data-hour="15">&nbsp;</td><td class="on" data-day="4" data-hour="16">&nbsp;</td><td class="on" data-day="4" data-hour="17">&nbsp;</td><td class="on" data-day="4" data-hour="18">&nbsp;</td><td class="on" data-day="4" data-hour="19">&nbsp;</td><td class="on" data-day="4" data-hour="20">&nbsp;</td><td class="on" data-day="4" data-hour="21">&nbsp;</td><td class="on" data-day="4" data-hour="22">&nbsp;</td><td class="on" data-day="4" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="5" data-hour="0">&nbsp;</td><td class="on" data-day="5" data-hour="1">&nbsp;</td><td class="on" data-day="5" data-hour="2">&nbsp;</td><td class="on" data-day="5" data-hour="3">&nbsp;</td><td class="on" data-day="5" data-hour="4">&nbsp;</td><td class="on" data-day="5" data-hour="5">&nbsp;</td><td class="on" data-day="5" data-hour="6">&nbsp;</td><td class="on" data-day="5" data-hour="7">&nbsp;</td><td class="on" data-day="5" data-hour="8">&nbsp;</td><td class="on" data-day="5" data-hour="9">&nbsp;</td><td class="on" data-day="5" data-hour="10">&nbsp;</td><td class="on" data-day="5" data-hour="11">&nbsp;</td><td class="on" data-day="5" data-hour="12">&nbsp;</td><td class="on" data-day="5" data-hour="13">&nbsp;</td><td class="on" data-day="5" data-hour="14">&nbsp;</td><td class="on" data-day="5" data-hour="15">&nbsp;</td><td class="on" data-day="5" data-hour="16">&nbsp;</td><td class="on" data-day="5" data-hour="17">&nbsp;</td><td class="on" data-day="5" data-hour="18">&nbsp;</td><td class="on" data-day="5" data-hour="19">&nbsp;</td><td class="on" data-day="5" data-hour="20">&nbsp;</td><td class="on" data-day="5" data-hour="21">&nbsp;</td><td class="on" data-day="5" data-hour="22">&nbsp;</td><td class="on" data-day="5" data-hour="23">&nbsp;</td></tr><tr><td class="off" data-day="6" data-hour="0">&nbsp;</td><td class="on" data-day="6" data-hour="1">&nbsp;</td><td class="on" data-day="6" data-hour="2">&nbsp;</td><td class="on" data-day="6" data-hour="3">&nbsp;</td><td class="on" data-day="6" data-hour="4">&nbsp;</td><td class="on" data-day="6" data-hour="5">&nbsp;</td><td class="on" data-day="6" data-hour="6">&nbsp;</td><td class="on" data-day="6" data-hour="7">&nbsp;</td><td class="on" data-day="6" data-hour="8">&nbsp;</td><td class="on" data-day="6" data-hour="9">&nbsp;</td><td class="on" data-day="6" data-hour="10">&nbsp;</td><td class="on" data-day="6" data-hour="11">&nbsp;</td><td class="on" data-day="6" data-hour="12">&nbsp;</td><td class="on" data-day="6" data-hour="13">&nbsp;</td><td class="on" data-day="6" data-hour="14">&nbsp;</td><td class="on" data-day="6" data-hour="15">&nbsp;</td><td class="on" data-day="6" data-hour="16">&nbsp;</td><td class="on" data-day="6" data-hour="17">&nbsp;</td><td class="on" data-day="6" data-hour="18">&nbsp;</td><td class="on" data-day="6" data-hour="19">&nbsp;</td><td class="on" data-day="6" data-hour="20">&nbsp;</td><td class="on" data-day="6" data-hour="21">&nbsp;</td><td class="on" data-day="6" data-hour="22">&nbsp;</td><td class="on" data-day="6" data-hour="23">&nbsp;</td></tr></tbody></table></div></div>'
12
12
  assert_equal expected, @builder.scheduler(:schedule)
13
13
  end
14
14
 
@@ -9,20 +9,20 @@ class SelectOrNewTest < ActionView::TestCase
9
9
 
10
10
  test "select_or_new" do
11
11
  expected = <<-HTML.chomp
12
- <div class="form-group" data-select-or-new="true"><label class="control-label col-sm-2" for="thing_category">Category</label><div class="col-sm-10"><select class="form-control" name="thing[category]" id="thing_category"><option value="">Please select</option>
12
+ <div class="form-group" data-select-or-new="true"><label class="control-label col-2" for="thing_category">Category</label><div class="col-10"><select class="form-control" name="thing[category]" id="thing_category"><option value="">Please select</option>
13
13
  <option value="1">One</option>
14
14
  <option value="2">Two</option>
15
- <option value="0">New...</option></select><div class="input-group" style="display: none;"><input type="text" name="thing[new_category]" id="thing_new_category" class="form-control" placeholder="New..." /><div class="input-group-addon select-or-new-cancel"><i class="text-danger glyphicon glyphicon-remove"></i></div></div></div></div>
15
+ <option value="0">New...</option></select><div class="input-group" style="display: none;"><input type="text" name="thing[new_category]" id="thing_new_category" class="form-control" placeholder="New..." /><div class="input-group-append select-or-new-cancel"><button class="btn btn-outline-danger" type="button">&times;</button></div></div></div></div>
16
16
  HTML
17
17
  assert_equal expected, @builder.select_or_new(:category, [ [ 'One', 1 ], [ 'Two', 2 ] ])
18
18
  end
19
19
 
20
20
  test "display new, if option is selected" do
21
21
  expected = <<-HTML.chomp
22
- <div class="form-group" data-select-or-new="true"><label class="control-label col-sm-2" for="thing_category">Category</label><div class="col-sm-10"><select class="form-control" name="thing[category]" id="thing_category"><option value="">Please select</option>
22
+ <div class="form-group" data-select-or-new="true"><label class="control-label col-2" for="thing_category">Category</label><div class="col-10"><select class="form-control" name="thing[category]" id="thing_category"><option value="">Please select</option>
23
23
  <option value="1">One</option>
24
24
  <option value="2">Two</option>
25
- <option value="0">New...</option></select><div class="input-group" style="display: none;"><input type="text" name="thing[new_category]" id="thing_new_category" value="New Category" class="form-control" placeholder="New..." /><div class="input-group-addon select-or-new-cancel"><i class="text-danger glyphicon glyphicon-remove"></i></div></div></div></div>
25
+ <option value="0">New...</option></select><div class="input-group" style="display: none;"><input type="text" name="thing[new_category]" id="thing_new_category" value="New Category" class="form-control" placeholder="New..." /><div class="input-group-append select-or-new-cancel"><button class="btn btn-outline-danger" type="button">&times;</button></div></div></div></div>
26
26
  HTML
27
27
  @thing.category_id = 0
28
28
  @thing.new_category = "New Category"
@@ -9,18 +9,23 @@ class SubmitBarTest < ActionView::TestCase
9
9
 
10
10
  test "SubmitBar with default values" do
11
11
  expected = <<-HTML
12
- <div class="form-group col-sm-12">
13
- <div class='pull-left submitbar-left'>
14
- <div class="btn-group dropup submitbar-submit-group">
15
- <button type="submit" class="btn btn-primary submitbar-save">Save</button>
16
- <button type="button" class="btn btn-primary dropdown-toggle submitbar-next-action-toggle" data-toggle="dropdown">
17
- <span class="caret"></span>
18
- <span class="sr-only">Toggle Dropdown</span>
12
+ <div class='form-group col-12'>
13
+ <div class='float-left submitbar-left'>
14
+ <div class='btn-group dropup submitbar-submit-group'>
15
+ <button type='submit' class='btn btn-primary submitbar-save'>
16
+ Save
17
+ </button>
18
+ <button type='button' class='btn btn-primary dropdown-toggle dropdown-toggle-split submitbar-next-action-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
19
+ <span class='sr-only'>Toggle Dropdown</span>
19
20
  </button>
20
- <ul class="dropdown-menu submitbar-next-action-menu" role="menu">
21
- <li><button type="submit" name="next_action" class="btn-link submitbar-duplicate" value="duplicate">Save and duplicate</button></li>
22
- <li><button type="submit" name="next_action" class="btn-link submitbar-new" value="new">Save and new</button></li>
23
- </ul>
21
+ <div class='dropdown-menu submitbar-next-action-menu' role='menu'>
22
+ <button type='submit' name='next_action' class='dropdown-item submitbar-duplicate' value='duplicate'>
23
+ Save and duplicate
24
+ </button>
25
+ <button type='submit' name='next_action' class='dropdown-item submitbar-new' value='new'>
26
+ Save and new
27
+ </button>
28
+ </div>
24
29
  </div>
25
30
  <a class="btn btn-default submitbar-cancel" rel="nofollow" href="/things">Cancel</a>
26
31
  </div>
@@ -45,21 +50,21 @@ class SubmitBarTest < ActionView::TestCase
45
50
  test "don't show the submit menu" do
46
51
  @output_buffer = @builder.submit_bar show_submit_menu: false
47
52
  assert_select 'button.submitbar-next-action-toggle', count: 0
48
- assert_select 'ul.submitbar-next-action-menu', count: 0
53
+ assert_select 'div.submitbar-next-action-menu', count: 0
49
54
  assert_select 'button[name=next_action]', count: 0
50
55
  end
51
56
 
52
57
  test "don't show the submit and duplicate button" do
53
58
  @output_buffer = @builder.submit_bar show_submit_and_dup_button: false
54
59
  assert_select 'button.submitbar-next-action-toggle', count: 1
55
- assert_select 'ul.submitbar-next-action-menu', count: 1
60
+ assert_select 'div.submitbar-next-action-menu', count: 1
56
61
  assert_select 'button.submitbar-duplicate', count: 0
57
62
  end
58
63
 
59
64
  test "don't show the submit and new button" do
60
65
  @output_buffer = @builder.submit_bar show_submit_and_new_button: false
61
66
  assert_select 'button.submitbar-next-action-toggle', count: 1
62
- assert_select 'ul.submitbar-next-action-menu', count: 1
67
+ assert_select 'div.submitbar-next-action-menu', count: 1
63
68
  assert_select 'button.submitbar-new', count: 0
64
69
  end
65
70
 
data/test/test_helper.rb CHANGED
@@ -32,7 +32,7 @@ def setup_test_fixture
32
32
  schedule: [[false],[false],[false],[false],[false],[false],[false]],
33
33
  start_at: Time.new(1971, 10, 21, 11, 30, 0, '+04:00'),
34
34
  duration_in_seconds2: 5843.476
35
- @builder = BootstrapForm::FormBuilder.new :thing, @thing, self, layout: :horizontal, label_col: "col-sm-2", control_col: "col-sm-10"
35
+ @builder = BootstrapForm::FormBuilder.new :thing, @thing, self, layout: :horizontal, label_col: "col-2", control_col: "col-10"
36
36
  @template = @builder.instance_variable_get :@template
37
37
  @template.stubs(:controller_name).returns('things')
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap_form_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesús Dugarte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2019-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootstrap_form
@@ -24,34 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.3'
27
- - !ruby/object:Gem::Dependency
28
- name: bootstrap-datepicker-rails
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 1.4.0
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 1.4.0
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: rails
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - "~>"
46
32
  - !ruby/object:Gem::Version
47
- version: '4.0'
33
+ version: '5.0'
48
34
  type: :development
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - "~>"
53
39
  - !ruby/object:Gem::Version
54
- version: '4.0'
40
+ version: '5.0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: sqlite3
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -103,25 +89,19 @@ files:
103
89
  - MIT-LICENSE
104
90
  - Rakefile
105
91
  - app/assets/javascripts/bootstrap_form_extensions/arrayed_field.js
106
- - app/assets/javascripts/bootstrap_form_extensions/bootstrap-timepicker.min.js
107
92
  - app/assets/javascripts/bootstrap_form_extensions/duration.js
108
93
  - app/assets/javascripts/bootstrap_form_extensions/index.js
109
94
  - app/assets/javascripts/bootstrap_form_extensions/jquery.html5data.min.js
110
95
  - app/assets/javascripts/bootstrap_form_extensions/scheduler.js
111
96
  - app/assets/javascripts/bootstrap_form_extensions/select_or_new.js
112
- - app/assets/javascripts/bootstrap_form_extensions/time_picker.js
113
97
  - app/assets/javascripts/bootstrap_form_extensions/timespan.js
114
- - app/assets/stylesheets/bootstrap_form_extensions/bootstrap-timepicker.min.css
115
- - app/assets/stylesheets/bootstrap_form_extensions/common.css
116
98
  - app/assets/stylesheets/bootstrap_form_extensions/duration.css
117
99
  - app/assets/stylesheets/bootstrap_form_extensions/index.css
118
100
  - app/assets/stylesheets/bootstrap_form_extensions/scheduler.css
119
101
  - app/assets/stylesheets/bootstrap_form_extensions/select_or_new.css
120
- - app/assets/stylesheets/bootstrap_form_extensions/submit_bar.css
121
102
  - app/views/bootstrap_form_extensions/_submit_bar.html.erb
122
103
  - lib/bootstrap_form_extensions.rb
123
104
  - lib/bootstrap_form_extensions/arrayed_field.rb
124
- - lib/bootstrap_form_extensions/date_time_pickers.rb
125
105
  - lib/bootstrap_form_extensions/duration.rb
126
106
  - lib/bootstrap_form_extensions/helpers.rb
127
107
  - lib/bootstrap_form_extensions/scheduler.rb
@@ -132,7 +112,6 @@ files:
132
112
  - lib/tasks/rails_bootstrap_form_extensions_tasks.rake
133
113
  - test/arrayed_field_test.rb
134
114
  - test/bootstrap_form_extensions_test.rb
135
- - test/date_time_pickers_test.rb
136
115
  - test/dummy/README.rdoc
137
116
  - test/dummy/Rakefile
138
117
  - test/dummy/app/assets/javascripts/application.js
@@ -171,7 +150,6 @@ files:
171
150
  - test/dummy/db/migrate/20151006171627_add_another_arrayed_field.rb
172
151
  - test/dummy/db/migrate/20151006181943_add_json_field.rb
173
152
  - test/dummy/db/migrate/20151007213131_add_scheduler_field.rb
174
- - test/dummy/db/migrate/20151030194330_add_date_time.rb
175
153
  - test/dummy/db/migrate/20151106165522_add_category.rb
176
154
  - test/dummy/db/migrate/20151119160842_add_duration.rb
177
155
  - test/dummy/db/schema.rb
@@ -191,7 +169,6 @@ files:
191
169
  - test/javascripts/select_or_new_spec.js
192
170
  - test/javascripts/support/jasmine.yml
193
171
  - test/javascripts/support/jasmine_helper.rb
194
- - test/javascripts/time_picker_spec.js
195
172
  - test/javascripts/timespan_spec.js
196
173
  - test/javascripts/vendor/bootstrap.min.js
197
174
  - test/javascripts/vendor/jquery-2.1.4.min.js
@@ -220,80 +197,76 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
197
  - !ruby/object:Gem::Version
221
198
  version: '0'
222
199
  requirements: []
223
- rubyforge_project:
224
- rubygems_version: 2.5.1
200
+ rubygems_version: 3.0.2
225
201
  signing_key:
226
202
  specification_version: 4
227
203
  summary: Specialized controls added to the bootstrap_form gem
228
204
  test_files:
229
- - test/arrayed_field_test.rb
230
- - test/bootstrap_form_extensions_test.rb
231
- - test/date_time_pickers_test.rb
205
+ - test/select_or_new_test.rb
206
+ - test/dummy/app/models/thing.rb
207
+ - test/dummy/app/models/category.rb
208
+ - test/dummy/app/controllers/application_controller.rb
209
+ - test/dummy/app/views/layouts/application.html.erb
232
210
  - test/dummy/app/assets/javascripts/application.js
233
211
  - test/dummy/app/assets/stylesheets/application.css
234
- - test/dummy/app/controllers/application_controller.rb
235
212
  - test/dummy/app/helpers/application_helper.rb
236
- - test/dummy/app/models/category.rb
237
- - test/dummy/app/models/thing.rb
238
- - test/dummy/app/views/layouts/application.html.erb
239
- - test/dummy/bin/bundle
240
- - test/dummy/bin/rails
213
+ - test/dummy/test/fixtures/things.yml
241
214
  - test/dummy/bin/rake
242
215
  - test/dummy/bin/setup
243
- - test/dummy/config/application.rb
244
- - test/dummy/config/boot.rb
245
- - test/dummy/config/database.yml
246
- - test/dummy/config/environment.rb
247
- - test/dummy/config/environments/development.rb
216
+ - test/dummy/bin/bundle
217
+ - test/dummy/bin/rails
218
+ - test/dummy/config/secrets.yml
219
+ - test/dummy/config/routes.rb
220
+ - test/dummy/config/locales/en.yml
248
221
  - test/dummy/config/environments/production.rb
222
+ - test/dummy/config/environments/development.rb
249
223
  - test/dummy/config/environments/test.rb
250
- - test/dummy/config/initializers/assets.rb
224
+ - test/dummy/config/environment.rb
225
+ - test/dummy/config/application.rb
226
+ - test/dummy/config/database.yml
227
+ - test/dummy/config/boot.rb
251
228
  - test/dummy/config/initializers/backtrace_silencers.rb
252
- - test/dummy/config/initializers/cookies_serializer.rb
253
- - test/dummy/config/initializers/filter_parameter_logging.rb
254
- - test/dummy/config/initializers/inflections.rb
255
229
  - test/dummy/config/initializers/mime_types.rb
230
+ - test/dummy/config/initializers/filter_parameter_logging.rb
256
231
  - test/dummy/config/initializers/session_store.rb
257
232
  - test/dummy/config/initializers/wrap_parameters.rb
258
- - test/dummy/config/locales/en.yml
259
- - test/dummy/config/routes.rb
260
- - test/dummy/config/secrets.yml
233
+ - test/dummy/config/initializers/assets.rb
234
+ - test/dummy/config/initializers/cookies_serializer.rb
235
+ - test/dummy/config/initializers/inflections.rb
261
236
  - test/dummy/config.ru
262
- - test/dummy/db/migrate/20150918185031_create_things.rb
263
- - test/dummy/db/migrate/20150924203053_add_timespan.rb
264
- - test/dummy/db/migrate/20150929213249_add_arrayed_field.rb
265
- - test/dummy/db/migrate/20151006171627_add_another_arrayed_field.rb
266
- - test/dummy/db/migrate/20151006181943_add_json_field.rb
267
- - test/dummy/db/migrate/20151007213131_add_scheduler_field.rb
268
- - test/dummy/db/migrate/20151030194330_add_date_time.rb
269
- - test/dummy/db/migrate/20151106165522_add_category.rb
270
- - test/dummy/db/migrate/20151119160842_add_duration.rb
237
+ - test/dummy/Rakefile
238
+ - test/dummy/public/favicon.ico
239
+ - test/dummy/public/422.html
240
+ - test/dummy/public/500.html
241
+ - test/dummy/public/404.html
271
242
  - test/dummy/db/schema.rb
272
243
  - test/dummy/db/test.sqlite3
244
+ - test/dummy/db/migrate/20151007213131_add_scheduler_field.rb
245
+ - test/dummy/db/migrate/20151006181943_add_json_field.rb
246
+ - test/dummy/db/migrate/20151006171627_add_another_arrayed_field.rb
247
+ - test/dummy/db/migrate/20150924203053_add_timespan.rb
248
+ - test/dummy/db/migrate/20150918185031_create_things.rb
249
+ - test/dummy/db/migrate/20151119160842_add_duration.rb
250
+ - test/dummy/db/migrate/20151106165522_add_category.rb
251
+ - test/dummy/db/migrate/20150929213249_add_arrayed_field.rb
273
252
  - test/dummy/log/test.log
274
- - test/dummy/public/404.html
275
- - test/dummy/public/422.html
276
- - test/dummy/public/500.html
277
- - test/dummy/public/favicon.ico
278
- - test/dummy/Rakefile
279
253
  - test/dummy/README.rdoc
280
- - test/dummy/test/fixtures/things.yml
254
+ - test/timespan_test.rb
255
+ - test/scheduler_serializer_test.rb
256
+ - test/submit_bar_test.rb
257
+ - test/arrayed_field_test.rb
258
+ - test/bootstrap_form_extensions_test.rb
281
259
  - test/duration_test.rb
282
- - test/javascripts/arrayed_field_spec.js
283
260
  - test/javascripts/duration_spec.js
284
- - test/javascripts/helpers/function_bind_polyfill_for_phantomjs.js
285
- - test/javascripts/helpers/jasmine-jquery.js
261
+ - test/javascripts/arrayed_field_spec.js
286
262
  - test/javascripts/scheduler_spec.js
287
- - test/javascripts/select_or_new_spec.js
288
- - test/javascripts/support/jasmine.yml
289
- - test/javascripts/support/jasmine_helper.rb
290
- - test/javascripts/time_picker_spec.js
291
263
  - test/javascripts/timespan_spec.js
264
+ - test/javascripts/support/jasmine_helper.rb
265
+ - test/javascripts/support/jasmine.yml
266
+ - test/javascripts/select_or_new_spec.js
267
+ - test/javascripts/helpers/function_bind_polyfill_for_phantomjs.js
268
+ - test/javascripts/helpers/jasmine-jquery.js
292
269
  - test/javascripts/vendor/bootstrap.min.js
293
270
  - test/javascripts/vendor/jquery-2.1.4.min.js
294
- - test/scheduler_serializer_test.rb
295
- - test/scheduler_test.rb
296
- - test/select_or_new_test.rb
297
- - test/submit_bar_test.rb
298
271
  - test/test_helper.rb
299
- - test/timespan_test.rb
272
+ - test/scheduler_test.rb
@@ -1,5 +0,0 @@
1
- /*! bootstrap-timepicker v0.5.0
2
- * http://jdewit.github.com/bootstrap-timepicker
3
- * Copyright (c) 2015 Joris de Wit
4
- * MIT License
5
- */!function(a,b,c){"use strict";var d=function(b,c){this.widget="",this.$element=a(b),this.defaultTime=c.defaultTime,this.disableFocus=c.disableFocus,this.disableMousewheel=c.disableMousewheel,this.isOpen=c.isOpen,this.minuteStep=c.minuteStep,this.modalBackdrop=c.modalBackdrop,this.orientation=c.orientation,this.secondStep=c.secondStep,this.snapToStep=c.snapToStep,this.showInputs=c.showInputs,this.showMeridian=c.showMeridian,this.showSeconds=c.showSeconds,this.template=c.template,this.appendWidgetTo=c.appendWidgetTo,this.showWidgetOnAddonClick=c.showWidgetOnAddonClick,this.maxHours=c.maxHours,this.explicitMode=c.explicitMode,this.handleDocumentClick=function(a){var b=a.data.scope;b.$element.parent().find(a.target).length||b.$widget.is(a.target)||b.$widget.find(a.target).length||b.hideWidget()},this._init()};d.prototype={constructor:d,_init:function(){var b=this;this.showWidgetOnAddonClick&&this.$element.parent().hasClass("input-group")&&this.$element.parent().hasClass("bootstrap-timepicker")?(this.$element.parent(".input-group.bootstrap-timepicker").find(".input-group-addon").on({"click.timepicker":a.proxy(this.showWidget,this)}),this.$element.on({"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)})):this.template?this.$element.on({"focus.timepicker":a.proxy(this.showWidget,this),"click.timepicker":a.proxy(this.showWidget,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)}):this.$element.on({"focus.timepicker":a.proxy(this.highlightUnit,this),"click.timepicker":a.proxy(this.highlightUnit,this),"keydown.timepicker":a.proxy(this.elementKeydown,this),"blur.timepicker":a.proxy(this.blurElement,this),"mousewheel.timepicker DOMMouseScroll.timepicker":a.proxy(this.mousewheel,this)}),this.template!==!1?this.$widget=a(this.getTemplate()).on("click",a.proxy(this.widgetClick,this)):this.$widget=!1,this.showInputs&&this.$widget!==!1&&this.$widget.find("input").each(function(){a(this).on({"click.timepicker":function(){a(this).select()},"keydown.timepicker":a.proxy(b.widgetKeydown,b),"keyup.timepicker":a.proxy(b.widgetKeyup,b)})}),this.setDefaultTime(this.defaultTime)},blurElement:function(){this.highlightedUnit=null,this.updateFromElementVal()},clear:function(){this.hour="",this.minute="",this.second="",this.meridian="",this.$element.val("")},decrementHour:function(){if(this.showMeridian)if(1===this.hour)this.hour=12;else{if(12===this.hour)return this.hour--,this.toggleMeridian();if(0===this.hour)return this.hour=11,this.toggleMeridian();this.hour--}else this.hour<=0?this.hour=this.maxHours-1:this.hour--},decrementMinute:function(a){var b;b=a?this.minute-a:this.minute-this.minuteStep,0>b?(this.decrementHour(),this.minute=b+60):this.minute=b},decrementSecond:function(){var a=this.second-this.secondStep;0>a?(this.decrementMinute(!0),this.second=a+60):this.second=a},elementKeydown:function(a){switch(a.which){case 9:if(a.shiftKey){if("hour"===this.highlightedUnit)break;this.highlightPrevUnit()}else{if(this.showMeridian&&"meridian"===this.highlightedUnit||this.showSeconds&&"second"===this.highlightedUnit||!this.showMeridian&&!this.showSeconds&&"minute"===this.highlightedUnit)break;this.highlightNextUnit()}a.preventDefault(),this.updateFromElementVal();break;case 27:this.updateFromElementVal();break;case 37:a.preventDefault(),this.highlightPrevUnit(),this.updateFromElementVal();break;case 38:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.incrementHour(),this.highlightHour();break;case"minute":this.incrementMinute(),this.highlightMinute();break;case"second":this.incrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update();break;case 39:a.preventDefault(),this.highlightNextUnit(),this.updateFromElementVal();break;case 40:switch(a.preventDefault(),this.highlightedUnit){case"hour":this.decrementHour(),this.highlightHour();break;case"minute":this.decrementMinute(),this.highlightMinute();break;case"second":this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian()}this.update()}},getCursorPosition:function(){var a=this.$element.get(0);if("selectionStart"in a)return a.selectionStart;if(c.selection){a.focus();var b=c.selection.createRange(),d=c.selection.createRange().text.length;return b.moveStart("character",-a.value.length),b.text.length-d}},getTemplate:function(){var a,b,c,d,e,f;switch(this.showInputs?(b='<input type="text" class="bootstrap-timepicker-hour" maxlength="2"/>',c='<input type="text" class="bootstrap-timepicker-minute" maxlength="2"/>',d='<input type="text" class="bootstrap-timepicker-second" maxlength="2"/>',e='<input type="text" class="bootstrap-timepicker-meridian" maxlength="2"/>'):(b='<span class="bootstrap-timepicker-hour"></span>',c='<span class="bootstrap-timepicker-minute"></span>',d='<span class="bootstrap-timepicker-second"></span>',e='<span class="bootstrap-timepicker-meridian"></span>'),f='<table><tr><td><a href="#" data-action="incrementHour"><span class="glyphicon glyphicon-chevron-up"></span></a></td><td class="separator">&nbsp;</td><td><a href="#" data-action="incrementMinute"><span class="glyphicon glyphicon-chevron-up"></span></a></td>'+(this.showSeconds?'<td class="separator">&nbsp;</td><td><a href="#" data-action="incrementSecond"><span class="glyphicon glyphicon-chevron-up"></span></a></td>':"")+(this.showMeridian?'<td class="separator">&nbsp;</td><td class="meridian-column"><a href="#" data-action="toggleMeridian"><span class="glyphicon glyphicon-chevron-up"></span></a></td>':"")+"</tr><tr><td>"+b+'</td> <td class="separator">:</td><td>'+c+"</td> "+(this.showSeconds?'<td class="separator">:</td><td>'+d+"</td>":"")+(this.showMeridian?'<td class="separator">&nbsp;</td><td>'+e+"</td>":"")+'</tr><tr><td><a href="#" data-action="decrementHour"><span class="glyphicon glyphicon-chevron-down"></span></a></td><td class="separator"></td><td><a href="#" data-action="decrementMinute"><span class="glyphicon glyphicon-chevron-down"></span></a></td>'+(this.showSeconds?'<td class="separator">&nbsp;</td><td><a href="#" data-action="decrementSecond"><span class="glyphicon glyphicon-chevron-down"></span></a></td>':"")+(this.showMeridian?'<td class="separator">&nbsp;</td><td><a href="#" data-action="toggleMeridian"><span class="glyphicon glyphicon-chevron-down"></span></a></td>':"")+"</tr></table>",this.template){case"modal":a='<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+(this.modalBackdrop?"true":"false")+'"><div class="modal-header"><a href="#" class="close" data-dismiss="modal">×</a><h3>Pick a Time</h3></div><div class="modal-content">'+f+'</div><div class="modal-footer"><a href="#" class="btn btn-primary" data-dismiss="modal">OK</a></div></div>';break;case"dropdown":a='<div class="bootstrap-timepicker-widget dropdown-menu">'+f+"</div>"}return a},getTime:function(){return""===this.hour?"":this.hour+":"+(1===this.minute.toString().length?"0"+this.minute:this.minute)+(this.showSeconds?":"+(1===this.second.toString().length?"0"+this.second:this.second):"")+(this.showMeridian?" "+this.meridian:"")},hideWidget:function(){this.isOpen!==!1&&(this.$element.trigger({type:"hide.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),"modal"===this.template&&this.$widget.modal?this.$widget.modal("hide"):this.$widget.removeClass("open"),a(c).off("mousedown.timepicker, touchend.timepicker",this.handleDocumentClick),this.isOpen=!1,this.$widget.detach())},highlightUnit:function(){this.position=this.getCursorPosition(),this.position>=0&&this.position<=2?this.highlightHour():this.position>=3&&this.position<=5?this.highlightMinute():this.position>=6&&this.position<=8?this.showSeconds?this.highlightSecond():this.highlightMeridian():this.position>=9&&this.position<=11&&this.highlightMeridian()},highlightNextUnit:function(){switch(this.highlightedUnit){case"hour":this.highlightMinute();break;case"minute":this.showSeconds?this.highlightSecond():this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"second":this.showMeridian?this.highlightMeridian():this.highlightHour();break;case"meridian":this.highlightHour()}},highlightPrevUnit:function(){switch(this.highlightedUnit){case"hour":this.showMeridian?this.highlightMeridian():this.showSeconds?this.highlightSecond():this.highlightMinute();break;case"minute":this.highlightHour();break;case"second":this.highlightMinute();break;case"meridian":this.showSeconds?this.highlightSecond():this.highlightMinute()}},highlightHour:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="hour",a.setSelectionRange&&setTimeout(function(){b.hour<10?a.setSelectionRange(0,1):a.setSelectionRange(0,2)},0)},highlightMinute:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="minute",a.setSelectionRange&&setTimeout(function(){b.hour<10?a.setSelectionRange(2,4):a.setSelectionRange(3,5)},0)},highlightSecond:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="second",a.setSelectionRange&&setTimeout(function(){b.hour<10?a.setSelectionRange(5,7):a.setSelectionRange(6,8)},0)},highlightMeridian:function(){var a=this.$element.get(0),b=this;this.highlightedUnit="meridian",a.setSelectionRange&&(this.showSeconds?setTimeout(function(){b.hour<10?a.setSelectionRange(8,10):a.setSelectionRange(9,11)},0):setTimeout(function(){b.hour<10?a.setSelectionRange(5,7):a.setSelectionRange(6,8)},0))},incrementHour:function(){if(this.showMeridian){if(11===this.hour)return this.hour++,this.toggleMeridian();12===this.hour&&(this.hour=0)}return this.hour===this.maxHours-1?void(this.hour=0):void this.hour++},incrementMinute:function(a){var b;b=a?this.minute+a:this.minute+this.minuteStep-this.minute%this.minuteStep,b>59?(this.incrementHour(),this.minute=b-60):this.minute=b},incrementSecond:function(){var a=this.second+this.secondStep-this.second%this.secondStep;a>59?(this.incrementMinute(!0),this.second=a-60):this.second=a},mousewheel:function(b){if(!this.disableMousewheel){b.preventDefault(),b.stopPropagation();var c=b.originalEvent.wheelDelta||-b.originalEvent.detail,d=null;switch("mousewheel"===b.type?d=-1*b.originalEvent.wheelDelta:"DOMMouseScroll"===b.type&&(d=40*b.originalEvent.detail),d&&(b.preventDefault(),a(this).scrollTop(d+a(this).scrollTop())),this.highlightedUnit){case"minute":c>0?this.incrementMinute():this.decrementMinute(),this.highlightMinute();break;case"second":c>0?this.incrementSecond():this.decrementSecond(),this.highlightSecond();break;case"meridian":this.toggleMeridian(),this.highlightMeridian();break;default:c>0?this.incrementHour():this.decrementHour(),this.highlightHour()}return!1}},changeToNearestStep:function(a,b){return a%b===0?a:Math.round(a%b/b)?(a+(b-a%b))%60:a-a%b},place:function(){if(!this.isInline){var c=this.$widget.outerWidth(),d=this.$widget.outerHeight(),e=10,f=a(b).width(),g=a(b).height(),h=a(b).scrollTop(),i=parseInt(this.$element.parents().filter(function(){return"auto"!==a(this).css("z-index")}).first().css("z-index"),10)+10,j=this.component?this.component.parent().offset():this.$element.offset(),k=this.component?this.component.outerHeight(!0):this.$element.outerHeight(!1),l=this.component?this.component.outerWidth(!0):this.$element.outerWidth(!1),m=j.left,n=j.top;this.$widget.removeClass("timepicker-orient-top timepicker-orient-bottom timepicker-orient-right timepicker-orient-left"),"auto"!==this.orientation.x?(this.picker.addClass("datepicker-orient-"+this.orientation.x),"right"===this.orientation.x&&(m-=c-l)):(this.$widget.addClass("timepicker-orient-left"),j.left<0?m-=j.left-e:j.left+c>f&&(m=f-c-e));var o,p,q=this.orientation.y;"auto"===q&&(o=-h+j.top-d,p=h+g-(j.top+k+d),q=Math.max(o,p)===p?"top":"bottom"),this.$widget.addClass("timepicker-orient-"+q),"top"===q?n+=k:n-=d+parseInt(this.$widget.css("padding-top"),10),this.$widget.css({top:n,left:m,zIndex:i})}},remove:function(){a("document").off(".timepicker"),this.$widget&&this.$widget.remove(),delete this.$element.data().timepicker},setDefaultTime:function(a){if(this.$element.val())this.updateFromElementVal();else if("current"===a){var b=new Date,c=b.getHours(),d=b.getMinutes(),e=b.getSeconds(),f="AM";0!==e&&(e=Math.ceil(b.getSeconds()/this.secondStep)*this.secondStep,60===e&&(d+=1,e=0)),0!==d&&(d=Math.ceil(b.getMinutes()/this.minuteStep)*this.minuteStep,60===d&&(c+=1,d=0)),this.showMeridian&&(0===c?c=12:c>=12?(c>12&&(c-=12),f="PM"):f="AM"),this.hour=c,this.minute=d,this.second=e,this.meridian=f,this.update()}else a===!1?(this.hour=0,this.minute=0,this.second=0,this.meridian="AM"):this.setTime(a)},setTime:function(a,b){if(!a)return void this.clear();var c,d,e,f,g,h;if("object"==typeof a&&a.getMonth)e=a.getHours(),f=a.getMinutes(),g=a.getSeconds(),this.showMeridian&&(h="AM",e>12&&(h="PM",e%=12),12===e&&(h="PM"));else{if(c=(/a/i.test(a)?1:0)+(/p/i.test(a)?2:0),c>2)return void this.clear();if(d=a.replace(/[^0-9\:]/g,"").split(":"),e=d[0]?d[0].toString():d.toString(),this.explicitMode&&e.length>2&&e.length%2!==0)return void this.clear();f=d[1]?d[1].toString():"",g=d[2]?d[2].toString():"",e.length>4&&(g=e.slice(-2),e=e.slice(0,-2)),e.length>2&&(f=e.slice(-2),e=e.slice(0,-2)),f.length>2&&(g=f.slice(-2),f=f.slice(0,-2)),e=parseInt(e,10),f=parseInt(f,10),g=parseInt(g,10),isNaN(e)&&(e=0),isNaN(f)&&(f=0),isNaN(g)&&(g=0),g>59&&(g=59),f>59&&(f=59),e>=this.maxHours&&(e=this.maxHours-1),this.showMeridian?(e>12&&(c=2,e-=12),c||(c=1),0===e&&(e=12),h=1===c?"AM":"PM"):12>e&&2===c?e+=12:e>=this.maxHours?e=this.maxHours-1:0>e&&(e=0)}this.hour=e,this.snapToStep?(this.minute=this.changeToNearestStep(f,this.minuteStep),this.second=this.changeToNearestStep(g,this.secondStep)):(this.minute=f,this.second=g),this.meridian=h,this.update(b)},showWidget:function(){this.isOpen||this.$element.is(":disabled")||(this.$widget.appendTo(this.appendWidgetTo),a(c).on("mousedown.timepicker, touchend.timepicker",{scope:this},this.handleDocumentClick),this.$element.trigger({type:"show.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}}),this.place(),this.disableFocus&&this.$element.blur(),""===this.hour&&(this.defaultTime?this.setDefaultTime(this.defaultTime):this.setTime("0:0:0")),"modal"===this.template&&this.$widget.modal?this.$widget.modal("show").on("hidden",a.proxy(this.hideWidget,this)):this.isOpen===!1&&this.$widget.addClass("open"),this.isOpen=!0)},toggleMeridian:function(){this.meridian="AM"===this.meridian?"PM":"AM"},update:function(a){this.updateElement(),a||this.updateWidget(),this.$element.trigger({type:"changeTime.timepicker",time:{value:this.getTime(),hours:this.hour,minutes:this.minute,seconds:this.second,meridian:this.meridian}})},updateElement:function(){this.$element.val(this.getTime()).change()},updateFromElementVal:function(){this.setTime(this.$element.val())},updateWidget:function(){if(this.$widget!==!1){var a=this.hour,b=1===this.minute.toString().length?"0"+this.minute:this.minute,c=1===this.second.toString().length?"0"+this.second:this.second;this.showInputs?(this.$widget.find("input.bootstrap-timepicker-hour").val(a),this.$widget.find("input.bootstrap-timepicker-minute").val(b),this.showSeconds&&this.$widget.find("input.bootstrap-timepicker-second").val(c),this.showMeridian&&this.$widget.find("input.bootstrap-timepicker-meridian").val(this.meridian)):(this.$widget.find("span.bootstrap-timepicker-hour").text(a),this.$widget.find("span.bootstrap-timepicker-minute").text(b),this.showSeconds&&this.$widget.find("span.bootstrap-timepicker-second").text(c),this.showMeridian&&this.$widget.find("span.bootstrap-timepicker-meridian").text(this.meridian))}},updateFromWidgetInputs:function(){if(this.$widget!==!1){var a=this.$widget.find("input.bootstrap-timepicker-hour").val()+":"+this.$widget.find("input.bootstrap-timepicker-minute").val()+(this.showSeconds?":"+this.$widget.find("input.bootstrap-timepicker-second").val():"")+(this.showMeridian?this.$widget.find("input.bootstrap-timepicker-meridian").val():"");this.setTime(a,!0)}},widgetClick:function(b){b.stopPropagation(),b.preventDefault();var c=a(b.target),d=c.closest("a").data("action");d&&this[d](),this.update(),c.is("input")&&c.get(0).setSelectionRange(0,2)},widgetKeydown:function(b){var c=a(b.target),d=c.attr("class").replace("bootstrap-timepicker-","");switch(b.which){case 9:if(b.shiftKey){if("hour"===d)return this.hideWidget()}else if(this.showMeridian&&"meridian"===d||this.showSeconds&&"second"===d||!this.showMeridian&&!this.showSeconds&&"minute"===d)return this.hideWidget();break;case 27:this.hideWidget();break;case 38:switch(b.preventDefault(),d){case"hour":this.incrementHour();break;case"minute":this.incrementMinute();break;case"second":this.incrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),c.get(0).setSelectionRange(0,2);break;case 40:switch(b.preventDefault(),d){case"hour":this.decrementHour();break;case"minute":this.decrementMinute();break;case"second":this.decrementSecond();break;case"meridian":this.toggleMeridian()}this.setTime(this.getTime()),c.get(0).setSelectionRange(0,2)}},widgetKeyup:function(a){(65===a.which||77===a.which||80===a.which||46===a.which||8===a.which||a.which>=48&&a.which<=57||a.which>=96&&a.which<=105)&&this.updateFromWidgetInputs()}},a.fn.timepicker=function(b){var c=Array.apply(null,arguments);return c.shift(),this.each(function(){var e=a(this),f=e.data("timepicker"),g="object"==typeof b&&b;f||e.data("timepicker",f=new d(this,a.extend({},a.fn.timepicker.defaults,g,a(this).data()))),"string"==typeof b&&f[b].apply(f,c)})},a.fn.timepicker.defaults={defaultTime:"current",disableFocus:!1,disableMousewheel:!1,isOpen:!1,minuteStep:15,modalBackdrop:!1,orientation:{x:"auto",y:"auto"},secondStep:15,snapToStep:!1,showSeconds:!1,showInputs:!0,showMeridian:!0,template:"dropdown",appendWidgetTo:"body",showWidgetOnAddonClick:!0,maxHours:24,explicitMode:!1},a.fn.timepicker.Constructor=d,a(c).on("focus.timepicker.data-api click.timepicker.data-api",'[data-provide="timepicker"]',function(b){var c=a(this);c.data("timepicker")||(b.preventDefault(),c.timepicker())})}(jQuery,window,document);