contour 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/CHANGELOG.rdoc +12 -0
  2. data/README.rdoc +2 -2
  3. data/app/assets/images/twitter-bootstrap/{v2.0.3 → v2.0.4}/glyphicons-halflings-white.png +0 -0
  4. data/app/assets/images/twitter-bootstrap/{v2.0.3 → v2.0.4}/glyphicons-halflings.png +0 -0
  5. data/app/assets/javascripts/contour.js +16 -5
  6. data/app/assets/javascripts/twitter-bootstrap/bootstrap.js.coffee +12 -0
  7. data/app/assets/javascripts/twitter-bootstrap/{v2.0.3 → v2.0.4}/bootstrap.js +15 -14
  8. data/app/assets/javascripts/twitter-bootstrap/v2.0.4/plugins/bootstrap-alert.js +90 -0
  9. data/app/assets/javascripts/twitter-bootstrap/v2.0.4/plugins/bootstrap-button.js +96 -0
  10. data/app/assets/javascripts/twitter-bootstrap/v2.0.4/plugins/bootstrap-carousel.js +169 -0
  11. data/app/assets/javascripts/twitter-bootstrap/{bootstrap-collapse.js → v2.0.4/plugins/bootstrap-collapse.js} +2 -2
  12. data/app/assets/javascripts/twitter-bootstrap/{bootstrap-dropdown.js → v2.0.4/plugins/bootstrap-dropdown.js} +2 -2
  13. data/app/assets/javascripts/twitter-bootstrap/{bootstrap-modal.js → v2.0.4/plugins/bootstrap-modal.js} +2 -2
  14. data/app/assets/javascripts/twitter-bootstrap/v2.0.4/plugins/bootstrap-popover.js +98 -0
  15. data/app/assets/javascripts/twitter-bootstrap/v2.0.4/plugins/bootstrap-scrollspy.js +151 -0
  16. data/app/assets/javascripts/twitter-bootstrap/{bootstrap-tab.js → v2.0.4/plugins/bootstrap-tab.js} +2 -2
  17. data/app/assets/javascripts/twitter-bootstrap/v2.0.4/plugins/bootstrap-tooltip.js +275 -0
  18. data/app/assets/javascripts/twitter-bootstrap/v2.0.4/plugins/bootstrap-typeahead.js +285 -0
  19. data/app/assets/stylesheets/bootstrap-base-overrides.css +5 -5
  20. data/app/assets/stylesheets/bootstrap-responsive-overrides.css +5 -0
  21. data/app/assets/stylesheets/contour.css +3 -2
  22. data/app/assets/stylesheets/twitter-bootstrap/bootstrap-subnav.css +139 -0
  23. data/app/assets/stylesheets/twitter-bootstrap/{v2.0.3 → v2.0.4}/bootstrap-responsive.css +10 -3
  24. data/app/assets/stylesheets/twitter-bootstrap/{v2.0.3 → v2.0.4}/bootstrap.css +128 -105
  25. data/app/views/contour/authentications/index.html.erb +1 -1
  26. data/app/views/contour/layouts/_subnav.html.erb +23 -0
  27. data/app/views/contour/layouts/application.html.erb +1 -1
  28. data/app/views/contour/registrations/edit.html.erb +1 -1
  29. data/contour.gemspec +2 -2
  30. data/lib/contour/version.rb +1 -1
  31. data/lib/generators/contour/scaffold/templates/_paginate.html.erb +1 -1
  32. data/lib/generators/contour/scaffold/templates/show.html.erb +1 -1
  33. data/test/dummy/db/test.sqlite3 +0 -0
  34. data/test/dummy/log/test.log +2423 -0
  35. data/test/unit/helpers/contour_helper_test.rb +13 -0
  36. metadata +102 -36
