tennpipes-su 3.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (192) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.rdoc +70 -0
  4. data/Rakefile +22 -0
  5. data/lib/tennpipes-su.rb +35 -0
  6. data/lib/tennpipes-su/access_control.rb +191 -0
  7. data/lib/tennpipes-su/bootstrap-less/alerts.less +67 -0
  8. data/lib/tennpipes-su/bootstrap-less/badges.less +55 -0
  9. data/lib/tennpipes-su/bootstrap-less/bootstrap.less +49 -0
  10. data/lib/tennpipes-su/bootstrap-less/breadcrumbs.less +26 -0
  11. data/lib/tennpipes-su/bootstrap-less/button-groups.less +226 -0
  12. data/lib/tennpipes-su/bootstrap-less/buttons.less +155 -0
  13. data/lib/tennpipes-su/bootstrap-less/carousel.less +232 -0
  14. data/lib/tennpipes-su/bootstrap-less/close.less +33 -0
  15. data/lib/tennpipes-su/bootstrap-less/code.less +63 -0
  16. data/lib/tennpipes-su/bootstrap-less/component-animations.less +29 -0
  17. data/lib/tennpipes-su/bootstrap-less/dropdowns.less +213 -0
  18. data/lib/tennpipes-su/bootstrap-less/font-awesome/bordered-pulled.less +16 -0
  19. data/lib/tennpipes-su/bootstrap-less/font-awesome/core.less +12 -0
  20. data/lib/tennpipes-su/bootstrap-less/font-awesome/fixed-width.less +6 -0
  21. data/lib/tennpipes-su/bootstrap-less/font-awesome/font-awesome.less +17 -0
  22. data/lib/tennpipes-su/bootstrap-less/font-awesome/icons.less +412 -0
  23. data/lib/tennpipes-su/bootstrap-less/font-awesome/larger.less +13 -0
  24. data/lib/tennpipes-su/bootstrap-less/font-awesome/list.less +19 -0
  25. data/lib/tennpipes-su/bootstrap-less/font-awesome/mixins.less +20 -0
  26. data/lib/tennpipes-su/bootstrap-less/font-awesome/path.less +14 -0
  27. data/lib/tennpipes-su/bootstrap-less/font-awesome/rotated-flipped.less +9 -0
  28. data/lib/tennpipes-su/bootstrap-less/font-awesome/spinning.less +30 -0
  29. data/lib/tennpipes-su/bootstrap-less/font-awesome/stacked.less +20 -0
  30. data/lib/tennpipes-su/bootstrap-less/font-awesome/variables.less +381 -0
  31. data/lib/tennpipes-su/bootstrap-less/forms.less +419 -0
  32. data/lib/tennpipes-su/bootstrap-less/glyphicons.less +233 -0
  33. data/lib/tennpipes-su/bootstrap-less/grid.less +100 -0
  34. data/lib/tennpipes-su/bootstrap-less/input-groups.less +157 -0
  35. data/lib/tennpipes-su/bootstrap-less/jumbotron.less +44 -0
  36. data/lib/tennpipes-su/bootstrap-less/labels.less +64 -0
  37. data/lib/tennpipes-su/bootstrap-less/list-group.less +110 -0
  38. data/lib/tennpipes-su/bootstrap-less/media.less +56 -0
  39. data/lib/tennpipes-su/bootstrap-less/mixins.less +926 -0
  40. data/lib/tennpipes-su/bootstrap-less/modals.less +138 -0
  41. data/lib/tennpipes-su/bootstrap-less/navbar.less +616 -0
  42. data/lib/tennpipes-su/bootstrap-less/navs.less +242 -0
  43. data/lib/tennpipes-su/bootstrap-less/normalize.less +423 -0
  44. data/lib/tennpipes-su/bootstrap-less/pager.less +55 -0
  45. data/lib/tennpipes-su/bootstrap-less/pagination.less +88 -0
  46. data/lib/tennpipes-su/bootstrap-less/panels.less +230 -0
  47. data/lib/tennpipes-su/bootstrap-less/popovers.less +133 -0
  48. data/lib/tennpipes-su/bootstrap-less/print.less +101 -0
  49. data/lib/tennpipes-su/bootstrap-less/progress-bars.less +80 -0
  50. data/lib/tennpipes-su/bootstrap-less/responsive-utilities.less +93 -0
  51. data/lib/tennpipes-su/bootstrap-less/scaffolding.less +134 -0
  52. data/lib/tennpipes-su/bootstrap-less/tables.less +233 -0
  53. data/lib/tennpipes-su/bootstrap-less/tennpipes-su.less +18 -0
  54. data/lib/tennpipes-su/bootstrap-less/theme.less +247 -0
  55. data/lib/tennpipes-su/bootstrap-less/thumbnails.less +36 -0
  56. data/lib/tennpipes-su/bootstrap-less/tooltip.less +95 -0
  57. data/lib/tennpipes-su/bootstrap-less/type.less +296 -0
  58. data/lib/tennpipes-su/bootstrap-less/utilities.less +56 -0
  59. data/lib/tennpipes-su/bootstrap-less/variables.less +827 -0
  60. data/lib/tennpipes-su/bootstrap-less/wells.less +29 -0
  61. data/lib/tennpipes-su/generators/actions.rb +78 -0
  62. data/lib/tennpipes-su/generators/admin_app.rb +169 -0
  63. data/lib/tennpipes-su/generators/admin_page.rb +68 -0
  64. data/lib/tennpipes-su/generators/orm.rb +172 -0
  65. data/lib/tennpipes-su/generators/templates/account/activerecord.rb.tt +41 -0
  66. data/lib/tennpipes-su/generators/templates/account/couchrest.rb.tt +67 -0
  67. data/lib/tennpipes-su/generators/templates/account/datamapper.rb.tt +56 -0
  68. data/lib/tennpipes-su/generators/templates/account/dynamoid.rb.tt +55 -0
  69. data/lib/tennpipes-su/generators/templates/account/minirecord.rb.tt +44 -0
  70. data/lib/tennpipes-su/generators/templates/account/mongoid.rb.tt +54 -0
  71. data/lib/tennpipes-su/generators/templates/account/mongomapper.rb.tt +47 -0
  72. data/lib/tennpipes-su/generators/templates/account/ohm.rb.tt +70 -0
  73. data/lib/tennpipes-su/generators/templates/account/seeds.rb.tt +29 -0
  74. data/lib/tennpipes-su/generators/templates/account/sequel.rb.tt +53 -0
  75. data/lib/tennpipes-su/generators/templates/app.rb.tt +42 -0
  76. data/lib/tennpipes-su/generators/templates/app/controllers/base.rb.tt +5 -0
  77. data/lib/tennpipes-su/generators/templates/app/controllers/sessions.rb.tt +29 -0
  78. data/lib/tennpipes-su/generators/templates/assets/images/favicon.ico +0 -0
  79. data/lib/tennpipes-su/generators/templates/assets/images/font/FontAwesome.otf +0 -0
  80. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.eot +0 -0
  81. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.svg +414 -0
  82. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.ttf +0 -0
  83. data/lib/tennpipes-su/generators/templates/assets/images/font/fontawesome-webfont.woff +0 -0
  84. data/lib/tennpipes-su/generators/templates/assets/images/logo.png +0 -0
  85. data/lib/tennpipes-su/generators/templates/assets/javascripts/application.js +118 -0
  86. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/affix.js +137 -0
  87. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/alert.js +88 -0
  88. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/bootstrap.min.js +6 -0
  89. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/button.js +107 -0
  90. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/carousel.js +205 -0
  91. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/collapse.js +170 -0
  92. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/dropdown.js +147 -0
  93. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/modal.js +243 -0
  94. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/popover.js +110 -0
  95. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/scrollspy.js +153 -0
  96. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/tab.js +125 -0
  97. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/tooltip.js +399 -0
  98. data/lib/tennpipes-su/generators/templates/assets/javascripts/bootstrap/transition.js +48 -0
  99. data/lib/tennpipes-su/generators/templates/assets/javascripts/jquery-1.11.0.min.js +4 -0
  100. data/lib/tennpipes-su/generators/templates/assets/stylesheets/application.css +353 -0
  101. data/lib/tennpipes-su/generators/templates/assets/stylesheets/bootstrap.css +4 -0
  102. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/FontAwesome.otf +0 -0
  103. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.eot +0 -0
  104. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.svg +414 -0
  105. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.ttf +0 -0
  106. data/lib/tennpipes-su/generators/templates/assets/stylesheets/fonts/fontawesome-webfont.woff +0 -0
  107. data/lib/tennpipes-su/generators/templates/erb/app/base/index.erb.tt +15 -0
  108. data/lib/tennpipes-su/generators/templates/erb/app/errors/403.erb.tt +3 -0
  109. data/lib/tennpipes-su/generators/templates/erb/app/errors/404.erb.tt +3 -0
  110. data/lib/tennpipes-su/generators/templates/erb/app/errors/500.erb.tt +3 -0
  111. data/lib/tennpipes-su/generators/templates/erb/app/layouts/application.erb.tt +64 -0
  112. data/lib/tennpipes-su/generators/templates/erb/app/layouts/error.erb.tt +23 -0
  113. data/lib/tennpipes-su/generators/templates/erb/app/sessions/new.erb.tt +44 -0
  114. data/lib/tennpipes-su/generators/templates/erb/page/_form.erb.tt +18 -0
  115. data/lib/tennpipes-su/generators/templates/erb/page/edit.erb.tt +10 -0
  116. data/lib/tennpipes-su/generators/templates/erb/page/index.erb.tt +81 -0
  117. data/lib/tennpipes-su/generators/templates/erb/page/new.erb.tt +9 -0
  118. data/lib/tennpipes-su/generators/templates/haml/app/base/index.haml.tt +12 -0
  119. data/lib/tennpipes-su/generators/templates/haml/app/errors/403.haml.tt +3 -0
  120. data/lib/tennpipes-su/generators/templates/haml/app/errors/404.haml.tt +3 -0
  121. data/lib/tennpipes-su/generators/templates/haml/app/errors/500.haml.tt +3 -0
  122. data/lib/tennpipes-su/generators/templates/haml/app/layouts/application.haml.tt +49 -0
  123. data/lib/tennpipes-su/generators/templates/haml/app/layouts/error.haml.tt +18 -0
  124. data/lib/tennpipes-su/generators/templates/haml/app/sessions/new.haml.tt +38 -0
  125. data/lib/tennpipes-su/generators/templates/haml/page/_form.haml.tt +16 -0
  126. data/lib/tennpipes-su/generators/templates/haml/page/edit.haml.tt +8 -0
  127. data/lib/tennpipes-su/generators/templates/haml/page/index.haml.tt +58 -0
  128. data/lib/tennpipes-su/generators/templates/haml/page/new.haml.tt +7 -0
  129. data/lib/tennpipes-su/generators/templates/page/controller.rb.tt +92 -0
  130. data/lib/tennpipes-su/generators/templates/slim/app/base/index.slim.tt +12 -0
  131. data/lib/tennpipes-su/generators/templates/slim/app/errors/403.slim.tt +3 -0
  132. data/lib/tennpipes-su/generators/templates/slim/app/errors/404.slim.tt +3 -0
  133. data/lib/tennpipes-su/generators/templates/slim/app/errors/500.slim.tt +3 -0
  134. data/lib/tennpipes-su/generators/templates/slim/app/layouts/application.slim.tt +48 -0
  135. data/lib/tennpipes-su/generators/templates/slim/app/layouts/error.slim.tt +19 -0
  136. data/lib/tennpipes-su/generators/templates/slim/app/sessions/new.slim.tt +37 -0
  137. data/lib/tennpipes-su/generators/templates/slim/page/_form.slim.tt +16 -0
  138. data/lib/tennpipes-su/generators/templates/slim/page/edit.slim.tt +8 -0
  139. data/lib/tennpipes-su/generators/templates/slim/page/index.slim.tt +56 -0
  140. data/lib/tennpipes-su/generators/templates/slim/page/new.slim.tt +7 -0
  141. data/lib/tennpipes-su/helpers/authentication_helpers.rb +108 -0
  142. data/lib/tennpipes-su/helpers/view_helpers.rb +87 -0
  143. data/lib/tennpipes-su/locale/admin/cs.yml +56 -0
  144. data/lib/tennpipes-su/locale/admin/da.yml +56 -0
  145. data/lib/tennpipes-su/locale/admin/de.yml +56 -0
  146. data/lib/tennpipes-su/locale/admin/en.yml +56 -0
  147. data/lib/tennpipes-su/locale/admin/es.yml +56 -0
  148. data/lib/tennpipes-su/locale/admin/fr.yml +56 -0
  149. data/lib/tennpipes-su/locale/admin/hu.yml +56 -0
  150. data/lib/tennpipes-su/locale/admin/it.yml +56 -0
  151. data/lib/tennpipes-su/locale/admin/ja.yml +57 -0
  152. data/lib/tennpipes-su/locale/admin/lv.yml +56 -0
  153. data/lib/tennpipes-su/locale/admin/nl.yml +56 -0
  154. data/lib/tennpipes-su/locale/admin/no.yml +56 -0
  155. data/lib/tennpipes-su/locale/admin/pl.yml +56 -0
  156. data/lib/tennpipes-su/locale/admin/pt_br.yml +56 -0
  157. data/lib/tennpipes-su/locale/admin/ro.yml +56 -0
  158. data/lib/tennpipes-su/locale/admin/ru.yml +57 -0
  159. data/lib/tennpipes-su/locale/admin/sv.yml +56 -0
  160. data/lib/tennpipes-su/locale/admin/tr.yml +56 -0
  161. data/lib/tennpipes-su/locale/admin/uk.yml +56 -0
  162. data/lib/tennpipes-su/locale/admin/zh_cn.yml +56 -0
  163. data/lib/tennpipes-su/locale/admin/zh_tw.yml +56 -0
  164. data/lib/tennpipes-su/locale/orm/cs.yml +12 -0
  165. data/lib/tennpipes-su/locale/orm/da.yml +12 -0
  166. data/lib/tennpipes-su/locale/orm/de.yml +12 -0
  167. data/lib/tennpipes-su/locale/orm/en.yml +12 -0
  168. data/lib/tennpipes-su/locale/orm/es.yml +12 -0
  169. data/lib/tennpipes-su/locale/orm/fr.yml +12 -0
  170. data/lib/tennpipes-su/locale/orm/hu.yml +12 -0
  171. data/lib/tennpipes-su/locale/orm/it.yml +12 -0
  172. data/lib/tennpipes-su/locale/orm/ja.yml +12 -0
  173. data/lib/tennpipes-su/locale/orm/lv.yml +12 -0
  174. data/lib/tennpipes-su/locale/orm/nl.yml +12 -0
  175. data/lib/tennpipes-su/locale/orm/no.yml +12 -0
  176. data/lib/tennpipes-su/locale/orm/pl.yml +38 -0
  177. data/lib/tennpipes-su/locale/orm/pt_br.yml +12 -0
  178. data/lib/tennpipes-su/locale/orm/ro.yml +12 -0
  179. data/lib/tennpipes-su/locale/orm/ru.yml +12 -0
  180. data/lib/tennpipes-su/locale/orm/sv.yml +12 -0
  181. data/lib/tennpipes-su/locale/orm/tr.yml +12 -0
  182. data/lib/tennpipes-su/locale/orm/uk.yml +12 -0
  183. data/lib/tennpipes-su/locale/orm/zh_cn.yml +12 -0
  184. data/lib/tennpipes-su/locale/orm/zh_tw.yml +12 -0
  185. data/test/fixtures/sequel.rb +72 -0
  186. data/test/generators/test_account_model_generator.rb +108 -0
  187. data/test/generators/test_admin_app_generator.rb +218 -0
  188. data/test/generators/test_admin_page_generator.rb +140 -0
  189. data/test/helper.rb +47 -0
  190. data/test/test_admin_application.rb +271 -0
  191. data/test/test_locale.rb +25 -0
  192. metadata +298 -0
