locomotivecms_wagon 1.4.0 → 1.5.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (352) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -0
  3. data/Gemfile +6 -2
  4. data/README.md +7 -1
  5. data/bin/wagon +3 -0
  6. data/generators/blank/Gemfile.tt +1 -3
  7. data/generators/blank/config/site.yml.tt +3 -3
  8. data/generators/bootstrap/config/site.yml.tt +3 -3
  9. data/generators/bootstrap3/Gemfile.tt +1 -3
  10. data/generators/bootstrap3/app/views/pages/index.liquid +21 -63
  11. data/generators/bootstrap3/app/views/pages/index.liquid.haml +15 -57
  12. data/generators/bootstrap3/config/deploy.yml +15 -15
  13. data/generators/bootstrap3/config/site.yml.tt +2 -2
  14. data/generators/bootstrap3/icon.png +0 -0
  15. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.eot +0 -0
  16. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.svg +201 -200
  17. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.ttf +0 -0
  18. data/generators/bootstrap3/public/fonts/glyphicons-halflings-regular.woff +0 -0
  19. data/generators/{bootstrap2/app/content_types → bootstrap3/public/images}/.empty_directory +0 -0
  20. data/generators/bootstrap3/public/javascripts/bootstrap/affix.js +137 -0
  21. data/generators/bootstrap3/public/javascripts/bootstrap/alert.js +88 -0
  22. data/generators/bootstrap3/public/javascripts/bootstrap/button.js +107 -0
  23. data/generators/bootstrap3/public/javascripts/bootstrap/carousel.js +205 -0
  24. data/generators/bootstrap3/public/javascripts/bootstrap/collapse.js +170 -0
  25. data/generators/bootstrap3/public/javascripts/bootstrap/dropdown.js +147 -0
  26. data/generators/bootstrap3/public/javascripts/bootstrap/modal.js +243 -0
  27. data/generators/bootstrap3/public/javascripts/bootstrap/popover.js +110 -0
  28. data/generators/bootstrap3/public/javascripts/bootstrap/scrollspy.js +153 -0
  29. data/generators/bootstrap3/public/javascripts/bootstrap/tab.js +125 -0
  30. data/generators/bootstrap3/public/javascripts/bootstrap/tooltip.js +399 -0
  31. data/generators/bootstrap3/public/javascripts/bootstrap/transition.js +48 -0
  32. data/generators/bootstrap3/public/javascripts/bootstrap.min.js +12 -6
  33. data/generators/bootstrap3/public/stylesheets/application.css +1 -0
  34. data/generators/bootstrap3/public/stylesheets/application.css.scss +8 -0
  35. data/generators/bootstrap3/public/stylesheets/bootstrap/_alerts.scss +67 -0
  36. data/generators/bootstrap3/public/stylesheets/bootstrap/_badges.scss +55 -0
  37. data/generators/bootstrap3/public/stylesheets/bootstrap/_breadcrumbs.scss +26 -0
  38. data/generators/bootstrap3/public/stylesheets/bootstrap/_button-groups.scss +226 -0
  39. data/generators/bootstrap3/public/stylesheets/bootstrap/_buttons.scss +159 -0
  40. data/generators/bootstrap3/public/stylesheets/bootstrap/_carousel.scss +232 -0
  41. data/generators/bootstrap3/public/stylesheets/bootstrap/_close.scss +35 -0
  42. data/generators/bootstrap3/public/stylesheets/bootstrap/_code.scss +63 -0
  43. data/generators/bootstrap3/public/stylesheets/bootstrap/_component-animations.scss +29 -0
  44. data/generators/bootstrap3/public/stylesheets/bootstrap/_dropdowns.scss +213 -0
  45. data/generators/bootstrap3/public/stylesheets/bootstrap/_forms.scss +436 -0
  46. data/generators/bootstrap3/public/stylesheets/bootstrap/_glyphicons.scss +233 -0
  47. data/generators/bootstrap3/public/stylesheets/bootstrap/_grid.scss +84 -0
  48. data/generators/bootstrap3/public/stylesheets/bootstrap/_input-groups.scss +162 -0
  49. data/generators/bootstrap3/public/stylesheets/bootstrap/_jumbotron.scss +44 -0
  50. data/generators/bootstrap3/public/stylesheets/bootstrap/_labels.scss +64 -0
  51. data/generators/bootstrap3/public/stylesheets/bootstrap/_list-group.scss +110 -0
  52. data/generators/bootstrap3/public/stylesheets/bootstrap/_media.scss +56 -0
  53. data/generators/bootstrap3/public/stylesheets/bootstrap/_mixins.scss +947 -0
  54. data/generators/bootstrap3/public/stylesheets/bootstrap/_modals.scss +139 -0
  55. data/generators/bootstrap3/public/stylesheets/bootstrap/_navbar.scss +620 -0
  56. data/generators/bootstrap3/public/stylesheets/bootstrap/_navs.scss +242 -0
  57. data/generators/bootstrap3/public/stylesheets/bootstrap/_normalize.scss +423 -0
  58. data/generators/bootstrap3/public/stylesheets/bootstrap/_pager.scss +55 -0
  59. data/generators/bootstrap3/public/stylesheets/bootstrap/_pagination.scss +88 -0
  60. data/generators/bootstrap3/public/stylesheets/bootstrap/_panels.scss +241 -0
  61. data/generators/bootstrap3/public/stylesheets/bootstrap/_popovers.scss +133 -0
  62. data/generators/bootstrap3/public/stylesheets/bootstrap/_print.scss +101 -0
  63. data/generators/bootstrap3/public/stylesheets/bootstrap/_progress-bars.scss +80 -0
  64. data/generators/bootstrap3/public/stylesheets/bootstrap/_responsive-utilities.scss +74 -0
  65. data/generators/bootstrap3/public/stylesheets/bootstrap/_scaffolding.scss +134 -0
  66. data/generators/bootstrap3/public/stylesheets/bootstrap/_tables.scss +233 -0
  67. data/generators/bootstrap3/public/stylesheets/bootstrap/_theme.scss +247 -0
  68. data/generators/bootstrap3/public/stylesheets/bootstrap/_thumbnails.scss +38 -0
  69. data/generators/bootstrap3/public/stylesheets/bootstrap/_tooltip.scss +95 -0
  70. data/generators/bootstrap3/public/stylesheets/bootstrap/_type.scss +284 -0
  71. data/generators/bootstrap3/public/stylesheets/bootstrap/_utilities.scss +56 -0
  72. data/generators/bootstrap3/public/stylesheets/bootstrap/_variables.scss +833 -0
  73. data/generators/bootstrap3/public/stylesheets/bootstrap/_wells.scss +29 -0
  74. data/generators/bootstrap3/public/stylesheets/bootstrap/bootstrap.css.scss +49 -0
  75. data/generators/bootstrap3/public/stylesheets/bootstrap.css +2035 -3056
  76. data/generators/bootstrap3/public/stylesheets/bootstrap.css.scss +49 -0
  77. data/generators/cloned/Gemfile.tt +1 -3
  78. data/generators/content_type/app/content_types/%slug%.yml.tt +57 -0
  79. data/generators/content_type/data/{%name%.yml.tt → %slug%.yml.tt} +2 -2
  80. data/generators/{bootstrap2 → foundation5}/Gemfile.tt +1 -3
  81. data/generators/{bootstrap2/data → foundation5/app/content_types}/.empty_directory +0 -0
  82. data/generators/{foundation → foundation5}/app/views/pages/404.liquid +1 -4
  83. data/generators/{foundation → foundation5}/app/views/pages/404.liquid.haml +1 -1
  84. data/generators/foundation5/app/views/pages/index.liquid +196 -0
  85. data/generators/foundation5/app/views/pages/index.liquid.haml +157 -0
  86. data/generators/foundation5/config/deploy.yml +15 -0
  87. data/generators/{bootstrap2 → foundation5}/config/site.yml.tt +3 -4
  88. data/generators/{bootstrap2 → foundation5}/config/translations.yml +0 -0
  89. data/generators/{bootstrap2 → foundation5}/config.ru +0 -0
  90. data/generators/{bootstrap2/public/samples → foundation5/data}/.empty_directory +0 -0
  91. data/generators/foundation5/favicon.ico +0 -0
  92. data/generators/foundation5/icon.png +0 -0
  93. data/generators/{foundation/app/content_types → foundation5/public/fonts}/.empty_directory +0 -0
  94. data/generators/{foundation/data → foundation5/public/images}/.empty_directory +0 -0
  95. data/generators/foundation5/public/javascripts/foundation/foundation.abide.js +299 -0
  96. data/generators/foundation5/public/javascripts/foundation/foundation.accordion.js +59 -0
  97. data/generators/foundation5/public/javascripts/foundation/foundation.alert.js +43 -0
  98. data/generators/foundation5/public/javascripts/foundation/foundation.clearing.js +534 -0
  99. data/generators/foundation5/public/javascripts/foundation/foundation.dropdown.js +311 -0
  100. data/generators/foundation5/public/javascripts/foundation/foundation.equalizer.js +74 -0
  101. data/generators/foundation5/public/javascripts/foundation/foundation.interchange.js +331 -0
  102. data/generators/foundation5/public/javascripts/foundation/foundation.joyride.js +843 -0
  103. data/generators/foundation5/public/javascripts/foundation/foundation.js +611 -0
  104. data/generators/foundation5/public/javascripts/foundation/foundation.magellan.js +178 -0
  105. data/generators/foundation5/public/javascripts/foundation/foundation.offcanvas.js +108 -0
  106. data/generators/foundation5/public/javascripts/foundation/foundation.orbit.js +610 -0
  107. data/generators/foundation5/public/javascripts/foundation/foundation.reveal.js +437 -0
  108. data/generators/foundation5/public/javascripts/foundation/foundation.slider.js +199 -0
  109. data/generators/foundation5/public/javascripts/foundation/foundation.tab.js +167 -0
  110. data/generators/foundation5/public/javascripts/foundation/foundation.tooltip.js +298 -0
  111. data/generators/foundation5/public/javascripts/foundation/foundation.topbar.js +425 -0
  112. data/generators/foundation5/public/javascripts/foundation.js +4161 -0
  113. data/generators/foundation5/public/javascripts/foundation.min.js +10 -0
  114. data/generators/{foundation → foundation5}/public/javascripts/vendor/custom.modernizr.js +0 -0
  115. data/generators/foundation5/public/javascripts/vendor/custom.modernizr.min.js +1 -0
  116. data/generators/foundation5/public/javascripts/vendor/fastclick.js +9 -0
  117. data/generators/foundation5/public/javascripts/vendor/fastclick.min.js +11 -0
  118. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.js +645 -0
  119. data/generators/foundation5/public/javascripts/vendor/jquery.autocomplete.min.js +1 -0
  120. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.js +8 -0
  121. data/generators/foundation5/public/javascripts/vendor/jquery.cookie.min.js +8 -0
  122. data/generators/foundation5/public/javascripts/vendor/jquery.js +26 -0
  123. data/generators/foundation5/public/javascripts/vendor/jquery.min.js +27 -0
  124. data/generators/foundation5/public/javascripts/vendor/modernizr.js +8 -0
  125. data/generators/foundation5/public/javascripts/vendor/modernizr.min.js +1 -0
  126. data/generators/foundation5/public/javascripts/vendor/placeholder.js +2 -0
  127. data/generators/foundation5/public/javascripts/vendor/placeholder.min.js +1 -0
  128. data/generators/{foundation/public/fonts → foundation5/public/samples}/.empty_directory +0 -0
  129. data/generators/foundation5/public/stylesheets/application.css +2 -0
  130. data/generators/foundation5/public/stylesheets/application.css.scss +3 -0
  131. data/generators/foundation5/public/stylesheets/foundation/_functions.scss +101 -0
  132. data/generators/foundation5/public/stylesheets/foundation/_settings.scss +1296 -0
  133. data/generators/foundation5/public/stylesheets/foundation/components/_accordion.scss +53 -0
  134. data/generators/foundation5/public/stylesheets/foundation/components/_alert-boxes.scss +126 -0
  135. data/generators/foundation5/public/stylesheets/foundation/components/_block-grid.scss +132 -0
  136. data/generators/foundation5/public/stylesheets/foundation/components/_breadcrumbs.scss +127 -0
  137. data/generators/foundation5/public/stylesheets/foundation/components/_button-groups.scss +108 -0
  138. data/generators/foundation5/public/stylesheets/foundation/components/_buttons.scss +222 -0
  139. data/generators/foundation5/public/stylesheets/foundation/components/_clearing.scss +247 -0
  140. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown-buttons.scss +129 -0
  141. data/generators/foundation5/public/stylesheets/foundation/components/_dropdown.scss +248 -0
  142. data/generators/foundation5/public/stylesheets/foundation/components/_flex-video.scss +51 -0
  143. data/generators/foundation5/public/stylesheets/foundation/components/_forms.scss +498 -0
  144. data/generators/foundation5/public/stylesheets/foundation/components/_global.scss +434 -0
  145. data/generators/foundation5/public/stylesheets/foundation/components/_grid.scss +260 -0
  146. data/generators/foundation5/public/stylesheets/foundation/components/_inline-lists.scss +57 -0
  147. data/generators/foundation5/public/stylesheets/foundation/components/_joyride.scss +220 -0
  148. data/generators/foundation5/public/stylesheets/foundation/components/_keystrokes.scss +61 -0
  149. data/generators/foundation5/public/stylesheets/foundation/components/_labels.scss +104 -0
  150. data/generators/foundation5/public/stylesheets/foundation/components/_magellan.scss +34 -0
  151. data/generators/foundation5/public/stylesheets/foundation/components/_offcanvas.scss +356 -0
  152. data/generators/foundation5/public/stylesheets/foundation/components/_orbit.scss +423 -0
  153. data/generators/foundation5/public/stylesheets/foundation/components/_pagination.scss +150 -0
  154. data/generators/foundation5/public/stylesheets/foundation/components/_panels.scss +90 -0
  155. data/generators/foundation5/public/stylesheets/foundation/components/_pricing-tables.scss +150 -0
  156. data/generators/foundation5/public/stylesheets/foundation/components/_progress-bars.scss +79 -0
  157. data/generators/foundation5/public/stylesheets/foundation/components/_range-slider.scss +148 -0
  158. data/generators/foundation5/public/stylesheets/foundation/components/_reveal-new.scss +0 -0
  159. data/generators/foundation5/public/stylesheets/foundation/components/_reveal.scss +216 -0
  160. data/generators/foundation5/public/stylesheets/foundation/components/_side-nav.scss +115 -0
  161. data/generators/foundation5/public/stylesheets/foundation/components/_split-buttons.scss +191 -0
  162. data/generators/foundation5/public/stylesheets/foundation/components/_sub-nav.scss +125 -0
  163. data/generators/foundation5/public/stylesheets/foundation/components/_switch.scss +294 -0
  164. data/generators/foundation5/public/stylesheets/foundation/components/_tables.scss +129 -0
  165. data/generators/foundation5/public/stylesheets/foundation/components/_tabs.scss +109 -0
  166. data/generators/foundation5/public/stylesheets/foundation/components/_thumbs.scss +68 -0
  167. data/generators/foundation5/public/stylesheets/foundation/components/_tooltips.scss +140 -0
  168. data/generators/foundation5/public/stylesheets/foundation/components/_top-bar.scss +659 -0
  169. data/generators/foundation5/public/stylesheets/foundation/components/_type.scss +513 -0
  170. data/generators/foundation5/public/stylesheets/foundation/components/_visibility.scss +408 -0
  171. data/generators/foundation5/public/stylesheets/foundation.css +5398 -0
  172. data/generators/foundation5/public/stylesheets/foundation.css.scss +45 -0
  173. data/generators/foundation5/public/stylesheets/normalize.css +425 -0
  174. data/generators/foundation5/public/stylesheets/normalize.css.scss +425 -0
  175. data/generators/{foundation → line_case}/Gemfile.tt +1 -3
  176. data/generators/line_case/app/content_types/categories.yml +56 -0
  177. data/generators/line_case/app/content_types/emails.yml +35 -0
  178. data/generators/line_case/app/content_types/projects.yml +58 -0
  179. data/generators/{bootstrap2 → line_case}/app/views/pages/404.liquid.haml +3 -2
  180. data/generators/line_case/app/views/pages/email-registered.liquid.haml +13 -0
  181. data/generators/line_case/app/views/pages/index.liquid.haml +110 -0
  182. data/generators/line_case/app/views/pages/projects/content_type_template.liquid.haml +32 -0
  183. data/generators/line_case/app/views/snippets/newsletter_form.liquid.haml +14 -0
  184. data/generators/line_case/app/views/snippets/projects.liquid.haml +17 -0
  185. data/generators/line_case/app/views/snippets/social_links.liquid.haml +19 -0
  186. data/generators/line_case/config/deploy.yml +15 -0
  187. data/generators/{foundation → line_case}/config/site.yml.tt +3 -3
  188. data/generators/{foundation → line_case}/config/translations.yml +0 -0
  189. data/generators/{foundation → line_case}/config.ru +0 -0
  190. data/generators/line_case/data/categories.yml +8 -0
  191. data/generators/line_case/data/emails.yml +2 -0
  192. data/generators/line_case/data/projects.yml +39 -0
  193. data/generators/line_case/icon.png +0 -0
  194. data/generators/line_case/public/images/banner-header.png +0 -0
  195. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.abide.js +0 -0
  196. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.alerts.js +0 -0
  197. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.clearing.js +0 -0
  198. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.cookie.js +0 -0
  199. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.dropdown.js +0 -0
  200. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.forms.js +0 -0
  201. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.interchange.js +0 -0
  202. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.joyride.js +0 -0
  203. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.js +0 -0
  204. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.magellan.js +0 -0
  205. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.orbit.js +0 -0
  206. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.placeholder.js +0 -0
  207. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.reveal.js +0 -0
  208. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.section.js +0 -0
  209. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.tooltips.js +0 -0
  210. data/generators/{foundation → line_case}/public/javascripts/foundation/foundation.topbar.js +0 -0
  211. data/generators/{foundation → line_case}/public/javascripts/foundation.min.js +0 -0
  212. data/generators/line_case/public/javascripts/vendor/custom.modernizr.js +4 -0
  213. data/generators/{foundation → line_case}/public/javascripts/vendor/jquery.js +0 -0
  214. data/generators/{foundation → line_case}/public/javascripts/vendor/zepto.js +0 -0
  215. data/generators/line_case/public/samples/projects/sample.jpeg +0 -0
  216. data/generators/line_case/public/samples/projects/sample2.jpeg +0 -0
  217. data/generators/line_case/public/samples/projects/sample3.jpeg +0 -0
  218. data/generators/line_case/public/samples/projects/sample4.jpeg +0 -0
  219. data/generators/line_case/public/samples/projects/sample5.jpeg +0 -0
  220. data/generators/line_case/public/samples/projects/sample6.jpeg +0 -0
  221. data/generators/line_case/public/samples/projects/sample7.jpeg +0 -0
  222. data/generators/line_case/public/samples/projects/sample8.jpeg +0 -0
  223. data/generators/line_case/public/stylesheets/_variables.css.sass +20 -0
  224. data/generators/line_case/public/stylesheets/foundation/_variables.scss +1290 -0
  225. data/generators/line_case/public/stylesheets/foundation/components/_alert-boxes.scss +107 -0
  226. data/generators/line_case/public/stylesheets/foundation/components/_block-grid.scss +71 -0
  227. data/generators/line_case/public/stylesheets/foundation/components/_breadcrumbs.scss +124 -0
  228. data/generators/line_case/public/stylesheets/foundation/components/_button-groups.scss +89 -0
  229. data/generators/line_case/public/stylesheets/foundation/components/_buttons.scss +230 -0
  230. data/generators/line_case/public/stylesheets/foundation/components/_clearing.scss +227 -0
  231. data/generators/line_case/public/stylesheets/foundation/components/_custom-forms.scss +278 -0
  232. data/generators/line_case/public/stylesheets/foundation/components/_dropdown-buttons.scss +115 -0
  233. data/generators/line_case/public/stylesheets/foundation/components/_dropdown.scss +151 -0
  234. data/generators/line_case/public/stylesheets/foundation/components/_flex-video.scss +46 -0
  235. data/generators/line_case/public/stylesheets/foundation/components/_forms.scss +411 -0
  236. data/generators/line_case/public/stylesheets/foundation/components/_global.scss +366 -0
  237. data/generators/line_case/public/stylesheets/foundation/components/_grid-5.scss +214 -0
  238. data/generators/line_case/public/stylesheets/foundation/components/_grid.scss +188 -0
  239. data/generators/line_case/public/stylesheets/foundation/components/_inline-lists.scss +53 -0
  240. data/generators/line_case/public/stylesheets/foundation/components/_joyride.scss +217 -0
  241. data/generators/line_case/public/stylesheets/foundation/components/_keystrokes.scss +57 -0
  242. data/generators/line_case/public/stylesheets/foundation/components/_labels.scss +85 -0
  243. data/generators/line_case/public/stylesheets/foundation/components/_magellan.scss +23 -0
  244. data/generators/line_case/public/stylesheets/foundation/components/_orbit.scss +340 -0
  245. data/generators/line_case/public/stylesheets/foundation/components/_pagination.scss +140 -0
  246. data/generators/line_case/public/stylesheets/foundation/components/_panels.scss +83 -0
  247. data/generators/line_case/public/stylesheets/foundation/components/_pricing-tables.scss +131 -0
  248. data/generators/line_case/public/stylesheets/foundation/components/_progress-bars.scss +71 -0
  249. data/generators/line_case/public/stylesheets/foundation/components/_reveal.scss +136 -0
  250. data/generators/line_case/public/stylesheets/foundation/components/_section.scss +391 -0
  251. data/generators/line_case/public/stylesheets/foundation/components/_side-nav.scss +69 -0
  252. data/generators/line_case/public/stylesheets/foundation/components/_split-buttons.scss +167 -0
  253. data/generators/line_case/public/stylesheets/foundation/components/_sub-nav.scss +84 -0
  254. data/generators/line_case/public/stylesheets/foundation/components/_switch.scss +266 -0
  255. data/generators/line_case/public/stylesheets/foundation/components/_tables.scss +84 -0
  256. data/generators/line_case/public/stylesheets/foundation/components/_thumbs.scss +53 -0
  257. data/generators/line_case/public/stylesheets/foundation/components/_tooltips.scss +117 -0
  258. data/generators/line_case/public/stylesheets/foundation/components/_top-bar.scss +576 -0
  259. data/generators/line_case/public/stylesheets/foundation/components/_type.scss +435 -0
  260. data/generators/line_case/public/stylesheets/foundation/components/_visibility.scss +322 -0
  261. data/generators/line_case/public/stylesheets/foundation.css.scss +43 -0
  262. data/generators/{foundation → line_case}/public/stylesheets/foundation.min.css +0 -0
  263. data/generators/{foundation/public/stylesheets/normalize.css → line_case/public/stylesheets/normalize.css.scss} +5 -5
  264. data/generators/line_case/public/stylesheets/pages.css.sass +163 -0
  265. data/generators/page/template.liquid.haml.tt +8 -5
  266. data/generators/page/template.liquid.tt +6 -2
  267. data/lib/locomotive/wagon/cli.rb +139 -43
  268. data/lib/locomotive/wagon/generators/content_type.rb +26 -10
  269. data/lib/locomotive/wagon/generators/page.rb +41 -25
  270. data/lib/locomotive/wagon/generators/site/base.rb +53 -0
  271. data/lib/locomotive/wagon/generators/site/blank.rb +9 -2
  272. data/lib/locomotive/wagon/generators/site/bootstrap2.rb +8 -2
  273. data/lib/locomotive/wagon/generators/site/bootstrap3.rb +20 -2
  274. data/lib/locomotive/wagon/generators/site/cloned.rb +4 -0
  275. data/lib/locomotive/wagon/generators/site/{foundation.rb → foundation4.rb} +10 -4
  276. data/lib/locomotive/wagon/generators/site/foundation5.rb +48 -0
  277. data/lib/locomotive/wagon/generators/site/line_case.rb +20 -0
  278. data/lib/locomotive/wagon/generators/site/unzip.rb +10 -2
  279. data/lib/locomotive/wagon/generators/site.rb +48 -2
  280. data/lib/locomotive/wagon/generators/snippet.rb +2 -1
  281. data/lib/locomotive/wagon/liquid/drops/content_types.rb +9 -3
  282. data/lib/locomotive/wagon/liquid/drops/page.rb +9 -1
  283. data/lib/locomotive/wagon/liquid/scopeable.rb +1 -1
  284. data/lib/locomotive/wagon/liquid/tags/fetch_page.rb +41 -0
  285. data/lib/locomotive/wagon/liquid/tags/model_form.rb +67 -0
  286. data/lib/locomotive/wagon/liquid/tags/path_helper.rb +2 -2
  287. data/lib/locomotive/wagon/liquid/tags/with_scope.rb +1 -1
  288. data/lib/locomotive/wagon/listen.rb +18 -10
  289. data/lib/locomotive/wagon/logger.rb +4 -0
  290. data/lib/locomotive/wagon/misc/core_ext.rb +8 -0
  291. data/lib/locomotive/wagon/misc/deployment_connection.rb +120 -0
  292. data/lib/locomotive/wagon/misc/hosting_api.rb +115 -0
  293. data/lib/locomotive/wagon/misc/httparty.rb +2 -0
  294. data/lib/locomotive/wagon/misc/livereload.rb +43 -0
  295. data/lib/locomotive/wagon/misc/mounter.rb +1 -1
  296. data/lib/locomotive/wagon/misc/tcp_port.rb +42 -0
  297. data/lib/locomotive/wagon/misc/thor.rb +15 -0
  298. data/lib/locomotive/wagon/server/entry_submission.rb +69 -38
  299. data/lib/locomotive/wagon/server/middleware.rb +4 -2
  300. data/lib/locomotive/wagon/server/page.rb +2 -2
  301. data/lib/locomotive/wagon/server.rb +11 -7
  302. data/lib/locomotive/wagon/version.rb +1 -1
  303. data/lib/locomotive/wagon.rb +141 -30
  304. data/locomotivecms_wagon.gemspec +7 -6
  305. data/spec/fixtures/default/app/content_types/bands.yml +3 -1
  306. data/spec/fixtures/default/app/views/pages/all.liquid.haml +3 -0
  307. data/spec/fixtures/default/app/views/pages/events.liquid.haml +21 -0
  308. data/spec/fixtures/default/app/views/pages/filtered.liquid.haml +11 -1
  309. data/spec/fixtures/default/app/views/pages/index.liquid.haml +1 -1
  310. data/spec/fixtures/default/data/bands.yml +3 -0
  311. data/spec/integration/server/basic_spec.rb +1 -0
  312. data/spec/integration/server/contact_form_spec.rb +1 -1
  313. data/spec/integration/server/liquid_spec.rb +8 -1
  314. data/spec/integration/server/new_contact_form_spec.rb +67 -0
  315. data/spec/integration/server/with_scope_spec.rb +10 -0
  316. data/spec/spec_helper.rb +3 -0
  317. metadata +339 -144
  318. data/generators/bootstrap2/app/views/pages/404.liquid +0 -13
  319. data/generators/bootstrap2/app/views/pages/index.liquid +0 -98
  320. data/generators/bootstrap2/app/views/pages/index.liquid.haml +0 -80
  321. data/generators/bootstrap2/app/views/snippets/footer.liquid +0 -3
  322. data/generators/bootstrap2/app/views/snippets/footer.liquid.haml +0 -2
  323. data/generators/bootstrap2/config/deploy.yml +0 -15
  324. data/generators/bootstrap2/public/fonts/FontAwesome.otf +0 -0
  325. data/generators/bootstrap2/public/fonts/fontawesome-webfont.eot +0 -0
  326. data/generators/bootstrap2/public/fonts/fontawesome-webfont.svg +0 -399
  327. data/generators/bootstrap2/public/fonts/fontawesome-webfont.ttf +0 -0
  328. data/generators/bootstrap2/public/fonts/fontawesome-webfont.woff +0 -0
  329. data/generators/bootstrap2/public/javascripts/bootstrap.js +0 -2280
  330. data/generators/bootstrap2/public/javascripts/bootstrap.min.js +0 -6
  331. data/generators/bootstrap2/public/stylesheets/application.css.scss +0 -39
  332. data/generators/bootstrap2/public/stylesheets/bootstrap-responsive.css +0 -1109
  333. data/generators/bootstrap2/public/stylesheets/bootstrap-responsive.min.css +0 -9
  334. data/generators/bootstrap2/public/stylesheets/bootstrap.css +0 -5568
  335. data/generators/bootstrap2/public/stylesheets/bootstrap.min.css +0 -9
  336. data/generators/bootstrap2/public/stylesheets/fonts/awesome.css.scss +0 -3
  337. data/generators/bootstrap2/public/stylesheets/fonts/font-awesome-ie7.css +0 -1203
  338. data/generators/bootstrap2/public/stylesheets/fonts/font-awesome-ie7.min.css +0 -384
  339. data/generators/bootstrap2/public/stylesheets/fonts/font-awesome.css +0 -1470
  340. data/generators/bootstrap2/public/stylesheets/fonts/font-awesome.min.css +0 -403
  341. data/generators/bootstrap3/public/javascripts/bootstrap.js +0 -1999
  342. data/generators/bootstrap3/public/stylesheets/bootstrap-theme.css +0 -384
  343. data/generators/bootstrap3/public/stylesheets/bootstrap-theme.min.css +0 -1
  344. data/generators/bootstrap3/public/stylesheets/bootstrap.min.css +0 -9
  345. data/generators/content_type/app/content_types/%name%.yml.tt +0 -58
  346. data/generators/foundation/app/views/pages/index.liquid +0 -150
  347. data/generators/foundation/app/views/pages/index.liquid.haml +0 -125
  348. data/generators/foundation/app/views/snippets/footer.liquid +0 -16
  349. data/generators/foundation/app/views/snippets/footer.liquid.haml +0 -22
  350. data/generators/foundation/config/deploy.yml +0 -15
  351. data/generators/foundation/public/samples/.empty_directory +0 -1
  352. data/generators/foundation/public/stylesheets/foundation.css +0 -4727