@@ -0,0 +1,285 @@
1
+ /* =============================================================
2
+ * bootstrap-typeahead.js v2.0.4
3
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
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
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
27
+ * ================================= */
28
+
29
+ var Typeahead = function (element, options) {
30
+ this.$element = $(element)
31
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
32
+ this.matcher = this.options.matcher || this.matcher
33
+ this.sorter = this.options.sorter || this.sorter
34
+ this.highlighter = this.options.highlighter || this.highlighter
35
+ this.updater = this.options.updater || this.updater
36
+ this.$menu = $(this.options.menu).appendTo('body')
37
+ this.source = this.options.source
38
+ this.shown = false
39
+ this.listen()
40
+ }
41
+
42
+ Typeahead.prototype = {
43
+
44
+ constructor: Typeahead
45
+
46
+ , select: function () {
47
+ var val = this.$menu.find('.active').attr('data-value')
48
+ this.$element
49
+ .val(this.updater(val))
50
+ .change()
51
+ return this.hide()
52
+ }
53
+
54
+ , updater: function (item) {
55
+ return item
56
+ }
57
+
58
+ , show: function () {
59
+ var pos = $.extend({}, this.$element.offset(), {
60
+ height: this.$element[0].offsetHeight
61
+ })
62
+
63
+ this.$menu.css({
64
+ top: pos.top + pos.height
65
+ , left: pos.left
66
+ })
67
+
68
+ this.$menu.show()
69
+ this.shown = true
70
+ return this
71
+ }
72
+
73
+ , hide: function () {
74
+ this.$menu.hide()
75
+ this.shown = false
76
+ return this
77
+ }
78
+
79
+ , lookup: function (event) {
80
+ var that = this
81
+ , items
82
+ , q
83
+
84
+ this.query = this.$element.val()
85
+
86
+ if (!this.query) {
87
+ return this.shown ? this.hide() : this
88
+ }
89
+
90
+ items = $.grep(this.source, function (item) {
91
+ return that.matcher(item)
92
+ })
93
+
94
+ items = this.sorter(items)
95
+
96
+ if (!items.length) {
97
+ return this.shown ? this.hide() : this
98
+ }
99
+
100
+ return this.render(items.slice(0, this.options.items)).show()
101
+ }
102
+
103
+ , matcher: function (item) {
104
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
105
+ }
106
+
107
+ , sorter: function (items) {
108
+ var beginswith = []
109
+ , caseSensitive = []
110
+ , caseInsensitive = []
111
+ , item
112
+
113
+ while (item = items.shift()) {
114
+ if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
115
+ else if (~item.indexOf(this.query)) caseSensitive.push(item)
116
+ else caseInsensitive.push(item)
117
+ }
118
+
119
+ return beginswith.concat(caseSensitive, caseInsensitive)
120
+ }
121
+
122
+ , highlighter: function (item) {
123
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
124
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
125
+ return '<strong>' + match + '</strong>'
126
+ })
127
+ }
128
+
129
+ , render: function (items) {
130
+ var that = this
131
+
132
+ items = $(items).map(function (i, item) {
133
+ i = $(that.options.item).attr('data-value', item)
134
+ i.find('a').html(that.highlighter(item))
135
+ return i[0]
136
+ })
137
+
138
+ items.first().addClass('active')
139
+ this.$menu.html(items)
140
+ return this
141
+ }
142
+
143
+ , next: function (event) {
144
+ var active = this.$menu.find('.active').removeClass('active')
145
+ , next = active.next()
146
+
147
+ if (!next.length) {
148
+ next = $(this.$menu.find('li')[0])
149
+ }
150
+
151
+ next.addClass('active')
152
+ }
153
+
154
+ , prev: function (event) {
155
+ var active = this.$menu.find('.active').removeClass('active')
156
+ , prev = active.prev()
157
+
158
+ if (!prev.length) {
159
+ prev = this.$menu.find('li').last()
160
+ }
161
+
162
+ prev.addClass('active')
163
+ }
164
+
165
+ , listen: function () {
166
+ this.$element
167
+ .on('blur', $.proxy(this.blur, this))
168
+ .on('keypress', $.proxy(this.keypress, this))
169
+ .on('keyup', $.proxy(this.keyup, this))
170
+
171
+ if ($.browser.webkit || $.browser.msie) {
172
+ this.$element.on('keydown', $.proxy(this.keypress, this))
173
+ }
174
+
175
+ this.$menu
176
+ .on('click', $.proxy(this.click, this))
177
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
178
+ }
179
+
180
+ , keyup: function (e) {
181
+ switch(e.keyCode) {
182
+ case 40: // down arrow
183
+ case 38: // up arrow
184
+ break
185
+
186
+ case 9: // tab
187
+ case 13: // enter
188
+ if (!this.shown) return
189
+ this.select()
190
+ break
191
+
192
+ case 27: // escape
193
+ if (!this.shown) return
194
+ this.hide()
195
+ break
196
+
197
+ default:
198
+ this.lookup()
199
+ }
200
+
201
+ e.stopPropagation()
202
+ e.preventDefault()
203
+ }
204
+
205
+ , keypress: function (e) {
206
+ if (!this.shown) return
207
+
208
+ switch(e.keyCode) {
209
+ case 9: // tab
210
+ case 13: // enter
211
+ case 27: // escape
212
+ e.preventDefault()
213
+ break
214
+
215
+ case 38: // up arrow
216
+ if (e.type != 'keydown') break
217
+ e.preventDefault()
218
+ this.prev()
219
+ break
220
+
221
+ case 40: // down arrow
222
+ if (e.type != 'keydown') break
223
+ e.preventDefault()
224
+ this.next()
225
+ break
226
+ }
227
+
228
+ e.stopPropagation()
229
+ }
230
+
231
+ , blur: function (e) {
232
+ var that = this
233
+ setTimeout(function () { that.hide() }, 150)
234
+ }
235
+
236
+ , click: function (e) {
237
+ e.stopPropagation()
238
+ e.preventDefault()
239
+ this.select()
240
+ }
241
+
242
+ , mouseenter: function (e) {
243
+ this.$menu.find('.active').removeClass('active')
244
+ $(e.currentTarget).addClass('active')
245
+ }
246
+
247
+ }
248
+
249
+
250
+ /* TYPEAHEAD PLUGIN DEFINITION
251
+ * =========================== */
252
+
253
+ $.fn.typeahead = function (option) {
254
+ return this.each(function () {
255
+ var $this = $(this)
256
+ , data = $this.data('typeahead')
257
+ , options = typeof option == 'object' && option
258
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
259
+ if (typeof option == 'string') data[option]()
260
+ })
261
+ }
262
+
263
+ $.fn.typeahead.defaults = {
264
+ source: []
265
+ , items: 8
266
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
267
+ , item: '<li><a href="#"></a></li>'
268
+ }
269
+
270
+ $.fn.typeahead.Constructor = Typeahead
271
+
272
+
273
+ /* TYPEAHEAD DATA-API
274
+ * ================== */
275
+
276
+ $(function () {
277
+ $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
278
+ var $this = $(this)
279
+ if ($this.data('typeahead')) return
280
+ e.preventDefault()
281
+ $this.typeahead($this.data())
282
+ })
283
+ })
284
+
285
+ }(window.jQuery);
@@ -1,18 +1,18 @@
1
1
  /* bootstrap-base-overrides.css */
