locomotivecms_wagon 2.2.0.beta1 → 2.2.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (219) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/generators/blank/config/metafields_schema.yml +1 -1
  4. data/generators/bootstrap/config/metafields_schema.yml +1 -1
  5. data/generators/{foundation5 → foundation}/Gemfile.tt +1 -1
  6. data/generators/{foundation5 → foundation}/Guardfile +0 -0
  7. data/generators/foundation/app/content_types/.gitkeep +0 -0
  8. data/generators/foundation/app/views/pages/404.liquid +11 -0
  9. data/generators/{foundation5 → foundation}/app/views/pages/404.liquid.haml +4 -3
  10. data/generators/{foundation5 → foundation}/app/views/pages/index.liquid +54 -78
  11. data/generators/foundation/app/views/pages/index.liquid.haml +144 -0
  12. data/generators/foundation/app/views/snippets/.gitkeep +0 -0
  13. data/generators/{foundation5 → foundation}/config/deploy.yml +2 -1
  14. data/generators/{foundation5 → foundation}/config/metafields_schema.yml +1 -1
  15. data/generators/{foundation5/config/site.yml.tt → foundation/config/site.yml} +2 -2
  16. data/generators/{foundation5 → foundation}/config/translations.yml +0 -0
  17. data/generators/foundation/data/.gitkeep +0 -0
  18. data/generators/foundation/log/.gitkeep +0 -0
  19. data/generators/foundation/public/images/.gitkeep +0 -0
  20. data/generators/foundation/public/javascripts/app.js +1 -0
  21. data/generators/foundation/public/javascripts/vendor/foundation.js +7472 -0
  22. data/generators/foundation/public/javascripts/vendor/foundation.min.js +3 -0
  23. data/generators/foundation/public/javascripts/vendor/what-input.js +212 -0
  24. data/generators/foundation/public/javascripts/vendor/what-input.min.js +1 -0
  25. data/generators/foundation/public/stylesheets/_settings.scss +529 -0
  26. data/generators/foundation/public/stylesheets/app.css +3 -0
  27. data/generators/foundation/public/stylesheets/app.scss +43 -0
  28. data/generators/foundation/public/stylesheets/foundation.css +3499 -0
  29. data/generators/foundation/public/stylesheets/foundation6/_global.scss +197 -0
  30. data/generators/foundation/public/stylesheets/foundation6/components/_accordion-menu.scss +28 -0
  31. data/generators/foundation/public/stylesheets/foundation6/components/_accordion.scss +112 -0
  32. data/generators/foundation/public/stylesheets/foundation6/components/_badge.scss +55 -0
  33. data/generators/foundation/public/stylesheets/foundation6/components/_breadcrumbs.scss +94 -0
  34. data/generators/foundation/public/stylesheets/foundation6/components/_button-group.scss +115 -0
  35. data/generators/foundation/public/stylesheets/foundation6/components/_button.scss +264 -0
  36. data/generators/foundation/public/stylesheets/foundation6/components/_callout.scss +115 -0
  37. data/generators/foundation/public/stylesheets/foundation6/components/_close-button.scss +61 -0
  38. data/generators/foundation/public/stylesheets/foundation6/components/_drilldown.scss +67 -0
  39. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown-menu.scss +123 -0
  40. data/generators/foundation/public/stylesheets/foundation6/components/_dropdown.scss +64 -0
  41. data/generators/foundation/public/stylesheets/foundation6/components/_flex-video.scss +68 -0
  42. data/generators/foundation/public/stylesheets/foundation6/components/_float.scss +27 -0
  43. data/generators/foundation/public/stylesheets/foundation6/components/_label.scss +56 -0
  44. data/generators/foundation/public/stylesheets/foundation6/components/_media-object.scss +74 -0
  45. data/generators/foundation/public/stylesheets/foundation6/components/_menu.scss +213 -0
  46. data/generators/foundation/public/stylesheets/foundation6/components/_off-canvas.scss +170 -0
  47. data/generators/foundation/public/stylesheets/foundation6/components/_orbit.scss +186 -0
  48. data/generators/foundation/public/stylesheets/foundation6/components/_pagination.scss +161 -0
  49. data/generators/foundation/public/stylesheets/foundation6/components/_progress-bar.scss +83 -0
  50. data/generators/foundation/public/stylesheets/foundation6/components/_reveal.scss +155 -0
  51. data/generators/foundation/public/stylesheets/foundation6/components/_slider.scss +158 -0
  52. data/generators/foundation/public/stylesheets/foundation6/components/_sticky.scss +38 -0
  53. data/generators/foundation/public/stylesheets/foundation6/components/_switch.scss +231 -0
  54. data/generators/foundation/public/stylesheets/foundation6/components/_table.scss +212 -0
  55. data/generators/foundation/public/stylesheets/foundation6/components/_tabs.scss +137 -0
  56. data/generators/foundation/public/stylesheets/foundation6/components/_thumbnail.scss +54 -0
  57. data/generators/foundation/public/stylesheets/foundation6/components/_title-bar.scss +44 -0
  58. data/generators/foundation/public/stylesheets/foundation6/components/_tooltip.scss +110 -0
  59. data/generators/foundation/public/stylesheets/foundation6/components/_top-bar.scss +57 -0
  60. data/generators/foundation/public/stylesheets/foundation6/components/_visibility.scss +131 -0
  61. data/generators/foundation/public/stylesheets/foundation6/forms/_checkbox.scss +36 -0
  62. data/generators/foundation/public/stylesheets/foundation6/forms/_error.scss +81 -0
  63. data/generators/foundation/public/stylesheets/foundation6/forms/_fieldset.scss +53 -0
  64. data/generators/foundation/public/stylesheets/foundation6/forms/_forms.scss +32 -0
  65. data/generators/foundation/public/stylesheets/foundation6/forms/_help-text.scss +30 -0
  66. data/generators/foundation/public/stylesheets/foundation6/forms/_input-group.scss +70 -0
  67. data/generators/foundation/public/stylesheets/foundation6/forms/_label.scss +48 -0
  68. data/generators/foundation/public/stylesheets/foundation6/forms/_select.scss +64 -0
  69. data/generators/foundation/public/stylesheets/foundation6/forms/_text.scss +153 -0
  70. data/generators/foundation/public/stylesheets/foundation6/foundation.scss +91 -0
  71. data/generators/foundation/public/stylesheets/foundation6/grid/_classes.scss +132 -0
  72. data/generators/foundation/public/stylesheets/foundation6/grid/_column.scss +112 -0
  73. data/generators/foundation/public/stylesheets/foundation6/grid/_flex-grid.scss +191 -0
  74. data/generators/foundation/public/stylesheets/foundation6/grid/_grid.scss +33 -0
  75. data/generators/foundation/public/stylesheets/foundation6/grid/_gutter.scss +31 -0
  76. data/generators/foundation/public/stylesheets/foundation6/grid/_layout.scss +32 -0
  77. data/generators/foundation/public/stylesheets/foundation6/grid/_position.scss +71 -0
  78. data/generators/foundation/public/stylesheets/foundation6/grid/_row.scss +72 -0
  79. data/generators/foundation/public/stylesheets/foundation6/grid/_size.scss +24 -0
  80. data/generators/foundation/public/stylesheets/foundation6/motion-ui/_classes.scss +102 -0
  81. data/generators/foundation/public/stylesheets/foundation6/motion-ui/_settings.scss +61 -0
  82. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_fade.scss +29 -0
  83. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_hinge.scss +65 -0
  84. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_shake.scss +15 -0
  85. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_slide.scss +41 -0
  86. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_spin.scss +28 -0
  87. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_wiggle.scss +13 -0
  88. data/generators/foundation/public/stylesheets/foundation6/motion-ui/effects/_zoom.scss +15 -0
  89. data/generators/foundation/public/stylesheets/foundation6/motion-ui/motion-ui.scss +29 -0
  90. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_fade.scss +28 -0
  91. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_hinge.scss +43 -0
  92. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_slide.scss +42 -0
  93. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_spin.scss +39 -0
  94. data/generators/foundation/public/stylesheets/foundation6/motion-ui/transitions/_zoom.scss +39 -0
  95. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_animation.scss +7 -0
  96. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_args.scss +15 -0
  97. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_keyframe.scss +136 -0
  98. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_selector.scss +23 -0
  99. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_series.scss +54 -0
  100. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_transition.scss +45 -0
  101. data/generators/foundation/public/stylesheets/foundation6/motion-ui/util/_unit.scss +7 -0
  102. data/generators/foundation/public/stylesheets/foundation6/motion-ui.scss +4 -0
  103. data/generators/foundation/public/stylesheets/foundation6/settings/_settings.scss +531 -0
  104. data/generators/foundation/public/stylesheets/foundation6/typography/_alignment.scss +21 -0
  105. data/generators/foundation/public/stylesheets/foundation6/typography/_base.scss +436 -0
  106. data/generators/foundation/public/stylesheets/foundation6/typography/_helpers.scss +77 -0
  107. data/generators/foundation/public/stylesheets/foundation6/typography/_print.scss +73 -0
  108. data/generators/foundation/public/stylesheets/foundation6/typography/_typography.scss +28 -0
  109. data/generators/foundation/public/stylesheets/foundation6/util/_breakpoint.scss +182 -0
  110. data/generators/foundation/public/stylesheets/foundation6/util/_color.scss +41 -0
  111. data/generators/foundation/public/stylesheets/foundation6/util/_mixins.scss +190 -0
  112. data/generators/foundation/public/stylesheets/foundation6/util/_selector.scss +39 -0
  113. data/generators/foundation/public/stylesheets/foundation6/util/_unit.scss +69 -0
  114. data/generators/foundation/public/stylesheets/foundation6/util/_util.scss +15 -0
  115. data/generators/foundation/public/stylesheets/foundation6/util/_value.scss +117 -0
  116. data/generators/{foundation5/public/stylesheets/normalize.css.scss → foundation/public/stylesheets/foundation6/vendor/normalize.scss} +8 -11
  117. data/generators/site_metafields/schema.yml.tt +1 -1
  118. data/lib/locomotive/wagon/commands/push_command.rb +1 -0
  119. data/lib/locomotive/wagon/commands/serve_command.rb +1 -0
  120. data/lib/locomotive/wagon/decorators/concerns/persist_assets_concern.rb +3 -3
  121. data/lib/locomotive/wagon/decorators/content_type_decorator.rb +5 -1
  122. data/lib/locomotive/wagon/generators/site/{foundation5.rb → foundation.rb} +8 -12
  123. data/lib/locomotive/wagon/generators/site.rb +1 -1
  124. data/lib/locomotive/wagon/version.rb +1 -1
  125. data/locomotivecms_wagon.gemspec +3 -2
  126. data/spec/fixtures/cassettes/authenticate.yml +38 -38
  127. data/spec/fixtures/cassettes/delete.yml +211 -211
  128. data/spec/fixtures/cassettes/push.yml +1333 -1374
  129. data/spec/integration/cli_spec.rb +1 -1
  130. data/spec/unit/decorators/content_entry_decorator_spec.rb +23 -0
  131. metadata +133 -104
  132. data/generators/foundation5/app/content_types/.empty_directory +0 -1
  133. data/generators/foundation5/app/views/pages/404.liquid +0 -10
  134. data/generators/foundation5/app/views/pages/index.liquid.haml +0 -157
  135. data/generators/foundation5/data/.empty_directory +0 -1
  136. data/generators/foundation5/icon.png +0 -0
  137. data/generators/foundation5/public/fonts/.empty_directory +0 -1
  138. data/generators/foundation5/public/images/.empty_directory +0 -1
  139. data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +0 -299
  140. data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +0 -59
  141. data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +0 -43
  142. data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +0 -534
  143. data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +0 -311
  144. data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +0 -74
  145. data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +0 -331
  146. data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +0 -843
  147. data/generators/foundation5/public/javascripts/foundation/foundation.js +0 -611
  148. data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +0 -178
  149. data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +0 -108
  150. data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +0 -610
  151. data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +0 -437
  152. data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +0 -199
  153. data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +0 -167
  154. data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +0 -298
  155. data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +0 -425
  156. data/generators/foundation5/public/javascripts/foundation.js +0 -4161
  157. data/generators/foundation5/public/javascripts/foundation.min.js +0 -10
  158. data/generators/foundation5/public/javascripts/vendor/custom.modernizr.js +0 -4
  159. data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +0 -1
  160. data/generators/foundation5/public/javascripts/vendor/fastclick.js +0 -9
  161. data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +0 -11
  162. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +0 -645
  163. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +0 -1
  164. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +0 -8
  165. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +0 -8
  166. data/generators/foundation5/public/javascripts/vendor/jquery.js +0 -26
  167. data/generators/foundation5/public/javascripts/vendor/jquery.min.js +0 -27
  168. data/generators/foundation5/public/javascripts/vendor/modernizr.js +0 -8
  169. data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +0 -1
  170. data/generators/foundation5/public/javascripts/vendor/placeholder.js +0 -2
  171. data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +0 -1
  172. data/generators/foundation5/public/samples/.empty_directory +0 -1
  173. data/generators/foundation5/public/stylesheets/application.css +0 -2
  174. data/generators/foundation5/public/stylesheets/application.css.scss +0 -3
  175. data/generators/foundation5/public/stylesheets/foundation/_functions.scss +0 -102
  176. data/generators/foundation5/public/stylesheets/foundation/_settings.scss +0 -1441
  177. data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +0 -157
  178. data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +0 -128
  179. data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +0 -132
  180. data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +0 -132
  181. data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +0 -197
  182. data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +0 -259
  183. data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +0 -247
  184. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +0 -130
  185. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +0 -262
  186. data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +0 -51
  187. data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +0 -585
  188. data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +0 -460
  189. data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +0 -275
  190. data/generators/foundation5/public/stylesheets/foundation/components/_icon-bar.scss +0 -293
  191. data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +0 -57
  192. data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +0 -222
  193. data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +0 -61
  194. data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +0 -106
  195. data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +0 -34
  196. data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +0 -513
  197. data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +0 -368
  198. data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +0 -162
  199. data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +0 -95
  200. data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +0 -150
  201. data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +0 -79
  202. data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +0 -168
  203. data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +0 -222
  204. data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +0 -116
  205. data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +0 -191
  206. data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +0 -123
  207. data/generators/foundation5/public/stylesheets/foundation/components/_switches.scss +0 -230
  208. data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +0 -135
  209. data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +0 -123
  210. data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +0 -66
  211. data/generators/foundation5/public/stylesheets/foundation/components/_toolbar.scss +0 -70
  212. data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +0 -142
  213. data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +0 -685
  214. data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +0 -525
  215. data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +0 -408
  216. data/generators/foundation5/public/stylesheets/foundation.css +0 -6138
  217. data/generators/foundation5/public/stylesheets/foundation.css.scss +0 -45
  218. data/generators/foundation5/public/stylesheets/normalize.css +0 -357
  219. data/lib/locomotive/wagon/generators/site/foundation4.rb +0 -34
