groundworkcss-rails 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. data/lib/generators/groundworkcss/layout/templates/_sidebar.html.erb +5 -5
  2. data/lib/groundworkcss/rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/groundworkcss/components/responsiveText.js +19 -2
  4. data/vendor/assets/javascripts/groundworkcss/groundwork.all.js +754 -744
  5. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.modals.js +152 -158
  6. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.popover.js +170 -176
  7. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.responsiveTables.js +44 -50
  8. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.responsiveText.js +26 -32
  9. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.tooltip.js +111 -117
  10. data/vendor/assets/stylesheets/groundworkcss-scss/_buttons.scss +67 -16
  11. data/vendor/assets/stylesheets/groundworkcss-scss/_callouts.scss +21 -11
  12. data/vendor/assets/stylesheets/groundworkcss-scss/_font-awesome.scss +1 -0
  13. data/vendor/assets/stylesheets/groundworkcss-scss/_forms.scss +4 -4
  14. data/vendor/assets/stylesheets/groundworkcss-scss/_messages.scss +20 -10
  15. data/vendor/assets/stylesheets/groundworkcss-scss/_typography.scss +2 -0
  16. data/vendor/assets/stylesheets/groundworkcss-scss/_variables.scss +30 -5
  17. data/vendor/assets/stylesheets/groundworkcss-scss/{groundwork.css.scss → groundwork.scss} +0 -0
  18. metadata +15 -22
  19. data/vendor/assets/fonts/groundworkcss/fontawesome.otf +0 -0
  20. data/vendor/assets/javascripts/groundworkcss/groundwork.js +0 -264
  21. data/vendor/assets/javascripts/groundworkcss/libs/html5shiv.js +0 -299
  22. data/vendor/assets/javascripts/groundworkcss/plugins/jquery.orbit-1.4.0.js +0 -919
  23. data/vendor/assets/stylesheets/groundworkcss-scss/_classes.scss +0 -143
  24. data/vendor/assets/stylesheets/groundworkcss-scss/_layout.scss +0 -78
  25. data/vendor/assets/stylesheets/groundworkcss-scss/_orbit.scss +0 -239
@@ -3,17 +3,17 @@
3
3
  <% if content_for? :nav %>
4
4
  <h3>
5
5
  <i class="icon-reorder"></i>
6
- Navigation
7
- </h3>
8
- <nav>
6
+ Navigation
7
+ </h3>
8
+ <nav class="nav">
9
9
  <ul>
10
10
  <%= yield :nav%>
11
11
  </ul>
12
12
  </nav>
13
13
  <%end%>
14
-
14
+
15
15
  <br/>
16
-
16
+
17
17
  <% if content_for? :sidebar%>
18
18
  <%= yield :sidebar%>
19
19
  <%end%>
@@ -1,5 +1,5 @@
1
1
  module Groundworkcss
2
2
  module Rails
3
- VERSION = "0.2.7"
3
+ VERSION = "0.2.8"
4
4
  end
5
5
  end
@@ -5,17 +5,34 @@
5
5
 