@@ -0,0 +1,205 @@
1
+ /* ========================================================================
2
+ * Bootstrap: carousel.js v3.1.0
3
+ * http://getbootstrap.com/javascript/#carousel
4
+ * ========================================================================
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // CAROUSEL CLASS DEFINITION
14
+ // =========================
15
+
16
+ var Carousel = function (element, options) {
17
+ this.$element = $(element)
18
+ this.$indicators = this.$element.find('.carousel-indicators')
19
+ this.options = options
20
+ this.paused =
21
+ this.sliding =
22
+ this.interval =
23
+ this.$active =
24
+ this.$items = null
25
+
26
+ this.options.pause == 'hover' && this.$element
27
+ .on('mouseenter', $.proxy(this.pause, this))
28
+ .on('mouseleave', $.proxy(this.cycle, this))
29
+ }
30
+
31
+ Carousel.DEFAULTS = {
32
+ interval: 5000,
33
+ pause: 'hover',
34
+ wrap: true
35
+ }
36
+
37
+ Carousel.prototype.cycle = function (e) {
38
+ e || (this.paused = false)
39
+
40
+ this.interval && clearInterval(this.interval)
41
+
42
+ this.options.interval
43
+ && !this.paused
44
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
45
+
46
+ return this
47
+ }
48
+
49
+ Carousel.prototype.getActiveIndex = function () {
50
+ this.$active = this.$element.find('.item.active')
51
+ this.$items = this.$active.parent().children()
52
+
53
+ return this.$items.index(this.$active)
54
+ }
55
+
56
+ Carousel.prototype.to = function (pos) {
57
+ var that = this
58
+ var activeIndex = this.getActiveIndex()
59
+
60
+ if (pos > (this.$items.length - 1) || pos < 0) return
61
+
62
+ if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
63
+ if (activeIndex == pos) return this.pause().cycle()
64
+
65
+ return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
66
+ }
67
+
68
+ Carousel.prototype.pause = function (e) {
69
+ e || (this.paused = true)
70
+
71
+ if (this.$element.find('.next, .prev').length && $.support.transition) {
72
+ this.$element.trigger($.support.transition.end)
73
+ this.cycle(true)
74
+ }
75
+
76
+ this.interval = clearInterval(this.interval)
77
+
78
+ return this
79
+ }
80
+
81
+ Carousel.prototype.next = function () {
82
+ if (this.sliding) return
83
+ return this.slide('next')
84
+ }
85
+
86
+ Carousel.prototype.prev = function () {
87
+ if (this.sliding) return
88
+ return this.slide('prev')
89
+ }
90
+
91
+ Carousel.prototype.slide = function (type, next) {
92
+ var $active = this.$element.find('.item.active')
93
+ var $next = next || $active[type]()
94
+ var isCycling = this.interval
95
+ var direction = type == 'next' ? 'left' : 'right'
96
+ var fallback = type == 'next' ? 'first' : 'last'
97
+ var that = this
98
+
99
+ if (!$next.length) {
100
+ if (!this.options.wrap) return
101
+ $next = this.$element.find('.item')[fallback]()
102
+ }
103
+
104
+ if ($next.hasClass('active')) return this.sliding = false
105
+
106
+ var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
107
+ this.$element.trigger(e)
108
+ if (e.isDefaultPrevented()) return
109
+
110
+ this.sliding = true
111
+
112
+ isCycling && this.pause()
113
+
114
+ if (this.$indicators.length) {
115
+ this.$indicators.find('.active').removeClass('active')
116
+ this.$element.one('slid.bs.carousel', function () {
117
+ var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
118
+ $nextIndicator && $nextIndicator.addClass('active')
119
+ })
120
+ }
121
+
122
+ if ($.support.transition && this.$element.hasClass('slide')) {
123
+ $next.addClass(type)
124
+ $next[0].offsetWidth // force reflow
125
+ $active.addClass(direction)
126
+ $next.addClass(direction)
127
+ $active
128
+ .one($.support.transition.end, function () {
129
+ $next.removeClass([type, direction].join(' ')).addClass('active')
130
+ $active.removeClass(['active', direction].join(' '))
131
+ that.sliding = false
132
+ setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
133
+ })
134
+ .emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
135
+ } else {
136
+ $active.removeClass('active')
137
+ $next.addClass('active')
138
+ this.sliding = false
139
+ this.$element.trigger('slid.bs.carousel')
140
+ }
141
+
142
+ isCycling && this.cycle()
143
+
144
+ return this
145
+ }
146
+
147
+
148
+ // CAROUSEL PLUGIN DEFINITION
149
+ // ==========================
150
+
151
+ var old = $.fn.carousel
152
+
153
+ $.fn.carousel = function (option) {
154
+ return this.each(function () {
155
+ var $this = $(this)
156
+ var data = $this.data('bs.carousel')
157
+ var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
158
+ var action = typeof option == 'string' ? option : options.slide
159
+
160
+ if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
161
+ if (typeof option == 'number') data.to(option)
162
+ else if (action) data[action]()
163
+ else if (options.interval) data.pause().cycle()
164
+ })
165
+ }
166
+
167
+ $.fn.carousel.Constructor = Carousel
168
+
169
+
170
+ // CAROUSEL NO CONFLICT
171
+ // ====================
172
+
173
+ $.fn.carousel.noConflict = function () {
174
+ $.fn.carousel = old
175
+ return this
176
+ }
177
+
178
+
179
+ // CAROUSEL DATA-API
180
+ // =================
181
+
182
+ $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
183
+ var $this = $(this), href
184
+ var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
185
+ var options = $.extend({}, $target.data(), $this.data())
186
+ var slideIndex = $this.attr('data-slide-to')
187
+ if (slideIndex) options.interval = false
188
+
189
+ $target.carousel(options)
190
+
191
+ if (slideIndex = $this.attr('data-slide-to')) {
192
+ $target.data('bs.carousel').to(slideIndex)
193
+ }
194
+
195
+ e.preventDefault()
196
+ })
197
+
198
+ $(window).on('load', function () {
199
+ $('[data-ride="carousel"]').each(function () {
200
+ var $carousel = $(this)
201
+ $carousel.carousel($carousel.data())
202
+ })
203
+ })
204
+
205
+ }(jQuery);
@@ -0,0 +1,170 @@
1
+ /* ========================================================================
2
+ * Bootstrap: collapse.js v3.1.0
3
+ * http://getbootstrap.com/javascript/#collapse
4
+ * ========================================================================
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // COLLAPSE PUBLIC CLASS DEFINITION
14
+ // ================================
15
+
16
+ var Collapse = function (element, options) {
17
+ this.$element = $(element)
18
+ this.options = $.extend({}, Collapse.DEFAULTS, options)
19
+ this.transitioning = null
20
+
21
+ if (this.options.parent) this.$parent = $(this.options.parent)
22
+ if (this.options.toggle) this.toggle()
23
+ }
24
+
25
+ Collapse.DEFAULTS = {
26
+ toggle: true
27
+ }
28
+
29
+ Collapse.prototype.dimension = function () {
30
+ var hasWidth = this.$element.hasClass('width')
31
+ return hasWidth ? 'width' : 'height'
32
+ }
33
+
34
+ Collapse.prototype.show = function () {
35
+ if (this.transitioning || this.$element.hasClass('in')) return
36
+
37
+ var startEvent = $.Event('show.bs.collapse')
38
+ this.$element.trigger(startEvent)
39
+ if (startEvent.isDefaultPrevented()) return
40
+
41
+ var actives = this.$parent && this.$parent.find('> .panel > .in')
42
+
43
+ if (actives && actives.length) {
44
+ var hasData = actives.data('bs.collapse')
45
+ if (hasData && hasData.transitioning) return
46
+ actives.collapse('hide')
47
+ hasData || actives.data('bs.collapse', null)
48
+ }
49
+
50
+ var dimension = this.dimension()
51
+
52
+ this.$element
53
+ .removeClass('collapse')
54
+ .addClass('collapsing')
55
+ [dimension](0)
56
+
57
+ this.transitioning = 1
58
+
59
+ var complete = function () {
60
+ this.$element
61
+ .removeClass('collapsing')
62
+ .addClass('collapse in')
63
+ [dimension]('auto')
64
+ this.transitioning = 0
65
+ this.$element.trigger('shown.bs.collapse')
66
+ }
67
+
68
+ if (!$.support.transition) return complete.call(this)
69
+
70
+ var scrollSize = $.camelCase(['scroll', dimension].join('-'))
71
+
72
+ this.$element
73
+ .one($.support.transition.end, $.proxy(complete, this))
74
+ .emulateTransitionEnd(350)
75
+ [dimension](this.$element[0][scrollSize])
76
+ }
77
+
78
+ Collapse.prototype.hide = function () {
79
+ if (this.transitioning || !this.$element.hasClass('in')) return
80
+
81
+ var startEvent = $.Event('hide.bs.collapse')
82
+ this.$element.trigger(startEvent)
83
+ if (startEvent.isDefaultPrevented()) return
84
+
85
+ var dimension = this.dimension()
86
+
87
+ this.$element
88
+ [dimension](this.$element[dimension]())
89
+ [0].offsetHeight
90
+
91
+ this.$element
92
+ .addClass('collapsing')
93
+ .removeClass('collapse')
94
+ .removeClass('in')
95
+
96
+ this.transitioning = 1
97
+
98
+ var complete = function () {
99
+ this.transitioning = 0
100
+ this.$element
101
+ .trigger('hidden.bs.collapse')
102
+ .removeClass('collapsing')
103
+ .addClass('collapse')
104
+ }
105
+
106
+ if (!$.support.transition) return complete.call(this)
107
+
108
+ this.$element
109
+ [dimension](0)
110
+ .one($.support.transition.end, $.proxy(complete, this))
111
+ .emulateTransitionEnd(350)
112
+ }
113
+
114
+ Collapse.prototype.toggle = function () {
115
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
116
+ }
117
+
118
+
119
+ // COLLAPSE PLUGIN DEFINITION
120
+ // ==========================
121
+
122
+ var old = $.fn.collapse
123
+
124
+ $.fn.collapse = function (option) {
125
+ return this.each(function () {
126
+ var $this = $(this)
127
+ var data = $this.data('bs.collapse')
128
+ var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
129
+
130
+ if (!data && options.toggle && option == 'show') option = !option
131
+ if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
132
+ if (typeof option == 'string') data[option]()
133
+ })
134
+ }
135
+
136
+ $.fn.collapse.Constructor = Collapse
137
+
138
+
139
+ // COLLAPSE NO CONFLICT
140
+ // ====================
141
+
142
+ $.fn.collapse.noConflict = function () {
143
+ $.fn.collapse = old
144
+ return this
145
+ }
146
+
147
+
148
+ // COLLAPSE DATA-API
149
+ // =================
150
+
151
+ $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
152
+ var $this = $(this), href
153
+ var target = $this.attr('data-target')
154
+ || e.preventDefault()
155
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
156
+ var $target = $(target)
157
+ var data = $target.data('bs.collapse')
158
+ var option = data ? 'toggle' : $this.data()
159
+ var parent = $this.attr('data-parent')
160
+ var $parent = parent && $(parent)
161
+
162
+ if (!data || !data.transitioning) {
163
+ if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
164
+ $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
165
+ }
166
+
167
+ $target.collapse(option)
168
+ })
169
+
170
+ }(jQuery);
@@ -0,0 +1,147 @@
1
+ /* ========================================================================
2
+ * Bootstrap: dropdown.js v3.1.0
3
+ * http://getbootstrap.com/javascript/#dropdowns
4
+ * ========================================================================
5
+ * Copyright 2011-2014 Twitter, Inc.
6
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
7
+ * ======================================================================== */
8
+
9
+
10
+ +function ($) {
11
+ 'use strict';
12
+
13
+ // DROPDOWN CLASS DEFINITION
14
+ // =========================
15
+
16
+ var backdrop = '.dropdown-backdrop'
17
+ var toggle = '[data-toggle=dropdown]'
18
+ var Dropdown = function (element) {
19
+ $(element).on('click.bs.dropdown', this.toggle)
20
+ }
21
+
22
+ Dropdown.prototype.toggle = function (e) {
23
+ var $this = $(this)
24
+
25
+ if ($this.is('.disabled, :disabled')) return
26
+
27
+ var $parent = getParent($this)
28
+ var isActive = $parent.hasClass('open')
29
+
30
+ clearMenus()
31
+
32
+ if (!isActive) {
33
+ if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
34
+ // if mobile we use a backdrop because click events don't delegate
35
+ $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
36
+ }
37
+
38
+ var relatedTarget = { relatedTarget: this }
39
+ $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
40
+
41
+ if (e.isDefaultPrevented()) return
42
+
43
+ $parent
44
+ .toggleClass('open')
45
+ .trigger('shown.bs.dropdown', relatedTarget)
46
+
47
+ $this.focus()
48
+ }
49
+
50
+ return false
51
+ }
52
+
53
+ Dropdown.prototype.keydown = function (e) {
54
+ if (!/(38|40|27)/.test(e.keyCode)) return
55
+
56
+ var $this = $(this)
57
+
58
+ e.preventDefault()
59
+ e.stopPropagation()
60
+
61
+ if ($this.is('.disabled, :disabled')) return
62
+
63
+ var $parent = getParent($this)
64
+ var isActive = $parent.hasClass('open')
65
+
66
+ if (!isActive || (isActive && e.keyCode == 27)) {
67
+ if (e.which == 27) $parent.find(toggle).focus()
68
+ return $this.click()
69
+ }
70
+
71
+ var desc = ' li:not(.divider):visible a'
72
+ var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
73
+
74
+ if (!$items.length) return
75
+
76
+ var index = $items.index($items.filter(':focus'))
77
+
78
+ if (e.keyCode == 38 && index > 0) index-- // up
79
+ if (e.keyCode == 40 && index < $items.length - 1) index++ // down
80
+ if (!~index) index = 0
81
+
82
+ $items.eq(index).focus()
83
+ }
84
+
85
+ function clearMenus(e) {
86
+ $(backdrop).remove()
87
+ $(toggle).each(function () {
88
+ var $parent = getParent($(this))
89
+ var relatedTarget = { relatedTarget: this }
90
+ if (!$parent.hasClass('open')) return
91
+ $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
92
+ if (e.isDefaultPrevented()) return
93
+ $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
94
+ })
95
+ }
96
+
97
+ function getParent($this) {
98
+ var selector = $this.attr('data-target')
99
+
100
+ if (!selector) {
101
+ selector = $this.attr('href')
102
+ selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
103
+ }
104
+
105
+ var $parent = selector && $(selector)
106
+
107
+ return $parent && $parent.length ? $parent : $this.parent()
108
+ }
109
+
110
+
111
+ // DROPDOWN PLUGIN DEFINITION
112
+ // ==========================
113
+
114
+ var old = $.fn.dropdown
115
+
116
+ $.fn.dropdown = function (option) {
117
+ return this.each(function () {
118
+ var $this = $(this)
119
+ var data = $this.data('bs.dropdown')
120
+
121
+ if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
122
+ if (typeof option == 'string') data[option].call($this)
123
+ })
124
+ }
125
+
126
+ $.fn.dropdown.Constructor = Dropdown
127
+
128
+
129
+ // DROPDOWN NO CONFLICT
130
+ // ====================
131
+
132
+ $.fn.dropdown.noConflict = function () {
133
+ $.fn.dropdown = old
134
+ return this
135
+ }
136
+
137
+
138
+ // APPLY TO STANDARD DROPDOWN ELEMENTS
139
+ // ===================================
140
+
141
+ $(document)
142
+ .on('click.bs.dropdown.data-api', clearMenus)
143
+ .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
144
+ .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
145
+ .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
146
+
147
+ }(jQuery);