@@ -1,611 +0,0 @@
1
- /*
2
- * Foundation Responsive Library
3
- * http://foundation.zurb.com
4
- * Copyright 2014, ZURB
5
- * Free to use under the MIT license.
6
- * http://www.opensource.org/licenses/mit-license.php
7
- */
8
-
9
- (function ($, window, document, undefined) {
10
- 'use strict';
11
-
12
- var header_helpers = function (class_array) {
13
- var i = class_array.length;
14
- var head = $('head');
15
-
16
- while (i--) {
17
- if(head.has('.' + class_array[i]).length === 0) {
18
- head.append('<meta class="' + class_array[i] + '" />');
19
- }
20
- }
21
- };
22
-
23
- header_helpers([
24
- 'foundation-mq-small',
25
- 'foundation-mq-medium',
26
- 'foundation-mq-large',
27
- 'foundation-mq-xlarge',
28
- 'foundation-mq-xxlarge',
29
- 'foundation-data-attribute-namespace']);
30
-
31
- // Enable FastClick if present
32
-
33
- $(function() {
34
- if (typeof FastClick !== 'undefined') {
35
- // Don't attach to body if undefined
36
- if (typeof document.body !== 'undefined') {
37
- FastClick.attach(document.body);
38
- }
39
- }
40
- });
41
-
42
- // private Fast Selector wrapper,
43
- // returns jQuery object. Only use where
44
- // getElementById is not available.
45
- var S = function (selector, context) {
46
- if (typeof selector === 'string') {
47
- if (context) {
48
- var cont;
49
- if (context.jquery) {
50
- cont = context[0];
51
- if (!cont) return context;
52
- } else {
53
- cont = context;
54
- }
55
- return $(cont.querySelectorAll(selector));
56
- }
57
-
58
- return $(document.querySelectorAll(selector));
59
- }
60
-
61
- return $(selector, context);
62
- };
63
-
64
- // Namespace functions.
65
-
66
- var attr_name = function (init) {
67
- var arr = [];
68
- if (!init) arr.push('data');
69
- if (this.namespace.length > 0) arr.push(this.namespace);
70
- arr.push(this.name);
71
-
72
- return arr.join('-');
73
- };
74
-
75
- var add_namespace = function (str) {
76
- var parts = str.split('-'),
77
- i = parts.length,
78
- arr = [];
79
-
80
- while (i--) {
81
- if (i !== 0) {
82
- arr.push(parts[i]);
83
- } else {
84
- if (this.namespace.length > 0) {
85
- arr.push(this.namespace, parts[i]);
86
- } else {
87
- arr.push(parts[i]);
88
- }
89
- }
90
- }
91
-
92
- return arr.reverse().join('-');
93
- };
94
-
95
- // Event binding and data-options updating.
96
-
97
- var bindings = function (method, options) {
98
- var self = this,
99
- should_bind_events = !S(this).data(this.attr_name(true));
100
-
101
- if (typeof method === 'string') {
102
- return this[method].call(this, options);
103
- }
104
-
105
- if (S(this.scope).is('[' + this.attr_name() +']')) {
106
- S(this.scope).data(this.attr_name(true) + '-init', $.extend({}, this.settings, (options || method), this.data_options(S(this.scope))));
107
-
108
- if (should_bind_events) {
109
- this.events(this.scope);
110
- }
111
-
112
- } else {
113
- S('[' + this.attr_name() +']', this.scope).each(function () {
114
- var should_bind_events = !S(this).data(self.attr_name(true) + '-init');
115
- S(this).data(self.attr_name(true) + '-init', $.extend({}, self.settings, (options || method), self.data_options(S(this))));
116
-
117
- if (should_bind_events) {
118
- self.events(this);
119
- }
120
- });
121
- }
122
- };
123
-
124
- var single_image_loaded = function (image, callback) {
125
- function loaded () {
126
- callback(image[0]);
127
- }
128
-
129
- function bindLoad () {
130
- this.one('load', loaded);
131
-
132
- if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
133
- var src = this.attr( 'src' ),
134
- param = src.match( /\?/ ) ? '&' : '?';
135
-
136
- param += 'random=' + (new Date()).getTime();
137
- this.attr('src', src + param);
138
- }
139
- }
140
-
141
- if (!image.attr('src')) {
142
- loaded();
143
- return;
144
- }
145
-
146
- if (image[0].complete || image[0].readyState === 4) {
147
- loaded();
148
- } else {
149
- bindLoad.call(image);
150
- }
151
- };
152
-
153
- /*
154
- https://github.com/paulirish/matchMedia.js
155
- */
156
-
157
- window.matchMedia = window.matchMedia || (function( doc ) {
158
-
159
- "use strict";
160
-
161
- var bool,
162
- docElem = doc.documentElement,
163
- refNode = docElem.firstElementChild || docElem.firstChild,
164
- // fakeBody required for <FF4 when executed in <head>
165
- fakeBody = doc.createElement( "body" ),
166
- div = doc.createElement( "div" );
167
-
168
- div.id = "mq-test-1";
169
- div.style.cssText = "position:absolute;top:-100em";
170
- fakeBody.style.background = "none";
171
- fakeBody.appendChild(div);
172
-
173
- return function (q) {
174
-
175
- div.innerHTML = "&shy;<style media=\"" + q + "\"> #mq-test-1 { width: 42px; }</style>";
176
-
177
- docElem.insertBefore( fakeBody, refNode );
178
- bool = div.offsetWidth === 42;
179
- docElem.removeChild( fakeBody );
180
-
181
- return {
182
- matches: bool,
183
- media: q
184
- };
185
-
186
- };
187
-
188
- }( document ));
189
-
190
- /*
191
- * jquery.requestAnimationFrame
192
- * https://github.com/gnarf37/jquery-requestAnimationFrame
193
- * Requires jQuery 1.8+
194
- *
195
- * Copyright (c) 2012 Corey Frang
196
- * Licensed under the MIT license.
197
- */
198
-
199
- (function($) {
200
-
201
- // requestAnimationFrame polyfill adapted from Erik Möller
202
- // fixes from Paul Irish and Tino Zijdel
203
- // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
204
- // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
205
-
206
- var animating,
207
- lastTime = 0,
208
- vendors = ['webkit', 'moz'],
209
- requestAnimationFrame = window.requestAnimationFrame,
210
- cancelAnimationFrame = window.cancelAnimationFrame,
211
- jqueryFxAvailable = 'undefined' !== typeof jQuery.fx;
212
-
213
- for (; lastTime < vendors.length && !requestAnimationFrame; lastTime++) {
214
- requestAnimationFrame = window[ vendors[lastTime] + "RequestAnimationFrame" ];
215
- cancelAnimationFrame = cancelAnimationFrame ||
216
- window[ vendors[lastTime] + "CancelAnimationFrame" ] ||
217
- window[ vendors[lastTime] + "CancelRequestAnimationFrame" ];
218
- }
219
-
220
- function raf() {
221
- if (animating) {
222
- requestAnimationFrame(raf);
223
-
224
- if (jqueryFxAvailable) {
225
- jQuery.fx.tick();
226
- }
227
- }
228
- }
229
-
230
- if (requestAnimationFrame) {
231
- // use rAF
232
- window.requestAnimationFrame = requestAnimationFrame;
233
- window.cancelAnimationFrame = cancelAnimationFrame;
234
-
235
- if (jqueryFxAvailable) {
236
- jQuery.fx.timer = function (timer) {
237
- if (timer() && jQuery.timers.push(timer) && !animating) {
238
- animating = true;
239
- raf();
240
- }
241
- };
242
-
243
- jQuery.fx.stop = function () {
244
- animating = false;
245
- };
246
- }
247
- } else {
248
- // polyfill
249
- window.requestAnimationFrame = function (callback) {
250
- var currTime = new Date().getTime(),
251
- timeToCall = Math.max(0, 16 - (currTime - lastTime)),
252
- id = window.setTimeout(function () {
253
- callback(currTime + timeToCall);
254
- }, timeToCall);
255
- lastTime = currTime + timeToCall;
256
- return id;
257
- };
258
-
259
- window.cancelAnimationFrame = function (id) {
260
- clearTimeout(id);
261
- };
262
-
263
- }
264
-
265
- }( jQuery ));
266
-
267
-
268
- function removeQuotes (string) {
269
- if (typeof string === 'string' || string instanceof String) {
270
- string = string.replace(/^['\\/"]+|(;\s?})+|['\\/"]+$/g, '');
271
- }
272
-
273
- return string;
274
- }
275
-
276
- window.Foundation = {
277
- name : 'Foundation',
278
-
279
- version : '5.2.3',
280
-
281
- media_queries : {
282
- small : S('.foundation-mq-small').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
283
- medium : S('.foundation-mq-medium').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
284
- large : S('.foundation-mq-large').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
285
- xlarge: S('.foundation-mq-xlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, ''),
286
- xxlarge: S('.foundation-mq-xxlarge').css('font-family').replace(/^[\/\\'"]+|(;\s?})+|[\/\\'"]+$/g, '')
287
- },
288
-
289
- stylesheet : $('<style></style>').appendTo('head')[0].sheet,
290
-
291
- global: {
292
- namespace: undefined
293
- },
294
-
295
- init : function (scope, libraries, method, options, response) {
296
- var args = [scope, method, options, response],
297
- responses = [];
298
-
299
- // check RTL
300
- this.rtl = /rtl/i.test(S('html').attr('dir'));
301
-
302
- // set foundation global scope
303
- this.scope = scope || this.scope;
304
-
305
- this.set_namespace();
306
-
307
- if (libraries && typeof libraries === 'string' && !/reflow/i.test(libraries)) {
308
- if (this.libs.hasOwnProperty(libraries)) {
309
- responses.push(this.init_lib(libraries, args));
310
- }
311
- } else {
312
- for (var lib in this.libs) {
313
- responses.push(this.init_lib(lib, libraries));
314
- }
315
- }
316
-
317
- return scope;
318
- },
319
-
320
- init_lib : function (lib, args) {
321
- if (this.libs.hasOwnProperty(lib)) {
322
- this.patch(this.libs[lib]);
323
-
324
- if (args && args.hasOwnProperty(lib)) {
325
- if (typeof this.libs[lib].settings !== 'undefined') {
326
- $.extend(true, this.libs[lib].settings, args[lib]);
327
- }
328
- else if (typeof this.libs[lib].defaults !== 'undefined') {
329
- $.extend(true, this.libs[lib].defaults, args[lib]);
330
- }
331
- return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
332
- }
333
-
334
- args = args instanceof Array ? args : new Array(args); // PATCH: added this line
335
- return this.libs[lib].init.apply(this.libs[lib], args);
336
- }
337
-
338
- return function () {};
339
- },
340
-
341
- patch : function (lib) {
342
- lib.scope = this.scope;
343
- lib.namespace = this.global.namespace;
344
- lib.rtl = this.rtl;
345
- lib['data_options'] = this.utils.data_options;
346
- lib['attr_name'] = attr_name;
347
- lib['add_namespace'] = add_namespace;
348
- lib['bindings'] = bindings;
349
- lib['S'] = this.utils.S;
350
- },
351
-
352
- inherit : function (scope, methods) {
353
- var methods_arr = methods.split(' '),
354
- i = methods_arr.length;
355
-
356
- while (i--) {
357
- if (this.utils.hasOwnProperty(methods_arr[i])) {
358
- scope[methods_arr[i]] = this.utils[methods_arr[i]];
359
- }
360
- }
361
- },
362
-
363
- set_namespace: function () {
364
-
365
- // Description:
366
- // Don't bother reading the namespace out of the meta tag
367
- // if the namespace has been set globally in javascript
368
- //
369
- // Example:
370
- // Foundation.global.namespace = 'my-namespace';
371
- // or make it an empty string:
372
- // Foundation.global.namespace = '';
373
- //
374
- //
375
-
376
- // If the namespace has not been set (is undefined), try to read it out of the meta element.
377
- // Otherwise use the globally defined namespace, even if it's empty ('')
378
- var namespace = ( this.global.namespace === undefined ) ? $('.foundation-data-attribute-namespace').css('font-family') : this.global.namespace;
379
-
380
- // Finally, if the namsepace is either undefined or false, set it to an empty string.
381
- // Otherwise use the namespace value.
382
- this.global.namespace = ( namespace === undefined || /false/i.test(namespace) ) ? '' : namespace;
383
- },
384
-
385
- libs : {},
386
-
387
- // methods that can be inherited in libraries
388
- utils : {
389
-
390
- // Description:
391
- // Fast Selector wrapper returns jQuery object. Only use where getElementById
392
- // is not available.
393
- //
394
- // Arguments:
395
- // Selector (String): CSS selector describing the element(s) to be
396
- // returned as a jQuery object.
397
- //
398
- // Scope (String): CSS selector describing the area to be searched. Default
399
- // is document.
400
- //
401
- // Returns:
402
- // Element (jQuery Object): jQuery object containing elements matching the
403
- // selector within the scope.
404
- S : S,
405
-
406
- // Description:
407
- // Executes a function a max of once every n milliseconds
408
- //
409
- // Arguments:
410
- // Func (Function): Function to be throttled.
411
- //
412
- // Delay (Integer): Function execution threshold in milliseconds.
413
- //
414
- // Returns:
415
- // Lazy_function (Function): Function with throttling applied.
416
- throttle : function (func, delay) {
417
- var timer = null;
418
-
419
- return function () {
420
- var context = this, args = arguments;
421
-
422
- if (timer == null) {
423
- timer = setTimeout(function () {
424
- func.apply(context, args);
425
- timer = null;
426
- }, delay);
427
- }
428
- };
429
- },
430
-
431
- // Description:
432
- // Executes a function when it stops being invoked for n seconds
433
- // Modified version of _.debounce() http://underscorejs.org
434
- //
435
- // Arguments:
436
- // Func (Function): Function to be debounced.
437
- //
438
- // Delay (Integer): Function execution threshold in milliseconds.
439
- //
440
- // Immediate (Bool): Whether the function should be called at the beginning
441
- // of the delay instead of the end. Default is false.
442
- //
443
- // Returns:
444
- // Lazy_function (Function): Function with debouncing applied.
445
- debounce : function (func, delay, immediate) {
446
- var timeout, result;
447
- return function () {
448
- var context = this, args = arguments;
449
- var later = function () {
450
- timeout = null;
451
- if (!immediate) result = func.apply(context, args);
452
- };
453
- var callNow = immediate && !timeout;
454
- clearTimeout(timeout);
455
- timeout = setTimeout(later, delay);
456
- if (callNow) result = func.apply(context, args);
457
- return result;
458
- };
459
- },
460
-
461
- // Description:
462
- // Parses data-options attribute
463
- //
464
- // Arguments:
465
- // El (jQuery Object): Element to be parsed.
466
- //
467
- // Returns:
468
- // Options (Javascript Object): Contents of the element's data-options
469
- // attribute.
470
- data_options : function (el, data_attr_name) {
471
- data_attr_name = data_attr_name || 'options';
472
- var opts = {}, ii, p, opts_arr,
473
- data_options = function (el) {
474
- var namespace = Foundation.global.namespace;
475
-
476
- if (namespace.length > 0) {
477
- return el.data(namespace + '-' + data_attr_name);
478
- }
479
-
480
- return el.data(data_attr_name);
481
- };
482
-
483
- var cached_options = data_options(el);
484
-
485
- if (typeof cached_options === 'object') {
486
- return cached_options;
487
- }
488
-
489
- opts_arr = (cached_options || ':').split(';');
490
- ii = opts_arr.length;
491
-
492
- function isNumber (o) {
493
- return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true;
494
- }
495
-
496
- function trim (str) {
497
- if (typeof str === 'string') return $.trim(str);
498
- return str;
499
- }
500
-
501
- while (ii--) {
502
- p = opts_arr[ii].split(':');
503
- p = [p[0], p.slice(1).join(':')];
504
-
505
- if (/true/i.test(p[1])) p[1] = true;
506
- if (/false/i.test(p[1])) p[1] = false;
507
- if (isNumber(p[1])) {
508
- if (p[1].indexOf('.') === -1) {
509
- p[1] = parseInt(p[1], 10);
510
- } else {
511
- p[1] = parseFloat(p[1]);
512
- }
513
- }
514
-
515
- if (p.length === 2 && p[0].length > 0) {
516
- opts[trim(p[0])] = trim(p[1]);
517
- }
518
- }
519
-
520
- return opts;
521
- },
522
-
523
- // Description:
524
- // Adds JS-recognizable media queries
525
- //
526
- // Arguments:
527
- // Media (String): Key string for the media query to be stored as in
528
- // Foundation.media_queries
529
- //
530
- // Class (String): Class name for the generated <meta> tag
531
- register_media : function (media, media_class) {
532
- if(Foundation.media_queries[media] === undefined) {
533
- $('head').append('<meta class="' + media_class + '">');
534
- Foundation.media_queries[media] = removeQuotes($('.' + media_class).css('font-family'));
535
- }
536
- },
537
-
538
- // Description:
539
- // Add custom CSS within a JS-defined media query
540
- //
541
- // Arguments:
542
- // Rule (String): CSS rule to be appended to the document.
543
- //
544
- // Media (String): Optional media query string for the CSS rule to be
545
- // nested under.
546
- add_custom_rule : function (rule, media) {
547
- if (media === undefined && Foundation.stylesheet) {
548
- Foundation.stylesheet.insertRule(rule, Foundation.stylesheet.cssRules.length);
549
- } else {
550
- var query = Foundation.media_queries[media];
551
-
552
- if (query !== undefined) {
553
- Foundation.stylesheet.insertRule('@media ' +
554
- Foundation.media_queries[media] + '{ ' + rule + ' }');
555
- }
556
- }
557
- },
558
-
559
- // Description:
560
- // Performs a callback function when an image is fully loaded
561
- //
562
- // Arguments:
563
- // Image (jQuery Object): Image(s) to check if loaded.
564
- //
565
- // Callback (Function): Function to execute when image is fully loaded.
566
- image_loaded : function (images, callback) {
567
- var self = this,
568
- unloaded = images.length;
569
-
570
- if (unloaded === 0) {
571
- callback(images);
572
- }
573
-
574
- images.each(function () {
575
- single_image_loaded(self.S(this), function () {
576
- unloaded -= 1;
577
- if (unloaded === 0) {
578
- callback(images);
579
- }
580
- });
581
- });
582
- },
583
-
584
- // Description:
585
- // Returns a random, alphanumeric string
586
- //
587
- // Arguments:
588
- // Length (Integer): Length of string to be generated. Defaults to random
589
- // integer.
590
- //
591
- // Returns:
592
- // Rand (String): Pseudo-random, alphanumeric string.
593
- random_str : function () {
594
- if (!this.fidx) this.fidx = 0;
595
- this.prefix = this.prefix || [(this.name || 'F'), (+new Date).toString(36)].join('-');
596
-
597
- return this.prefix + (this.fidx++).toString(36);
598
- }
599
- }
600
- };
601
-
602
- $.fn.foundation = function () {
603
- var args = Array.prototype.slice.call(arguments, 0);
604
-
605
- return this.each(function () {
606
- Foundation.init.apply(Foundation, [this].concat(args));
607
- return this;
608
- });
609
- };
610
-
611
- }(jQuery, window, window.document));