6
6
  $(function() {
7
7
  return $('.responsive').not('table').each(function(index, object) {
8
- var compression, max, min;
8
+ var $this, compression, max, min, scrollReset, scrollTime;
9
9
  compression = 10;
10
10
  min = 10;
11
11
  max = 200;
12
+ scrollTime = 650;
13
+ scrollReset = 200;
12
14
  compression = parseFloat($(this).attr('data-compression') || compression);
13
15
  min = parseFloat($(this).attr('data-min') || min);
14
16
  max = parseFloat($(this).attr('data-max') || max);
15
- return $(object).responsiveText({
17
+ $(object).responsiveText({
16
18
  compressor: compression,
17
19
  minSize: min,
18
20
  maxSize: max
19
21
  });
22
+ $this = $(this);
23
+ return $(this).hover((function() {
24
+ var difference;
25
+ difference = $this.get(0).scrollWidth - $this.width();
26
+ console.log(difference);
27
+ if (difference > 0) {
28
+ return $this.stop().animate({
29
+ "text-indent": -difference
30
+ }, scrollTime);
31
+ }
32
+ }), function() {
33
+ return $this.stop().animate({
34
+ "text-indent": 0
35
+ }, scrollReset);
36
+ });
20
37
  });
21
38
  });
@@ -1,5 +1,4 @@
1
1
  // Generated by CoffeeScript 1.6.1
2
-
3
2
  /*
4
3
  *
5
4
  * GroundworkCSS JS by Gary Hepting - https://github.com/groundworkcss/groundwork
@@ -10,13 +9,11 @@
10
9
  *
11
10
  */
12
11
 
13
-
14
12
  /* --------------------------------------------
15
13
  Begin jquery.modals.coffee
16
14
  --------------------------------------------
17
15
  */
18
16
 
19
-
20
17
  /*
21
18
  *
22
19
  * jQuery Modals by Gary Hepting
@@ -24,492 +21,490 @@
24
21
  *
25
22
  */
26
23
 
27
-
28
- (function() {
29
- var equalizeColumns, limitPaginationItems;
30
-
31
- (function($) {
32
- var elems, modals;
33
- if ($('div#iframeModal').length < 1) {
34
- $('body').append('<div class="iframe modal" id="iframeModal"><iframe marginheight="0" marginwidth="0" frameborder="0"></iframe></div>');
35
- $('div#iframeModal').prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>');
36
- }
37
- $('a.modal').each(function() {
38
- $(this).attr('data-url', $(this).attr('href'));
39
- return $(this).attr('href', '#iframeModal');
24
+ var equalizeColumns, limitPaginationItems;
25
+
26
+ (function($) {
27
+ var elems, modals;
28
+ if ($('div#iframeModal').length < 1) {
29
+ $('body').append('<div class="iframe modal" id="iframeModal"><iframe marginheight="0" marginwidth="0" frameborder="0"></iframe></div>');
30
+ $('div#iframeModal').prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>');
31
+ }
32
+ $('a.modal').each(function() {
33
+ $(this).attr('data-url', $(this).attr('href'));
34
+ return $(this).attr('href', '#iframeModal');
35
+ });
36
+ $('a.modal').on("click", function(e) {
37
+ $('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0" width="100%" height="100%" src="' + $(this).attr('data-url') + '"></iframe>');
38
+ e.preventDefault();
39
+ return false;
40
+ });
41
+ elems = [];
42
+ $.fn.modal = function() {
43
+ this.each(function() {
44
+ var $this;
45
+ $(this).not('#iframeModal').wrapInner('<div class="modal-content"></div>');
46
+ $(this).prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>').appendTo('body');
47
+ $this = $(this);
48
+ return $('[href=#' + $(this).attr('id') + ']').on("click", function(e) {
49
+ modals.open($(this).attr('href'), $(this).hasClass('fullscreen'));
50
+ e.preventDefault();
51
+ return false;
52
+ });
40
53
  });
41
- $('a.modal').on("click", function(e) {
42
- $('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0" width="100%" height="100%" src="' + $(this).attr('data-url') + '"></iframe>');
43
- e.preventDefault();
44
- return false;
54
+ $('div.modal .close').on("click", function() {
55
+ return modals.close();
45
56
  });
46
- elems = [];
47
- $.fn.modal = function() {
48
- this.each(function() {
49
- var $this;
50
- $(this).not('#iframeModal').wrapInner('<div class="modal-content"></div>');
51
- $(this).prepend('<i class="close icon-remove"></i>').prepend('<i class="fullscreen icon-resize-full"></i>').appendTo('body');
52
- $this = $(this);
53
- return $('[href=#' + $(this).attr('id') + ']').on("click", function(e) {
54
- modals.open($(this).attr('href'), $(this).hasClass('fullscreen'));
55
- e.preventDefault();
56
- return false;
57
- });
58
- });
59
- $('div.modal .close').on("click", function() {
60
- return modals.close();
61
- });
62
- return $('div.modal .fullscreen').on("click", function() {
63
- return modals.fullscreen($(this).parent('div.modal'));
57
+ return $('div.modal .fullscreen').on("click", function() {
58
+ return modals.fullscreen($(this).parent('div.modal'));
59
+ });
60
+ };
61
+ modals = (function() {
62
+ var close, fullscreen, open;
63
+ $('body').addClass('modal-ready');
64
+ if ($("#overlay").length < 1) {
65
+ $('body').append('<div id="overlay"></div>');
66
+ }
67
+ $('#overlay, div.modal .close').bind("click", function(e) {
68
+ return close();
69
+ });
70
+ open = function(elem, fullscreen) {
71
+ $(window).bind("keydown", function(e) {
72
+ var keyCode;
73
+ keyCode = (e.which ? e.which : e.keyCode);
74
+ if (keyCode === 27) {
75
+ return close();
76
+ }
64
77
  });
65
- };
66
- modals = (function() {
67
- var close, fullscreen, open;
68
- $('body').addClass('modal-ready');
69
- if ($("#overlay").length < 1) {
70
- $('body').append('<div id="overlay"></div>');
78
+ $(elem).addClass("active");
79
+ if (!$(elem).hasClass('iframe')) {
80
+ $(elem).css({
81
+ width: 'auto',
82
+ height: 'auto'
83
+ });
84
+ $(elem).css({
85
+ height: $(elem).outerHeight()
86
+ });
71
87
  }
72
- $('#overlay, div.modal .close').bind("click", function(e) {
73
- return close();
88
+ $(elem).css({
89
+ top: '50%',
90
+ left: '50%',
91
+ 'margin-top': ($(elem).outerHeight() / -2) + 'px',
92
+ 'margin-left': ($(elem).outerWidth() / -2) + 'px'
74
93
  });
75
- open = function(elem, fullscreen) {
76
- $(window).bind("keydown", function(e) {
77
- var keyCode;
78
- keyCode = (e.which ? e.which : e.keyCode);
79
- if (keyCode === 27) {
80
- return close();
81
- }
94
+ setTimeout(function() {
95
+ return $('body').addClass("modal-active");
96
+ }, 0);
97
+ setTimeout(function() {
98
+ return $('body').removeClass('modal-ready');
99
+ }, 400);
100
+ if (fullscreen) {
101
+ modals.fullscreen(elem);
102
+ }
103
+ };
104
+ close = function() {
105
+ var modal;
106
+ modal = $('div.modal.active');
107
+ $(window).unbind("keydown");
108
+ $('body').removeClass("modal-active").addClass('modal-ready');
109
+ if (modal.hasClass('iframe')) {
110
+ $('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0"></iframe>');
111
+ modal.css({
112
+ width: '80%',
113
+ height: '80%'
82
114
  });
83
- $(elem).addClass("active");
84
- if (!$(elem).hasClass('iframe')) {
85
- $(elem).css({
86
- width: 'auto',
87
- height: 'auto'
88
- });
89
- $(elem).css({
90
- height: $(elem).outerHeight()
91
- });
92
- }
93
- $(elem).css({
94
- top: '50%',
95
- left: '50%',
96
- 'margin-top': ($(elem).outerHeight() / -2) + 'px',
97
- 'margin-left': ($(elem).outerWidth() / -2) + 'px'
115
+ } else {
116
+ modal.css({
117
+ width: 'auto',
118
+ height: 'auto'
98
119
  });
99
- setTimeout(function() {
100
- return $('body').addClass("modal-active");
101
- }, 0);
102
- setTimeout(function() {
103
- return $('body').removeClass('modal-ready');
104
- }, 400);
105
- if (fullscreen) {
106
- modals.fullscreen(elem);
107
- }
108
- };
109
- close = function() {
110
- var modal;
111
- modal = $('div.modal.active');
112
- $(window).unbind("keydown");
113
- $('body').removeClass("modal-active").addClass('modal-ready');
114
- if (modal.hasClass('iframe')) {
115
- $('div#iframeModal iframe').replaceWith('<iframe marginheight="0" marginwidth="0" frameborder="0"></iframe>');
116
- modal.css({
120
+ }
121
+ modal.css({
122
+ top: '10%',
123
+ left: '10%',
124
+ 'max-width': '80%',
125
+ 'max-height': '80%',
126
+ 'margin-top': 0,
127
+ 'margin-left': 0
128
+ });
129
+ modal.removeClass("active").removeClass("fullscreen");
130
+ $('i.fullscreen', modal).removeClass('icon-resize-small').addClass('icon-resize-full');
131
+ };
132
+ fullscreen = function(elem) {
133
+ if ($('div.modal.active').hasClass('fullscreen')) {
134
+ $('div.modal i.fullscreen').removeClass('icon-resize-small').addClass('icon-resize-full');
135
+ if ($('div.modal.active').hasClass('iframe')) {
136
+ $('div.modal.active').css({
117
137
  width: '80%',
118
138
  height: '80%'
119
139
  });
120
140
  } else {
121
- modal.css({
141
+ $('div.modal.active').css({
122
142
  width: 'auto',
123
143
  height: 'auto'
124
144
  });
145
+ $('div.modal.active').css({
146
+ height: $('div.modal.active').outerHeight()
147
+ });
125
148
  }
126
- modal.css({
127
- top: '10%',
128
- left: '10%',
149
+ $('div.modal.active').removeClass('fullscreen').css({
129
150
  'max-width': '80%',
130
- 'max-height': '80%',
151
+ 'max-height': '80%'
152
+ });
153
+ $('div.modal.active').delay(100).css({
154
+ top: '50%',
155
+ left: '50%',
156
+ 'margin-top': ($('div.modal.active').outerHeight() / -2) + 'px',
157
+ 'margin-left': ($('div.modal.active').outerWidth() / -2) + 'px'
158
+ });
159
+ } else {
160
+ $('div.modal i.fullscreen').addClass('icon-resize-small').removeClass('icon-resize-full');
161
+ $('div.modal.active').addClass('fullscreen').css({
162
+ top: 0,
163
+ left: 0,
131
164
  'margin-top': 0,
132
- 'margin-left': 0
165
+ 'margin-left': 0,
166
+ width: '100%',
167
+ height: '100%',
168
+ 'max-width': '100%',
169
+ 'max-height': '100%'
133
170
  });
134
- modal.removeClass("active").removeClass("fullscreen");
135
- $('i.fullscreen', modal).removeClass('icon-resize-small').addClass('icon-resize-full');
136
- };
137
- fullscreen = function(elem) {
138
- if ($('div.modal.active').hasClass('fullscreen')) {
139
- $('div.modal i.fullscreen').removeClass('icon-resize-small').addClass('icon-resize-full');
140
- if ($('div.modal.active').hasClass('iframe')) {
141
- $('div.modal.active').css({
142
- width: '80%',
143
- height: '80%'
144
- });
145
- } else {
146
- $('div.modal.active').css({
147
- width: 'auto',
148
- height: 'auto'
149
- });
150
- $('div.modal.active').css({
151
- height: $('div.modal.active').outerHeight()
152
- });
153
- }
154
- $('div.modal.active').removeClass('fullscreen').css({
155
- 'max-width': '80%',
156
- 'max-height': '80%'
157
- });
158
- $('div.modal.active').delay(100).css({
159
- top: '50%',
160
- left: '50%',
161
- 'margin-top': ($('div.modal.active').outerHeight() / -2) + 'px',
162
- 'margin-left': ($('div.modal.active').outerWidth() / -2) + 'px'
171
+ }
172
+ };
173
+ return {
174
+ open: open,
175
+ close: close,
176
+ fullscreen: fullscreen
177
+ };
178
+ })();
179
+ return $(window).resize(function() {
180
+ return $('div.modal.active').each(function() {
181
+ if (!$(this).hasClass('fullscreen')) {
182
+ $(this).removeClass('active').css({
183
+ top: '50%',
184
+ left: '50%',
185
+ 'margin-top': ($(this).outerHeight() / -2) + 'px',
186
+ 'margin-left': ($(this).outerWidth() / -2) + 'px'
187
+ }).addClass('active');
188
+ if (!$(this).hasClass('iframe')) {
189
+ $(this).css({
190
+ height: 'auto'
163
191
  });
164
- } else {
165
- $('div.modal i.fullscreen').addClass('icon-resize-small').removeClass('icon-resize-full');
166
- $('div.modal.active').addClass('fullscreen').css({
167
- top: 0,
168
- left: 0,
169
- 'margin-top': 0,
170
- 'margin-left': 0,
171
- width: '100%',
172
- height: '100%',
173
- 'max-width': '100%',
174
- 'max-height': '100%'
192
+ return $(this).css({
193
+ height: $(this).outerHeight()
175
194
  });
176
195
  }
177
- };
178
- return {
179
- open: open,
180
- close: close,
181
- fullscreen: fullscreen
182
- };
183
- })();
184
- return $(window).resize(function() {
185
- return $('div.modal.active').each(function() {
186
- if (!$(this).hasClass('fullscreen')) {
187
- $(this).removeClass('active').css({
188
- top: '50%',
189
- left: '50%',
190
- 'margin-top': ($(this).outerHeight() / -2) + 'px',
191
- 'margin-left': ($(this).outerWidth() / -2) + 'px'
192
- }).addClass('active');
193
- if (!$(this).hasClass('iframe')) {
194
- $(this).css({
195
- height: 'auto'
196
- });
197
- return $(this).css({
198
- height: $(this).outerHeight()
199
- });
200
- }
201
- }
202
- });
196
+ }
203
197
  });
204
- })(jQuery);
205
-
206
- /* --------------------------------------------
207
- Begin jquery.responsiveTables.coffee
208
- --------------------------------------------
209
- */
210
-
211
-
212
- /*
213
- *
214
- * jQuery ResponsiveTables by Gary Hepting - https://github.com/ghepting/responsiveTables
215
- *
216
- * Open source under the BSD License.
217
- *
218
- * Copyright © 2013 Gary Hepting. All rights reserved.
219
- *
220
- */
221
-
222
-
223
- (function($) {
224
- var elems;
225
- elems = [];
226
- $.fn.responsiveTable = function(options) {
227
- var settings;
228
- settings = {
229
- compressor: options.compressor || 10,
230
- minSize: options.minSize || Number.NEGATIVE_INFINITY,
231
- maxSize: options.maxSize || Number.POSITIVE_INFINITY,
232
- padding: 2,
233
- height: "auto",
234
- adjust_parents: true
235
- };
236
- return this.each(function() {
237
- var columns, elem, fontSize, rows;
238
- elem = $(this);
239
- elem.attr('data-compression', settings.compressor);
240
- elem.attr('data-min', settings.minSize);
241
- elem.attr('data-max', settings.maxSize);
242
- elem.attr('data-padding', settings.padding);
243
- columns = $("tr", elem).first().children("th, td").length;
244
- rows = $("tr", elem).length;
245
- if (settings.height !== "auto") {
246
- $this.css("height", settings.height);
247
- if (settings.adjust_parents) {
248
- $this.parents().each(function() {
249
- return $(this).css("height", "100%");
250
- });
251
- }
252
- }
253
- $("tr th, tr td", elem).css("width", Math.floor(100 / columns) + "%");
254
- $("tr th, tr td", elem).css("height", Math.floor(100 / rows) + "%");
255
- fontSize = Math.floor(Math.max(Math.min(elem.width() / settings.compressor, parseFloat(settings.maxSize)), parseFloat(settings.minSize)));
256
- $("tr th, tr td", elem).css("font-size", fontSize + "px");
257
- return elems.push(elem);
258
- });
198
+ });
199
+ })(jQuery);
200
+
201
+ /* --------------------------------------------
202
+ Begin jquery.responsiveTables.coffee
203
+ --------------------------------------------
204
+ */
205
+
206
+
207
+ /*
208
+ *
209
+ * jQuery ResponsiveTables by Gary Hepting - https://github.com/ghepting/responsiveTables
210
+ *
211
+ * Open source under the BSD License.
212
+ *
213
+ * Copyright © 2013 Gary Hepting. All rights reserved.
214
+ *
215
+ */
216
+
217
+
218
+ (function($) {
219
+ var elems;
220
+ elems = [];
221
+ $.fn.responsiveTable = function(options) {
222
+ var settings;
223
+ settings = {
224
+ compressor: options.compressor || 10,
225
+ minSize: options.minSize || Number.NEGATIVE_INFINITY,
226
+ maxSize: options.maxSize || Number.POSITIVE_INFINITY,
227
+ padding: 2,
228
+ height: "auto",
229
+ adjust_parents: true
259
230
  };
260
- return $(window).on("resize", function() {
261
- return $(elems).each(function() {
262
- var elem, fontSize;
263
- elem = $(this);
264
- fontSize = Math.floor(Math.max(Math.min(elem.width() / (elem.attr('data-compression')), parseFloat(elem.attr('data-max'))), parseFloat(elem.attr('data-min'))));
265
- return $("tr th, tr td", elem).css("font-size", fontSize + "px");
266
- });
231
+ return this.each(function() {
232
+ var columns, elem, fontSize, rows;
233
+ elem = $(this);
234
+ elem.attr('data-compression', settings.compressor);
235
+ elem.attr('data-min', settings.minSize);
236
+ elem.attr('data-max', settings.maxSize);
237
+ elem.attr('data-padding', settings.padding);
238
+ columns = $("tr", elem).first().children("th, td").length;
239
+ rows = $("tr", elem).length;
240
+ if (settings.height !== "auto") {
241
+ $this.css("height", settings.height);
242
+ if (settings.adjust_parents) {
243
+ $this.parents().each(function() {
244
+ return $(this).css("height", "100%");
245
+ });
246
+ }
247
+ }
248
+ $("tr th, tr td", elem).css("width", Math.floor(100 / columns) + "%");
249
+ $("tr th, tr td", elem).css("height", Math.floor(100 / rows) + "%");
250
+ fontSize = Math.floor(Math.max(Math.min(elem.width() / settings.compressor, parseFloat(settings.maxSize)), parseFloat(settings.minSize)));
251
+ $("tr th, tr td", elem).css("font-size", fontSize + "px");
252
+ return elems.push(elem);
267
253
  });
268
- })(jQuery);
269
-
270
- /* --------------------------------------------
271
- Begin jquery.responsiveText.coffee
272
- --------------------------------------------
273
- */
274
-
275
-
276
- /*
277
- *
278
- * jQuery ResponsiveText by Gary Hepting - https://github.com/ghepting/responsiveText
279
- *
280
- * Open source under the BSD License.
281
- *
282
- * Copyright © 2013 Gary Hepting. All rights reserved.
283
- *
284
- */
285
-
286
-
287
- (function($) {
288
- var elems;
289
- elems = [];
290
- $.fn.responsiveText = function(options) {
291
- var settings;
292
- settings = {
293
- compressor: options.compressor || 10,
294
- minSize: options.minSize || Number.NEGATIVE_INFINITY,
295
- maxSize: options.maxSize || Number.POSITIVE_INFINITY
296
- };
297
- return this.each(function() {
298
- var elem;
299
- elem = $(this);
300
- elem.attr('data-compression', settings.compressor);
301
- elem.attr('data-min', settings.minSize);
302
- elem.attr('data-max', settings.maxSize);
303
- elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / settings.compressor, parseFloat(settings.maxSize)), parseFloat(settings.minSize))));
304
- return elems.push(elem);
305
- });
254
+ };
255
+ return $(window).on("resize", function() {
256
+ return $(elems).each(function() {
257
+ var elem, fontSize;
258
+ elem = $(this);
259
+ fontSize = Math.floor(Math.max(Math.min(elem.width() / (elem.attr('data-compression')), parseFloat(elem.attr('data-max'))), parseFloat(elem.attr('data-min'))));
260
+ return $("tr th, tr td", elem).css("font-size", fontSize + "px");
261
+ });
262
+ });
263
+ })(jQuery);
264
+
265
+ /* --------------------------------------------
266
+ Begin jquery.responsiveText.coffee
267
+ --------------------------------------------
268
+ */
269
+
270
+
271
+ /*
272
+ *
273
+ * jQuery ResponsiveText by Gary Hepting - https://github.com/ghepting/responsiveText
274
+ *
275
+ * Open source under the BSD License.
276
+ *
277
+ * Copyright © 2013 Gary Hepting. All rights reserved.
278
+ *
279
+ */
280
+
281
+
282
+ (function($) {
283
+ var elems;
284
+ elems = [];
285
+ $.fn.responsiveText = function(options) {
286
+ var settings;
287
+ settings = {
288
+ compressor: options.compressor || 10,
289
+ minSize: options.minSize || Number.NEGATIVE_INFINITY,
290
+ maxSize: options.maxSize || Number.POSITIVE_INFINITY
306
291
  };
307
- return $(window).on("resize", function() {
308
- return $(elems).each(function() {
309
- var elem;
310
- elem = $(this);
311
- return elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / (elem.attr('data-compression')), parseFloat(elem.attr('data-max'))), parseFloat(elem.attr('data-min')))));
312
- });
292
+ return this.each(function() {
293
+ var elem;
294
+ elem = $(this);
295
+ elem.attr('data-compression', settings.compressor);
296
+ elem.attr('data-min', settings.minSize);
297
+ elem.attr('data-max', settings.maxSize);
298
+ elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / settings.compressor, parseFloat(settings.maxSize)), parseFloat(settings.minSize))));
299
+ return elems.push(elem);
313
300
  });
314
- })(jQuery);
315
-
316
- /* --------------------------------------------
317
- Begin jquery.tooltip.coffee
318
- --------------------------------------------
319
- */
320
-
321
-
322
- /*
323
- *
324
- * jQuery Tooltips by Gary Hepting - https://github.com/ghepting/jquery-tooltips
325
- *
326
- * Open source under the BSD License.
327
- *
328
- * Copyright © 2013 Gary Hepting. All rights reserved.
329
- *
330
- */
331
-
332
-
333
- (function($) {
334
- return $.fn.tooltip = function(options) {
335
- var closetooltip, defaults, delayShow, getElementPosition, resettooltip, setPosition, showtooltip, tooltip, trigger;
336
- defaults = {
337
- topOffset: 0,
338
- delay: 100,
339
- speed: 100
301
+ };
302
+ return $(window).on("resize", function() {
303
+ return $(elems).each(function() {
304
+ var elem;
305
+ elem = $(this);
306
+ return elem.css("font-size", Math.floor(Math.max(Math.min(elem.width() / (elem.attr('data-compression')), parseFloat(elem.attr('data-max'))), parseFloat(elem.attr('data-min')))));
307
+ });
308
+ });
309
+ })(jQuery);
310
+
311
+ /* --------------------------------------------
312
+ Begin jquery.tooltip.coffee
313
+ --------------------------------------------
314
+ */
315
+
316
+
317
+ /*
318
+ *
319
+ * jQuery Tooltips by Gary Hepting - https://github.com/ghepting/jquery-tooltips
320
+ *
321
+ * Open source under the BSD License.
322
+ *
323
+ * Copyright © 2013 Gary Hepting. All rights reserved.
324
+ *
325
+ */
326
+
327
+
328
+ (function($) {
329
+ return $.fn.tooltip = function(options) {
330
+ var closetooltip, defaults, delayShow, getElementPosition, resettooltip, setPosition, showtooltip, tooltip, trigger;
331
+ defaults = {
332
+ topOffset: 0,
333
+ delay: 100,
334
+ speed: 100
335
+ };
336
+ options = $.extend(defaults, options);
337
+ tooltip = $('#tooltip');
338
+ delayShow = '';
339
+ trigger = '';
340
+ if ($('#tooltip').length !== 1) {
341
+ tooltip = $("<div id=\"tooltip\"></div>");
342
+ tooltip.appendTo("body").hide();
343
+ }
344
+ getElementPosition = function(el) {
345
+ var bottom, left, offset, right, top, win;
346
+ offset = el.offset();
347
+ win = $(window);
348
+ return {
349
+ top: top = offset.top - win.scrollTop(),
350
+ left: left = offset.left - win.scrollLeft(),
351
+ bottom: bottom = win.height() - top - el.outerHeight(),
352
+ right: right = win.width() - left - el.outerWidth()
340
353
  };
341
- options = $.extend(defaults, options);
342
- tooltip = $('#tooltip');
343
- delayShow = '';
344
- trigger = '';
345
- if ($('#tooltip').length !== 1) {
346
- tooltip = $("<div id=\"tooltip\"></div>");
347
- tooltip.appendTo("body").hide();
354
+ };
355
+ setPosition = function(trigger) {
356
+ var attrs, coords, height, width;
357
+ coords = getElementPosition(trigger);
358
+ if (tooltip.outerWidth() > ($(window).width() - 20)) {
359
+ tooltip.css('width', $(window).width() - 20);
348
360
  }
349
- getElementPosition = function(el) {
350
- var bottom, left, offset, right, top, win;
351
- offset = el.offset();
352
- win = $(window);
353
- return {
354
- top: top = offset.top - win.scrollTop(),
355
- left: left = offset.left - win.scrollLeft(),
356
- bottom: bottom = win.height() - top - el.outerHeight(),
357
- right: right = win.width() - left - el.outerWidth()
358
- };
359
- };
360
- setPosition = function(trigger) {
361
- var attrs, coords, height, width;
362
- coords = getElementPosition(trigger);
363
- if (tooltip.outerWidth() > ($(window).width() - 20)) {
364
- tooltip.css('width', $(window).width() - 20);
365
- }
366
- attrs = {};
367
- tooltip.css('max-width', Math.min($(window).width() - parseInt($('body').css('padding-left')) - parseInt($('body').css('padding-right')), parseInt(tooltip.css('max-width'))));
368
- width = tooltip.outerWidth();
369
- height = tooltip.outerHeight();
370
- if (coords.left <= coords.right) {
371
- tooltip.addClass('left');
372
- attrs.left = coords.left;
373
- } else {
374
- tooltip.addClass('right');
375
- attrs.right = coords.right;
376
- }
377
- if ((coords.top - options.topOffset) > (height + 20)) {
378
- tooltip.addClass('top');
379
- attrs.top = (trigger.offset().top - height) - 20;
380
- } else {
381
- tooltip.addClass('bottom');
382
- attrs.top = trigger.offset().top + trigger.outerHeight() - 4;
383
- }
384
- return tooltip.css(attrs);
385
- };
386
- resettooltip = function() {
387
- return tooltip.text('').removeClass('left right top bottom').css({
388
- left: 'auto',
389
- right: 'auto',
390
- top: 'auto',
391
- bottom: 'auto',
392
- width: 'auto',
393
- 'padding-left': 'auto',
394
- 'padding-right': 'auto'
395
- });
396
- };
397
- closetooltip = function() {
398
- tooltip.stop().hide();
399
- resettooltip();
400
- return $('[role=tooltip]').removeClass('on');
401
- };
402
- showtooltip = function(trigger) {
403
- clearTimeout(delayShow);
404
- return delayShow = setTimeout(function() {
405
- tooltip.css({
406
- "opacity": 0,
407
- "display": "block"
408
- }).text(trigger.attr('data-title'));
409
- setPosition(trigger);
410
- trigger.addClass('on');
411
- console.log(tooltip.css('display'));
412
- return tooltip.animate({
413
- top: "+=10",
414
- opacity: 1
415
- }, options.speed);
416
- }, options.delay);
417
- };
418
- this.each(function() {
419
- var $this;
420
- $this = $(this);
421
- $this.attr('role', 'tooltip').attr('data-title', $this.attr('title'));
422
- return $this.removeAttr("title");
423
- });
424
- $('body').on('focus', '[role=tooltip]', function() {
425
- return showtooltip($(this));
426
- }).on('blur', '[role=tooltip]', function() {
427
- clearTimeout(delayShow);
428
- return closetooltip();
429
- }).on('mouseenter', '[role=tooltip]:not(input,select,textarea)', function() {
430
- return showtooltip($(this));
431
- }).on('mouseleave', '[role=tooltip]:not(input,select,textarea)', function() {
432
- clearTimeout(delayShow);
433
- return closetooltip();
434
- });
435
- return $(window).on({
436
- scroll: function() {
437
- trigger = $('[role=tooltip].on');
438
- if (trigger.length) {
439
- setPosition(trigger);
440
- return $('#tooltip').css({
441
- top: "+=10"
442
- });
443
- }
444
- }
361
+ attrs = {};
362
+ tooltip.css('max-width', Math.min($(window).width() - parseInt($('body').css('padding-left')) - parseInt($('body').css('padding-right')), parseInt(tooltip.css('max-width'))));
363
+ width = tooltip.outerWidth();
364
+ height = tooltip.outerHeight();
365
+ if (coords.left <= coords.right) {
366
+ tooltip.addClass('left');
367
+ attrs.left = coords.left;
368
+ } else {
369
+ tooltip.addClass('right');
370
+ attrs.right = coords.right;
371
+ }
372
+ if ((coords.top - options.topOffset) > (height + 20)) {
373
+ tooltip.addClass('top');
374
+ attrs.top = (trigger.offset().top - height) - 20;
375
+ } else {
376
+ tooltip.addClass('bottom');
377
+ attrs.top = trigger.offset().top + trigger.outerHeight() - 4;
378
+ }
379
+ return tooltip.css(attrs);
380
+ };
381
+ resettooltip = function() {
382
+ return tooltip.text('').removeClass('left right top bottom').css({
383
+ left: 'auto',
384
+ right: 'auto',
385
+ top: 'auto',
386
+ bottom: 'auto',
387
+ width: 'auto',
388
+ 'padding-left': 'auto',
389
+ 'padding-right': 'auto'
445
390
  });
446
391
  };
447
- })(jQuery);
392
+ closetooltip = function() {
393
+ tooltip.stop().hide();
394
+ resettooltip();
395
+ return $('[role=tooltip]').removeClass('on');
396
+ };
397
+ showtooltip = function(trigger) {
398
+ clearTimeout(delayShow);
399
+ return delayShow = setTimeout(function() {
400
+ tooltip.css({
401
+ "opacity": 0,
402
+ "display": "block"
403
+ }).text(trigger.attr('data-title'));
404
+ setPosition(trigger);
405
+ trigger.addClass('on');
406
+ console.log(tooltip.css('display'));
407
+ return tooltip.animate({
408
+ top: "+=10",
409
+ opacity: 1
410
+ }, options.speed);
411
+ }, options.delay);
412
+ };
413
+ this.each(function() {
414
+ var $this;
415
+ $this = $(this);
416
+ $this.attr('role', 'tooltip').attr('data-title', $this.attr('title'));
417
+ return $this.removeAttr("title");
418
+ });
419
+ $('body').on('focus', '[role=tooltip]', function() {
420
+ return showtooltip($(this));
421
+ }).on('blur', '[role=tooltip]', function() {
422
+ clearTimeout(delayShow);
423
+ return closetooltip();
424
+ }).on('mouseenter', '[role=tooltip]:not(input,select,textarea)', function() {
425
+ return showtooltip($(this));
426
+ }).on('mouseleave', '[role=tooltip]:not(input,select,textarea)', function() {
427
+ clearTimeout(delayShow);
428
+ return closetooltip();
429
+ });
430
+ return $(window).on({
431
+ scroll: function() {
432
+ trigger = $('[role=tooltip].on');
433
+ if (trigger.length) {
434
+ setPosition(trigger);
435
+ return $('#tooltip').css({
436
+ top: "+=10"
437
+ });
438
+ }
439
+ }
440
+ });
441
+ };
442
+ })(jQuery);
448
443
 
449
- /* --------------------------------------------
450
- Begin disabled.coffee
451
- --------------------------------------------
452
- */
444
+ /* --------------------------------------------
445
+ Begin disabled.coffee
446
+ --------------------------------------------
447
+ */
453
448
 
454
449
 
455
- $(function() {
456
- $('.disabled').each(function() {
457
- $(this).attr('tabindex', '-1');
458
- $(this).find('a').attr('tabindex', '-1');
459
- return $(this).find('input, select, textarea').addClass('disabled').attr('tabindex', '-1').attr('readonly', 'readyonly');
460
- });
461
- $('body').on('click', '.disabled, .disabled *', function(e) {
462
- e.preventDefault();
463
- return false;
464
- });
450
+ $(function() {
451
+ $('.disabled').each(function() {
452
+ $(this).attr('tabindex', '-1');
453
+ $(this).find('a').attr('tabindex', '-1');
454
+ return $(this).find('input, select, textarea').addClass('disabled').attr('tabindex', '-1').attr('readonly', 'readyonly');
455
+ });
456
+ $('body').on('click', '.disabled, .disabled *', function(e) {
457
+ e.preventDefault();
458
+ return false;
465
459
  });
460
+ });
466
461
 
467
- /* --------------------------------------------
468
- Begin equalizeColumns.coffee
469
- --------------------------------------------
470
- */
462
+ /* --------------------------------------------
463
+ Begin equalizeColumns.coffee
464
+ --------------------------------------------
465
+ */
471
466
 
472
467
 
473
- $(function() {
474
- return equalizeColumns();
475
- });
468
+ $(function() {
469
+ return equalizeColumns();
470
+ });
476
471
 
477
- $(window).resize(function() {
478
- return equalizeColumns();
479
- });
472
+ $(window).resize(function() {
473
+ return equalizeColumns();
474
+ });
480
475
 
481
- equalizeColumns = function() {
482
- return $('.row.equalize').each(function() {
483
- var $row, collapsed, tallest;
484
- $row = $(this);
485
- tallest = 0;
486
- collapsed = false;
487
- $(this).children('*').each(function(i) {
488
- $(this).css('min-height', '1px');
489
- collapsed = $(this).outerWidth() === $row.outerWidth();
490
- if (!collapsed) {
491
- if (!$(this).hasClass('equal')) {
492
- $(this).addClass('equal');
493
- }
494
- if ($(this).outerHeight() > tallest) {
495
- return tallest = $(this).outerHeight();
496
- }
497
- }
498
- });
476
+ equalizeColumns = function() {
477
+ return $('.row.equalize').each(function() {
478
+ var $row, collapsed, tallest;
479
+ $row = $(this);
480
+ tallest = 0;
481
+ collapsed = false;
482
+ $(this).children('*').each(function(i) {
483
+ $(this).css('min-height', '1px');
484
+ collapsed = $(this).outerWidth() === $row.outerWidth();
499
485
  if (!collapsed) {
500
- return $(this).children('*').css('min-height', tallest);
486
+ if (!$(this).hasClass('equal')) {
487
+ $(this).addClass('equal');
488
+ }
489
+ if ($(this).outerHeight() > tallest) {
490
+ return tallest = $(this).outerHeight();
491
+ }
501
492
  }
502
493
  });
503
- };
494
+ if (!collapsed) {
495
+ return $(this).children('*').css('min-height', tallest);
496
+ }
497
+ });
498
+ };
504
499
 
505
- /* --------------------------------------------
506
- Begin forms.coffee
507
- --------------------------------------------
508
- */
500
+ /* --------------------------------------------
501
+ Begin forms.coffee
502
+ --------------------------------------------
503
+ */
509
504
 
510
505
 
511
- $(function() {
512
- $('body').on('click', '\
506
+ $(function() {
507
+ $('body').on('click', '\
513
508
  .error input, \
514
509
  .error textarea, \
515
510
  .invalid input, \
@@ -518,358 +513,373 @@
518
513
  textarea.error, \
519
514
  input.invalid, \
520
515
  textarea.invalid', function(e) {
521
- return $(this).focus().select();
522
- });
523
- $('span.select select').each(function() {
524
- if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
525
- return $(this).addClass('unselected');
526
- } else {
527
- return $(this).removeClass('unselected');
528
- }
529
- });
530
- $('body').on('change', 'span.select select', function(e) {
531
- if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
532
- return $(this).addClass('unselected');
533
- } else {
534
- return $(this).removeClass('unselected');
535
- }
536
- });
516
+ return $(this).focus().select();
537
517
  });
518
+ $('span.select select').each(function() {
519
+ if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
520
+ return $(this).addClass('unselected');
521
+ } else {
522
+ return $(this).removeClass('unselected');
523
+ }
524
+ });
525
+ $('body').on('change', 'span.select select', function(e) {
526
+ if ($(this).children('option').first().val() === '' && $(this).children('option').first().attr('selected')) {
527
+ return $(this).addClass('unselected');
528
+ } else {
529
+ return $(this).removeClass('unselected');
530
+ }
531
+ });
532
+ });
538
533
 
539
- /* --------------------------------------------
540
- Begin menus.coffee
541
- --------------------------------------------
542
- */
534
+ /* --------------------------------------------
535
+ Begin menus.coffee
536
+ --------------------------------------------
537
+ */
543
538
 
544
539
 
545
- $(function() {
546
- var delay, openMenu,
547
- _this = this;
548
- delay = '';
549
- openMenu = function(target) {
550
- return $(target).parent('li.menu').toggleClass('on');
551
- };
552
- $('body').on('mouseenter', '.nav > ul > li.menu:not(.disabled)', function(e) {
553
- if ($(window).width() >= 768) {
554
- clearTimeout(delay);
555
- $('.nav > ul > li.menu.on').removeClass('on');
556
- return $(this).addClass('on');
557
- }
558
- });
559
- $('body').on('mouseleave', '.nav > ul > li.menu:not(.disabled)', function(e) {
560
- if ($(window).width() >= 768) {
561
- return delay = setTimeout((function() {
562
- return $('.nav > ul > li.menu.on').removeClass('on');
563
- }), 350);
564
- }
565
- });
566
- $('body').on('click', '.nav > ul > li.menu:not(.disabled) > a', function(e) {
567
- if (Modernizr.touch || $(window).width() < 768) {
568
- openMenu(e.target);
569
- } else {
570
- $('.nav > ul > li.menu.on').removeClass('on');
571
- $(e.target).parents('li.menu').addClass('on');
572
- }
573
- e.preventDefault();
574
- return false;
575
- });
576
- $('body').on('focus', '.nav > ul > li:not(.on) > a', function() {
577
- return $('.nav > ul > li.menu.on').removeClass('on');
578
- });
579
- $('body').on('focus', '.nav > ul > li.menu > a', function(e) {
580
- openMenu(e.target);
581
- e.preventDefault();
582
- return false;
583
- });
584
- $('body').on('click', function(e) {
585
- if ($(e.target).hasClass('dropdown')) {
586
- $(e.target).toggleClass('on');
587
- } else {
588
- if ($('.dropdown').filter('.on').length) {
589
- $('.dropdown').filter('.on').removeClass('on');
590
- }
591
- }
592
- if ($('.nav > ul > li').filter('.menu.on').length) {
593
- return $('.nav > ul > li').filter('.menu.on').removeClass('on');
594
- }
595
- });
596
- $('body').on('focus', '.dropdown', function(e) {
540
+ $(function() {
541
+ var delay, openMenu,
542
+ _this = this;
543
+ delay = '';
544
+ openMenu = function(target) {
545
+ return $(target).parent('li.menu').toggleClass('on');
546
+ };
547
+ $('body').on('mouseenter', '.nav > ul > li.menu:not(.disabled)', function(e) {
548
+ if ($(window).width() >= 768) {
549
+ clearTimeout(delay);
550
+ $('.nav > ul > li.menu.on').removeClass('on');
597
551
  return $(this).addClass('on');
598
- });
599
- $('body').on('blur', '.dropdown li:last-child a', function(e) {
600
- return $('.dropdown').filter('.on').removeClass('on');
601
- });
602
- $('.nav.menu').each(function() {
603
- if (!$(this).attr('data-label')) {
604
- $(this).attr('data-label', 'Menu');
605
- }
606
- if (!($(this).find('.menu-toggle').length > 0)) {
607
- return $(this).prepend('<a href="#" class="menu-toggle"><i class="icon-reorder"></i></a>');
552
+ }
553
+ });
554
+ $('body').on('mouseleave', '.nav > ul > li.menu:not(.disabled)', function(e) {
555
+ if ($(window).width() >= 768) {
556
+ return delay = setTimeout((function() {
557
+ return $('.nav > ul > li.menu.on').removeClass('on');
558
+ }), 350);
559
+ }
560
+ });
561
+ $('body').on('click', '.nav > ul > li.menu:not(.disabled) > a', function(e) {
562
+ if (Modernizr.touch || $(window).width() < 768) {
563
+ openMenu(e.target);
564
+ } else {
565
+ $('.nav > ul > li.menu.on').removeClass('on');
566
+ $(e.target).parents('li.menu').addClass('on');
567
+ }
568
+ e.preventDefault();
569
+ return false;
570
+ });
571
+ $('body').on('focus', '.nav > ul > li:not(.on) > a', function() {
572
+ return $('.nav > ul > li.menu.on').removeClass('on');
573
+ });
574
+ $('body').on('focus', '.nav > ul > li.menu > a', function(e) {
575
+ openMenu(e.target);
576
+ e.preventDefault();
577
+ return false;
578
+ });
579
+ $('body').on('click', function(e) {
580
+ if ($(e.target).hasClass('dropdown')) {
581
+ $(e.target).toggleClass('on');
582
+ } else {
583
+ if ($('.dropdown').filter('.on').length) {
584
+ $('.dropdown').filter('.on').removeClass('on');
608
585
  }
609
- });
610
- $('body').on('click', '.nav.menu .menu-toggle', function(e) {
611
- $(this).parent('.nav.menu').toggleClass('on');
612
- e.preventDefault();
613
- return false;
614
- });
615
- $('body').on('focus', '.menu-toggle', function(e) {
616
- return $(e.target).parent('.nav.menu').addClass('on');
617
- });
618
- $('body').on('blur', '.nav.menu > ul > li:last-child a', function(e) {
619
- return $('.nav.menu').filter('.on').removeClass('on');
620
- });
586
+ }
587
+ if ($('.nav > ul > li').filter('.menu.on').length) {
588
+ return $('.nav > ul > li').filter('.menu.on').removeClass('on');
589
+ }
621
590
  });
622
-
623
- $(window).on('resize', function() {
624
- if ($('.nav > ul > li.menu.on').length > 1) {
625
- return $('.nav > ul > li.menu.on').removeClass('on').first().addClass('on');
591
+ $('body').on('focus', '.dropdown', function(e) {
592
+ return $(this).addClass('on');
593
+ });
594
+ $('body').on('blur', '.dropdown li:last-child a', function(e) {
595
+ return $('.dropdown').filter('.on').removeClass('on');
596
+ });
597
+ $('.nav.menu').each(function() {
598
+ if (!$(this).attr('data-label')) {
599
+ $(this).attr('data-label', 'Menu');
600
+ }
601
+ if (!($(this).find('.menu-toggle').length > 0)) {
602
+ return $(this).prepend('<a href="#" class="menu-toggle"><i class="icon-reorder"></i></a>');
626
603
  }
627
604
  });
605
+ $('body').on('click', '.nav.menu .menu-toggle', function(e) {
606
+ $(this).parent('.nav.menu').toggleClass('on');
607
+ e.preventDefault();
608
+ return false;
609
+ });
610
+ $('body').on('focus', '.menu-toggle', function(e) {
611
+ return $(e.target).parent('.nav.menu').addClass('on');
612
+ });
613
+ $('body').on('blur', '.nav.menu > ul > li:last-child a', function(e) {
614
+ return $('.nav.menu').filter('.on').removeClass('on');
615
+ });
616
+ });
628
617
 
629
- /* --------------------------------------------
630
- Begin modals.coffee
631
- --------------------------------------------
632
- */
618
+ $(window).on('resize', function() {
619
+ if ($('.nav > ul > li.menu.on').length > 1) {
620
+ return $('.nav > ul > li.menu.on').removeClass('on').first().addClass('on');
621
+ }
622
+ });
633
623
 
624
+ /* --------------------------------------------
625
+ Begin modals.coffee
626
+ --------------------------------------------
627
+ */
634
628
 
635
- /*
636
- * Requires jquery.modals.js
637
- */
629
+
630
+ /*
631
+ * Requires jquery.modals.js
632
+ */
638
633
 
639
634
 
640
- $(function() {
641
- return $('div.modal, div[role=dialog]').modal();
642
- });
635
+ $(function() {
636
+ return $('div.modal, div[role=dialog]').modal();
637
+ });
643
638
 
644
- /* --------------------------------------------
645
- Begin pagination.coffee
646
- --------------------------------------------
647
- */
639
+ /* --------------------------------------------
640
+ Begin pagination.coffee
641
+ --------------------------------------------
642
+ */
648
643
 
649
644
 
650
- $(function() {
645
+ $(function() {
646
+ limitPaginationItems();
647
+ $('body').on('click', '.pagination ul > li:not(.next, .prev) a', function(e) {
648
+ $('.pagination ul > li:not(.next, .prev)').removeClass('active');
649
+ $(this).parent('li').addClass('active');
650
+ if ($(this).parent('li').hasClass('first')) {
651
+ $('.pagination ul > li.prev').addClass('disabled');
652
+ } else {
653
+ $('.pagination ul > li.prev').removeClass('disabled');
654
+ }
655
+ if ($(this).parent('li').hasClass('last')) {
656
+ $('.pagination ul > li.next').addClass('disabled');
657
+ } else {
658
+ $('.pagination ul > li.next').removeClass('disabled');
659
+ }
651
660
  limitPaginationItems();
652
- $('body').on('click', '.pagination ul > li:not(.next, .prev) a', function(e) {
653
- $('.pagination ul > li:not(.next, .prev)').removeClass('active');
654
- $(this).parent('li').addClass('active');
655
- if ($(this).parent('li').hasClass('first')) {
656
- $('.pagination ul > li.prev').addClass('disabled');
657
- } else {
658
- $('.pagination ul > li.prev').removeClass('disabled');
659
- }
660
- if ($(this).parent('li').hasClass('last')) {
661
- $('.pagination ul > li.next').addClass('disabled');
662
- } else {
663
- $('.pagination ul > li.next').removeClass('disabled');
664
- }
661
+ e.preventDefault();
662
+ return false;
663
+ });
664
+ $('body').on('click', '.pagination ul > li.prev:not(.disabled)', function(e) {
665
+ var el;
666
+ $('.pagination ul > li.next').removeClass('disabled');
667
+ el = $('.pagination ul > li.active');
668
+ if (!el.hasClass('first')) {
669
+ el.removeClass('active');
670
+ el.prev().addClass('active');
665
671
  limitPaginationItems();
666
- e.preventDefault();
667
- return false;
668
- });
669
- $('body').on('click', '.pagination ul > li.prev:not(.disabled)', function(e) {
670
- var el;
671
- $('.pagination ul > li.next').removeClass('disabled');
672
- el = $('.pagination ul > li.active');
673
- if (!el.hasClass('first')) {
674
- el.removeClass('active');
675
- el.prev().addClass('active');
676
- limitPaginationItems();
677
- }
678
- if ($('.pagination ul > li.active').hasClass('first')) {
679
- $(this).addClass('disabled');
680
- }
681
- e.preventDefault();
682
- return false;
683
- });
684
- $('body').on('click', '.pagination ul > li.next:not(.disabled)', function(e) {
685
- var el;
686
- $('.pagination ul > li.prev').removeClass('disabled');
687
- el = $('.pagination ul > li.active');
688
- if (!el.hasClass('last')) {
689
- el.removeClass('active');
690
- el.next().addClass('active');
691
- limitPaginationItems();
692
- }
693
- if ($('.pagination ul > li.active').hasClass('last')) {
694
- $(this).addClass('disabled');
695
- }
696
- e.preventDefault();
697
- return false;
698
- });
699
- $('body').on('click', '.pagination ul > li.disabled a', function(e) {
700
- e.preventDefault();
701
- return false;
702
- });
672
+ }
673
+ if ($('.pagination ul > li.active').hasClass('first')) {
674
+ $(this).addClass('disabled');
675
+ }
676
+ e.preventDefault();
677
+ return false;
703
678
  });
704
-
705
- $(window).resize(function() {
706
- return limitPaginationItems();
679
+ $('body').on('click', '.pagination ul > li.next:not(.disabled)', function(e) {
680
+ var el;
681
+ $('.pagination ul > li.prev').removeClass('disabled');
682
+ el = $('.pagination ul > li.active');
683
+ if (!el.hasClass('last')) {
684
+ el.removeClass('active');
685
+ el.next().addClass('active');
686
+ limitPaginationItems();
687
+ }
688
+ if ($('.pagination ul > li.active').hasClass('last')) {
689
+ $(this).addClass('disabled');
690
+ }
691
+ e.preventDefault();
692
+ return false;
707
693
  });
708
-
709
- limitPaginationItems = function() {
710
- return $('.pagination ul').each(function() {
711
- var pagination, totalItemsWidth, visibleItemsWidth, visibleSpace, _results;
712
- pagination = $(this);
713
- visibleSpace = pagination.outerWidth() - pagination.children('li.prev').outerWidth() - pagination.children('li.next').outerWidth();
714
- totalItemsWidth = 0;
715
- pagination.children('li').each(function() {
716
- return totalItemsWidth += $(this).outerWidth();
717
- });
718
- pagination.children('li').not('.prev, .next, .active').hide();
694
+ $('body').on('click', '.pagination ul > li.disabled a', function(e) {
695
+ e.preventDefault();
696
+ return false;
697
+ });
698
+ });
699
+
700
+ $(window).resize(function() {
701
+ return limitPaginationItems();
702
+ });
703
+
704
+ limitPaginationItems = function() {
705
+ return $('.pagination ul').each(function() {
706
+ var pagination, totalItemsWidth, visibleItemsWidth, visibleSpace, _results;
707
+ pagination = $(this);
708
+ visibleSpace = pagination.outerWidth() - pagination.children('li.prev').outerWidth() - pagination.children('li.next').outerWidth();
709
+ totalItemsWidth = 0;
710
+ pagination.children('li').each(function() {
711
+ return totalItemsWidth += $(this).outerWidth();
712
+ });
713
+ pagination.children('li').not('.prev, .next, .active').hide();
714
+ visibleItemsWidth = 0;
715
+ pagination.children('li:visible').each(function() {
716
+ return visibleItemsWidth += $(this).outerWidth();
717
+ });
718
+ _results = [];
719
+ while ((visibleItemsWidth + 29) < visibleSpace && (visibleItemsWidth + 29) < totalItemsWidth) {
720
+ pagination.children('li:visible').not('.next').last().next().show();
719
721
  visibleItemsWidth = 0;
720
722
  pagination.children('li:visible').each(function() {
721
723
  return visibleItemsWidth += $(this).outerWidth();
722
724
  });
723
- _results = [];
724
- while ((visibleItemsWidth + 29) < visibleSpace && (visibleItemsWidth + 29) < totalItemsWidth) {
725
- pagination.children('li:visible').not('.next').last().next().show();
725
+ if ((visibleItemsWidth + 29) <= visibleSpace) {
726
+ pagination.children('li:visible').not('.prev').first().prev().show();
726
727
  visibleItemsWidth = 0;
727
728
  pagination.children('li:visible').each(function() {
728
729
  return visibleItemsWidth += $(this).outerWidth();
729
730
  });
730
- if ((visibleItemsWidth + 29) <= visibleSpace) {
731
- pagination.children('li:visible').not('.prev').first().prev().show();
732
- visibleItemsWidth = 0;
733
- pagination.children('li:visible').each(function() {
734
- return visibleItemsWidth += $(this).outerWidth();
735
- });
736
- }
737
- visibleItemsWidth = 0;
738
- _results.push(pagination.children('li:visible').each(function() {
739
- return visibleItemsWidth += $(this).outerWidth();
740
- }));
741
731
  }
742
- return _results;
743
- });
744
- };
745
-
746
- /* --------------------------------------------
747
- Begin responsiveTables.coffee
748
- --------------------------------------------
749
- */
750
-
751
-
752
- /*
753
- * Requires jquery.responsiveText.js
754
- */
755
-
756
-
757
- $(function() {
758
- return $('table.responsive').each(function(index, object) {
759
- var compression, max, min, padding;
760
- compression = 30;
761
- min = 8;
762
- max = 13;
763
- padding = 0;
764
- compression = parseFloat($(this).attr('data-compression') || compression);
765
- min = parseFloat($(this).attr('data-min') || min);
766
- max = parseFloat($(this).attr('data-max') || max);
767
- padding = parseFloat($(this).attr('data-padding') || padding);
768
- return $(object).responsiveTable({
769
- compressor: compression,
770
- minSize: min,
771
- maxSize: max,
772
- padding: padding
773
- });
774
- });
732
+ visibleItemsWidth = 0;
733
+ _results.push(pagination.children('li:visible').each(function() {
734
+ return visibleItemsWidth += $(this).outerWidth();
735
+ }));
736
+ }
737
+ return _results;
775
738
  });
739
+ };
776
740
 
777
- /* --------------------------------------------
778
- Begin responsiveText.coffee
779
- --------------------------------------------
780
- */
741
+ /* --------------------------------------------
742
+ Begin responsiveTables.coffee
743
+ --------------------------------------------
744
+ */
781
745
 
782
746
 
783
- /*
784
- * Requires jquery.responsiveText.js
785
- */
747
+ /*
748
+ * Requires jquery.responsiveText.js
749
+ */
786
750
 
787
751
 
788
- $(function() {
789
- return $('.responsive').not('table').each(function(index, object) {
790
- var compression, max, min;
791
- compression = 10;
792
- min = 10;
793
- max = 200;
794
- compression = parseFloat($(this).attr('data-compression') || compression);
795
- min = parseFloat($(this).attr('data-min') || min);
796
- max = parseFloat($(this).attr('data-max') || max);
797
- return $(object).responsiveText({
798
- compressor: compression,
799
- minSize: min,
800
- maxSize: max
801
- });
752
+ $(function() {
753
+ return $('table.responsive').each(function(index, object) {
754
+ var compression, max, min, padding;
755
+ compression = 30;
756
+ min = 8;
757
+ max = 13;
758
+ padding = 0;
759
+ compression = parseFloat($(this).attr('data-compression') || compression);
760
+ min = parseFloat($(this).attr('data-min') || min);
761
+ max = parseFloat($(this).attr('data-max') || max);
762
+ padding = parseFloat($(this).attr('data-padding') || padding);
763
+ return $(object).responsiveTable({
764
+ compressor: compression,
765
+ minSize: min,
766
+ maxSize: max,
767
+ padding: padding
802
768
  });
803
769
  });
770
+ });
804
771
 
805
- /* --------------------------------------------
806
- Begin tabs.coffee
807
- --------------------------------------------
808
- */
772
+ /* --------------------------------------------
773
+ Begin responsiveText.coffee
774
+ --------------------------------------------
775
+ */
809
776
 
810
777
 
811
- $(function() {
812
- return $('body').on('click', '.tabs > ul li a[href^=#], [role=tab] a', function(e) {
813
- var tabs;
814
- if (!$(this).hasClass('disabled')) {
815
- if ($(this).parents('[role=tabpanel]').length > 0) {
816
- tabs = $(this).parents('[role=tabpanel]');
817
- } else {
818
- tabs = $(this).parents('.tabs');
819
- }
820
- tabs.find('> ul li a, [role=tab] a').removeClass('active');
821
- $(this).addClass('active');
822
- tabs.children('div, [role=tabpanel]').removeClass('active');
823
- tabs.children($(this).attr('href')).addClass('active');
778
+ /*
779
+ * Requires jquery.responsiveText.js
780
+ */
781
+
782
+
783
+ $(function() {
784
+ return $('.responsive').not('table').each(function(index, object) {
785
+ var $this, compression, max, min, scrollReset, scrollTime;
786
+ compression = 10;
787
+ min = 10;
788
+ max = 200;
789
+ scrollTime = 650;
790
+ scrollReset = 200;
791
+ compression = parseFloat($(this).attr('data-compression') || compression);
792
+ min = parseFloat($(this).attr('data-min') || min);
793
+ max = parseFloat($(this).attr('data-max') || max);
794
+ $(object).responsiveText({
795
+ compressor: compression,
796
+ minSize: min,
797
+ maxSize: max
798
+ });
799
+ $this = $(this);
800
+ return $(this).hover((function() {
801
+ var difference;
802
+ difference = $this.get(0).scrollWidth - $this.width();
803
+ console.log(difference);
804
+ if (difference > 0) {
805
+ return $this.stop().animate({
806
+ "text-indent": -difference
807
+ }, scrollTime);
824
808
  }
825
- e.preventDefault();
826
- return false;
809
+ }), function() {
810
+ return $this.stop().animate({
811
+ "text-indent": 0
812
+ }, scrollReset);
827
813
  });
828
814
  });
815
+ });
829
816
 
830
- /* --------------------------------------------
831
- Begin tiles.coffee
832
- --------------------------------------------
833
- */
817
+ /* --------------------------------------------
818
+ Begin tabs.coffee
819
+ --------------------------------------------
820
+ */
834
821
 
835
822
 
836
- $(function() {
837
- $('.tiles').each(function() {
838
- $(this).find('.tile').attr('role', 'button');
839
- return $(this).find('.tile[data-value=' + $(this).find('input.value, select.value').val() + ']').addClass('active');
840
- });
841
- $('body').on('click', '.tiles .tile', function(e) {
842
- var tiles;
843
- if (!$(this).hasClass('disabled')) {
844
- tiles = $(this).parents('.tiles');
845
- tiles.find('.tile').removeClass('active');
846
- tiles.find('input.value, select.value').val($(this).data('value')).change();
847
- $(this).addClass('active');
823
+ $(function() {
824
+ return $('body').on('click', '.tabs > ul li a[href^=#], [role=tab] a', function(e) {
825
+ var tabs;
826
+ if (!$(this).hasClass('disabled')) {
827
+ if ($(this).parents('[role=tabpanel]').length > 0) {
828
+ tabs = $(this).parents('[role=tabpanel]');
829
+ } else {
830
+ tabs = $(this).parents('.tabs');
848
831
  }
849
- e.preventDefault();
850
- return false;
851
- });
852
- return $('body').on('change', '.tiles input.value, .tiles select.value', function(e) {
853
- var tiles;
854
- tiles = $(this).parents('.tiles');
855
- tiles.find('.tile').removeClass('active');
856
- return tiles.find('.tile[data-value=' + $(this).val() + ']').addClass('active');
857
- });
832
+ tabs.find('> ul li a, [role=tab] a').removeClass('active');
833
+ $(this).addClass('active');
834
+ tabs.children('div, [role=tabpanel]').removeClass('active');
835
+ tabs.children($(this).attr('href')).addClass('active');
836
+ }
837
+ e.preventDefault();
838
+ return false;
858
839
  });
840
+ });
841
+
842
+ /* --------------------------------------------
843
+ Begin tooltips.coffee
844
+ --------------------------------------------
845
+ */
859
846
 
860
- /* --------------------------------------------
861
- Begin tooltips.coffee
862
- --------------------------------------------
863
- */
864
847
 
848
+ /*
849
+ * Requires jquery.tooltips.js
850
+ */
865
851
 
866
- /*
867
- * Requires jquery.tooltips.js
868
- */
869
852
 
853
+ $(function() {
854
+ return $('.tooltip[title]').tooltip();
855
+ });
870
856
 
871
- $(function() {
872
- return $('.tooltip[title]').tooltip();
873
- });
857
+ /* --------------------------------------------
858
+ Begin tiles.coffee
859
+ --------------------------------------------
860
+ */
874
861
 
875
- }).call(this);
862
+
863
+ $(function() {
864
+ $('.tiles').each(function() {
865
+ $(this).find('.tile').attr('role', 'button');
866
+ return $(this).find('.tile[data-value=' + $(this).find('input.value, select.value').val() + ']').addClass('active');
867
+ });
868
+ $('body').on('click', '.tiles .tile', function(e) {
869
+ var tiles;
870
+ if (!$(this).hasClass('disabled')) {
871
+ tiles = $(this).parents('.tiles');
872
+ tiles.find('.tile').removeClass('active');
873
+ tiles.find('input.value, select.value').val($(this).data('value')).change();
874
+ $(this).addClass('active');
875
+ }
876
+ e.preventDefault();
877
+ return false;
878
+ });
879
+ return $('body').on('change', '.tiles input.value, .tiles select.value', function(e) {
880
+ var tiles;
881
+ tiles = $(this).parents('.tiles');
882
+ tiles.find('.tile').removeClass('active');
883
+ return tiles.find('.tile[data-value=' + $(this).val() + ']').addClass('active');
884
+ });
885
+ });