spiderfw 0.6.39 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +2 -0
  3. data/Rakefile +4 -3
  4. data/VERSION +1 -1
  5. data/apps/core/admin/public/css/sass/admin.css +61 -12
  6. data/apps/core/admin/public/sass/admin.scss +51 -0
  7. data/apps/core/admin/views/login.layout.shtml +1 -1
  8. data/apps/core/components/assets.rb +34 -2
  9. data/apps/core/components/po/it/spider_components.po +2 -2
  10. data/apps/core/components/public/bootstrap/scss/_aggiunte_bootstrap_3.scss +54 -0
  11. data/apps/core/components/public/bootstrap/scss/_pagination.scss +1 -1
  12. data/apps/core/components/public/bootstrap/scss/_variables.scss +2 -0
  13. data/apps/core/components/public/bootstrap/scss/bootstrap.css +48 -2
  14. data/apps/core/components/public/bootstrap/scss/bootstrap.scss +4 -1
  15. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.eot +0 -0
  16. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.svg +272 -213
  17. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.ttf +0 -0
  18. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.woff +0 -0
  19. data/apps/core/components/public/bootstrap_3/img/glyphicons-halflings-regular.woff2 +0 -0
  20. data/apps/core/components/public/bootstrap_3/js/affix.js +48 -26
  21. data/apps/core/components/public/bootstrap_3/js/alert.js +8 -6
  22. data/apps/core/components/public/bootstrap_3/js/button.js +27 -17
  23. data/apps/core/components/public/bootstrap_3/js/carousel.js +66 -39
  24. data/apps/core/components/public/bootstrap_3/js/collapse.js +73 -42
  25. data/apps/core/components/public/bootstrap_3/js/dropdown.js +54 -40
  26. data/apps/core/components/public/bootstrap_3/js/modal.js +102 -42
  27. data/apps/core/components/public/bootstrap_3/js/popover.js +6 -11
  28. data/apps/core/components/public/bootstrap_3/js/scrollspy.js +47 -33
  29. data/apps/core/components/public/bootstrap_3/js/tab.js +48 -21
  30. data/apps/core/components/public/bootstrap_3/js/tooltip.js +118 -60
  31. data/apps/core/components/public/bootstrap_3/js/transition.js +15 -4
  32. data/apps/core/components/public/bootstrap_3/scss/_alerts.scss +8 -2
  33. data/apps/core/components/public/bootstrap_3/scss/_badges.scss +14 -3
  34. data/apps/core/components/public/bootstrap_3/scss/_button-groups.scss +23 -19
  35. data/apps/core/components/public/bootstrap_3/scss/_buttons.scss +22 -13
  36. data/apps/core/components/public/bootstrap_3/scss/_carousel.scss +28 -2
  37. data/apps/core/components/public/bootstrap_3/scss/_close.scss +1 -0
  38. data/apps/core/components/public/bootstrap_3/scss/_code.scss +7 -0
  39. data/apps/core/components/public/bootstrap_3/scss/_component-animations.scss +3 -1
  40. data/apps/core/components/public/bootstrap_3/scss/_dropdowns.scss +11 -9
  41. data/apps/core/components/public/bootstrap_3/scss/_forms.scss +190 -68
  42. data/apps/core/components/public/bootstrap_3/scss/_glyphicons.scss +83 -13
  43. data/apps/core/components/public/bootstrap_3/scss/_grid.scss +4 -4
  44. data/apps/core/components/public/bootstrap_3/scss/_input-groups.scss +1 -0
  45. data/apps/core/components/public/bootstrap_3/scss/_jumbotron.scss +8 -4
  46. data/apps/core/components/public/bootstrap_3/scss/_list-group.scss +13 -12
  47. data/apps/core/components/public/bootstrap_3/scss/_media.scss +40 -30
  48. data/apps/core/components/public/bootstrap_3/scss/_mixins.scss +1 -0
  49. data/apps/core/components/public/bootstrap_3/scss/_modals.scss +7 -4
  50. data/apps/core/components/public/bootstrap_3/scss/_navbar.scss +36 -32
  51. data/apps/core/components/public/bootstrap_3/scss/_navs.scss +3 -3
  52. data/apps/core/components/public/bootstrap_3/scss/_normalize.scss +12 -13
  53. data/apps/core/components/public/bootstrap_3/scss/_pager.scss +2 -3
  54. data/apps/core/components/public/bootstrap_3/scss/_pagination.scss +4 -3
  55. data/apps/core/components/public/bootstrap_3/scss/_panels.scss +38 -7
  56. data/apps/core/components/public/bootstrap_3/scss/_popovers.scss +5 -7
  57. data/apps/core/components/public/bootstrap_3/scss/_print.scss +96 -96
  58. data/apps/core/components/public/bootstrap_3/scss/_progress-bars.scss +20 -22
  59. data/apps/core/components/public/bootstrap_3/scss/_responsive-embed.scss +10 -9
  60. data/apps/core/components/public/bootstrap_3/scss/_responsive-utilities.scss +8 -3
  61. data/apps/core/components/public/bootstrap_3/scss/_scaffolding.scss +15 -4
  62. data/apps/core/components/public/bootstrap_3/scss/_tables.scss +15 -14
  63. data/apps/core/components/public/bootstrap_3/scss/_theme.scss +57 -13
  64. data/apps/core/components/public/bootstrap_3/scss/_thumbnails.scss +2 -2
  65. data/apps/core/components/public/bootstrap_3/scss/_tooltip.scss +13 -7
  66. data/apps/core/components/public/bootstrap_3/scss/_type.scss +21 -21
  67. data/apps/core/components/public/bootstrap_3/scss/_utilities.scss +3 -4
  68. data/apps/core/components/public/bootstrap_3/scss/_variables.scss +54 -32
  69. data/apps/core/components/public/bootstrap_3/scss/bootstrap.css +8772 -0
  70. data/apps/core/components/public/bootstrap_3/scss/bootstrap.scss +6 -0
  71. data/apps/core/components/public/bootstrap_3/scss/mixins/_background-variant.scss +2 -1
  72. data/apps/core/components/public/bootstrap_3/scss/mixins/_buttons.scss +19 -1
  73. data/apps/core/components/public/bootstrap_3/scss/mixins/_forms.scss +5 -1
  74. data/apps/core/components/public/bootstrap_3/scss/mixins/_gradients.scss +1 -1
  75. data/apps/core/components/public/bootstrap_3/scss/mixins/_grid-framework.scss +4 -10
  76. data/apps/core/components/public/bootstrap_3/scss/mixins/_grid.scss +7 -7
  77. data/apps/core/components/public/bootstrap_3/scss/mixins/_hide-text.scss +3 -3
  78. data/apps/core/components/public/bootstrap_3/scss/mixins/_labels.scss +1 -1
  79. data/apps/core/components/public/bootstrap_3/scss/mixins/_list-group.scss +3 -2
  80. data/apps/core/components/public/bootstrap_3/scss/mixins/_opacity.scss +1 -1
  81. data/apps/core/components/public/bootstrap_3/scss/mixins/_pagination.scss +2 -1
  82. data/apps/core/components/public/bootstrap_3/scss/mixins/_panels.scss +4 -0
  83. data/apps/core/components/public/bootstrap_3/scss/mixins/_progress-bar.scss +3 -1
  84. data/apps/core/components/public/bootstrap_3/scss/mixins/_reset-text.scss +18 -0
  85. data/apps/core/components/public/bootstrap_3/scss/mixins/_responsive-visibility.scss +1 -1
  86. data/apps/core/components/public/bootstrap_3/scss/mixins/_text-emphasis.scss +2 -1
  87. data/apps/core/components/public/bootstrap_3/scss/mixins/_vendor-prefixes.scss +11 -13
  88. data/apps/core/components/public/css/table_base.css +46 -1
  89. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.eot +0 -0
  90. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.svg +565 -0
  91. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.ttf +0 -0
  92. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.woff +0 -0
  93. data/apps/core/components/public/fontawesome_4/fonts/font-awesome/fontawesome-webfont.woff2 +0 -0
  94. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome.css +2893 -0
  95. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_animated.scss +34 -0
  96. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_bordered-pulled.scss +16 -0
  97. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_core.scss +12 -0
  98. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_extras.scss +44 -0
  99. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_fixed-width.scss +6 -0
  100. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_icons.scss +596 -0
  101. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_larger.scss +13 -0
  102. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_list.scss +19 -0
  103. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_mixins.scss +26 -0
  104. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_path.scss +14 -0
  105. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_rotated-flipped.scss +20 -0
  106. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_stacked.scss +20 -0
  107. data/apps/core/components/public/fontawesome_4/stylesheets/font-awesome/_variables.scss +608 -0
  108. data/apps/core/components/public/fontawesome_4/stylesheets/font_awesome.css +2893 -0
  109. data/apps/core/components/public/fontawesome_4/stylesheets/font_awesome.scss +17 -0
  110. data/apps/core/components/public/js/paginatore.js +307 -0
  111. data/apps/core/components/public/js/spin.js +399 -0
  112. data/apps/core/components/public/mmenu/js/jquery.mmenu.js +133 -0
  113. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.borderstyle.scss +33 -0
  114. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.effects.scss +199 -0
  115. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.fullscreen.scss +24 -0
  116. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.iconbar.scss +26 -0
  117. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.multiline.scss +15 -0
  118. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.pagedim.scss +36 -0
  119. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.pageshadow.scss +36 -0
  120. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.positioning.scss +87 -0
  121. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.themes.scss +76 -0
  122. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.tileview.scss +98 -0
  123. data/apps/core/components/public/mmenu/scss/extensions/_jquery.mmenu.widescreen.scss +61 -0
  124. data/apps/core/components/public/mmenu/scss/inc/_colors.scss +175 -0
  125. data/apps/core/components/public/mmenu/scss/inc/_mixins.scss +135 -0
  126. data/apps/core/components/public/mmenu/scss/inc/_sizing.scss +86 -0
  127. data/apps/core/components/public/mmenu/scss/inc/_variables.scss +61 -0
  128. data/apps/core/components/public/mmenu/scss/jquery.mmenu.scss +478 -0
  129. data/apps/core/components/widgets/table/table.rb +7 -0
  130. data/apps/core/components/widgets/table/table.shtml +50 -17
  131. data/apps/core/forms/tags/row.erb +1 -1
  132. data/lib/spiderfw/cmd/cmd.rb +2 -0
  133. data/lib/spiderfw/cmd/commands/assets.rb +12 -0
  134. data/lib/spiderfw/controller/mixins/visual.rb +1 -0
  135. data/lib/spiderfw/create.rb +0 -1
  136. data/lib/spiderfw/i18n/gettext.rb +33 -0
  137. data/lib/spiderfw/i18n/javascript_parser.rb +2 -2
  138. data/lib/spiderfw/i18n/shtml_parser.rb +2 -2
  139. data/lib/spiderfw/model/model.rb +2 -1
  140. data/lib/spiderfw/setup/app_manager.rb +8 -0
  141. data/lib/spiderfw/spider.rb +9 -1
  142. data/lib/spiderfw/templates/layout.rb +47 -39
  143. data/lib/spiderfw/templates/template.rb +12 -4
  144. metadata +46 -1
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: affix.js v3.1.1
2
+ * Bootstrap: affix.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#affix
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -21,14 +21,14 @@
21
21
  .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
