shibori 1.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,112 @@
1
+ /**
2
+ * okaidia theme for JavaScript, CSS and HTML
3
+ * Loosely based on Monokai textmate theme by http://www.monokai.nl/
4
+ * @author ocodia
5
+ */
6
+
7
+ code[class*="language-"],
8
+ pre[class*="language-"] {
9
+ color: #f8f8f2;
10
+ text-shadow: 0 1px rgba(0,0,0,0.3);
11
+ font-family: Consolas, Monaco, 'Andale Mono', monospace;
12
+ direction: ltr;
13
+ text-align: left;
14
+ white-space: pre;
15
+ word-spacing: normal;
16
+
17
+ -moz-tab-size: 4;
18
+ -o-tab-size: 4;
19
+ tab-size: 4;
20
+
21
+ -webkit-hyphens: none;
22
+ -moz-hyphens: none;
23
+ -ms-hyphens: none;
24
+ hyphens: none;
25
+ }
26
+
27
+ /* Code blocks */
28
+ pre[class*="language-"] {
29
+ padding: 1em;
30
+ margin: .5em 0;
31
+ overflow: auto;
32
+ border-radius: 0.3em;
33
+ }
34
+
35
+ :not(pre) > code[class*="language-"],
36
+ pre[class*="language-"] {
37
+ background: #272822;
38
+ }
39
+
40
+ /* Inline code */
41
+ :not(pre) > code[class*="language-"] {
42
+ padding: .1em;
43
+ border-radius: .3em;
44
+ }
45
+
46
+ .token.comment,
47
+ .token.prolog,
48
+ .token.doctype,
49
+ .token.cdata {
50
+ color: slategray;
51
+ }
52
+
53
+ .token.punctuation {
54
+ color: #f8f8f2;
55
+ }
56
+
57
+ .namespace {
58
+ opacity: .7;
59
+ }
60
+
61
+ .token.property,
62
+ .token.tag,
63
+ .token.constant,
64
+ .token.symbol {
65
+ color: #f92672;
66
+ }
67
+
68
+ .token.boolean,
69
+ .token.number{
70
+ color: #ae81ff;
71
+ }
72
+
73
+ .token.selector,
74
+ .token.attr-name,
75
+ .token.string,
76
+ .token.builtin {
77
+ color: #a6e22e;
78
+ }
79
+
80
+
81
+ .token.operator,
82
+ .token.entity,
83
+ .token.url,
84
+ .language-css .token.string,
85
+ .style .token.string,
86
+ .token.variable {
87
+ color: #f8f8f2;
88
+ }
89
+
90
+ .token.atrule,
91
+ .token.attr-value
92
+ {
93
+ color: #e6db74;
94
+ }
95
+
96
+
97
+ .token.keyword{
98
+ color: #66d9ef;
99
+ }
100
+
101
+ .token.regex,
102
+ .token.important {
103
+ color: #fd971f;
104
+ }
105
+
106
+ .token.important {
107
+ font-weight: bold;
108
+ }
109
+
110
+ .token.entity {
111
+ cursor: help;
112
+ }
@@ -0,0 +1,66 @@
1
+ #sg-find {
2
+ color: #000;
3
+ text-transform: lowercase;
4
+ }
5
+
6
+ .show-overflow {
7
+ overflow: visible;
8
+ }
9
+
10
+ .typeahead,
11
+ .tt-query,
12
+ .tt-hint {
13
+ width: 220px;
14
+ height: 30px;
15
+ padding: 8px 12px;
16
+ font-size: 14px;
17
+ line-height: 16px;
18
+ border: 2px solid #ccc;
19
+ outline: none;
20
+ }
21
+
22
+ .typeahead {
23
+ background-color: #fff;
24
+ }
25
+
26
+ .typeahead:focus {
27
+ border: 2px solid #999;
28
+ }
29
+
30
+ .tt-query {
31
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
32
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
33
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
34
+ }
35
+
36
+ .tt-hint {
37
+ color: #999
38
+ }
39
+
40
+ .tt-dropdown-menu {
41
+ width: 422px;
42
+ padding: 8px 0;
43
+ background-color: #fff;
44
+ border: 1px solid #ccc;
45
+ border: 1px solid rgba(0, 0, 0, 0.2);
46
+ text-align: left;
47
+ -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2);
48
+ -moz-box-shadow: 0 5px 10px rgba(0,0,0,.2);
49
+ box-shadow: 0 5px 10px rgba(0,0,0,.2);
50
+ }
51
+
52
+ .tt-suggestion {
53
+ padding: 3px 13px;
54
+ font-size: 14px;
55
+ line-height: 16px;
56
+ }
57
+
58
+ .tt-suggestion.tt-cursor {
59
+ color: #fff;
60
+ background-color: #0097cf;
61
+
62
+ }
63
+
64
+ .tt-suggestion p {
65
+ margin: 0;
66
+ }
Binary file
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Generated by IcoMoon</metadata>
5
+ <defs>
6
+ <font id="icomoon" horiz-adv-x="512">
7
+ <font-face units-per-em="512" ascent="480" descent="-32" />
8
+ <missing-glyph horiz-adv-x="512" />
9
+ <glyph unicode="&#x20;" d="" horiz-adv-x="256" />
10
+ <glyph unicode="&#xe600;" d="M496.131 44.302l-121.276 103.147c-12.537 11.283-25.945 16.463-36.776 15.963 28.628 33.534 45.921 77.039 45.921 124.588 0 106.039-85.961 192-192 192-106.038 0-192-85.961-192-192 0-106.039 85.961-192 192-192 47.549 0 91.054 17.293 124.588 45.922-0.5-10.831 4.68-24.239 15.963-36.776l103.147-121.276c17.661-19.623 46.511-21.277 64.11-3.678s15.946 46.449-3.677 64.11zM192 160c-70.692 0-128 57.308-128 128s57.308 128 128 128 128-57.308 128-128-57.307-128-128-128z" />
11
+ <glyph unicode="&#xe601;" d="M512 175.953v96.094l-73.387 12.231c-2.979 9.066-6.611 17.834-10.847 26.25l43.227 60.517-67.948 67.949-60.413-43.152c-8.455 4.277-17.269 7.944-26.384 10.951l-12.201 73.207h-96.094l-12.201-73.208c-9.115-3.007-17.929-6.674-26.383-10.951l-60.414 43.152-67.949-67.949 43.227-60.518c-4.235-8.415-7.867-17.183-10.846-26.249l-73.387-12.23v-96.094l73.559-12.26c2.98-8.984 6.605-17.674 10.821-26.015l-43.374-60.724 67.949-67.948 60.827 43.447c8.301-4.175 16.945-7.764 25.882-10.717l12.289-73.736h96.094l12.289 73.737c8.937 2.953 17.581 6.542 25.883 10.716l60.826-43.446 67.948 67.948-43.372 60.723c4.216 8.341 7.839 17.031 10.82 26.016l73.559 12.259zM256 160c-35.346 0-64 28.653-64 64 0 35.346 28.654 64 64 64 35.347 0 64-28.654 64-64 0-35.347-28.653-64-64-64z" />
12
+ <glyph unicode="&#xe602;" d="M0 272v-96c0-8.836 7.164-16 16-16h480c8.836 0 16 7.164 16 16v96c0 8.836-7.164 16-16 16h-480c-8.836 0-16-7.164-16-16z" />
13
+ <glyph unicode="&#xe603;" d="M496 288h-176v176c0 8.836-7.164 16-16 16h-96c-8.836 0-16-7.164-16-16v-176h-176c-8.836 0-16-7.164-16-16v-96c0-8.836 7.164-16 16-16h176v-176c0-8.836 7.164-16 16-16h96c8.836 0 16 7.164 16 16v176h176c8.836 0 16 7.164 16 16v96c0 8.836-7.164 16-16 16z" />
14
+ <glyph unicode="&#xe604;" d="M32 384h448v-96h-448zM32 256h448v-96h-448zM32 128h448v-96h-448z" />
15
+ <glyph unicode="&#xe605;" d="M256 480c-141.385 0-256-114.615-256-256s114.615-256 256-256 256 114.615 256 256-114.615 256-256 256zM256 32c-106.039 0-192 85.961-192 192s85.961 192 192 192c106.039 0 192-85.961 192-192 0-106.039-85.961-192-192-192zM160 224c0 53.019 42.981 96 96 96s96-42.981 96-96c0-53.019-42.981-96-96-96-53.019 0-96 42.981-96 96z" />
16
+ <glyph unicode="&#xe606;" d="M256 480c-141.385 0-256-114.615-256-256s114.615-256 256-256 256 114.615 256 256-114.615 256-256 256zM256 32c-106.039 0-192 85.961-192 192s85.961 192 192 192c106.039 0 192-85.961 192-192 0-106.039-85.961-192-192-192z" />
17
+ <glyph unicode="&#xe607;" d="M446.059 385.941l-60.117 60.118c-18.669 18.668-55.542 33.941-81.942 33.941h-224c-26.4 0-48-21.6-48-48v-416c0-26.4 21.6-48 48-48h352c26.4 0 48 21.6 48 48v288c0 26.4-15.273 63.273-33.941 81.941zM320 412.219c1.098-0.402 2.226-0.84 3.379-1.318 9.030-3.741 15.299-8.088 17.308-10.097l60.118-60.119c2.009-2.009 6.356-8.277 10.097-17.307 0.478-1.153 0.916-2.281 1.318-3.378h-92.22v92.219zM416 32h-320v384h192v-128h128v-256zM128 224h256v-32h-256zM128 160h256v-32h-256zM128 96h256v-32h-256z" />
18
+ <glyph unicode="&#xe608;" d="M476.698 442.679l-2.014 2.021c-47.074 47.067-124.097 47.067-171.163 0l-109.053-109.068c-47.067-47.066-47.067-124.088 0-171.155l2.013-2.013c3.916-3.924 8.073-7.462 12.368-10.729l39.924 39.925c-4.651 2.747-9.063 6.036-13.058 10.030l-2.021 2.021c-25.557 25.549-25.557 67.136 0 92.695l109.064 109.056c25.558 25.559 67.137 25.559 92.693 0l2.021-2.012c25.55-25.558 25.55-67.146 0-92.695l-49.343-49.343c8.566-21.154 12.624-43.7 12.269-66.193l76.302 76.302c47.067 47.068 47.067 124.089-0.002 171.158zM315.521 285.533c-3.916 3.916-8.073 7.461-12.368 10.72l-39.924-39.916c4.652-2.748 9.063-6.037 13.058-10.031l2.021-2.020c25.558-25.558 25.558-67.136 0-92.694l-109.065-109.067c-25.559-25.551-67.138-25.551-92.694 0l-2.021 2.021c-25.549 25.56-25.549 67.138 0 92.694l49.344 49.343c-8.567 21.153-12.623 43.701-12.269 66.193l-76.301-76.299c-47.068-47.066-47.068-124.089 0-171.162l2.013-2.016c47.076-47.064 124.096-47.064 171.164 0l109.055 109.059c47.067 47.066 47.067 124.097 0 171.163l-2.013 2.012z" />
19
+ <glyph unicode="&#xe609;" d="M544 416h-512c-17.6 0-32-14.4-32-32v-320c0-17.6 14.4-32 32-32h512c17.6 0 32 14.4 32 32v320c0 17.6-14.4 32-32 32zM320 352h64v-64h-64v64zM416 256v-64h-64v64h64zM224 352h64v-64h-64v64zM320 256v-64h-64v64h64zM128 352h64v-64h-64v64zM224 256v-64h-64v64h64zM64 352h32v-64h-32v64zM64 256h64v-64h-64v64zM96 96h-32v64h32v-64zM384 96h-256v64h256v-64zM512 96h-96v64h96v-64zM512 192h-64v64h64v-64zM512 288h-96v64h96v-64z" horiz-adv-x="576" />
20
+ <glyph unicode="&#xe60a;" d="M160 448h-128v-128h128v128zM192 480v0-192h-192v192h192zM64 416h64v-64h-64zM480 448h-128v-128h128v128zM512 480v0-192h-192v192h192zM384 416h64v-64h-64zM160 128h-128v-128h128v128zM192 160v0-192h-192v192h192zM64 96h64v-64h-64zM224 480h32v-32h-32zM256 448h32v-32h-32zM224 416h32v-32h-32zM256 384h32v-32h-32zM224 352h32v-32h-32zM256 320h32v-32h-32zM224 288h32v-32h-32zM224 224h32v-32h-32zM256 192h32v-32h-32zM224 160h32v-32h-32zM256 128h32v-32h-32zM224 96h32v-32h-32zM256 64h32v-32h-32zM224 32h32v-32h-32zM256 0h32v-32h-32zM480 224h32v-32h-32zM32 224h32v-32h-32zM64 256h32v-32h-32zM0 256h32v-32h-32zM128 256h32v-32h-32zM160 224h32v-32h-32zM192 256h32v-32h-32zM288 224h32v-32h-32zM320 256h32v-32h-32zM352 224h32v-32h-32zM384 256h32v-32h-32zM416 224h32v-32h-32zM448 256h32v-32h-32zM480 160h32v-32h-32zM288 160h32v-32h-32zM320 192h32v-32h-32zM352 160h32v-32h-32zM416 160h32v-32h-32zM448 192h32v-32h-32zM480 96h32v-32h-32zM288 96h32v-32h-32zM320 128h32v-32h-32zM384 128h32v-32h-32zM416 96h32v-32h-32zM448 128h32v-32h-32zM480 32h32v-32h-32zM320 64h32v-32h-32zM352 32h32v-32h-32zM384 64h32v-32h-32zM416 32h32v-32h-32zM320 0h32v-32h-32zM384 0h32v-32h-32zM448 0h32v-32h-32z" />
21
+ <glyph unicode="&#xe60b;" d="M256 384c-111.659 0-208.441-65.021-256-160 47.559-94.979 144.341-160 256-160 111.657 0 208.439 65.021 256 160-47.558 94.979-144.343 160-256 160zM382.225 299.148c30.081-19.187 55.571-44.887 74.717-75.148-19.146-30.261-44.637-55.961-74.718-75.149-37.797-24.108-81.445-36.851-126.224-36.851-44.78 0-88.428 12.743-126.225 36.852-30.080 19.186-55.57 44.886-74.717 75.148 19.146 30.262 44.637 55.962 74.717 75.148 1.959 1.25 3.938 2.461 5.929 3.65-4.979-13.664-7.704-28.411-7.704-43.798 0-70.692 57.308-128 128-128s128 57.308 128 128c0 15.387-2.725 30.134-7.704 43.799 1.99-1.189 3.969-2.401 5.929-3.651zM256 275c0-26.51-21.49-48-48-48s-48 21.49-48 48 21.49 48 48 48 48-21.49 48-48z" />
22
+ </font></defs></svg>
Binary file
@@ -0,0 +1 @@
1
+ will hold the auto-generated styleguide.html
@@ -0,0 +1,308 @@
1
+ /*!
2
+ * Annotations Support for Patterns - v0.3
3
+ *
4
+ * Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
5
+ * Licensed under the MIT license
6
+ *
7
+ */
8
+
9
+ var annotationsPattern = {
10
+
11
+ commentsOverlayActive: false,
12
+ commentsOverlay: false,
13
+ commentsEmbeddedActive: false,
14
+ commentsEmbedded: false,
15
+ commentsGathered: { "commentOverlay": "on", "comments": { } },
16
+ trackedElements: [ ],
17
+ targetOrigin: (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host,
18
+
19
+ /**
20
+ * record which annotations are related to this pattern so they can be sent to the viewer when called
21
+ */
22
+ gatherComments: function() {
23
+
24
+ // make sure this only added when we're on a pattern specific view
25
+ if (document.getElementById("sg-patterns") === null) {
26
+
27
+ var count = 0;
28
+
29
+ for (comment in comments.comments) {
30
+ var item = comments.comments[comment];
31
+ var els = document.querySelectorAll(item.el);
32
+ if (els.length > 0) {
33
+
34
+ count++;
35
+ item.displaynumber = count;
36
+
37
+ for (var i = 0; i < els.length; ++i) {
38
+ els[i].onclick = (function(item) {
39
+ return function(e) {
40
+
41
+ if (annotationsPattern.commentsOverlayActive) {
42
+
43
+ e.preventDefault();
44
+ e.stopPropagation();
45
+
46
+ // if an element was clicked on while the overlay was already on swap it
47
+ var obj = JSON.stringify({ "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment });
48
+ parent.postMessage(obj,annotationsPattern.targetOrigin);
49
+
50
+ }
51
+
52
+ }
53
+ })(item);
54
+ }
55
+ }
56
+
57
+
58
+ }
59
+
60
+ } else {
61
+
62
+ var obj = JSON.stringify({ "commentOverlay": "off" });
63
+ parent.postMessage(obj,annotationsPattern.targetOrigin);
64
+
65
+ }
66
+
67
+ },
68
+
69
+ /**
70
+ * embed a comment by building the sg-annotations div (if necessary) and building an sg-annotation div
71
+ * @param {Object} element to check the parent node of
72
+ * @param {String} the title of the comment
73
+ * @param {String} the comment HTML
74
+ */
75
+ embedComments: function (el,title,comment) {
76
+
77
+ // build the annotation div and add the content to it
78
+ var annotationDiv = document.createElement("div");
79
+ annotationDiv.classList.add("sg-annotation");
80
+
81
+ var h3 = document.createElement("h3");
82
+ var p = document.createElement("p");
83
+ h3.innerHTML = title;
84
+ p.innerHTML = comment;
85
+
86
+ annotationDiv.appendChild(h3);
87
+ annotationDiv.appendChild(p);
88
+
89
+ // find the parent element to attach things to
90
+ var parentEl = annotationsPattern.findParent(el);
91
+
92
+ // see if a child with the class annotations exists
93
+ var els = parentEl.getElementsByClassName("sg-annotations");
94
+ if (els.length > 0) {
95
+ els[0].appendChild(annotationDiv);
96
+ } else {
97
+ var annotationsDiv = document.createElement("div");
98
+ annotationsDiv.classList.add("sg-annotations");
99
+ annotationsDiv.appendChild(annotationDiv);
100
+ parentEl.appendChild(annotationsDiv);
101
+ }
102
+
103
+ },
104
+
105
+ /**
106
+ * recursively find the parent of an element to see if it contains the sg-pattern class
107
+ * @param {Object} element to check the parent node of
108
+ */
109
+ findParent: function(el) {
110
+
111
+ var parentEl;
112
+
113
+ if (el.classList.contains("sg-pattern")) {
114
+ return el;
115
+ } else if (el.parentNode.classList.contains("sg-pattern")) {
116
+ return el.parentNode;
117
+ } else {
118
+ parentEl = annotationsPattern.findParent(el.parentNode);
119
+ }
120
+
121
+ return parentEl;
122
+
123
+ },
124
+
125
+ /**
126
+ * toggle the annotation feature on/off
127
+ * based on the great MDN docs at https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage
128
+ * @param {Object} event info
129
+ */
130
+ receiveIframeMessage: function(event) {
131
+
132
+ var data = (typeof event.data !== "string") ? event.data : JSON.parse(event.data);
133
+
134
+ // does the origin sending the message match the current host? if not dev/null the request
135
+ if ((window.location.protocol != "file:") && (event.origin !== window.location.protocol+"//"+window.location.host)) {
136
+ return;
137
+ }
138
+
139
+ if ((data.resize !== undefined) && (annotationsPattern.commentsOverlayActive)) {
140
+
141
+ for (var i = 0; i < annotationsPattern.trackedElements.length; ++i) {
142
+ var el = annotationsPattern.trackedElements[i];
143
+ if (window.getComputedStyle(el.element,null).getPropertyValue("max-height") == "0px") {
144
+ el.element.firstChild.style.display = "none";
145
+ var obj = JSON.stringify({"annotationState": false, "displayNumber": el.displayNumber });
146
+ parent.postMessage(obj,annotationsPattern.targetOrigin);
147
+ } else {
148
+ el.element.firstChild.style.display = "block";
149
+ var obj = JSON.stringify({"annotationState": true, "displayNumber": el.displayNumber });
150
+ parent.postMessage(obj,annotationsPattern.targetOrigin);
151
+ }
152
+ }
153
+
154
+ } else if (data.commentToggle !== undefined) {
155
+
156
+ var i, els, item, displayNum;
157
+
158
+ // if this is an overlay make sure it's active for the onclick event
159
+ annotationsPattern.commentsOverlayActive = false;
160
+ annotationsPattern.commentsEmbeddedActive = false;
161
+
162
+ // see which flag to toggle based on if this is a styleguide or view-all page
163
+ if ((data.commentToggle === "on") && (document.getElementById("sg-patterns") !== null)) {
164
+ annotationsPattern.commentsEmbeddedActive = true;
165
+ } else if (data.commentToggle === "on") {
166
+ annotationsPattern.commentsOverlayActive = true;
167
+ }
168
+
169
+ // if comments overlay is turned off make sure to remove the has-annotation class and pointer
170
+ if (!annotationsPattern.commentsOverlayActive) {
171
+ els = document.querySelectorAll(".has-annotation");
172
+ for (i = 0; i < els.length; i++) {
173
+ els[i].classList.remove("has-annotation");
174
+ }
175
+ els = document.querySelectorAll(".annotation-tip");
176
+ for (i = 0; i < els.length; i++) {
177
+ els[i].style.display = "none";
178
+ }
179
+ }
180
+
181
+ // if comments embedding is turned off make sure to hide the annotations div
182
+ if (!annotationsPattern.commentsEmbeddedActive) {
183
+ els = document.getElementsByClassName("sg-annotations");
184
+ for (i = 0; i < els.length; i++) {
185
+ els[i].style.display = "none";
186
+ }
187
+ }
188
+
189
+ // if comments overlay is turned on add the has-annotation class and pointer
190
+ if (annotationsPattern.commentsOverlayActive) {
191
+
192
+ var count = 0;
193
+
194
+ for (i = 0; i < comments.comments.length; i++) {
195
+ item = comments.comments[i];
196
+ els = document.querySelectorAll(item.el);
197
+
198
+ var state = true;
199
+
200
+ if (els.length) {
201
+
202
+ count++;
203
+
204
+ //Loop through all items with annotations
205
+ for (k = 0; k < els.length; k++) {
206
+
207
+ els[k].classList.add("has-annotation");
208
+
209
+ var span = document.createElement("span");
210
+ span.innerHTML = count;
211
+ span.classList.add("annotation-tip");
212
+
213
+ if (window.getComputedStyle(els[k],null).getPropertyValue("max-height") == "0px") {
214
+ span.style.display = "none";
215
+ state = false;
216
+ }
217
+
218
+ annotationsPattern.trackedElements.push({ "itemel": item.el, "element": els[k], "displayNumber": count, "state": state });
219
+
220
+ els[k].insertBefore(span,els[k].firstChild);
221
+
222
+ }
223
+
224
+ }
225
+
226
+ }
227
+
228
+ // count elements so it can be used when displaying the results in the viewer
229
+ var count = 0;
230
+
231
+ // iterate over the comments in annotations.js
232
+ for(i = 0; i < comments.comments.length; i++) {
233
+
234
+ var state = true;
235
+
236
+ var item = comments.comments[i];
237
+ var els = document.querySelectorAll(item.el);
238
+
239
+ // if an element is found in the given pattern add it to the overall object so it can be passed when the overlay is turned on
240
+ if (els.length > 0) {
241
+ count++;
242
+ for (k = 0; k < els.length; k++) {
243
+ if (window.getComputedStyle(els[k],null).getPropertyValue("max-height") == "0px") {
244
+ state = false;
245
+ }
246
+ }
247
+ annotationsPattern.commentsGathered.comments[count] = { "el": item.el, "title": item.title, "comment": item.comment, "number": count, "state": state };
248
+ }
249
+
250
+ }
251
+
252
+ // send the list of annotations for the page back to the parent
253
+ var obj = JSON.stringify(annotationsPattern.commentsGathered);
254
+ parent.postMessage(obj,annotationsPattern.targetOrigin);
255
+
256
+ } else if (annotationsPattern.commentsEmbeddedActive && !annotationsPattern.commentsEmbedded) {
257
+
258
+ // if comment embedding is turned on and comments haven't been embedded yet do it
259
+ for (i = 0; i < comments.comments.length; i++) {
260
+ item = comments.comments[i];
261
+ els = document.querySelectorAll(item.el);
262
+ if (els.length > 0) {
263
+ annotationsPattern.embedComments(els[0],item.title,item.comment); //Embed the comment
264
+ }
265
+ annotationsPattern.commentsEmbedded = true;
266
+ }
267
+
268
+ } else if (annotationsPattern.commentsEmbeddedActive && annotationsPattern.commentsEmbedded) {
269
+
270
+ // if comment embedding is turned on and comments have been embedded simply display them
271
+ els = document.getElementsByClassName("sg-annotations");
272
+ for (i = 0; i < els.length; ++i) {
273
+ els[i].style.display = "block";
274
+ }
275
+
276
+ }
277
+
278
+ }
279
+
280
+ }
281
+
282
+ };
283
+
284
+ // add the onclick handlers to the elements that have an annotations
285
+ annotationsPattern.gatherComments();
286
+ window.addEventListener("message", annotationsPattern.receiveIframeMessage, false);
287
+
288
+ // before unloading the iframe make sure any active overlay is turned off/closed
289
+ window.onbeforeunload = function() {
290
+ var obj = JSON.stringify({ "commentOverlay": "off" });
291
+ parent.postMessage(obj,annotationsPattern.targetOrigin);
292
+ };
293
+
294
+ // tell the parent iframe that keys were pressed
295
+
296
+ // toggle the annotations panel
297
+ jwerty.key('ctrl+shift+a', function (e) {
298
+ var obj = JSON.stringify({ "keyPress": "ctrl+shift+a" });
299
+ parent.postMessage(obj,codePattern.targetOrigin);
300
+ return false;
301
+ });
302
+
303
+ // close the annotations panel if using escape
304
+ jwerty.key('esc', function (e) {
305
+ var obj = JSON.stringify({ "keyPress": "esc" });
306
+ parent.postMessage(obj,codePattern.targetOrigin);
307
+ return false;
308
+ });