contour 1.0.6 → 1.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/CHANGELOG.rdoc +9 -6
  2. data/README.rdoc +1 -1
  3. data/app/assets/images/contour/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  4. data/app/assets/images/contour/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  5. data/app/assets/images/contour/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  6. data/app/assets/images/contour/ui-icons_217bc0_256x240.png +0 -0
  7. data/app/assets/images/contour/ui-icons_d8e7f3_256x240.png +0 -0
  8. data/app/assets/images/contour/ui-icons_f9bd01_256x240.png +0 -0
  9. data/app/assets/images/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/glyphicons-halflings-white.png +0 -0
  10. data/app/assets/images/twitter-bootstrap/v2.1.0-wip/glyphicons-halflings.png +0 -0
  11. data/app/assets/javascripts/contour.js +15 -13
  12. data/app/assets/javascripts/contour/global.js.coffee +3 -0
  13. data/app/assets/javascripts/external/jquery-ui-1.8.22.custom.min.js +93 -0
  14. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/bootstrap.js +247 -152
  15. data/app/assets/javascripts/twitter-bootstrap/v2.1.0-wip/plugins/bootstrap-affix.js +104 -0
  16. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-alert.js +0 -0
  17. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-button.js +0 -0
  18. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-carousel.js +11 -4
  19. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-collapse.js +3 -2
  20. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-dropdown.js +64 -14
  21. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-modal.js +94 -73
  22. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-popover.js +7 -3
  23. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-scrollspy.js +8 -8
  24. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-tab.js +1 -1
  25. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-tooltip.js +10 -12
  26. data/app/assets/javascripts/twitter-bootstrap/v2.1.0-wip/plugins/bootstrap-transition.js +60 -0
  27. data/app/assets/javascripts/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/plugins/bootstrap-typeahead.js +49 -34
  28. data/app/assets/stylesheets/bootstrap-base-overrides.css +23 -2
  29. data/app/assets/stylesheets/contour.css +3 -3
  30. data/app/assets/stylesheets/{jquery-ui-1.8.10.custom.css → jquery-ui-1.8.22.custom.css} +26 -219
  31. data/app/assets/stylesheets/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/bootstrap-responsive.css +528 -272
  32. data/app/assets/stylesheets/twitter-bootstrap/{v2.0.4 → v2.1.0-wip}/bootstrap.css +1304 -720
  33. data/app/controllers/contour/registrations_controller.rb +1 -1
  34. data/app/controllers/contour/sessions_controller.rb +1 -5
  35. data/app/views/contour/layouts/_menu.html.erb +2 -1
  36. data/app/views/contour/layouts/application.html.erb +25 -39
  37. data/contour.gemspec +1 -1
  38. data/lib/contour/version.rb +3 -3
  39. data/test/dummy/app/models/user.rb +1 -1
  40. data/test/dummy/db/test.sqlite3 +0 -0
  41. data/test/dummy/log/test.log +0 -2096
  42. metadata +27 -25
  43. data/app/assets/images/twitter-bootstrap/v2.0.4/glyphicons-halflings.png +0 -0
  44. data/app/assets/javascripts/external/jquery-ui-1.8.10.custom.min.js +0 -782
@@ -0,0 +1,104 @@
1
+ /* ==========================================================
2
+ * bootstrap-affix.js v2.1.0
3
+ * http://twitter.github.com/bootstrap/javascript.html#affix
4
+ * ==========================================================
5
+ * Copyright 2012 Twitter, Inc.
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ * ========================================================== */
19
+
20
+
21
+ !function ($) {
22
+
23
+ "use strict"; // jshint ;_;
24
+
25
+
26
+ /* AFFIX CLASS DEFINITION
27
+ * ====================== */
28
+
29
+ var Affix = function (element, options) {
30
+ this.options = $.extend({}, $.fn.affix.defaults, options)
31
+ this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
32
+ this.$element = $(element)
33
+ this.checkPosition()
34
+ }
35
+
36
+ Affix.prototype.checkPosition = function () {
37
+ if (!this.$element.is(':visible')) return
38
+
39
+ var scrollHeight = $(document).height()
40
+ , scrollTop = this.$window.scrollTop()
41
+ , position = this.$element.offset()
42
+ , offset = this.options.offset
43
+ , offsetBottom = offset.bottom
44
+ , offsetTop = offset.top
45
+ , reset = 'affix affix-top affix-bottom'
46
+ , affix
47
+
48
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
49
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
50
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
51
+
52
+ affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
53
+ false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
54
+ 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
55
+ 'top' : false
56
+
57
+ if (this.affixed === affix) return
58
+
59
+ this.affixed = affix
60
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
61
+
62
+ this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
63
+ }
64
+
65
+
66
+ /* AFFIX PLUGIN DEFINITION
67
+ * ======================= */
68
+
69
+ $.fn.affix = function (option) {
70
+ return this.each(function () {
71
+ var $this = $(this)
72
+ , data = $this.data('affix')
73
+ , options = typeof option == 'object' && option
74
+ if (!data) $this.data('affix', (data = new Affix(this, options)))
75
+ if (typeof option == 'string') data[option]()
76
+ })
77
+ }
78
+
79
+ $.fn.affix.Constructor = Affix
80
+
81
+ $.fn.affix.defaults = {
82
+ offset: 0
83
+ }
84
+
85
+
86
+ /* AFFIX DATA-API
87
+ * ============== */
88
+
89
+ $(window).on('load', function () {
90
+ $('[data-spy="affix"]').each(function () {
91
+ var $spy = $(this)
92
+ , data = $spy.data()
93
+
94
+ data.offset = data.offset || {}
95
+
96
+ data.offsetBottom && (data.offset.bottom = data.offsetBottom)
97
+ data.offsetTop && (data.offset.top = data.offsetTop)
98
+
99
+ $spy.affix(data)
100
+ })
101
+ })
102
+
103
+
104
+ }(window.jQuery);
@@ -46,7 +46,7 @@
46
46
  }