22
22
 
23
23
  this.$element = $(element)
24
- this.affixed =
25
- this.unpin =
24
+ this.affixed = null
25
+ this.unpin = null
26
26
  this.pinnedOffset = null
27
27
 
28
28
  this.checkPosition()
29
29
  }
30
30
 
31
- Affix.VERSION = '3.1.1'
31
+ Affix.VERSION = '3.3.5'
32
32
 
33
33
  Affix.RESET = 'affix affix-top affix-bottom'
34
34
 
@@ -37,6 +37,28 @@
37
37
  target: window
38
38
  }
39
39
 
40
+ Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
41
+ var scrollTop = this.$target.scrollTop()
42
+ var position = this.$element.offset()
43
+ var targetHeight = this.$target.height()
44
+
45
+ if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false
46
+
47
+ if (this.affixed == 'bottom') {
48
+ if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
49
+ return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
50
+ }
51
+
52
+ var initializing = this.affixed == null
53
+ var colliderTop = initializing ? scrollTop : position.top
54
+ var colliderHeight = initializing ? targetHeight : height
55
+
56
+ if (offsetTop != null && scrollTop <= offsetTop) return 'top'
57
+ if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
58
+
59
+ return false
60
+ }
61
+
40
62
  Affix.prototype.getPinnedOffset = function () {
41
63
  if (this.pinnedOffset) return this.pinnedOffset
42
64
  this.$element.removeClass(Affix.RESET).addClass('affix')
@@ -52,41 +74,41 @@
52
74
  Affix.prototype.checkPosition = function () {
53
75
  if (!this.$element.is(':visible')) return
54
76
 
55
- var scrollHeight = $(document).height()
56
- var scrollTop = this.$target.scrollTop()
57
- var position = this.$element.offset()
77
+ var height = this.$element.height()
58
78
  var offset = this.options.offset
59
79
  var offsetTop = offset.top
60
80
  var offsetBottom = offset.bottom
81
+ var scrollHeight = Math.max($(document).height(), $(document.body).height())
61
82
 
62
83
  if (typeof offset != 'object') offsetBottom = offsetTop = offset
63
84
  if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
64
85
  if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
65
86
 
66
- var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
67
- offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
68
- offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
87
+ var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)
69
88
 
70
- if (this.affixed === affix) return
71
- if (this.unpin != null) this.$element.css('top', '')
89
+ if (this.affixed != affix) {
90
+ if (this.unpin != null) this.$element.css('top', '')
72
91
 
73
- var affixType = 'affix' + (affix ? '-' + affix : '')
74
- var e = $.Event(affixType + '.bs.affix')
92
+ var affixType = 'affix' + (affix ? '-' + affix : '')
93
+ var e = $.Event(affixType + '.bs.affix')
75
94
 
76
- this.$element.trigger(e)
95
+ this.$element.trigger(e)
77
96
 
78
- if (e.isDefaultPrevented()) return
97
+ if (e.isDefaultPrevented()) return
79
98
 
80
- this.affixed = affix
81
- this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
99
+ this.affixed = affix
100
+ this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
82
101
 
83
- this.$element
84
- .removeClass(Affix.RESET)
85
- .addClass(affixType)
86
- .trigger($.Event(affixType.replace('affix', 'affixed')))
102
+ this.$element
103
+ .removeClass(Affix.RESET)
104
+ .addClass(affixType)
105
+ .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
106
+ }
87
107
 
88
108
  if (affix == 'bottom') {
89
- this.$element.offset({ top: scrollHeight - this.$element.height() - offsetBottom })
109
+ this.$element.offset({
110
+ top: scrollHeight - height - offsetBottom
111
+ })
90
112
  }
91
113
  }