2
2
  /* These overrides come after bootstrap.css but before bootstrap-responsive.css */
3
3
 
4
- /* Line 1752 */
4
+ /* Line 1773 */
5
5
  [class^="icon-"],
6
6
  [class*=" icon-"] {
7
- background-image: url(twitter-bootstrap/v2.0.3/glyphicons-halflings.png);
7
+ background-image: url(twitter-bootstrap/v2.0.4/glyphicons-halflings.png);
8
8
  }
9
9
 
10
- /* Line 1770 */
10
+ /* Line 1791 */
11
11
  .icon-white {
12
- background-image: url(twitter-bootstrap/v2.0.3/glyphicons-halflings-white.png);
12
+ background-image: url(twitter-bootstrap/v2.0.4/glyphicons-halflings-white.png);
13
13
  }
14
14
 
15
- /* Line 3604 */
15
+ /* Line 3615 */
16
16
  .navbar .brand {
17
17
  color: #ffffff;
18
18
  }
@@ -6,6 +6,11 @@ dt, dd {
6
6
  min-height: 40px;
7
7
  }
8
8
 
9
+ .dl-horizontal dt {
10
+ white-space: normal;
11
+ overflow: visible;
12
+ }
13
+
9
14
  @media (max-width: 480px) {
10
15
  .modal-wrapper {
11
16
  position: absolute;
@@ -3,10 +3,11 @@
3
3
  * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
4
  * the top of the compiled file, but it's generally better to create a new file per style scope.
5
5
  *= require_self
6
- *= require twitter-bootstrap/v2.0.3/bootstrap
6
+ *= require twitter-bootstrap/v2.0.4/bootstrap
7
7
  *= require bootstrap-base-overrides
8
8
  *= require twitter-bootstrap/bootstrap-scroll-modal
9
- *= require twitter-bootstrap/v2.0.3/bootstrap-responsive
9
+ *= require twitter-bootstrap/v2.0.4/bootstrap-responsive
10
+ *= require twitter-bootstrap/bootstrap-subnav
10
11
  *= require bootstrap-responsive-overrides
11
12
  *= require jquery-ui-1.8.10.custom
12
13
  *= require jquery.qtip
@@ -0,0 +1,139 @@
1
+ /* Portion for Fixed Subnav From Bootstrap Components Documentation */
2
+ /* http://twitter.github.com/bootstrap/assets/css/docs.css */
3
+
4
+ /* Subnav */
5
+ .subnav {
6
+ width: 100%;
7
+ height: 36px;
8
+ background-color: #eeeeee; /* Old browsers */
9
+ background-repeat: repeat-x; /* Repeat the gradient */
10
+ background-image: -moz-linear-gradient(top, #f5f5f5 0%, #eeeeee 100%); /* FF3.6+ */
11
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f5f5), color-stop(100%,#eeeeee)); /* Chrome,Safari4+ */
12
+ background-image: -webkit-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Chrome 10+,Safari 5.1+ */
13
+ background-image: -ms-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* IE10+ */
14
+ background-image: -o-linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* Opera 11.10+ */
15
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f5f5', endColorstr='#eeeeee',GradientType=0 ); /* IE6-9 */
16
+ background-image: linear-gradient(top, #f5f5f5 0%,#eeeeee 100%); /* W3C */
17
+ border: 1px solid #e5e5e5;
18
+ -webkit-border-radius: 4px;
19
+ -moz-border-radius: 4px;
20
+ border-radius: 4px;
21
+ }
22
+ .subnav .nav {
23
+ margin-bottom: 0;
24
+ }
25
+ .subnav .nav > li > a {
26
+ margin: 0;
27
+ padding-top: 11px;
28
+ padding-bottom: 11px;
29
+ border-left: 1px solid #f5f5f5;
30
+ border-right: 1px solid #e5e5e5;
31
+ -webkit-border-radius: 0;
32
+ -moz-border-radius: 0;
33
+ border-radius: 0;
34
+ }
35
+ .subnav .nav > .active > a,
36
+ .subnav .nav > .active > a:hover {
37
+ padding-left: 13px;
38
+ color: #777;
39
+ background-color: #e9e9e9;
40
+ border-right-color: #ddd;
41
+ border-left: 0;
42
+ -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
43
+ -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
44
+ box-shadow: inset 0 3px 5px rgba(0,0,0,.05);
45
+ }
46
+ .subnav .nav > .active > a .caret,
47
+ .subnav .nav > .active > a:hover .caret {
48
+ border-top-color: #777;
49
+ }
50
+ .subnav .nav > li:first-child > a,
51
+ .subnav .nav > li:first-child > a:hover {
52
+ border-left: 0;
53
+ padding-left: 12px;
54
+ -webkit-border-radius: 4px 0 0 4px;
55
+ -moz-border-radius: 4px 0 0 4px;
56
+ border-radius: 4px 0 0 4px;
57
+ }
58
+ .subnav .nav > li:last-child > a {
59
+ border-right: 0;
60
+ }
61
+ .subnav .dropdown-menu {
62
+ -webkit-border-radius: 0 0 4px 4px;
63
+ -moz-border-radius: 0 0 4px 4px;
64
+ border-radius: 0 0 4px 4px;
65
+ }
66
+
67
+ /* Fixed subnav on scroll, but only for 980px and up (sorry IE!) */
68
+ @media (min-width: 980px) {
69
+ .subnav-fixed {
70
+ position: fixed;
71
+ top: 40px;
72
+ left: 0;
73
+ right: 0;
74
+ z-index: 1020; /* 10 less than .navbar-fixed to prevent any overlap */
75
+ border-color: #d5d5d5;
76
+ border-width: 0 0 1px; /* drop the border on the fixed edges */
77
+ -webkit-border-radius: 0;
78
+ -moz-border-radius: 0;
79
+ border-radius: 0;
80
+ -webkit-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
81
+ -moz-box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
82
+ box-shadow: inset 0 1px 0 #fff, 0 1px 5px rgba(0,0,0,.1);
83
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled=false); /* IE6-9 */
84
+ }
85
+ .subnav-fixed .nav {
86
+ width: 938px;
87
+ margin: 0 auto;
88
+ padding: 0 1px;
89
+ }
90
+ .subnav .nav > li:first-child > a,
91
+ .subnav .nav > li:first-child > a:hover {
92
+ -webkit-border-radius: 0;
93
+ -moz-border-radius: 0;
94
+ border-radius: 0;
95
+ }
96
+ }
97
+
98
+ @media (max-width: 768px) {
99
+
100
+ /* Subnav */
101
+ .subnav {
102
+ position: static;
103
+ top: auto;
104
+ z-index: auto;
105
+ width: auto;
106
+ height: auto;
107
+ background: #fff; /* whole background property since we use a background-image for gradient */
108
+ -webkit-box-shadow: none;
109
+ -moz-box-shadow: none;
110
+ box-shadow: none;
111
+ }
112
+ .subnav .nav > li {
113
+ float: none;
114
+ }
115
+ .subnav .nav > li > a {
116
+ border: 0;
117
+ }
118
+ .subnav .nav > li + li > a {
119
+ border-top: 1px solid #e5e5e5;
120
+ }
121
+ .subnav .nav > li:first-child > a,
122
+ .subnav .nav > li:first-child > a:hover {
123
+ -webkit-border-radius: 4px 4px 0 0;
124
+ -moz-border-radius: 4px 4px 0 0;
125
+ border-radius: 4px 4px 0 0;
126
+ }
127
+
128
+ }
129
+
130
+
131
+ /* LARGE DESKTOP SCREENS */
132
+ @media (min-width: 1210px) {
133
+
134
+ /* Update subnav container */
135
+ .subnav-fixed .nav {
136
+ width: 1168px; /* 2px less to account for left/right borders being removed when in fixed mode */
137
+ }
138
+
139
+ }