47
47
 
48
48
  , to: function (pos) {
49
- var $active = this.$element.find('.active')
49
+ var $active = this.$element.find('.item.active')
50
50
  , children = $active.parent().children()
51
51
  , activePos = children.index($active)
52
52
  , that = this
@@ -68,6 +68,10 @@
68
68
 
69
69
  , pause: function (e) {
70
70
  if (!e) this.paused = true
71
+ if (this.$element.find('.next, .prev').length && $.support.transition.end) {
72
+ this.$element.trigger($.support.transition.end)
73
+ this.cycle()
74
+ }
71
75
  clearInterval(this.interval)
72
76
  this.interval = null
73
77
  return this
@@ -84,13 +88,15 @@
84
88
  }
85
89
 
86
90
  , slide: function (type, next) {
87
- var $active = this.$element.find('.active')
91
+ var $active = this.$element.find('.item.active')
88
92
  , $next = next || $active[type]()
89
93
  , isCycling = this.interval
90
94
  , direction = type == 'next' ? 'left' : 'right'
91
95
  , fallback = type == 'next' ? 'first' : 'last'
92
96
  , that = this
93
- , e = $.Event('slide')
97
+ , e = $.Event('slide', {
98
+ relatedTarget: $next[0]
99
+ })
94
100
 
95
101
  this.sliding = true
96
102
 
@@ -138,9 +144,10 @@
138
144
  var $this = $(this)
139
145
  , data = $this.data('carousel')
140
146
  , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
147
+ , action = typeof option == 'string' ? option : options.slide
141
148
  if (!data) $this.data('carousel', (data = new Carousel(this, options)))
142
149
  if (typeof option == 'number') data.to(option)
143
- else if (typeof option == 'string' || (option = options.slide)) data[option]()
150
+ else if (action) data[action]()
144
151
  else if (options.interval) data.cycle()
145
152
  })
146
153
  }
@@ -67,7 +67,7 @@
67
67
 
68
68
  this.$element[dimension](0)
69
69
  this.transition('addClass', $.Event('show'), 'shown')
70
- this.$element[dimension](this.$element[0][scroll])
70
+ $.support.transition && this.$element[dimension](this.$element[0][scroll])
71
71
  }
72
72
 
73
73
  , hide: function () {
@@ -144,12 +144,13 @@
144
144
  * ==================== */
145
145
 
146
146
  $(function () {
147
- $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
147
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
148
148
  var $this = $(this), href
149
149
  , target = $this.attr('data-target')
150
150
  || e.preventDefault()
151
151
  || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
152
152
  , option = $(target).data('collapse') ? 'toggle' : $this.data()
153
+ $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
153
154
  $(target).collapse(option)
154
155
  })
155
156
  })
@@ -26,7 +26,7 @@
26
26
  /* DROPDOWN CLASS DEFINITION
27
27
  * ========================= */
28
28
 