92
114
 
@@ -130,8 +152,8 @@
130
152
 
131
153
  data.offset = data.offset || {}
132
154
 
133
- if (data.offsetBottom) data.offset.bottom = data.offsetBottom
134
- if (data.offsetTop) data.offset.top = data.offsetTop
155
+ if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
156
+ if (data.offsetTop != null) data.offset.top = data.offsetTop
135
157
 
136
158
  Plugin.call($spy, data)
137
159
  })
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: alert.js v3.1.1
2
+ * Bootstrap: alert.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#alerts
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -18,7 +18,9 @@
18
18
  $(el).on('click', dismiss, this.close)
19
19
  }
20
20
 
21
- Alert.VERSION = '3.1.1'
21
+ Alert.VERSION = '3.3.5'
22
+
23
+ Alert.TRANSITION_DURATION = 150
22
24
 
23
25
  Alert.prototype.close = function (e) {
24
26
  var $this = $(this)
@@ -34,7 +36,7 @@
34
36
  if (e) e.preventDefault()
35
37
 
36
38
  if (!$parent.length) {
37
- $parent = $this.hasClass('alert') ? $this : $this.parent()
39
+ $parent = $this.closest('.alert')
38
40
  }
39
41
 
40
42
  $parent.trigger(e = $.Event('close.bs.alert'))
@@ -50,8 +52,8 @@
50
52
 
51
53
  $.support.transition && $parent.hasClass('fade') ?
52
54
  $parent
53
- .one($.support.transition.end, removeElement)
54
- .emulateTransitionEnd(150) :
55
+ .one('bsTransitionEnd', removeElement)
56
+ .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
55
57
  removeElement()
56
58
  }
