groundworkcss-rails 0.2.9 → 0.2.10

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