29
- var toggle = '[data-toggle="dropdown"]'
29
+ var toggle = '[data-toggle=dropdown]'
30
30
  , Dropdown = function (element) {
31
31
  var $el = $(element).on('click.dropdown.data-api', this.toggle)
32
32
  $('html').on('click.dropdown.data-api', function () {
@@ -41,34 +41,82 @@
41
41
  , toggle: function (e) {
42
42
  var $this = $(this)
43
43
  , $parent
44
- , selector
45
44
  , isActive
46
45
 
47
46
  if ($this.is('.disabled, :disabled')) return
48
47
 
49
- selector = $this.attr('data-target')
48
+ $parent = getParent($this)
50
49
 
51
- if (!selector) {
52
- selector = $this.attr('href')
53
- selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
50
+ isActive = $parent.hasClass('open')
51
+
52
+ clearMenus()
53
+
54
+ if (!isActive) {
55
+ $parent.toggleClass('open')
56
+ $this.focus()
54
57
  }
55
58
 
56
- $parent = $(selector)
57
- $parent.length || ($parent = $this.parent())
59
+ return false
60
+ }
61
+
62
+ , keydown: function (e) {
63
+ var $this
64
+ , $items
65
+ , $active
66
+ , $parent
67
+ , isActive
68
+ , index
69
+
70
+ if (!/(38|40|27)/.test(e.keyCode)) return
71
+
72
+ $this = $(this)
73
+
74
+ e.preventDefault()
75
+ e.stopPropagation()
76
+
77
+ if ($this.is('.disabled, :disabled')) return
78
+
79
+ $parent = getParent($this)
58
80
 
59
81
  isActive = $parent.hasClass('open')
60
82
 
61
- clearMenus()
83
+ if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
62
84
 
63
- if (!isActive) $parent.toggleClass('open')
85
+ $items = $('[role=menu] li:not(.divider) a', $parent)
64
86
 
65
- return false
87
+ if (!$items.length) return
88
+
89
+ index = $items.index($items.filter(':focus'))
90
+
91
+ if (e.keyCode == 38 && index > 0) index-- // up
92
+ if (e.keyCode == 40 && index < $items.length - 1) index++ // down
93
+ if (!~index) index = 0
94
+
95
+ $items
96
+ .eq(index)
97
+ .focus()
66
98
  }
67
99
 
68
100
  }
69
101
 
70
102
  function clearMenus() {
71
- $(toggle).parent().removeClass('open')
103
+ getParent($(toggle))
104
+ .removeClass('open')
105
+ }
106
+
107
+ function getParent($this) {
108
+ var selector = $this.attr('data-target')
109
+ , $parent
110
+
111
+ if (!selector) {
112
+ selector = $this.attr('href')
113
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
114
+ }
115
+
116
+ $parent = $(selector)
117
+ $parent.length || ($parent = $this.parent())
118
+
119
+ return $parent
72
120
  }
73
121
 
74
122
 
@@ -91,10 +139,12 @@
91
139
  * =================================== */
92
140
 
93
141
  $(function () {
94
- $('html').on('click.dropdown.data-api', clearMenus)
142
+ $('html')
143
+ .on('click.dropdown.data-api', clearMenus)
95
144
  $('body')
96
145
  .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
97
- .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
146
+ .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
147
+ .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
98
148
  })
99
149
 
100
150
  }(window.jQuery);
@@ -26,10 +26,11 @@
26
26
  /* MODAL CLASS DEFINITION
27
27
  * ====================== */
28
28
 
29
- var Modal = function (content, options) {
29
+ var Modal = function (element, options) {
30
30
  this.options = options
31
- this.$element = $(content)
31
+ this.$element = $(element)
32
32
  .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
33
+ this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
33
34
  }
34
35
 
35
36
  Modal.prototype = {
@@ -52,8 +53,9 @@
52
53
 
53
54
  this.isShown = true
54
55
 
55
- escape.call(this)
56
- backdrop.call(this, function () {
56
+ this.escape()
57
+
58
+ this.backdrop(function () {
57
59
  var transition = $.support.transition && that.$element.hasClass('fade')
58
60
 
59
61
  if (!that.$element.parent().length) {
@@ -67,7 +69,12 @@
67
69
  that.$element[0].offsetWidth // force reflow
68
70
  }
69
71
 
70
- that.$element.addClass('in')
72
+ that.$element
73
+ .addClass('in')
74
+ .attr('aria-hidden', false)
75
+ .focus()
76
+
77
+ that.enforceFocus()
71
78
 
72
79
  transition ?
73
80
  that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
@@ -91,90 +98,98 @@
91
98
 
92
99
  $('body').removeClass('modal-open')
93
100
 
94
- escape.call(this)
101
+ this.escape()
102
+
103
+ $(document).off('focusin.modal')
95
104
 
96
- this.$element.removeClass('in')
105
+ this.$element
106
+ .removeClass('in')
107
+ .attr('aria-hidden', true)
97
108
 
98
109
  $.support.transition && this.$element.hasClass('fade') ?
99
- hideWithTransition.call(this) :
100
- hideModal.call(this)
110
+ this.hideWithTransition() :
111
+ this.hideModal()
101
112
  }
102
113
 
103
- }
104
-
105
-
106
- /* MODAL PRIVATE METHODS
107
- * ===================== */
108
-
109
- function hideWithTransition() {
110
- var that = this
111
- , timeout = setTimeout(function () {
112
- that.$element.off($.support.transition.end)
113
- hideModal.call(that)
114
- }, 500)
114
+ , enforceFocus: function () {
115
+ var that = this
116
+ $(document).on('focusin.modal', function (e) {
117
+ if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
118
+ that.$element.focus()
119
+ }
120
+ })
121
+ }
115
122
 
116
- this.$element.one($.support.transition.end, function () {
117
- clearTimeout(timeout)
118
- hideModal.call(that)
119
- })
120
- }
123
+ , escape: function () {
124
+ var that = this
125
+ if (this.isShown && this.options.keyboard) {
126
+ this.$element.on('keyup.dismiss.modal', function ( e ) {
127
+ e.which == 27 && that.hide()
128
+ })
129
+ } else if (!this.isShown) {
130
+ this.$element.off('keyup.dismiss.modal')
131
+ }
132
+ }
121
133
 
122
- function hideModal(that) {
123
- this.$element
124
- .hide()
125
- .trigger('hidden')
134
+ , hideWithTransition: function () {
135
+ var that = this
136
+ , timeout = setTimeout(function () {
137
+ that.$element.off($.support.transition.end)
138
+ that.hideModal()
139
+ }, 500)
140
+
141
+ this.$element.one($.support.transition.end, function () {
142
+ clearTimeout(timeout)
143
+ that.hideModal()
144
+ })
145
+ }
126
146
 
127
- backdrop.call(this)
128
- }
147
+ , hideModal: function (that) {
148
+ this.$element
149
+ .hide()
150
+ .trigger('hidden')
129
151
 
130
- function backdrop(callback) {
131
- var that = this
132
- , animate = this.$element.hasClass('fade') ? 'fade' : ''
152
+ this.backdrop()
153
+ }
133
154
 
134
- if (this.isShown && this.options.backdrop) {
135
- var doAnimate = $.support.transition && animate
155
+ , removeBackdrop: function () {
156
+ this.$backdrop.remove()
157
+ this.$backdrop = null
158
+ }
136
159
 
137
- this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
138
- .appendTo(document.body)
160
+ , backdrop: function (callback) {
161
+ var that = this
162
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
139
163
 
140
- if (this.options.backdrop != 'static') {
141
- this.$backdrop.click($.proxy(this.hide, this))
142
- }
164
+ if (this.isShown && this.options.backdrop) {
165
+ var doAnimate = $.support.transition && animate
143
166
 
144
- if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
167
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
168
+ .appendTo(document.body)
145
169
 
146
- this.$backdrop.addClass('in')
170
+ if (this.options.backdrop != 'static') {
171
+ this.$backdrop.click($.proxy(this.hide, this))
172
+ }
147
173
 
148
- doAnimate ?
149
- this.$backdrop.one($.support.transition.end, callback) :
150
- callback()
174
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
151
175
 
152
- } else if (!this.isShown && this.$backdrop) {
153
- this.$backdrop.removeClass('in')
176
+ this.$backdrop.addClass('in')
154
177
 
155
- $.support.transition && this.$element.hasClass('fade')?
156
- this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
157
- removeBackdrop.call(this)
178
+ doAnimate ?
179
+ this.$backdrop.one($.support.transition.end, callback) :
180
+ callback()
158
181
 
159
- } else if (callback) {
160
- callback()
161
- }
162
- }
182
+ } else if (!this.isShown && this.$backdrop) {
183
+ this.$backdrop.removeClass('in')
163
184
 
164
- function removeBackdrop() {
165
- this.$backdrop.remove()
166
- this.$backdrop = null
167
- }
185
+ $.support.transition && this.$element.hasClass('fade')?
186
+ this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
187
+ this.removeBackdrop()
168
188
 
169
- function escape() {
170
- var that = this
171
- if (this.isShown && this.options.keyboard) {
172
- $(document).on('keyup.dismiss.modal', function ( e ) {
173
- e.which == 27 && that.hide()
174
- })
175
- } else if (!this.isShown) {
176
- $(document).off('keyup.dismiss.modal')
177
- }
189
+ } else if (callback) {
190
+ callback()
191
+ }
192
+ }
178
193
  }
179
194
 
180
195
 
@@ -206,12 +221,18 @@
206
221
 
207
222
  $(function () {
208
223
  $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
209
- var $this = $(this), href
210
- , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
211
- , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
224
+ var $this = $(this)
225
+ , href = $this.attr('href')
226
+ , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
227
+ , option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
212
228
 
213
229
  e.preventDefault()
214
- $target.modal(option)
230
+
231
+ $target
232
+ .modal(option)
233
+ .one('hide', function () {
234
+ $this.focus()
235
+ })
215
236
  })
216
237
  })
217
238