57
59
 
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: button.js v3.1.1
2
+ * Bootstrap: button.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#buttons
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -19,7 +19,7 @@
19
19
  this.isLoading = false
20
20
  }
21
21
 
22
- Button.VERSION = '3.1.1'
22
+ Button.VERSION = '3.3.5'
23
23
 
24
24
  Button.DEFAULTS = {
25
25
  loadingText: 'loading...'
@@ -31,14 +31,14 @@
31
31
  var val = $el.is('input') ? 'val' : 'html'
32
32
  var data = $el.data()
33
33
 
34
- state = state + 'Text'
34
+ state += 'Text'
35
35
 
36
36
  if (data.resetText == null) $el.data('resetText', $el[val]())
37
37
 
38
- $el[val](data[state] == null ? this.options[state] : data[state])
39
-
40
38
  // push to event loop to allow forms to submit
41
39
  setTimeout($.proxy(function () {
40
+ $el[val](data[state] == null ? this.options[state] : data[state])
41
+
42
42
  if (state == 'loadingText') {
43
43
  this.isLoading = true
44
44
  $el.addClass(d).attr(d, d)
@@ -56,13 +56,19 @@
56
56
  if ($parent.length) {
57
57
  var $input = this.$element.find('input')
58
58
  if ($input.prop('type') == 'radio') {
59
- if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
60
- else $parent.find('.active').removeClass('active')
59
+ if ($input.prop('checked')) changed = false
60
+ $parent.find('.active').removeClass('active')
61
+ this.$element.addClass('active')
62
+ } else if ($input.prop('type') == 'checkbox') {
63
+ if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false
64
+ this.$element.toggleClass('active')
61
65
  }
62
- if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
66
+ $input.prop('checked', this.$element.hasClass('active'))
67
+ if (changed) $input.trigger('change')
68
+ } else {
69
+ this.$element.attr('aria-pressed', !this.$element.hasClass('active'))
70
+ this.$element.toggleClass('active')
63
71
  }
64
-
65
- if (changed) this.$element.toggleClass('active')
66
72
  }
67
73
 
68
74
 
@@ -100,11 +106,15 @@
100
106
  // BUTTON DATA-API
101
107
  // ===============
102
108
 
103
- $(document).on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
104
- var $btn = $(e.target)
105
- if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
106
- Plugin.call($btn, 'toggle')
107
- e.preventDefault()
108
- })
109
+ $(document)
110
+ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
111
+ var $btn = $(e.target)
112
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
113
+ Plugin.call($btn, 'toggle')
114
+ if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault()
115
+ })
116
+ .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) {
117
+ $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type))
118
+ })
109
119
 