@@ -0,0 +1,311 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Foundation.libs.dropdown = {
5
+ name : 'dropdown',
6
+
7
+ version : '5.2.3',
8
+
9
+ settings : {
10
+ active_class: 'open',
11
+ align: 'bottom',
12
+ is_hover: false,
13
+ opened: function(){},
14
+ closed: function(){}
15
+ },
16
+
17
+ init : function (scope, method, options) {
18
+ Foundation.inherit(this, 'throttle');
19
+
20
+ this.bindings(method, options);
21
+ },
22
+
23
+ events : function (scope) {
24
+ var self = this,
25
+ S = self.S;
26
+
27
+ S(this.scope)
28
+ .off('.dropdown')
29
+ .on('click.fndtn.dropdown', '[' + this.attr_name() + ']', function (e) {
30
+ var settings = S(this).data(self.attr_name(true) + '-init') || self.settings;
31
+ if (!settings.is_hover || Modernizr.touch) {
32
+ e.preventDefault();
33
+ self.toggle($(this));
34
+ }
35
+ })
36
+ .on('mouseenter.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
37
+ var $this = S(this),
38
+ dropdown,
39
+ target;
40
+
41
+ clearTimeout(self.timeout);
42
+
43
+ if ($this.data(self.data_attr())) {
44
+ dropdown = S('#' + $this.data(self.data_attr()));
45
+ target = $this;
46
+ } else {
47
+ dropdown = $this;
48
+ target = S("[" + self.attr_name() + "='" + dropdown.attr('id') + "']");
49
+ }
50
+
51
+ var settings = target.data(self.attr_name(true) + '-init') || self.settings;
52
+
53
+ if(S(e.target).data(self.data_attr()) && settings.is_hover) {
54
+ self.closeall.call(self);
55
+ }
56
+
57
+ if (settings.is_hover) self.open.apply(self, [dropdown, target]);
58
+ })
59
+ .on('mouseleave.fndtn.dropdown', '[' + this.attr_name() + '], [' + this.attr_name() + '-content]', function (e) {
60
+ var $this = S(this);
61
+ self.timeout = setTimeout(function () {
62
+ if ($this.data(self.data_attr())) {
63
+ var settings = $this.data(self.data_attr(true) + '-init') || self.settings;
64
+ if (settings.is_hover) self.close.call(self, S('#' + $this.data(self.data_attr())));
65
+ } else {
66
+ var target = S('[' + self.attr_name() + '="' + S(this).attr('id') + '"]'),
67
+ settings = target.data(self.attr_name(true) + '-init') || self.settings;
68
+ if (settings.is_hover) self.close.call(self, $this);
69
+ }
70
+ }.bind(this), 150);
71
+ })
72
+ .on('click.fndtn.dropdown', function (e) {
73
+ var parent = S(e.target).closest('[' + self.attr_name() + '-content]');
74
+
75
+ if (S(e.target).data(self.data_attr()) || S(e.target).parent().data(self.data_attr())) {
76
+ return;
77
+ }
78
+ if (!(S(e.target).data('revealId')) &&
79
+ (parent.length > 0 && (S(e.target).is('[' + self.attr_name() + '-content]') ||
80
+ $.contains(parent.first()[0], e.target)))) {
81
+ e.stopPropagation();
82
+ return;
83
+ }
84
+
85
+ self.close.call(self, S('[' + self.attr_name() + '-content]'));
86
+ })
87
+ .on('opened.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
88
+ self.settings.opened.call(this);
89
+ })
90
+ .on('closed.fndtn.dropdown', '[' + self.attr_name() + '-content]', function () {
91
+ self.settings.closed.call(this);
92
+ });
93
+
94
+ S(window)
95
+ .off('.dropdown')
96
+ .on('resize.fndtn.dropdown', self.throttle(function () {
97
+ self.resize.call(self);
98
+ }, 50));
99
+
100
+ this.resize();
101
+ },
102
+
103
+ close: function (dropdown) {
104
+ var self = this;
105
+ dropdown.each(function () {
106
+ if (self.S(this).hasClass(self.settings.active_class)) {
107
+ self.S(this)
108
+ .css(Foundation.rtl ? 'right':'left', '-99999px')
109
+ .removeClass(self.settings.active_class)
110
+ .prev('[' + self.attr_name() + ']')
111
+ .removeClass(self.settings.active_class)
112
+ .removeData('target');
113
+
114
+ self.S(this).trigger('closed', [dropdown]);
115
+ }
116
+ });
117
+ },
118
+
119
+ closeall: function() {
120
+ var self = this;
121
+ $.each(self.S('[' + this.attr_name() + '-content]'), function() {
122
+ self.close.call(self, self.S(this))
123
+ });
124
+ },
125
+
126
+ open: function (dropdown, target) {
127
+ this
128
+ .css(dropdown
129
+ .addClass(this.settings.active_class), target);
130
+ dropdown.prev('[' + this.attr_name() + ']').addClass(this.settings.active_class);
131
+ dropdown.data('target', target.get(0)).trigger('opened', [dropdown, target]);
132
+ },
133
+
134
+ data_attr: function () {
135
+ if (this.namespace.length > 0) {
136
+ return this.namespace + '-' + this.name;
137
+ }
138
+
139
+ return this.name;
140
+ },
141
+
142
+ toggle : function (target) {
143
+ var dropdown = this.S('#' + target.data(this.data_attr()));
144
+ if (dropdown.length === 0) {
145
+ // No dropdown found, not continuing
146
+ return;
147
+ }
148
+
149
+ this.close.call(this, this.S('[' + this.attr_name() + '-content]').not(dropdown));
150
+
151
+ if (dropdown.hasClass(this.settings.active_class)) {
152
+ this.close.call(this, dropdown);
153
+ if (dropdown.data('target') !== target.get(0))
154
+ this.open.call(this, dropdown, target);
155
+ } else {
156
+ this.open.call(this, dropdown, target);
157
+ }
158
+ },
159
+
160
+ resize : function () {
161
+ var dropdown = this.S('[' + this.attr_name() + '-content].open'),
162
+ target = this.S("[" + this.attr_name() + "='" + dropdown.attr('id') + "']");
163
+
164
+ if (dropdown.length && target.length) {
165
+ this.css(dropdown, target);
166
+ }
167
+ },
168
+
169
+ css : function (dropdown, target) {
170
+ this.clear_idx();
171
+
172
+ if (this.small()) {
173
+ var p = this.dirs.bottom.call(dropdown, target);
174
+
175
+ dropdown.attr('style', '').removeClass('drop-left drop-right drop-top').css({
176
+ position : 'absolute',
177
+ width: '95%',
178
+ 'max-width': 'none',
179
+ top: p.top
180
+ });
181
+
182
+ dropdown.css(Foundation.rtl ? 'right':'left', '2.5%');
183
+ } else {
184
+ var settings = target.data(this.attr_name(true) + '-init') || this.settings;
185
+
186
+ this.style(dropdown, target, settings);
187
+ }
188
+
189
+ return dropdown;
190
+ },
191
+
192
+ style : function (dropdown, target, settings) {
193
+ var css = $.extend({position: 'absolute'},
194
+ this.dirs[settings.align].call(dropdown, target, settings));
195
+
196
+ dropdown.attr('style', '').css(css);
197
+ },
198
+
199
+ // return CSS property object
200
+ // `this` is the dropdown
201
+ dirs : {
202
+ // Calculate target offset
203
+ _base : function (t) {
204
+ var o_p = this.offsetParent(),
205
+ o = o_p.offset(),
206
+ p = t.offset();
207
+
208
+ p.top -= o.top;
209
+ p.left -= o.left;
210
+
211
+ return p;
212
+ },
213
+ top: function (t, s) {
214
+ var self = Foundation.libs.dropdown,
215
+ p = self.dirs._base.call(this, t),
216
+ pip_offset_base = (t.outerWidth() / 2) - 8;
217
+
218
+ this.addClass('drop-top');
219
+
220
+ if (t.outerWidth() < this.outerWidth() || self.small()) {
221
+ self.adjust_pip(pip_offset_base, p);
222
+ }
223
+
224
+ if (Foundation.rtl) {
225
+ return {left: p.left - this.outerWidth() + t.outerWidth(),
226
+ top: p.top - this.outerHeight()};
227
+ }
228
+
229
+ return {left: p.left, top: p.top - this.outerHeight()};
230
+ },
231
+ bottom: function (t, s) {
232
+ var self = Foundation.libs.dropdown,
233
+ p = self.dirs._base.call(this, t),
234
+ pip_offset_base = (t.outerWidth() / 2) - 8;
235
+
236
+ if (t.outerWidth() < this.outerWidth() || self.small()) {
237
+ self.adjust_pip(pip_offset_base, p);
238
+ }
239
+
240
+ if (self.rtl) {
241
+ return {left: p.left - this.outerWidth() + t.outerWidth(), top: p.top + t.outerHeight()};
242
+ }
243
+
244
+ return {left: p.left, top: p.top + t.outerHeight()};
245
+ },
246
+ left: function (t, s) {
247
+ var p = Foundation.libs.dropdown.dirs._base.call(this, t);
248
+
249
+ this.addClass('drop-left');
250
+
251
+ return {left: p.left - this.outerWidth(), top: p.top};
252
+ },
253
+ right: function (t, s) {
254
+ var p = Foundation.libs.dropdown.dirs._base.call(this, t);
255
+
256
+ this.addClass('drop-right');
257
+
258
+ return {left: p.left + t.outerWidth(), top: p.top};
259
+ }
260
+ },
261
+
262
+ // Insert rule to style psuedo elements
263
+ adjust_pip : function (pip_offset_base, p) {
264
+ var sheet = Foundation.stylesheet;
265
+
266
+ if (this.small()) {
267
+ pip_offset_base += p.left - 8;
268
+ }
269
+
270
+ this.rule_idx = sheet.cssRules.length;
271
+
272
+ var sel_before = '.f-dropdown.open:before',
273
+ sel_after = '.f-dropdown.open:after',
274
+ css_before = 'left: ' + pip_offset_base + 'px;',
275
+ css_after = 'left: ' + (pip_offset_base - 1) + 'px;';
276
+
277
+ if (sheet.insertRule) {
278
+ sheet.insertRule([sel_before, '{', css_before, '}'].join(' '), this.rule_idx);
279
+ sheet.insertRule([sel_after, '{', css_after, '}'].join(' '), this.rule_idx + 1);
280
+ } else {
281
+ sheet.addRule(sel_before, css_before, this.rule_idx);
282
+ sheet.addRule(sel_after, css_after, this.rule_idx + 1);
283
+ }
284
+ },
285
+
286
+ // Remove old dropdown rule index
287
+ clear_idx : function () {
288
+ var sheet = Foundation.stylesheet;
289
+
290
+ if (this.rule_idx) {
291
+ sheet.deleteRule(this.rule_idx);
292
+ sheet.deleteRule(this.rule_idx);
293
+ delete this.rule_idx;
294
+ }
295
+ },
296
+
297
+ small : function () {
298
+ return matchMedia(Foundation.media_queries.small).matches &&
299
+ !matchMedia(Foundation.media_queries.medium).matches;
300
+ },
301
+
302
+ off: function () {
303
+ this.S(this.scope).off('.fndtn.dropdown');
304
+ this.S('html, body').off('.fndtn.dropdown');
305
+ this.S(window).off('.fndtn.dropdown');
306
+ this.S('[data-dropdown-content]').off('.fndtn.dropdown');
307
+ },
308
+
309
+ reflow : function () {}
310
+ };
311
+ }(jQuery, window, window.document));
@@ -0,0 +1,74 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Foundation.libs.equalizer = {
5
+ name : 'equalizer',
6
+
7
+ version : '5.2.3',
8
+
9
+ settings : {
10
+ use_tallest: true,
11
+ before_height_change: $.noop,
12
+ after_height_change: $.noop,
13
+ equalize_on_stack: false
14
+ },
15
+
16
+ init : function (scope, method, options) {
17
+ Foundation.inherit(this, 'image_loaded');
18
+ this.bindings(method, options);
19
+ this.reflow();
20
+ },
21
+
22
+ events : function () {
23
+ this.S(window).off('.equalizer').on('resize.fndtn.equalizer', function(e){
24
+ this.reflow();
25
+ }.bind(this));
26
+ },
27
+
28
+ equalize: function(equalizer) {
29
+ var isStacked = false,
30
+ vals = equalizer.find('[' + this.attr_name() + '-watch]:visible'),
31
+ settings = equalizer.data(this.attr_name(true)+'-init');
32
+
33
+ if (vals.length === 0) return;
34
+ var firstTopOffset = vals.first().offset().top;
35
+ settings.before_height_change();
36
+ equalizer.trigger('before-height-change');
37
+ vals.height('inherit');
38
+ vals.each(function(){
39
+ var el = $(this);
40
+ if (el.offset().top !== firstTopOffset) {
41
+ isStacked = true;
42
+ }
43
+ });
44
+
45
+ if (settings.equalize_on_stack === false) {
46
+ if (isStacked) return;
47
+ };
48
+
49
+ var heights = vals.map(function(){ return $(this).outerHeight(false) }).get();
50
+
51
+ if (settings.use_tallest) {
52
+ var max = Math.max.apply(null, heights);
53
+ vals.css('height', max);
54
+ } else {
55
+ var min = Math.min.apply(null, heights);
56
+ vals.css('height', min);
57
+ }
58
+ settings.after_height_change();
59
+ equalizer.trigger('after-height-change');
60
+ },
61
+
62
+ reflow : function () {
63
+ var self = this;
64
+
65
+ this.S('[' + this.attr_name() + ']', this.scope).each(function(){
66
+ var $eq_target = $(this);
67
+ self.image_loaded(self.S('img', this), function(){
68
+ self.equalize($eq_target)
69
+ });
70
+ });
71
+ }
72
+ };
73
+ })(jQuery, window, window.document);
74
+
@@ -0,0 +1,331 @@
1
+ ;(function ($, window, document, undefined) {
2
+ 'use strict';
3
+
4
+ Foundation.libs.interchange = {
5
+ name : 'interchange',
6
+
7
+ version : '5.2.3',
8
+
9
+ cache : {},
10
+
11
+ images_loaded : false,
12
+ nodes_loaded : false,
13
+
14
+ settings : {
15
+ load_attr : 'interchange',
16
+
17
+ named_queries : {
18
+ 'default' : 'only screen',
19
+ small : Foundation.media_queries.small,
20
+ medium : Foundation.media_queries.medium,
21
+ large : Foundation.media_queries.large,
22
+ xlarge : Foundation.media_queries.xlarge,
23
+ xxlarge: Foundation.media_queries.xxlarge,
24
+ landscape : 'only screen and (orientation: landscape)',
25
+ portrait : 'only screen and (orientation: portrait)',
26
+ retina : 'only screen and (-webkit-min-device-pixel-ratio: 2),' +
27
+ 'only screen and (min--moz-device-pixel-ratio: 2),' +
28
+ 'only screen and (-o-min-device-pixel-ratio: 2/1),' +
29
+ 'only screen and (min-device-pixel-ratio: 2),' +
30
+ 'only screen and (min-resolution: 192dpi),' +
31
+ 'only screen and (min-resolution: 2dppx)'
32
+ },
33
+
34
+ directives : {
35
+ replace: function (el, path, trigger) {
36
+ // The trigger argument, if called within the directive, fires
37
+ // an event named after the directive on the element, passing
38
+ // any parameters along to the event that you pass to trigger.
39
+ //
40
+ // ex. trigger(), trigger([a, b, c]), or trigger(a, b, c)
41
+ //
42
+ // This allows you to bind a callback like so:
43
+ // $('#interchangeContainer').on('replace', function (e, a, b, c) {
44
+ // console.log($(this).html(), a, b, c);
45
+ // });
46
+
47
+ if (/IMG/.test(el[0].nodeName)) {
48
+ var orig_path = el[0].src;
49
+
50
+ if (new RegExp(path, 'i').test(orig_path)) return;
51
+
52
+ el[0].src = path;
53
+
54
+ return trigger(el[0].src);
55
+ }
56
+ var last_path = el.data(this.data_attr + '-last-path');
57
+
58
+ if (last_path == path) return;
59
+
60
+ if (/\.(gif|jpg|jpeg|tiff|png)([?#].*)?/i.test(path)) {
61
+ $(el).css('background-image', 'url('+path+')');
62
+ el.data('interchange-last-path', path);
63
+ return trigger(path);
64
+ }
65
+
66
+ return $.get(path, function (response) {
67
+ el.html(response);
68
+ el.data(this.data_attr + '-last-path', path);
69
+ trigger();
70
+ });
71
+
72
+ }
73
+ }
74
+ },
75
+
76
+ init : function (scope, method, options) {
77
+ Foundation.inherit(this, 'throttle random_str');
78
+
79
+ this.data_attr = this.set_data_attr();
80
+ $.extend(true, this.settings, method, options);
81
+ this.bindings(method, options);
82
+ this.load('images');
83
+ this.load('nodes');
84
+ },
85
+
86
+ get_media_hash : function() {
87
+ var mediaHash='';
88
+ for (var queryName in this.settings.named_queries ) {
89
+ mediaHash += matchMedia(this.settings.named_queries[queryName]).matches.toString();
90
+ }
91
+ return mediaHash;
92
+ },
93
+
94
+ events : function () {
95
+ var self = this, prevMediaHash;
96
+
97
+ $(window)
98
+ .off('.interchange')
99
+ .on('resize.fndtn.interchange', self.throttle(function () {
100
+ var currMediaHash = self.get_media_hash();
101
+ if (currMediaHash !== prevMediaHash) {
102
+ self.resize();
103
+ }
104
+ prevMediaHash = currMediaHash;
105
+ }, 50));
106
+
107
+ return this;
108
+ },
109
+
110
+ resize : function () {
111
+ var cache = this.cache;
112
+
113
+ if(!this.images_loaded || !this.nodes_loaded) {
114
+ setTimeout($.proxy(this.resize, this), 50);
115
+ return;
116
+ }
117
+
118
+ for (var uuid in cache) {
119
+ if (cache.hasOwnProperty(uuid)) {
120
+ var passed = this.results(uuid, cache[uuid]);
121
+
122
+ if (passed) {
123
+ this.settings.directives[passed
124
+ .scenario[1]].call(this, passed.el, passed.scenario[0], function () {
125
+ if (arguments[0] instanceof Array) {
126
+ var args = arguments[0];
127
+ } else {
128
+ var args = Array.prototype.slice.call(arguments, 0);
129
+ }
130
+
131
+ passed.el.trigger(passed.scenario[1], args);
132
+ });
133
+ }
134
+ }
135
+ }
136
+
137
+ },
138
+
139
+ results : function (uuid, scenarios) {
140
+ var count = scenarios.length;
141
+
142
+ if (count > 0) {
143
+ var el = this.S('[' + this.add_namespace('data-uuid') + '="' + uuid + '"]');
144
+
145
+ while (count--) {
146
+ var mq, rule = scenarios[count][2];
147
+ if (this.settings.named_queries.hasOwnProperty(rule)) {
148
+ mq = matchMedia(this.settings.named_queries[rule]);
149
+ } else {
150
+ mq = matchMedia(rule);
151
+ }
152
+ if (mq.matches) {
153
+ return {el: el, scenario: scenarios[count]};
154
+ }
155
+ }
156
+ }
157
+
158
+ return false;
159
+ },
160
+
161
+ load : function (type, force_update) {
162
+ if (typeof this['cached_' + type] === 'undefined' || force_update) {
163
+ this['update_' + type]();
164
+ }
165
+
166
+ return this['cached_' + type];
167
+ },
168
+
169
+ update_images : function () {
170
+ var images = this.S('img[' + this.data_attr + ']'),
171
+ count = images.length,
172
+ i = count,
173
+ loaded_count = 0,
174
+ data_attr = this.data_attr;
175
+
176
+ this.cache = {};
177
+ this.cached_images = [];
178
+ this.images_loaded = (count === 0);
179
+
180
+ while (i--) {
181
+ loaded_count++;
182
+ if (images[i]) {
183
+ var str = images[i].getAttribute(data_attr) || '';
184
+
185
+ if (str.length > 0) {
186
+ this.cached_images.push(images[i]);
187
+ }
188
+ }
189
+
190
+ if (loaded_count === count) {
191
+ this.images_loaded = true;
192
+ this.enhance('images');
193
+ }
194
+ }
195
+
196
+ return this;
197
+ },
198
+
199
+ update_nodes : function () {
200
+ var nodes = this.S('[' + this.data_attr + ']').not('img'),
201
+ count = nodes.length,
202
+ i = count,
203
+ loaded_count = 0,
204
+ data_attr = this.data_attr;
205
+
206
+ this.cached_nodes = [];
207
+ this.nodes_loaded = (count === 0);
208
+
209
+
210
+ while (i--) {
211
+ loaded_count++;
212
+ var str = nodes[i].getAttribute(data_attr) || '';
213
+
214
+ if (str.length > 0) {
215
+ this.cached_nodes.push(nodes[i]);
216
+ }
217
+
218
+ if(loaded_count === count) {
219
+ this.nodes_loaded = true;
220
+ this.enhance('nodes');
221
+ }
222
+ }
223
+
224
+ return this;
225
+ },
226
+
227
+ enhance : function (type) {
228
+ var i = this['cached_' + type].length;
229
+
230
+ while (i--) {
231
+ this.object($(this['cached_' + type][i]));
232
+ }
233
+
234
+ return $(window).trigger('resize');
235
+ },
236
+
237
+ parse_params : function (path, directive, mq) {
238
+ return [this.trim(path), this.convert_directive(directive), this.trim(mq)];
239
+ },
240
+
241
+ convert_directive : function (directive) {
242
+
243
+ var trimmed = this.trim(directive);
244
+
245
+ if (trimmed.length > 0) {
246
+ return trimmed;
247
+ }
248
+
249
+ return 'replace';
250
+ },
251
+
252
+ object : function(el) {
253
+ var raw_arr = this.parse_data_attr(el),
254
+ scenarios = [],
255
+ i = raw_arr.length;
256
+
257
+ if (i > 0) {
258
+ while (i--) {
259
+ var split = raw_arr[i].split(/\((.*?)(\))$/);
260
+
261
+ if (split.length > 1) {
262
+ var cached_split = split[0].split(/\, /),
263
+ params = this.parse_params(cached_split[0],
264
+ cached_split[1], split[1]);
265
+
266
+ scenarios.push(params);
267
+ }
268
+ }
269
+ }
270
+
271
+ return this.store(el, scenarios);
272
+ },
273
+
274
+ store : function (el, scenarios) {
275
+ var uuid = this.random_str(),
276
+ current_uuid = el.data(this.add_namespace('uuid', true));
277
+
278
+ if (this.cache[current_uuid]) return this.cache[current_uuid];
279
+
280
+ el.attr(this.add_namespace('data-uuid'), uuid);
281
+
282
+ return this.cache[uuid] = scenarios;
283
+ },
284
+
285
+ trim : function(str) {
286
+
287
+ if (typeof str === 'string') {
288
+ return $.trim(str);
289
+ }
290
+
291
+ return str;
292
+ },
293
+
294
+ set_data_attr: function (init) {
295
+ if (init) {
296
+ if (this.namespace.length > 0) {
297
+ return this.namespace + '-' + this.settings.load_attr;
298
+ }
299
+
300
+ return this.settings.load_attr;
301
+ }
302
+
303
+ if (this.namespace.length > 0) {
304
+ return 'data-' + this.namespace + '-' + this.settings.load_attr;
305
+ }
306
+
307
+ return 'data-' + this.settings.load_attr;
308
+ },
309
+
310
+ parse_data_attr : function (el) {
311
+ var raw = el.attr(this.attr_name()).split(/\[(.*?)\]/),
312
+ i = raw.length,
313
+ output = [];
314
+
315
+ while (i--) {
316
+ if (raw[i].replace(/[\W\d]+/, '').length > 4) {
317
+ output.push(raw[i]);
318
+ }
319
+ }
320
+
321
+ return output;
322
+ },
323
+
324
+ reflow : function () {
325
+ this.load('images', true);
326
+ this.load('nodes', true);
327
+ }
328
+
329
+ };
330
+
331
+ }(jQuery, window, window.document));