shibori 1.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +27 -0
  5. data/Procfile +1 -0
  6. data/README.md +24 -0
  7. data/Rakefile +2 -0
  8. data/app.json +11 -0
  9. data/builder/lineage_hunter.js +80 -0
  10. data/builder/list_item_hunter.js +106 -0
  11. data/builder/media_hunter.js +51 -0
  12. data/builder/object_factory.js +60 -0
  13. data/builder/parameter_hunter.js +69 -0
  14. data/builder/pattern_assembler.js +258 -0
  15. data/builder/pattern_exporter.js +43 -0
  16. data/builder/patternlab.js +365 -0
  17. data/builder/patternlab_grunt.js +38 -0
  18. data/builder/patternlab_gulp.js +26 -0
  19. data/builder/pseudopattern_hunter.js +78 -0
  20. data/config.json +34 -0
  21. data/docs/Pattern Lab Node.md +225 -0
  22. data/favicon.ico +0 -0
  23. data/gulpfile.js +148 -0
  24. data/index.js +20 -0
  25. data/lib/shibori/version.rb +3 -0
  26. data/lib/shibori.rb +11 -0
  27. data/package.json +44 -0
  28. data/public/data/annotations.js +109 -0
  29. data/public/styleguide/css/static.css +458 -0
  30. data/public/styleguide/css/static.scss +404 -0
  31. data/public/styleguide/css/styleguide-specific.css +170 -0
  32. data/public/styleguide/css/styleguide-specific.scss +204 -0
  33. data/public/styleguide/css/styleguide.css +880 -0
  34. data/public/styleguide/css/styleguide.scss +950 -0
  35. data/public/styleguide/css/vendor/prism.css +112 -0
  36. data/public/styleguide/css/vendor/typeahead.css +66 -0
  37. data/public/styleguide/fonts/icomoon.eot +0 -0
  38. data/public/styleguide/fonts/icomoon.svg +22 -0
  39. data/public/styleguide/fonts/icomoon.ttf +0 -0
  40. data/public/styleguide/fonts/icomoon.woff +0 -0
  41. data/public/styleguide/html/README +1 -0
  42. data/public/styleguide/images/spinner.gif +0 -0
  43. data/public/styleguide/js/annotations-pattern.js +308 -0
  44. data/public/styleguide/js/annotations-viewer.js +289 -0
  45. data/public/styleguide/js/code-pattern.js +120 -0
  46. data/public/styleguide/js/code-viewer.js +443 -0
  47. data/public/styleguide/js/data-saver.js +169 -0
  48. data/public/styleguide/js/pattern-finder.js +114 -0
  49. data/public/styleguide/js/postmessage.js +127 -0
  50. data/public/styleguide/js/styleguide.js +600 -0
  51. data/public/styleguide/js/url-handler.js +182 -0
  52. data/public/styleguide/js/vendor/classlist-polyfill.js +176 -0
  53. data/public/styleguide/js/vendor/jquery.js +4 -0
  54. data/public/styleguide/js/vendor/jwerty.js +523 -0
  55. data/public/styleguide/js/vendor/prism.js +7 -0
  56. data/public/styleguide/js/vendor/typeahead.bundle.min.js +7 -0
  57. data/script/bootstrap +58 -0
  58. data/shibori.gemspec +18 -0
  59. data/shibori.jpg +0 -0
  60. data/source/_data/annotations.js +109 -0
  61. data/source/_data/data.json +93 -0
  62. data/source/_data/listitems.json +782 -0
  63. data/source/_patternlab-files/README +1 -0
  64. data/source/_patternlab-files/index.mustache +94 -0
  65. data/source/_patternlab-files/partials/ishControls.mustache +64 -0
  66. data/source/_patternlab-files/partials/patternNav.mustache +17 -0
  67. data/source/_patternlab-files/partials/patternPaths.mustache +3 -0
  68. data/source/_patternlab-files/partials/viewAllPaths.mustache +3 -0
  69. data/source/_patternlab-files/pattern-header-footer/README +1 -0
  70. data/source/_patternlab-files/pattern-header-footer/footer.html +34 -0
  71. data/source/_patternlab-files/pattern-header-footer/header.html +44 -0
  72. data/source/_patternlab-files/styleguide.mustache +75 -0
  73. data/source/_patternlab-files/viewall.mustache +75 -0
  74. data/source/_patterns/00-atoms/00-typography/00-headings.mustache +6 -0
  75. data/source/_patterns/00-atoms/00-typography/01-headings-options.mustache +7 -0
  76. data/source/_patterns/00-atoms/00-typography/02-body.mustache +2 -0
  77. data/source/_patterns/00-atoms/00-typography/03-text-manipulation.mustache +12 -0
  78. data/source/_patterns/00-atoms/00-typography/04-blockquotes.mustache +3 -0
  79. data/source/_patterns/00-atoms/00-typography/05-lists.mustache +64 -0
  80. data/source/_patterns/00-atoms/01-colors/00-colors-monochromatic.mustache +36 -0
  81. data/source/_patterns/00-atoms/01-colors/01-colors-brand.mustache +26 -0
  82. data/source/_patterns/00-atoms/01-colors/02-colors-gradients.mustache +38 -0
  83. data/source/_patterns/00-atoms/02-buttons/00-btn-lg.mustache +7 -0
  84. data/source/_patterns/00-atoms/02-buttons/01-btn-sm.mustache +7 -0
  85. data/source/_patterns/00-atoms/02-buttons/02-btn-xs.mustache +7 -0
  86. data/source/_patterns/00-atoms/02-buttons/03-btn-block.mustache +7 -0
  87. data/source/_patterns/00-atoms/02-buttons/04-btn-deploy.mustache +4 -0
  88. data/source/_patterns/00-atoms/03-forms/00-text-fields.mustache +24 -0
  89. data/source/_patterns/00-atoms/03-forms/01-select-menu.mustache +6 -0
  90. data/source/_patterns/00-atoms/03-forms/02-checkbox.mustache +10 -0
  91. data/source/_patterns/00-atoms/03-forms/03-radios.mustache +10 -0
  92. data/source/_patterns/00-atoms/03-forms/04-validation.mustache +14 -0
  93. data/source/_patterns/00-atoms/04-quote/00-pullquote.mustache +7 -0
  94. data/source/_patterns/00-atoms/04-quote/01-quote-small.mustache +7 -0
  95. data/source/_patterns/00-atoms/05-code/01-pre.mustache +11 -0
  96. data/source/_patterns/00-atoms/06-tooltips/00-text.mustache +3 -0
  97. data/source/_patterns/00-atoms/06-tooltips/01-diagram-callout.mustache +1 -0
  98. data/source/_patterns/00-atoms/07-loader/00-spinner.mustache +5 -0
  99. data/source/_patterns/00-atoms/08-readmore/00-readmore.mustache +3 -0
  100. data/source/_patterns/00-atoms/09-slider/00-dots.mustache +8 -0
  101. data/source/_patterns/00-atoms/10-tables/00-tables.mustache +26 -0
  102. data/source/_patterns/00-atoms/12-modal/00-modal.mustache +14 -0
  103. data/source/_patterns/00-atoms/13-panel/00-panel.mustache +3 -0
  104. data/source/_patterns/00-atoms/14-users/00-avatar.mustache +3 -0
  105. data/source/_patterns/00-atoms/15-icons/00-icons.mustache +333 -0
  106. data/source/_patterns/00-atoms/15-icons/04-icon-colors.mustache +38 -0
  107. data/source/_patterns/00-atoms/15-icons/05-icon-sizes.mustache +31 -0
  108. data/source/_patterns/00-atoms/15-icons/_02-languages.mustache +0 -0
  109. data/source/_patterns/00-atoms/15-icons/_03-social.mustache +0 -0
  110. data/source/_patterns/00-atoms/15-icons/_05-icon-containers.mustache +0 -0
  111. data/source/_patterns/00-atoms/16-video/01-video.mustache +3 -0
  112. data/source/_patterns/00-atoms/16-video/_00-play-button.mustache +0 -0
  113. data/source/_patterns/00-atoms/17-utilities/00-visibility.mustache +8 -0
  114. data/source/_patterns/00-atoms/17-utilities/01-ui-elements.mustache +3 -0
  115. data/source/_patterns/00-atoms/18-grid/_00-grid.mustache +0 -0
  116. data/source/_patterns/01-molecules/00-text/00-header-groups.mustache +4 -0
  117. data/source/_patterns/01-molecules/00-text/01-intro-text.mustache +5 -0
  118. data/source/_patterns/01-molecules/01-layout/00-one-up.mustache +8 -0
  119. data/source/_patterns/01-molecules/01-layout/01-two-up.mustache +9 -0
  120. data/source/_patterns/01-molecules/01-layout/02-three-up.mustache +10 -0
  121. data/source/_patterns/01-molecules/01-layout/03-four-up.mustache +11 -0
  122. data/source/_patterns/01-molecules/01-layout/04-masonary-2.mustache +24 -0
  123. data/source/_patterns/01-molecules/01-layout/05-masonary-3.mustache +24 -0
  124. data/source/_patterns/01-molecules/02-navigation/01-subnav.mustache +21 -0
  125. data/source/_patterns/01-molecules/02-navigation/02-breadcrumbs.mustache +25 -0
  126. data/source/_patterns/01-molecules/02-navigation/03-side-nav.mustache +11 -0
  127. data/source/_patterns/01-molecules/02-navigation/04-side-nav-small.mustache +32 -0
  128. data/source/_patterns/01-molecules/02-navigation/05-pagination.mustache +0 -0
  129. data/source/_patterns/01-molecules/02-navigation/06-tabs.mustache +46 -0
  130. data/source/_patterns/01-molecules/03-forms/_00-search.mustache +0 -0
  131. data/source/_patterns/01-molecules/04-slider/00-slider.mustache +8 -0
  132. data/source/_patterns/01-molecules/05-messages/00-alert.mustache +15 -0
  133. data/source/_patterns/01-molecules/06-components/_00-social-share.mustache +0 -0
  134. data/source/_patterns/01-molecules/07-Elements/01-Addons-Card.mustache +79 -0
  135. data/source/_patterns/01-molecules/07-Elements/02-Buttons-Card.mustache +131 -0
  136. data/source/_patterns/01-molecules/07-Elements/03-Buildpack-Card.mustache +109 -0
  137. data/source/_patterns/01-molecules/08-vertical-tabs/01-vertical-tabs.mustache +30 -0
  138. data/source/_patterns/02-organisms/03-sections/00-purple.mustache +11 -0
  139. data/source/_patterns/02-organisms/03-sections/01-purple-dark.mustache +12 -0
  140. data/source/_patterns/02-organisms/03-sections/03-gray-light.mustache +12 -0
  141. data/source/css/hk-icon-rails.scss +13 -0
  142. data/source/css/scss/base/_base.scss +62 -0
  143. data/source/css/scss/base/_fonts.scss +12 -0
  144. data/source/css/scss/base/_normalize.scss +431 -0
  145. data/source/css/scss/base/_type.scss +128 -0
  146. data/source/css/scss/base/_utilities.scss +78 -0
  147. data/source/css/scss/components/_alert.scss +38 -0
  148. data/source/css/scss/components/_animate.scss +3340 -0
  149. data/source/css/scss/components/_animation.scss +15 -0
  150. data/source/css/scss/components/_buttons.scss +175 -0
  151. data/source/css/scss/components/_code.scss +26 -0
  152. data/source/css/scss/components/_forms.scss +136 -0
  153. data/source/css/scss/components/_hero.scss +18 -0
  154. data/source/css/scss/components/_hr.scss +11 -0
  155. data/source/css/scss/components/_icons.scss +85 -0
  156. data/source/css/scss/components/_lists.scss +45 -0
  157. data/source/css/scss/components/_logos.scss +15 -0
  158. data/source/css/scss/components/_masonary.scss +46 -0
  159. data/source/css/scss/components/_modal.scss +218 -0
  160. data/source/css/scss/components/_owlCarousel.scss +270 -0
  161. data/source/css/scss/components/_panel.scss +11 -0
  162. data/source/css/scss/components/_pill-box.scss +38 -0
  163. data/source/css/scss/components/_quote.scss +96 -0
  164. data/source/css/scss/components/_readmore.scss +11 -0
  165. data/source/css/scss/components/_slider.scss +96 -0
  166. data/source/css/scss/components/_spinner.scss +64 -0
  167. data/source/css/scss/components/_sprites.scss +3 -0
  168. data/source/css/scss/components/_sr-only.scss +10 -0
  169. data/source/css/scss/components/_tables.scss +62 -0
  170. data/source/css/scss/components/_tooltips.scss +93 -0
  171. data/source/css/scss/components/_users.scss +11 -0
  172. data/source/css/scss/components/_vertical-tabs.scss +129 -0
  173. data/source/css/scss/components/_video.scss +7 -0
  174. data/source/css/scss/ecosystem/_addons-card.scss +3 -0
  175. data/source/css/scss/ecosystem/_cards.scss +369 -0
  176. data/source/css/scss/ecosystem/_elements-brand.scss +32 -0
  177. data/source/css/scss/ecosystem/_elements.scss +4 -0
  178. data/source/css/scss/globals/_colors.scss +189 -0
  179. data/source/css/scss/globals/_mixins.scss +45 -0
  180. data/source/css/scss/globals/_variables.scss +87 -0
  181. data/source/css/scss/layout/_grid-settings.scss +13 -0
  182. data/source/css/scss/layout/_layout.scss +95 -0
  183. data/source/css/scss/page-elements/_headers.scss +3 -0
  184. data/source/css/scss/page-elements/_navigation.scss +254 -0
  185. data/source/css/scss/page-elements/_sections.scss +66 -0
  186. data/source/css/scss/page-elements/_sidebar.scss +34 -0
  187. data/source/css/shibori.scss +63 -0
  188. data/source/fonts/bentonsans/bentonsans-book.eot +0 -0
  189. data/source/fonts/bentonsans/bentonsans-book.svg +400 -0
  190. data/source/fonts/bentonsans/bentonsans-book.ttf +0 -0
  191. data/source/fonts/bentonsans/bentonsans-book.woff +0 -0
  192. data/source/fonts/bentonsans/bentonsans-medium.eot +0 -0
  193. data/source/fonts/bentonsans/bentonsans-medium.svg +416 -0
  194. data/source/fonts/bentonsans/bentonsans-medium.ttf +0 -0
  195. data/source/fonts/bentonsans/bentonsans-medium.woff +0 -0
  196. data/source/fonts/bentonsans/bentonsans-regular.eot +0 -0
  197. data/source/fonts/bentonsans/bentonsans-regular.svg +416 -0
  198. data/source/fonts/bentonsans/bentonsans-regular.ttf +0 -0
  199. data/source/fonts/bentonsans/bentonsans-regular.woff +0 -0
  200. data/source/fonts/hk-icon/hk-icon.eot +0 -0
  201. data/source/fonts/hk-icon/hk-icon.svg +261 -0
  202. data/source/fonts/hk-icon/hk-icon.ttf +0 -0
  203. data/source/fonts/hk-icon/hk-icon.woff +0 -0
  204. data/source/fonts/inconsolata/inconsolata-bold.eot +0 -0
  205. data/source/fonts/inconsolata/inconsolata-bold.svg +239 -0
  206. data/source/fonts/inconsolata/inconsolata-bold.ttf +0 -0
  207. data/source/fonts/inconsolata/inconsolata-bold.woff +0 -0
  208. data/source/fonts/inconsolata/inconsolata-regular.eot +0 -0
  209. data/source/fonts/inconsolata/inconsolata-regular.svg +239 -0
  210. data/source/fonts/inconsolata/inconsolata-regular.ttf +0 -0
  211. data/source/fonts/inconsolata/inconsolata-regular.woff +0 -0
  212. data/source/images/blockquote/close-sm.png +0 -0
  213. data/source/images/blockquote/close.png +0 -0
  214. data/source/images/blockquote/close@2x.png +0 -0
  215. data/source/images/blockquote/open-sm.png +0 -0
  216. data/source/images/blockquote/open.png +0 -0
  217. data/source/images/blockquote/open@2x.png +0 -0
  218. data/source/images/elements/heroku_suported.svg +32 -0
  219. data/source/images/forms/select-input-arrows.svg +8 -0
  220. data/source/js/init.js +26 -0
  221. data/source/js/main.js +22 -0
  222. data/source/js/vendor/bourbon-modal.js +17 -0
  223. data/source/js/vendor/fitvids.js +77 -0
  224. data/source/js/vendor/fixto.js +719 -0
  225. data/source/js/vendor/jquery-2.0.0b2.js +8690 -0
  226. data/source/js/vendor/modernizr.js +4 -0
  227. data/source/js/vendor/owl.carousel.js +3069 -0
  228. data/source/js/vendor/readmore.js +11 -0
  229. data/source/js/vendor/unslider.js +1 -0
  230. data/source/js/vendor/vertical-tabs.js +34 -0
  231. data/test/files/test.css +19 -0
  232. data/test/lineage_hunter_tests.js +262 -0
  233. data/test/list_item_hunter_tests.js +167 -0
  234. data/test/media_hunter_tests.js +74 -0
  235. data/test/object_factory_tests.js +62 -0
  236. data/test/parameter_hunter_tests.js +298 -0
  237. data/test/pattern_assembler_tests.js +43 -0
  238. data/test/patternlab_tests.js +8 -0
  239. metadata +320 -0
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * @preserve
3
+ *
4
+ * Readmore.js jQuery plugin
5
+ * Author: @jed_foster
6
+ * Project home: http://jedfoster.github.io/Readmore.js
7
+ * Licensed under the MIT license
8
+ *
9
+ * Debounce function from http://davidwalsh.name/javascript-debounce-function
10
+ */
11
+ !function(e){"use strict";function t(e,t,a){var i;return function(){var n=this,o=arguments,r=function(){i=null,a||e.apply(n,o)},s=a&&!i;clearTimeout(i),i=setTimeout(r,t),s&&e.apply(n,o)}}function a(e){var t=++h;return String(null==e?"rmjs-":e)+t}function i(e){var t=e.clone().css({height:"auto",width:e.width(),maxHeight:"none",overflow:"hidden"}).insertAfter(e),a=t.outerHeight(),i=parseInt(t.css({maxHeight:""}).css("max-height").replace(/[^-\d\.]/g,""),10),n=e.data("defaultHeight");t.remove();var o=i||e.data("collapsedHeight")||n;e.data({expandedHeight:a,maxHeight:i,collapsedHeight:o}).css({maxHeight:"none"})}function n(e){if(!d[e.selector]){var t=" ";e.embedCSS&&""!==e.blockCSS&&(t+=e.selector+" + [data-readmore-toggle], "+e.selector+"[data-readmore]{"+e.blockCSS+"}"),t+=e.selector+"[data-readmore]{transition: height "+e.speed+"ms;overflow: hidden;}",function(e,t){var a=e.createElement("style");a.type="text/css",a.styleSheet?a.styleSheet.cssText=t:a.appendChild(e.createTextNode(t)),e.getElementsByTagName("head")[0].appendChild(a)}(document,t),d[e.selector]=!0}}function o(t,a){this.element=t,this.options=e.extend({},s,a),n(this.options),this._defaults=s,this._name=r,this.init(),window.addEventListener?(window.addEventListener("load",l),window.addEventListener("resize",l)):(window.attachEvent("load",l),window.attachEvent("resize",l))}var r="readmore",s={speed:100,collapsedHeight:200,heightMargin:16,moreLink:'<a href="#">Read More</a>',lessLink:'<a href="#">Close</a>',embedCSS:!0,blockCSS:"display: block; width: 100%;",startOpen:!1,beforeToggle:function(){},afterToggle:function(){}},d={},h=0,l=t(function(){e("[data-readmore]").each(function(){var t=e(this),a="true"===t.attr("aria-expanded");i(t),t.css({height:t.data(a?"expandedHeight":"collapsedHeight")})})},100);o.prototype={init:function(){var t=this,n=e(this.element);n.data({defaultHeight:this.options.collapsedHeight,heightMargin:this.options.heightMargin}),i(n);var o=n.data("collapsedHeight"),r=n.data("heightMargin");if(n.outerHeight(!0)<=o+r)return!0;var s=n.attr("id")||a(),d=t.options.startOpen?t.options.lessLink:t.options.moreLink;n.attr({"data-readmore":"","aria-expanded":!1,id:s}),n.after(e(d).on("click",function(e){t.toggle(this,n[0],e)}).attr({"data-readmore-toggle":"","aria-controls":s})),t.options.startOpen||n.css({height:o})},toggle:function(t,a,i){i&&i.preventDefault(),t||(t=e('[aria-controls="'+this.element.id+'"]')[0]),a||(a=this.element);var n=this,o=e(a),r="",s="",d=!1,h=o.data("collapsedHeight");o.height()<=h?(r=o.data("expandedHeight")+"px",s="lessLink",d=!0):(r=h,s="moreLink"),n.options.beforeToggle(t,a,!d),o.css({height:r}),o.on("transitionend",function(){n.options.afterToggle(t,a,d),e(this).attr({"aria-expanded":d}).off("transitionend")}),e(t).replaceWith(e(n.options[s]).on("click",function(e){n.toggle(this,a,e)}).attr({"data-readmore-toggle":"","aria-controls":o.attr("id")}))},destroy:function(){e(this.element).each(function(){var t=e(this);t.attr({"data-readmore":null,"aria-expanded":null}).css({maxHeight:"",height:""}).next("[data-readmore-toggle]").remove(),t.removeData()})}},e.fn.readmore=function(t){var a=arguments,i=this.selector;return t=t||{},"object"==typeof t?this.each(function(){if(e.data(this,"plugin_"+r)){var a=e.data(this,"plugin_"+r);a.destroy.apply(a)}t.selector=i,e.data(this,"plugin_"+r,new o(this,t))}):"string"==typeof t&&"_"!==t[0]&&"init"!==t?this.each(function(){var i=e.data(this,"plugin_"+r);i instanceof o&&"function"==typeof i[t]&&i[t].apply(i,Array.prototype.slice.call(a,1))}):void 0}}(jQuery);
@@ -0,0 +1 @@
1
+ !function($){return $?($.Unslider=function(t,n){var e=this;return e._="unslider",e.defaults={autoplay:!1,delay:3e3,speed:750,easing:"swing",keys:{prev:37,next:39},nav:!0,arrows:{prev:'<a class="'+e._+'-arrow prev">←</a>',next:'<a class="'+e._+'-arrow next">→</a>'},animation:"horizontal",selectors:{container:"ul:first",slides:"li"},animateHeight:!1,activeClass:e._+"-active"},e.$context=t,e.options={},e.$parent=null,e.$container=null,e.$slides=null,e.$nav=null,e.$arrows=[],e.total=0,e.current=0,e.prefix=e._+"-",e.eventSuffix="."+e.prefix+~~(2e3*Math.random()),e.interval=null,e.init=function(t){return e.options=$.extend({},e.defaults,t),e.$container=e.$context.find(e.options.selectors.container).addClass(e.prefix+"wrap"),e.$slides=e.$container.children(e.options.selectors.slides),e.setup(),["nav","arrows","keys","infinite"].forEach(function(t){e.options[t]&&e["init"+$._ucfirst(t)]()}),void 0!==typeof jQuery.event.special.swipe&&e.initSwipe(),e.options.autoplay&&e.start(),e.calculateSlides(),e.$context.trigger(e._+".ready"),e.animate(e.options.index||e.current,"init")},e.setup=function(){e.$context.addClass(e.prefix+"slider "+e.prefix+e.options.animation).wrap('<div class="'+e._+'" />'),e.$parent=e.$context.parent("."+e._);var t=e.$context.css("position");"static"===t&&e.$context.css("position","relative"),e.$context.css("overflow","hidden")},e.calculateSlides=function(){e.total=e.$slides.length,"fade"!==e.options.animation&&(e.$container.css("width",100*e.total+"%").addClass(e.prefix+"carousel"),e.$slides.css("width",100/e.total+"%"))},e.start=function(){return e.interval=setTimeout(function(){e.next(),e.start()},e.options.delay),e},e.stop=function(){return clearTimeout(e.interval),e},e.initNav=function(){var t=$('<nav class="'+e.prefix+'nav"><ol /></nav>');e.$slides.each(function(n){var i=this.getAttribute("data-nav")||n+1;$.isFunction(e.options.nav)&&(i=e.options.nav.call(e.$slides.eq(n),n,i)),t.children("ol").append('<li data-slide="'+n+'">'+i+"</li>")}),e.$nav=t.insertAfter(e.$context),e.$nav.find("li").on("click"+e.eventSuffix,function(){var t=$(this).addClass(e.options.activeClass);t.siblings().removeClass(e.options.activeClass),e.options.autoplay&&e.stop().start(),e.animate(t.attr("data-slide"))})},e.initArrows=function(){e.options.arrows===!0&&(e.options.arrows=e.defaults.arrows),$.each(e.options.arrows,function(t,n){e.$arrows.push($(n).insertAfter(e.$context).on("click"+e.eventSuffix,e[t]))})},e.initKeys=function(){e.options.keys===!0&&(e.options.keys=e.defaults.keys),$(document).on("keyup"+e.eventSuffix,function(t){$.each(e.options.keys,function(n,i){t.which===i&&$.isFunction(e[n])&&e[n].call(e)})})},e.initSwipe=function(){var t=e.$slides.width();e.$container.on({swipeleft:e.next,swiperight:e.prev,movestart:function(t){return t.distX>t.distY&&t.distX<-t.distY||t.distX<t.distY&&t.distX>-t.distY?!!t.preventDefault():void e.$container.css("position","relative")}}),"fade"!==e.options.animation&&e.$container.on({move:function(n){e.$container.css("left",100*n.distX/t+"%")},moveend:function(){e.$container.animate({left:0},200)}})},e.initInfinite=function(){var t=["first","last"];t.forEach(function(n,i){e.$slides.push.apply(e.$slides,e.$slides.filter(':not(".'+e._+'-cloned")')[n]().clone().addClass(e._+"-cloned")["insert"+(0===i?"After":"Before")](e.$slides[t[~~!i]]()))}),e.$container.css("margin-left","-100%")},e.destroyArrows=function(){e.$arrows.forEach(function(t){t.remove()})},e.destroySwipe=function(){e.$container.off("movestart swipeleft move moveend").css("left",0)},e.destroyKeys=function(){$(document).off("keyup"+e.eventSuffix)},e.setIndex=function(t){return 0>t&&(t=e.total-1),e.current=Math.min(Math.max(0,t),e.total-1),e.options.nav&&e.$nav.find('[data-slide="'+e.current+'"]')._toggleActive(e.options.activeClass),e.$slides.eq(e.current)._toggleActive(e.options.activeClass),e},e.animate=function(t,n){if("first"===t&&(t=0),"last"===t&&(t=e.total),isNaN(t))return e;e.setIndex(t),e.$context.trigger(e._+".change",[t,e.$slides.eq(t)]);var i="animate"+$._ucfirst(e.options.animation);return $.isFunction(e[i])&&e[i](e.current,n),e},e.next=function(){var t=e.current+1;return t>=e.total&&(t=0),e.animate(t,"next")},e.prev=function(){return e.animate(e.current-1,"prev")},e.animateHorizontal=function(t){if(e.options.animateHeight&&e._move(e.$context,{height:e.$slides.eq(t).height()},!1),e.options.infinite){var n;t===e.total-1&&(n=e.total-3,t=-1),t===e.total-2&&(n=0,t=e.total-2),"number"==typeof n&&(e.setIndex(n),e.$context.on(e._+".moved",function(){e.current===n&&e.$container.css("left",-(100*n)+"%").off(e._+".moved")}))}return e._move(e.$container,{left:-(100*t)+"%"})},e.animateFade=function(t,n){var i=e.$slides.eq(t).addClass(e.options.activeClass);e._move(i.siblings().removeClass(e.options.activeClass),{opacity:0}),e._move(i,{opacity:1},!1)},e._move=function(t,n,i){return i!==!1&&(i=function(){e.$context.trigger(e._+".moved")}),t._move(n,e.options.speed,e.options.easing,i)},e.init(n)},$.fn._toggleActive=function(t){return this.addClass(t).siblings().removeClass(t)},$._ucfirst=function(t){return t.toString().toLowerCase().replace(/^./,function(t){return t.toUpperCase()})},$.fn._move=function(){return this.stop(!0,!0),$.fn.velocity?$.fn.velocity.apply(this,arguments):$.fn.animate.apply(this,arguments)},void($.fn.unslider=function(t){return this.each(function(){var n=$(this);if("string"==typeof t&&n.data("unslider")){t=t.split(":");var e=t[0],i=n.data("unslider")[e];if(t[1]){var o=t[1].split(",");return $.isFunction(i)&&i.apply(n,o)}return $.isFunction(i)&&i()}return n.data("unslider",new $.Unslider(n,t))})})):console.warn("Unslider needs jQuery")}(window.jQuery);
@@ -0,0 +1,34 @@
1
+ $(document).ready(function() {
2
+ $(".js-vertical-tab-content").hide();
3
+ $(".js-vertical-tab-content:first").show();
4
+
5
+ /* if in tab mode */
6
+ $(".js-vertical-tab").click(function(event) {
7
+ event.preventDefault();
8
+
9
+ $(".js-vertical-tab-content").hide();
10
+ var activeTab = $(this).attr("rel");
11
+ $("#"+activeTab).show();
12
+
13
+ $(".js-vertical-tab").removeClass("is-active");
14
+ $(this).addClass("is-active");
15
+
16
+ $(".js-vertical-tab-accordion-heading").removeClass("is-active");
17
+ $(".js-vertical-tab-accordion-heading[rel^='"+activeTab+"']").addClass("is-active");
18
+ });
19
+
20
+ /* if in accordion mode */
21
+ $(".js-vertical-tab-accordion-heading").click(function(event) {
22
+ event.preventDefault();
23
+
24
+ $(".js-vertical-tab-content").hide();
25
+ var accordion_activeTab = $(this).attr("rel");
26
+ $("#"+accordion_activeTab).show();
27
+
28
+ $(".js-vertical-tab-accordion-heading").removeClass("is-active");
29
+ $(this).addClass("is-active");
30
+
31
+ $(".js-vertical-tab").removeClass("is-active");
32
+ $(".js-vertical-tab[rel^='"+accordion_activeTab+"']").addClass("is-active");
33
+ });
34
+ });
@@ -0,0 +1,19 @@
1
+ @media only screen and (min-width: 35em){
2
+ body{
3
+ color: rebeccapurple;
4
+ }
5
+ }
6
+
7
+ @media (min-width:50em){ body{ color: grey;} }
8
+
9
+ @media only screen and (min-width: 70em) and (max-width: 1600px){
10
+ body{
11
+ color: green;
12
+ }
13
+ }
14
+
15
+ @media only screen and( max-width: 50em){
16
+ body{
17
+ color: orange;
18
+ }
19
+ }
@@ -0,0 +1,262 @@
1
+ (function () {
2
+ "use strict";
3
+
4
+ var lh = require('../builder/lineage_hunter');
5
+
6
+ exports['lineage hunter '] = {
7
+ 'test lineage hunter finds lineage' : function(test){
8
+
9
+ //setup current pattern from what we would have during execution
10
+ var currentPattern = {
11
+ "name": "02-organisms-00-global-00-header",
12
+ "subdir": "02-organisms\\00-global",
13
+ "filename": "00-header.mustache",
14
+ "data": null,
15
+ "template": "<!-- Begin .header -->\r\n<header class=\"header cf\" role=\"banner\">\r\n\t{{> atoms-logo }}\r\n\t<a href=\"#\" class=\"nav-toggle nav-toggle-search icon-search\"><span class=\"is-vishidden\">Search</span></a>\r\n\t<a href=\"#\" class=\"nav-toggle nav-toggle-menu icon-menu\"><span class=\"is-vishidden\">Menu</span></a>\r\n\t{{> molecules-primary-nav }}\r\n\t{{> molecules-search }}\r\n</header>\r\n<!-- End .header -->\r\n",
16
+ "patternPartial": "<!-- Begin .header -->\r\n<header class=\"header cf\" role=\"banner\">\r\n<a href=\"/\"><img src=\"../../images/logo.png\" class=\"logo\" alt=\"Logo Alt Text\" /></a>\t<a href=\"#\" class=\"nav-toggle nav-toggle-search icon-search\"><span class=\"is-vishidden\">Search</span></a>\r\n\t<a href=\"#\" class=\"nav-toggle nav-toggle-menu icon-menu\"><span class=\"is-vishidden\">Menu</span></a>\r\n<nav id=\"nav\" class=\"nav\">\r\n\t<ul>\r\n\t\t<li><a href=\"#\">Home</a></li>\r\n\t\t<li><a href=\"#\">About</a></li>\r\n\t\t<li><a href=\"#\">Blog</a></li>\r\n\t\t<li><a href=\"#\">Contact</a></li>\r\n\t</ul>\r\n</nav><!--end .nav-->\r\n<form action=\"#\" method=\"post\" class=\"inline-form search-form\"> \r\n <fieldset>\r\n\t <legend class=\"is-vishidden\">Search</legend>\r\n\t <label for=\"search-field\" class=\"is-vishidden\">Search</label>\r\n\t <input type=\"search\" placeholder=\"Search\" id=\"search-field\" class=\"search-field\" />\r\n\t <button class=\"search-submit\">\r\n\t \t<span class=\"icon-search\" aria-hidden=\"true\"></span>\r\n\t \t<span class=\"is-vishidden\">Search</span>\r\n\t </button>\r\n </fieldset>\r\n</form></header>\r\n<!-- End .header -->\r\n",
17
+ "patternName": "header",
18
+ "patternLink": "02-organisms-00-global-00-header/02-organisms-00-global-00-header.html",
19
+ "patternGroup": "organisms",
20
+ "patternSubGroup": "organisms\\00-global",
21
+ "flatPatternPath": "02-organisms\\00-global",
22
+ "patternState": "",
23
+ "lineage": [],
24
+ "lineageIndex": [],
25
+ "lineageR": [],
26
+ "lineageRIndex": []
27
+ };
28
+ var patternlab = {
29
+ patterns: [
30
+ {
31
+ "name": "00-atoms-03-images-00-logo",
32
+ "subdir": "00-atoms\\03-images",
33
+ "filename": "00-logo.mustache",
34
+ "data": null,
35
+ "template": "<a href=\"/\"><img src=\"../../images/logo.png\" class=\"logo\" alt=\"Logo Alt Text\" /></a>",
36
+ "patternPartial": "<a href=\"/\"><img src=\"../../images/logo.png\" class=\"logo\" alt=\"Logo Alt Text\" /></a>",
37
+ "patternName": "logo",
38
+ "patternLink": "00-atoms-03-images-00-logo/00-atoms-03-images-00-logo.html",
39
+ "patternGroup": "atoms",
40
+ "patternSubGroup": "atoms\\03-images",
41
+ "flatPatternPath": "00-atoms\\03-images",
42
+ "patternState": "",
43
+ "lineage": [],
44
+ "lineageIndex": [],
45
+ "lineageR": [],
46
+ "lineageRIndex": []
47
+ },
48
+ {
49
+ "name": "01-molecules-05-navigation-00-primary-nav",
50
+ "subdir": "01-molecules\\05-navigation",
51
+ "filename": "00-primary-nav.mustache",
52
+ "data": null,
53
+ "template": "<nav id=\"nav\" class=\"nav\">\r\n\t<ul>\r\n\t\t<li><a href=\"#\">Home</a></li>\r\n\t\t<li><a href=\"#\">About</a></li>\r\n\t\t<li><a href=\"#\">Blog</a></li>\r\n\t\t<li><a href=\"#\">Contact</a></li>\r\n\t</ul>\r\n</nav><!--end .nav-->\r\n",
54
+ "patternPartial": "<nav id=\"nav\" class=\"nav\">\r\n\t<ul>\r\n\t\t<li><a href=\"#\">Home</a></li>\r\n\t\t<li><a href=\"#\">About</a></li>\r\n\t\t<li><a href=\"#\">Blog</a></li>\r\n\t\t<li><a href=\"#\">Contact</a></li>\r\n\t</ul>\r\n</nav><!--end .nav-->\r\n",
55
+ "patternName": "primary-nav",
56
+ "patternLink": "01-molecules-05-navigation-00-primary-nav/01-molecules-05-navigation-00-primary-nav.html",
57
+ "patternGroup": "molecules",
58
+ "patternSubGroup": "molecules\\05-navigation",
59
+ "flatPatternPath": "01-molecules\\05-navigation",
60
+ "patternState": "",
61
+ "lineage": [],
62
+ "lineageIndex": [],
63
+ "lineageR": [],
64
+ "lineageRIndex": []
65
+ },
66
+ {
67
+ "name": "01-molecules-04-forms-00-search",
68
+ "subdir": "01-molecules\\04-forms",
69
+ "filename": "00-search.mustache",
70
+ "data": null,
71
+ "template": "<form action=\"#\" method=\"post\" class=\"inline-form search-form\"> \r\n <fieldset>\r\n\t <legend class=\"is-vishidden\">Search</legend>\r\n\t <label for=\"search-field\" class=\"is-vishidden\">Search</label>\r\n\t <input type=\"search\" placeholder=\"Search\" id=\"search-field\" class=\"search-field\" />\r\n\t <button class=\"search-submit\">\r\n\t \t<span class=\"icon-search\" aria-hidden=\"true\"></span>\r\n\t \t<span class=\"is-vishidden\">Search</span>\r\n\t </button>\r\n </fieldset>\r\n</form>",
72
+ "patternPartial": "<form action=\"#\" method=\"post\" class=\"inline-form search-form\"> \r\n <fieldset>\r\n\t <legend class=\"is-vishidden\">Search</legend>\r\n\t <label for=\"search-field\" class=\"is-vishidden\">Search</label>\r\n\t <input type=\"search\" placeholder=\"Search\" id=\"search-field\" class=\"search-field\" />\r\n\t <button class=\"search-submit\">\r\n\t \t<span class=\"icon-search\" aria-hidden=\"true\"></span>\r\n\t \t<span class=\"is-vishidden\">Search</span>\r\n\t </button>\r\n </fieldset>\r\n</form>",
73
+ "patternName": "search",
74
+ "patternLink": "01-molecules-04-forms-00-search/01-molecules-04-forms-00-search.html",
75
+ "patternGroup": "molecules",
76
+ "patternSubGroup": "molecules\\04-forms",
77
+ "flatPatternPath": "01-molecules\\04-forms",
78
+ "patternState": "",
79
+ "lineage": [],
80
+ "lineageIndex": [],
81
+ "lineageR": [],
82
+ "lineageRIndex": []
83
+ }
84
+ ]
85
+ };
86
+
87
+ var lineage_hunter = new lh();
88
+ lineage_hunter.find_lineage(currentPattern, patternlab);
89
+
90
+ test.equals(currentPattern.lineageIndex.length, 3);
91
+ test.equals(currentPattern.lineageIndex[0], "atoms-logo");
92
+ test.equals(currentPattern.lineageIndex[1], "molecules-primary-nav");
93
+ test.equals(currentPattern.lineageIndex[2], "molecules-search");
94
+
95
+ test.done();
96
+ },
97
+
98
+ 'test lineage hunter finds lineage with spaced pattern parameters' : function(test){
99
+ //setup current pattern from what we would have during execution
100
+ var currentPattern = {
101
+ "name": "01-molecules-01-toast-00-error",
102
+ "subdir": "01-molecules\\01-toast",
103
+ "filename": "00-error.mustache",
104
+ "data": null,
105
+ "template": "{{> atoms-error(message: 'That\'s no moon...') }}",
106
+ "patternPartial": "{{> atoms-error(message: 'That\'s no moon...') }}",
107
+ "patternName": "error",
108
+ "patternLink": "01-molecules-01-toast-00-error/01-molecules-01-toast-00-error.html",
109
+ "patternGroup": "molecules",
110
+ "patternSubGroup": "molecules\\01-toast",
111
+ "flatPatternPath": "01-molecules\\01-toast",
112
+ "patternState": "",
113
+ "lineage": [],
114
+ "lineageIndex": [],
115
+ "lineageR": [],
116
+ "lineageRIndex": []
117
+ };
118
+ var patternlab = {
119
+ patterns: [
120
+ {
121
+ "name": "01-atoms-05-alerts-00-error",
122
+ "subdir": "01-atoms\\05-alerts",
123
+ "filename": "00-error.mustache",
124
+ "data": null,
125
+ "template": "<h1> {{message}} </h1>",
126
+ "patternPartial": "<h1> {{message}} </h1>",
127
+ "patternName": "error",
128
+ "patternLink": "01-atoms-05-alerts-00-error/01-atoms-05-alerts-00-error.html",
129
+ "patternGroup": "atoms",
130
+ "patternSubGroup": "atoms\\05-alerts",
131
+ "flatPatternPath": "01-atoms\\05-alerts",
132
+ "patternState": "",
133
+ "lineage": [],
134
+ "lineageIndex": [],
135
+ "lineageR": [],
136
+ "lineageRIndex": []
137
+ }
138
+ ]
139
+ };
140
+
141
+ var lineage_hunter = new lh();
142
+ lineage_hunter.find_lineage(currentPattern, patternlab);
143
+
144
+ test.equals(currentPattern.lineageIndex.length, 1);
145
+ test.equals(currentPattern.lineageIndex[0], "atoms-error");
146
+
147
+ test.done();
148
+ },
149
+
150
+ 'test lineage hunter finds lineage with unspaced pattern parameters' : function(test){
151
+ //setup current pattern from what we would have during execution
152
+ var currentPattern = {
153
+ "name": "01-molecules-01-toast-00-error",
154
+ "subdir": "01-molecules\\01-toast",
155
+ "filename": "00-error.mustache",
156
+ "data": null,
157
+ "template": "{{>atoms-error(message: 'That\'s no moon...')}}",
158
+ "patternPartial": "{{>atoms-error(message: 'That\'s no moon...')}}",
159
+ "patternName": "error",
160
+ "patternLink": "01-molecules-01-toast-00-error/01-molecules-01-toast-00-error.html",
161
+ "patternGroup": "molecules",
162
+ "patternSubGroup": "molecules\\01-toast",
163
+ "flatPatternPath": "01-molecules\\01-toast",
164
+ "patternState": "",
165
+ "lineage": [],
166
+ "lineageIndex": [],
167
+ "lineageR": [],
168
+ "lineageRIndex": []
169
+ };
170
+ var patternlab = {
171
+ patterns: [
172
+ {
173
+ "name": "01-atoms-05-alerts-00-error",
174
+ "subdir": "01-atoms\\05-alerts",
175
+ "filename": "00-error.mustache",
176
+ "data": null,
177
+ "template": "<h1> {{message}} </h1>",
178
+ "patternPartial": "<h1> {{message}} </h1>",
179
+ "patternName": "error",
180
+ "patternLink": "01-atoms-05-alerts-00-error/01-atoms-05-alerts-00-error.html",
181
+ "patternGroup": "atoms",
182
+ "patternSubGroup": "atoms\\05-alerts",
183
+ "flatPatternPath": "01-atoms\\05-alerts",
184
+ "patternState": "",
185
+ "lineage": [],
186
+ "lineageIndex": [],
187
+ "lineageR": [],
188
+ "lineageRIndex": []
189
+ }
190
+ ]
191
+ };
192
+
193
+ var lineage_hunter = new lh();
194
+ lineage_hunter.find_lineage(currentPattern, patternlab);
195
+
196
+ test.equals(currentPattern.lineageIndex.length, 1);
197
+ test.equals(currentPattern.lineageIndex[0], "atoms-error");
198
+ test.equals(patternlab.patterns[0].lineageRIndex.length, 1);
199
+ test.equals(JSON.parse(patternlab.patterns[0].lineageR).lineagePattern, 'molecules-error');
200
+
201
+ test.done();
202
+ },
203
+
204
+ 'test lineage hunter does not apply lineage twice' : function(test){
205
+ //setup current pattern from what we would have during execution
206
+ var currentPattern = {
207
+ "name": "01-molecules-01-toast-00-error",
208
+ "subdir": "01-molecules\\01-toast",
209
+ "filename": "00-error.mustache",
210
+ "data": null,
211
+ "template": "{{>atoms-error(message: 'That\'s no moon...')}}",
212
+ "patternPartial": "{{>atoms-error(message: 'That\'s no moon...')}}",
213
+ "patternName": "error",
214
+ "patternLink": "01-molecules-01-toast-00-error/01-molecules-01-toast-00-error.html",
215
+ "patternGroup": "molecules",
216
+ "patternSubGroup": "molecules\\01-toast",
217
+ "flatPatternPath": "01-molecules\\01-toast",
218
+ "patternState": "",
219
+ "lineage": [],
220
+ "lineageIndex": [],
221
+ "lineageR": [],
222
+ "lineageRIndex": []
223
+ };
224
+ var patternlab = {
225
+ patterns: [
226
+ {
227
+ "name": "01-atoms-05-alerts-00-error",
228
+ "subdir": "01-atoms\\05-alerts",
229
+ "filename": "00-error.mustache",
230
+ "data": null,
231
+ "template": "<h1> {{message}} </h1>",
232
+ "patternPartial": "<h1> {{message}} </h1>",
233
+ "patternName": "error",
234
+ "patternLink": "01-atoms-05-alerts-00-error/01-atoms-05-alerts-00-error.html",
235
+ "patternGroup": "atoms",
236
+ "patternSubGroup": "atoms\\05-alerts",
237
+ "flatPatternPath": "01-atoms\\05-alerts",
238
+ "patternState": "",
239
+ "lineage": [],
240
+ "lineageIndex": [],
241
+ "lineageR": [],
242
+ "lineageRIndex": []
243
+ }
244
+ ]
245
+ };
246
+
247
+ var lineage_hunter = new lh();
248
+ lineage_hunter.find_lineage(currentPattern, patternlab);
249
+ lineage_hunter.find_lineage(currentPattern, patternlab);
250
+
251
+ test.equals(currentPattern.lineageIndex.length, 1);
252
+ test.equals(currentPattern.lineageIndex[0], "atoms-error");
253
+ test.equals(patternlab.patterns[0].lineageRIndex.length, 1);
254
+ test.equals(JSON.parse(patternlab.patterns[0].lineageR).lineagePattern, 'molecules-error');
255
+
256
+ test.done();
257
+ },
258
+
259
+
260
+ };
261
+
262
+ }());
@@ -0,0 +1,167 @@
1
+ (function () {
2
+ "use strict";
3
+
4
+ var lih = require('../builder/list_item_hunter');
5
+
6
+ exports['list_item_hunter'] = {
7
+ 'process_list_item_partials finds and outputs basic repeating blocks' : function(test){
8
+ //arrange
9
+ //setup current pattern from what we would have during execution
10
+ var currentPattern = {
11
+ "template": "{{#listItems.two}}{{ title }}{{/listItems.two}}",
12
+ "extendedTemplate" : "{{#listItems.two}}{{ title }}{{/listItems.two}}",
13
+ "key": "test-patternName",
14
+ "jsonFileData" : {}
15
+ };
16
+
17
+ var patternlab = {
18
+ "listitems": {
19
+ "1": [
20
+ {
21
+ "title": "Foo"
22
+ }
23
+ ],
24
+ "2": [
25
+ {
26
+ "title": "Foo"
27
+ },
28
+ {
29
+ "title": "Bar"
30
+ }
31
+ ]
32
+ },
33
+ "data": {
34
+ "link": {},
35
+ "partials": []
36
+ },
37
+ "config": {"debug": false}
38
+ };
39
+
40
+ var list_item_hunter = new lih();
41
+
42
+ //act
43
+ list_item_hunter.process_list_item_partials(currentPattern, patternlab);
44
+
45
+ //assert
46
+ test.equals(currentPattern.extendedTemplate, "FooBar" );
47
+
48
+ test.done();
49
+ },
50
+
51
+ 'process_list_item_partials finds partials and outputs repeated renders' : function(test){
52
+ //arrange
53
+ //setup current pattern from what we would have during execution
54
+ var currentPattern = {
55
+ "template": "{{#listItems.two}}{{ title }}{{/listItems.two}}",
56
+ "extendedTemplate" : "{{#listItems.two}}{{> test-simple }}{{/listItems.two}}",
57
+ "key": "test-patternName",
58
+ "jsonFileData" : {}
59
+ };
60
+
61
+ var patternlab = {
62
+ "listitems": {
63
+ "1": [
64
+ {
65
+ "title": "Foo"
66
+ }
67
+ ],
68
+ "2": [
69
+ {
70
+ "title": "Foo"
71
+ },
72
+ {
73
+ "title": "Bar"
74
+ }
75
+ ]
76
+ },
77
+ "data": {
78
+ "link": {},
79
+ "partials": []
80
+ },
81
+ "config": {"debug": false},
82
+ "patterns": [
83
+ {
84
+ "template": "{{ title }}",
85
+ "extendedTemplate" : "{{ title }}",
86
+ "key": "test-simple",
87
+ "jsonFileData" : {}
88
+ }
89
+ ]
90
+ };
91
+
92
+ var list_item_hunter = new lih();
93
+
94
+ //act
95
+ list_item_hunter.process_list_item_partials(currentPattern, patternlab);
96
+
97
+ //assert
98
+ test.equals(currentPattern.extendedTemplate, "FooBar" );
99
+
100
+ test.done();
101
+ },
102
+
103
+ 'process_list_item_partials overwrites listItem data if local .listitem.json is found' : function(test){
104
+ //arrange
105
+ //setup current pattern from what we would have during execution
106
+ var currentPattern = {
107
+ "template": "{{#listItems.two}}{{ title }}{{/listItems.two}}",
108
+ "extendedTemplate" : "{{#listItems.two}}{{> test-simple }}{{/listItems.two}}",
109
+ "key": "test-patternName",
110
+ "jsonFileData" : {},
111
+ "patternSpecificListJson" : {
112
+ "2": [
113
+ {
114
+ "title": "One"
115
+ },
116
+ {
117
+ "title": "Two"
118
+ },
119
+ ]
120
+ }
121
+ };
122
+
123
+ var patternlab = {
124
+ "listitems": {
125
+ "1": [
126
+ {
127
+ "title": "Foo"
128
+ }
129
+ ],
130
+ "2": [
131
+ {
132
+ "title": "Foo"
133
+ },
134
+ {
135
+ "title": "Bar"
136
+ }
137
+ ]
138
+ },
139
+ "data": {
140
+ "link": {},
141
+ "partials": []
142
+ },
143
+ "config": {"debug": false},
144
+ "patterns": [
145
+ {
146
+ "template": "{{ title }}",
147
+ "extendedTemplate" : "{{ title }}",
148
+ "key": "test-simple",
149
+ "jsonFileData" : {}
150
+ }
151
+ ]
152
+ };
153
+
154
+ var list_item_hunter = new lih();
155
+
156
+ //act
157
+ list_item_hunter.process_list_item_partials(currentPattern, patternlab);
158
+
159
+ //assert
160
+ test.equals(currentPattern.extendedTemplate, "OneTwo" );
161
+
162
+ test.done();
163
+ }
164
+
165
+ };
166
+
167
+ }());
@@ -0,0 +1,74 @@
1
+ (function () {
2
+ "use strict";
3
+
4
+ var MediaHunter = require('../builder/media_hunter');
5
+
6
+ exports['media_query hunter basic support '] = {
7
+ 'test media hunter finds query' : function(test){
8
+
9
+ //setup pl object
10
+ var pl = {};
11
+ var mh = new MediaHunter();
12
+
13
+ mh.find_media_queries('./test/files', pl);
14
+
15
+ test.equals(pl.mediaQueries.length, 4);
16
+
17
+ test.done();
18
+ },
19
+
20
+ 'test media hunter supports spaces in media query' : function(test){
21
+
22
+ //setup pl object
23
+ var pl = {};
24
+ var mh = new MediaHunter();
25
+
26
+ mh.find_media_queries('./test/files', pl);
27
+
28
+ test.equals(pl.mediaQueries[0], '35em');
29
+
30
+ test.done();
31
+ },
32
+
33
+ 'test media hunter supports nospaces in media query' : function(test){
34
+
35
+ //setup pl object
36
+ var pl = {};
37
+ var mh = new MediaHunter();
38
+
39
+ mh.find_media_queries('./test/files', pl);
40
+
41
+ test.equals(pl.mediaQueries[1], '50em');
42
+
43
+ test.done();
44
+ },
45
+
46
+ 'calling media hunter twice does not double add media queries' : function(test){
47
+
48
+ //setup pl object
49
+ var pl = {};
50
+ var mh = new MediaHunter();
51
+
52
+ mh.find_media_queries('./test/files', pl);
53
+ mh.find_media_queries('./test/files', pl);
54
+
55
+ test.equals(pl.mediaQueries.length, 4);
56
+
57
+ test.done();
58
+ },
59
+
60
+ 'encountering the same breakpoint in a file does not double add' : function(test){
61
+
62
+ //setup pl object
63
+ var pl = {};
64
+ var mh = new MediaHunter();
65
+
66
+ mh.find_media_queries('./test/files', pl);
67
+
68
+ test.equals(pl.mediaQueries.length, 4);
69
+
70
+ test.done();
71
+ }
72
+ };
73
+
74
+ }());
@@ -0,0 +1,62 @@
1
+ (function () {
2
+ "use strict";
3
+
4
+ var of = require('../builder/object_factory');
5
+
6
+ exports['oPattern initialization'] = {
7
+ 'test oPattern initializes correctly' : function(test){
8
+ var p = new of.oPattern('00-atoms/00-global', '00-colors.mustache', { d: 123});
9
+ test.equals(p.name, '00-atoms-00-global-00-colors');
10
+ test.equals(p.subdir, '00-atoms/00-global');
11
+ test.equals(p.fileName, '00-colors');
12
+ test.equals(p.jsonFileData.d, 123);
13
+ test.equals(p.patternName, 'colors');
14
+ test.equals(p.patternLink, '00-atoms-00-global-00-colors/00-atoms-00-global-00-colors.html');
15
+ test.equals(p.patternGroup, 'atoms');
16
+ test.equals(p.patternSubGroup, 'global');
17
+ test.equals(p.flatPatternPath, '00-atoms-00-global');
18
+ test.equals(p.key, 'atoms-colors');
19
+ test.equals(p.template, '');
20
+ test.equals(p.patternPartial, '');
21
+ test.equals(p.lineage.length, 0);
22
+ test.equals(p.lineageIndex.length, 0);
23
+ test.equals(p.lineageR.length, 0);
24
+ test.equals(p.lineageRIndex.length, 0);
25
+ test.done();
26
+ }
27
+ };
28
+
29
+ exports['oBucket initialization'] = {
30
+ 'test oBucket initializes correctly' : function(test){
31
+ var b = new of.oBucket('test');
32
+ test.equals(b.bucketNameLC, 'test');
33
+ test.equals(b.bucketNameUC, 'Test');
34
+ test.equals(b.navItems.length, 0);
35
+ test.equals(b.navItemsIndex.length, 0);
36
+ test.equals(b.patternItems.length, 0);
37
+ test.equals(b.patternItemsIndex.length, 0);
38
+ test.done();
39
+ }
40
+ };
41
+
42
+ exports['oNavItem initialization'] = {
43
+ 'test oNavItem initializes correctly' : function(test){
44
+ var ni = new of.oNavItem('test');
45
+ test.equals(ni.sectionNameLC, 'test');
46
+ test.equals(ni.navSubItems.length, 0);
47
+ test.equals(ni.navSubItemsIndex.length, 0);
48
+ test.done();
49
+ }
50
+ };
51
+
52
+ exports['oSubNavItem initialization'] = {
53
+ 'test oSubNavItem initializes correctly' : function(test){
54
+ var sni = new of.oNavSubItem('test');
55
+ test.equals(sni.patternName, 'Test');
56
+ test.equals(sni.patternPath, '');
57
+ test.equals(sni.patternPartial, '');
58
+ test.done();
59
+ }
60
+ };
61
+
62
+ }());