110
120
  }(jQuery);
@@ -1,8 +1,8 @@
1
1
  /* ========================================================================
2
- * Bootstrap: carousel.js v3.1.1
2
+ * Bootstrap: carousel.js v3.3.5
3
3
  * http://getbootstrap.com/javascript/#carousel
4
4
  * ========================================================================
5
- * Copyright 2011-2014 Twitter, Inc.
5
+ * Copyright 2011-2015 Twitter, Inc.
6
6
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
7
  * ======================================================================== */
8
8
 
@@ -17,26 +17,42 @@
17
17
  this.$element = $(element)
18
18
  this.$indicators = this.$element.find('.carousel-indicators')
19
19
  this.options = options
20
- this.paused =
21
- this.sliding =
22
- this.interval =
23
- this.$active =
20
+ this.paused = null
21
+ this.sliding = null
22
+ this.interval = null
23
+ this.$active = null
24
24
  this.$items = null
25
25
 
26
- this.options.pause == 'hover' && this.$element
27
- .on('mouseenter', $.proxy(this.pause, this))
28
- .on('mouseleave', $.proxy(this.cycle, this))
26
+ this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this))
27
+
28
+ this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element
29
+ .on('mouseenter.bs.carousel', $.proxy(this.pause, this))
30
+ .on('mouseleave.bs.carousel', $.proxy(this.cycle, this))
29
31
  }
30
32
 
31
- Carousel.VERSION = '3.1.1'
33
+ Carousel.VERSION = '3.3.5'
34
+
35
+ Carousel.TRANSITION_DURATION = 600
32
36
 
33
37
  Carousel.DEFAULTS = {
34
38
  interval: 5000,
35
39
  pause: 'hover',
36
- wrap: true
40
+ wrap: true,
41
+ keyboard: true
42
+ }
43
+
44
+ Carousel.prototype.keydown = function (e) {
45
+ if (/input|textarea/i.test(e.target.tagName)) return
46
+ switch (e.which) {
47
+ case 37: this.prev(); break
48
+ case 39: this.next(); break
49
+ default: return
50
+ }
51
+
52
+ e.preventDefault()
37
53
  }
38
54
 
39
- Carousel.prototype.cycle = function (e) {
55
+ Carousel.prototype.cycle = function (e) {
40
56
  e || (this.paused = false)
41
57
 
42
58
  this.interval && clearInterval(this.interval)
@@ -48,23 +64,31 @@
48
64
  return this
49
65
  }
50
66
 
51
- Carousel.prototype.getActiveIndex = function () {
52
- this.$active = this.$element.find('.item.active')
53
- this.$items = this.$active.parent().children('.item')
67
+ Carousel.prototype.getItemIndex = function (item) {
68
+ this.$items = item.parent().children('.item')
69
+ return this.$items.index(item || this.$active)
70
+ }
54
71
 
55
- return this.$items.index(this.$active)
72
+ Carousel.prototype.getItemForDirection = function (direction, active) {
73
+ var activeIndex = this.getItemIndex(active)
74
+ var willWrap = (direction == 'prev' && activeIndex === 0)
75
+ || (direction == 'next' && activeIndex == (this.$items.length - 1))
76
+ if (willWrap && !this.options.wrap) return active
77
+ var delta = direction == 'prev' ? -1 : 1
78
+ var itemIndex = (activeIndex + delta) % this.$items.length
79
+ return this.$items.eq(itemIndex)
56
80
  }
57
81
 
58
82
  Carousel.prototype.to = function (pos) {
59
83
  var that = this
60
- var activeIndex = this.getActiveIndex()
84
+ var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active'))
61
85
 
62
86
  if (pos > (this.$items.length - 1) || pos < 0) return
63
87
 
64
88
  if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) // yes, "slid"
65
89
  if (activeIndex == pos) return this.pause().cycle()
66
90
 
67
- return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
91
+ return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos))
68
92
  }
69
93
 
70
94
  Carousel.prototype.pause = function (e) {
@@ -92,21 +116,18 @@
92
116
 
93
117
  Carousel.prototype.slide = function (type, next) {
94
118
  var $active = this.$element.find('.item.active')
95
- var $next = next || $active[type]()
119
+ var $next = next || this.getItemForDirection(type, $active)
96
120
  var isCycling = this.interval
97
121
  var direction = type == 'next' ? 'left' : 'right'
98
- var fallback = type == 'next' ? 'first' : 'last'
99
122
  var that = this
100
123
 
101
- if (!$next.length) {
102
- if (!this.options.wrap) return
103
- $next = this.$element.find('.item')[fallback]()
104
- }
105
-
106
- if ($next.hasClass('active')) return this.sliding = false
124
+ if ($next.hasClass('active')) return (this.sliding = false)
107
125
 
108
126
  var relatedTarget = $next[0]
109
- var slideEvent = $.Event('slide.bs.carousel', { relatedTarget: relatedTarget, direction: direction })
127
+ var slideEvent = $.Event('slide.bs.carousel', {
128
+ relatedTarget: relatedTarget,
129
+ direction: direction
130
+ })
110
131
  this.$element.trigger(slideEvent)
111
132
  if (slideEvent.isDefaultPrevented()) return
112
133
 
@@ -116,10 +137,8 @@
116
137
 
117
138
  if (this.$indicators.length) {
118
139
  this.$indicators.find('.active').removeClass('active')
119
- this.$element.one('slid.bs.carousel', function () { // yes, "slid"
120
- var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
121
- $nextIndicator && $nextIndicator.addClass('active')
122
- })
140
+ var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)])
141
+ $nextIndicator && $nextIndicator.addClass('active')
123
142
  }
124
143
 
125
144
  var slidEvent = $.Event('slid.bs.carousel', { relatedTarget: relatedTarget, direction: direction }) // yes, "slid"
@@ -129,13 +148,15 @@
129
148
  $active.addClass(direction)
130
149
  $next.addClass(direction)
131
150
  $active
132
- .one($.support.transition.end, function () {
151
+ .one('bsTransitionEnd', function () {
133
152
  $next.removeClass([type, direction].join(' ')).addClass('active')
134
153
  $active.removeClass(['active', direction].join(' '))
135
154
  that.sliding = false
136
- setTimeout(function () { that.$element.trigger(slidEvent) }, 0)
155
+ setTimeout(function () {
156
+ that.$element.trigger(slidEvent)
157
+ }, 0)
137
158
  })
138
- .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
159
+ .emulateTransitionEnd(Carousel.TRANSITION_DURATION)
139
160
  } else {
140
161
  $active.removeClass('active')
141
162
  $next.addClass('active')
@@ -184,21 +205,27 @@
184
205
  // CAROUSEL DATA-API
185
206
  // =================
186
207
 
187
- $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
188
- var $this = $(this), href
189
- var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
208
+ var clickHandler = function (e) {
209
+ var href
210
+ var $this = $(this)
211
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
212
+ if (!$target.hasClass('carousel')) return
190
213
  var options = $.extend({}, $target.data(), $this.data())
191
214
  var slideIndex = $this.attr('data-slide-to')
192
215
  if (slideIndex) options.interval = false
193
216
 
194
217
  Plugin.call($target, options)
195
218
 
196
- if (slideIndex = $this.attr('data-slide-to')) {
219
+ if (slideIndex) {
197
220
  $target.data('bs.carousel').to(slideIndex)
198
221
  }
199
222
 
200
223
  e.preventDefault()
201
- })
224
+ }
225
+
226
+ $(document)
227
+ .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)
228
+ .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler)
202
229
 
203
230
  $(window).on('load', function () {
204
231
  $('[data-ride="carousel"]').each(function () {