jekyll-theme-chalk 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (405) hide show
  1. checksums.yaml +7 -0
  2. data/404.html +39 -0
  3. data/LICENSE +21 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +91 -0
  6. data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.eot +0 -0
  7. data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.ttf +0 -0
  8. data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff +0 -0
  9. data/_assets/fonts/cormorant-garamond/Cormorant-Garamond-700.woff2 +0 -0
  10. data/_assets/fonts/ionicons/ionicons.eot +0 -0
  11. data/_assets/fonts/ionicons/ionicons.ttf +0 -0
  12. data/_assets/fonts/ionicons/ionicons.woff +0 -0
  13. data/_assets/fonts/lato/Lato-300.eot +0 -0
  14. data/_assets/fonts/lato/Lato-300.ttf +0 -0
  15. data/_assets/fonts/lato/Lato-300.woff +0 -0
  16. data/_assets/fonts/lato/Lato-300.woff2 +0 -0
  17. data/_assets/fonts/lato/Lato-700.eot +0 -0
  18. data/_assets/fonts/lato/Lato-700.ttf +0 -0
  19. data/_assets/fonts/lato/Lato-700.woff +0 -0
  20. data/_assets/fonts/lato/Lato-700.woff2 +0 -0
  21. data/_assets/fonts/lato/Lato-regular.eot +0 -0
  22. data/_assets/fonts/lato/Lato-regular.ttf +0 -0
  23. data/_assets/fonts/lato/Lato-regular.woff +0 -0
  24. data/_assets/fonts/lato/Lato-regular.woff2 +0 -0
  25. data/_assets/images/about.jpg +0 -0
  26. data/_assets/images/about@2x.jpg +0 -0
  27. data/_assets/images/apple-touch-icon.png +0 -0
  28. data/_assets/images/documentation/chalk-intro.png +0 -0
  29. data/_assets/images/documentation/chalk-intro@2x.png +0 -0
  30. data/_assets/images/documentation/enlarge.gif +0 -0
  31. data/_assets/images/documentation/enlarge@2x.gif +0 -0
  32. data/_assets/images/documentation/sample-image.jpg +0 -0
  33. data/_assets/images/documentation/sample-image@2x.jpg +0 -0
  34. data/_assets/images/og-image.jpg +0 -0
  35. data/_assets/javascripts/application.js +17 -0
  36. data/_assets/javascripts/scrollappear.js +25 -0
  37. data/_assets/javascripts/vendor.js +4 -0
  38. data/_assets/javascripts/webfonts.js +7 -0
  39. data/_assets/stylesheets/.csscomb.json +196 -0
  40. data/_assets/stylesheets/.scss-lint.yml +33 -0
  41. data/_assets/stylesheets/_base.scss +151 -0
  42. data/_assets/stylesheets/_mixins.scss +28 -0
  43. data/_assets/stylesheets/_variables.scss +47 -0
  44. data/_assets/stylesheets/dark.scss +71 -0
  45. data/_assets/stylesheets/fonts.scss +63 -0
  46. data/_assets/stylesheets/layouts/_footer.scss +17 -0
  47. data/_assets/stylesheets/layouts/_grid.scss +102 -0
  48. data/_assets/stylesheets/light.scss +71 -0
  49. data/_assets/stylesheets/modules/_about.scss +10 -0
  50. data/_assets/stylesheets/modules/_articles.scss +213 -0
  51. data/_assets/stylesheets/modules/_embed.scss +31 -0
  52. data/_assets/stylesheets/modules/_header.scss +57 -0
  53. data/_assets/stylesheets/modules/_highlights-dark.scss +415 -0
  54. data/_assets/stylesheets/modules/_highlights-light.scss +409 -0
  55. data/_assets/stylesheets/modules/_icons.scss +83 -0
  56. data/_assets/stylesheets/modules/_scrollappear.scss +14 -0
  57. data/_assets/stylesheets/notfound-dark.scss +91 -0
  58. data/_assets/stylesheets/notfound-light.scss +91 -0
  59. data/_assets/stylesheets/vendor/_normalize.scss +461 -0
  60. data/_assets/yarn/.yarn-integrity +22 -0
  61. data/_assets/yarn/fluidbox/.gitattributes +22 -0
  62. data/_assets/yarn/fluidbox/.npmignore +220 -0
  63. data/_assets/yarn/fluidbox/.travis.yml +6 -0
  64. data/_assets/yarn/fluidbox/Gruntfile.js +8 -0
  65. data/_assets/yarn/fluidbox/LICENSE.md +23 -0
  66. data/_assets/yarn/fluidbox/README.html +750 -0
  67. data/_assets/yarn/fluidbox/README.md +396 -0
  68. data/_assets/yarn/fluidbox/bower.json +35 -0
  69. data/_assets/yarn/fluidbox/demo/css/styles.min.css +2 -0
  70. data/_assets/yarn/fluidbox/demo/css/styles.min.css.map +1 -0
  71. data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.eot +0 -0
  72. data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.svg +233 -0
  73. data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.ttf +0 -0
  74. data/_assets/yarn/fluidbox/demo/fonts/BLOKKRegular.woff +0 -0
  75. data/_assets/yarn/fluidbox/demo/fonts/fontello.eot +0 -0
  76. data/_assets/yarn/fluidbox/demo/fonts/fontello.svg +13 -0
  77. data/_assets/yarn/fluidbox/demo/fonts/fontello.ttf +0 -0
  78. data/_assets/yarn/fluidbox/demo/fonts/fontello.woff +0 -0
  79. data/_assets/yarn/fluidbox/demo/index.html +758 -0
  80. data/_assets/yarn/fluidbox/demo/src/css/styles.scss +1131 -0
  81. data/_assets/yarn/fluidbox/dist/css/fluidbox.min.css +2 -0
  82. data/_assets/yarn/fluidbox/dist/css/fluidbox.min.css.map +1 -0
  83. data/_assets/yarn/fluidbox/dist/js/jquery.fluidbox.min.js +1 -0
  84. data/_assets/yarn/fluidbox/grunt/aliases.yaml +20 -0
  85. data/_assets/yarn/fluidbox/grunt/clean.js +5 -0
  86. data/_assets/yarn/fluidbox/grunt/concurrent.js +33 -0
  87. data/_assets/yarn/fluidbox/grunt/jshint.js +10 -0
  88. data/_assets/yarn/fluidbox/grunt/postcss.js +47 -0
  89. data/_assets/yarn/fluidbox/grunt/sass.js +42 -0
  90. data/_assets/yarn/fluidbox/grunt/uglify.js +7 -0
  91. data/_assets/yarn/fluidbox/grunt/watch.js +28 -0
  92. data/_assets/yarn/fluidbox/index.html +8 -0
  93. data/_assets/yarn/fluidbox/license.txt +21 -0
  94. data/_assets/yarn/fluidbox/package.json +61 -0
  95. data/_assets/yarn/fluidbox/src/css/_fluidbox.scss +95 -0
  96. data/_assets/yarn/fluidbox/src/css/fluidbox.scss +2 -0
  97. data/_assets/yarn/fluidbox/src/js/jquery.fluidbox.js +722 -0
  98. data/_assets/yarn/jquery/AUTHORS.txt +301 -0
  99. data/_assets/yarn/jquery/LICENSE.txt +36 -0
  100. data/_assets/yarn/jquery/README.md +67 -0
  101. data/_assets/yarn/jquery/bower.json +14 -0
  102. data/_assets/yarn/jquery/dist/core.js +476 -0
  103. data/_assets/yarn/jquery/dist/jquery.js +10253 -0
  104. data/_assets/yarn/jquery/dist/jquery.min.js +4 -0
  105. data/_assets/yarn/jquery/dist/jquery.min.map +1 -0
  106. data/_assets/yarn/jquery/dist/jquery.slim.js +8160 -0
  107. data/_assets/yarn/jquery/dist/jquery.slim.min.js +4 -0
  108. data/_assets/yarn/jquery/dist/jquery.slim.min.map +1 -0
  109. data/_assets/yarn/jquery/external/sizzle/LICENSE.txt +36 -0
  110. data/_assets/yarn/jquery/external/sizzle/dist/sizzle.js +2272 -0
  111. data/_assets/yarn/jquery/external/sizzle/dist/sizzle.min.js +3 -0
  112. data/_assets/yarn/jquery/external/sizzle/dist/sizzle.min.map +1 -0
  113. data/_assets/yarn/jquery/package.json +97 -0
  114. data/_assets/yarn/jquery/src/.eslintrc.json +5 -0
  115. data/_assets/yarn/jquery/src/ajax.js +855 -0
  116. data/_assets/yarn/jquery/src/ajax/jsonp.js +102 -0
  117. data/_assets/yarn/jquery/src/ajax/load.js +76 -0
  118. data/_assets/yarn/jquery/src/ajax/parseXML.js +30 -0
  119. data/_assets/yarn/jquery/src/ajax/script.js +77 -0
  120. data/_assets/yarn/jquery/src/ajax/var/location.js +5 -0
  121. data/_assets/yarn/jquery/src/ajax/var/nonce.js +7 -0
  122. data/_assets/yarn/jquery/src/ajax/var/rquery.js +5 -0
  123. data/_assets/yarn/jquery/src/ajax/xhr.js +169 -0
  124. data/_assets/yarn/jquery/src/attributes.js +13 -0
  125. data/_assets/yarn/jquery/src/attributes/attr.js +141 -0
  126. data/_assets/yarn/jquery/src/attributes/classes.js +174 -0
  127. data/_assets/yarn/jquery/src/attributes/prop.js +143 -0
  128. data/_assets/yarn/jquery/src/attributes/support.js +33 -0
  129. data/_assets/yarn/jquery/src/attributes/val.js +190 -0
  130. data/_assets/yarn/jquery/src/callbacks.js +234 -0
  131. data/_assets/yarn/jquery/src/core.js +476 -0
  132. data/_assets/yarn/jquery/src/core/DOMEval.js +16 -0
  133. data/_assets/yarn/jquery/src/core/access.js +70 -0
  134. data/_assets/yarn/jquery/src/core/init.js +128 -0
  135. data/_assets/yarn/jquery/src/core/nodeName.js +13 -0
  136. data/_assets/yarn/jquery/src/core/parseHTML.js +65 -0
  137. data/_assets/yarn/jquery/src/core/ready-no-deferred.js +96 -0
  138. data/_assets/yarn/jquery/src/core/ready.js +86 -0
  139. data/_assets/yarn/jquery/src/core/readyException.js +13 -0
  140. data/_assets/yarn/jquery/src/core/stripAndCollapse.js +14 -0
  141. data/_assets/yarn/jquery/src/core/support.js +20 -0
  142. data/_assets/yarn/jquery/src/core/var/rsingleTag.js +6 -0
  143. data/_assets/yarn/jquery/src/css.js +438 -0
  144. data/_assets/yarn/jquery/src/css/addGetHookIf.js +26 -0
  145. data/_assets/yarn/jquery/src/css/adjustCSS.js +71 -0
  146. data/_assets/yarn/jquery/src/css/curCSS.js +65 -0
  147. data/_assets/yarn/jquery/src/css/hiddenVisibleSelectors.js +15 -0
  148. data/_assets/yarn/jquery/src/css/showHide.js +105 -0
  149. data/_assets/yarn/jquery/src/css/support.js +89 -0
  150. data/_assets/yarn/jquery/src/css/var/cssExpand.js +5 -0
  151. data/_assets/yarn/jquery/src/css/var/getStyles.js +17 -0
  152. data/_assets/yarn/jquery/src/css/var/isHiddenWithinTree.js +34 -0
  153. data/_assets/yarn/jquery/src/css/var/rmargin.js +5 -0
  154. data/_assets/yarn/jquery/src/css/var/rnumnonpx.js +7 -0
  155. data/_assets/yarn/jquery/src/css/var/swap.js +26 -0
  156. data/_assets/yarn/jquery/src/data.js +179 -0
  157. data/_assets/yarn/jquery/src/data/Data.js +161 -0
  158. data/_assets/yarn/jquery/src/data/var/acceptData.js +19 -0
  159. data/_assets/yarn/jquery/src/data/var/dataPriv.js +7 -0
  160. data/_assets/yarn/jquery/src/data/var/dataUser.js +7 -0
  161. data/_assets/yarn/jquery/src/deferred.js +391 -0
  162. data/_assets/yarn/jquery/src/deferred/exceptionHook.js +21 -0
  163. data/_assets/yarn/jquery/src/deprecated.js +40 -0
  164. data/_assets/yarn/jquery/src/dimensions.js +56 -0
  165. data/_assets/yarn/jquery/src/effects.js +699 -0
  166. data/_assets/yarn/jquery/src/effects/Tween.js +123 -0
  167. data/_assets/yarn/jquery/src/effects/animatedSelector.js +15 -0
  168. data/_assets/yarn/jquery/src/event.js +746 -0
  169. data/_assets/yarn/jquery/src/event/ajax.js +22 -0
  170. data/_assets/yarn/jquery/src/event/alias.js +29 -0
  171. data/_assets/yarn/jquery/src/event/focusin.js +55 -0
  172. data/_assets/yarn/jquery/src/event/support.js +11 -0
  173. data/_assets/yarn/jquery/src/event/trigger.js +185 -0
  174. data/_assets/yarn/jquery/src/exports/amd.js +26 -0
  175. data/_assets/yarn/jquery/src/exports/global.js +34 -0
  176. data/_assets/yarn/jquery/src/jquery.js +41 -0
  177. data/_assets/yarn/jquery/src/manipulation.js +488 -0
  178. data/_assets/yarn/jquery/src/manipulation/_evalUrl.js +23 -0
  179. data/_assets/yarn/jquery/src/manipulation/buildFragment.js +104 -0
  180. data/_assets/yarn/jquery/src/manipulation/getAll.js +32 -0
  181. data/_assets/yarn/jquery/src/manipulation/setGlobalEval.js +22 -0
  182. data/_assets/yarn/jquery/src/manipulation/support.js +35 -0
  183. data/_assets/yarn/jquery/src/manipulation/var/rcheckableType.js +5 -0
  184. data/_assets/yarn/jquery/src/manipulation/var/rscriptType.js +5 -0
  185. data/_assets/yarn/jquery/src/manipulation/var/rtagName.js +5 -0
  186. data/_assets/yarn/jquery/src/manipulation/wrapMap.js +29 -0
  187. data/_assets/yarn/jquery/src/offset.js +229 -0
  188. data/_assets/yarn/jquery/src/queue.js +145 -0
  189. data/_assets/yarn/jquery/src/queue/delay.js +24 -0
  190. data/_assets/yarn/jquery/src/selector-native.js +237 -0
  191. data/_assets/yarn/jquery/src/selector-sizzle.js +19 -0
  192. data/_assets/yarn/jquery/src/selector.js +3 -0
  193. data/_assets/yarn/jquery/src/serialize.js +130 -0
  194. data/_assets/yarn/jquery/src/traversing.js +191 -0
  195. data/_assets/yarn/jquery/src/traversing/findFilter.js +106 -0
  196. data/_assets/yarn/jquery/src/traversing/var/dir.js +22 -0
  197. data/_assets/yarn/jquery/src/traversing/var/rneedsContext.js +8 -0
  198. data/_assets/yarn/jquery/src/traversing/var/siblings.js +17 -0
  199. data/_assets/yarn/jquery/src/var/ObjectFunctionString.js +7 -0
  200. data/_assets/yarn/jquery/src/var/arr.js +5 -0
  201. data/_assets/yarn/jquery/src/var/class2type.js +6 -0
  202. data/_assets/yarn/jquery/src/var/concat.js +7 -0
  203. data/_assets/yarn/jquery/src/var/document.js +5 -0
  204. data/_assets/yarn/jquery/src/var/documentElement.js +7 -0
  205. data/_assets/yarn/jquery/src/var/fnToString.js +7 -0
  206. data/_assets/yarn/jquery/src/var/getProto.js +5 -0
  207. data/_assets/yarn/jquery/src/var/hasOwn.js +7 -0
  208. data/_assets/yarn/jquery/src/var/indexOf.js +7 -0
  209. data/_assets/yarn/jquery/src/var/pnum.js +5 -0
  210. data/_assets/yarn/jquery/src/var/push.js +7 -0
  211. data/_assets/yarn/jquery/src/var/rcssNum.js +9 -0
  212. data/_assets/yarn/jquery/src/var/rnothtmlwhite.js +8 -0
  213. data/_assets/yarn/jquery/src/var/slice.js +7 -0
  214. data/_assets/yarn/jquery/src/var/support.js +6 -0
  215. data/_assets/yarn/jquery/src/var/toString.js +7 -0
  216. data/_assets/yarn/jquery/src/wrap.js +77 -0
  217. data/_assets/yarn/retinajs/.babelrc +4 -0
  218. data/_assets/yarn/retinajs/.editorconfig +15 -0
  219. data/_assets/yarn/retinajs/.eslintignore +2 -0
  220. data/_assets/yarn/retinajs/.eslintrc +9 -0
  221. data/_assets/yarn/retinajs/.npmignore +7 -0
  222. data/_assets/yarn/retinajs/.travis.yml +20 -0
  223. data/_assets/yarn/retinajs/LICENSE +20 -0
  224. data/_assets/yarn/retinajs/README.md +267 -0
  225. data/_assets/yarn/retinajs/bower.json +25 -0
  226. data/_assets/yarn/retinajs/dist/_retina.sass +68 -0
  227. data/_assets/yarn/retinajs/dist/_retina.scss +102 -0
  228. data/_assets/yarn/retinajs/dist/retina.js +100 -0
  229. data/_assets/yarn/retinajs/dist/retina.js.map +1 -0
  230. data/_assets/yarn/retinajs/dist/retina.less +56 -0
  231. data/_assets/yarn/retinajs/dist/retina.min.js +2 -0
  232. data/_assets/yarn/retinajs/dist/retina.min.js.map +1 -0
  233. data/_assets/yarn/retinajs/dist/retina.styl +56 -0
  234. data/_assets/yarn/retinajs/es/_retina.sass +68 -0
  235. data/_assets/yarn/retinajs/es/_retina.scss +102 -0
  236. data/_assets/yarn/retinajs/es/retina.js +91 -0
  237. data/_assets/yarn/retinajs/es/retina.js.map +1 -0
  238. data/_assets/yarn/retinajs/es/retina.less +56 -0
  239. data/_assets/yarn/retinajs/es/retina.styl +56 -0
  240. data/_assets/yarn/retinajs/gulpfile.babel.js +154 -0
  241. data/_assets/yarn/retinajs/package.json +57 -0
  242. data/_assets/yarn/retinajs/src/_retina.sass +68 -0
  243. data/_assets/yarn/retinajs/src/_retina.scss +102 -0
  244. data/_assets/yarn/retinajs/src/retina.js +246 -0
  245. data/_assets/yarn/retinajs/src/retina.less +56 -0
  246. data/_assets/yarn/retinajs/src/retina.styl +56 -0
  247. data/_assets/yarn/retinajs/test/DOM.js +44 -0
  248. data/_assets/yarn/retinajs/test/fixtures/image.js +19 -0
  249. data/_assets/yarn/retinajs/test/fixtures/less_expected_output.css +18 -0
  250. data/_assets/yarn/retinajs/test/fixtures/scss_expected_output.css +13 -0
  251. data/_assets/yarn/retinajs/test/fixtures/test.less +10 -0
  252. data/_assets/yarn/retinajs/test/fixtures/test.scss +11 -0
  253. data/_assets/yarn/retinajs/test/fixtures/xml_http_request.js +24 -0
  254. data/_assets/yarn/retinajs/test/functional/public/google-logo.png +0 -0
  255. data/_assets/yarn/retinajs/test/functional/public/google-logo@2x.png +0 -0
  256. data/_assets/yarn/retinajs/test/functional/public/google-logo@3x.png +0 -0
  257. data/_assets/yarn/retinajs/test/functional/public/index.html +190 -0
  258. data/_assets/yarn/retinajs/test/functional/public/ipad.png +0 -0
  259. data/_assets/yarn/retinajs/test/functional/public/ipad@2x.png +0 -0
  260. data/_assets/yarn/retinajs/test/functional/public/ipad@3x.png +0 -0
  261. data/_assets/yarn/retinajs/test/functional/public/styles/_retina.sass +68 -0
  262. data/_assets/yarn/retinajs/test/functional/public/styles/_retina.scss +102 -0
  263. data/_assets/yarn/retinajs/test/functional/public/styles/less-base.less +13 -0
  264. data/_assets/yarn/retinajs/test/functional/public/styles/retina.less +56 -0
  265. data/_assets/yarn/retinajs/test/functional/public/styles/retina.less.css +73 -0
  266. data/_assets/yarn/retinajs/test/functional/public/styles/retina.sass.css +42 -0
  267. data/_assets/yarn/retinajs/test/functional/public/styles/retina.scss.css +96 -0
  268. data/_assets/yarn/retinajs/test/functional/public/styles/retina.styl +56 -0
  269. data/_assets/yarn/retinajs/test/functional/public/styles/retina.styl.css +61 -0
  270. data/_assets/yarn/retinajs/test/functional/public/styles/sass-base.sass +10 -0
  271. data/_assets/yarn/retinajs/test/functional/public/styles/scss-base.scss +13 -0
  272. data/_assets/yarn/retinajs/test/functional/public/styles/styl-base.styl +10 -0
  273. data/_assets/yarn/retinajs/test/mocha-runner.js +7 -0
  274. data/_assets/yarn/retinajs/test/retina.spec.js +14 -0
  275. data/_assets/yarn/scrollreveal/.gitattributes +10 -0
  276. data/_assets/yarn/scrollreveal/.github/CONTRIBUTING.md +9 -0
  277. data/_assets/yarn/scrollreveal/.github/ISSUE_TEMPLATE.md +11 -0
  278. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/base.css +213 -0
  279. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/index.html +158 -0
  280. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/index.html +93 -0
  281. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/package.json.html +143 -0
  282. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/constructor.js.html +311 -0
  283. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/defaults.js.html +158 -0
  284. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/animate.js.html +395 -0
  285. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/delegate.js.html +179 -0
  286. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/index.html +145 -0
  287. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/initialize.js.html +197 -0
  288. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/rinse.js.html +311 -0
  289. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/functions/style.js.html +617 -0
  290. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/index.html +119 -0
  291. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/clean.js.html +137 -0
  292. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/destroy.js.html +182 -0
  293. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/index.html +132 -0
  294. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/reveal.js.html +524 -0
  295. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/methods/sync.js.html +125 -0
  296. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/instance/noop.js.html +89 -0
  297. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/polyfills/index.html +93 -0
  298. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/polyfills/requestAnimationFrame.js.html +125 -0
  299. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/browser.js.html +272 -0
  300. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/core.js.html +434 -0
  301. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/generic.js.html +218 -0
  302. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/lib/src/utils/index.html +119 -0
  303. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/prettify.css +1 -0
  304. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/prettify.js +1 -0
  305. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/sort-arrow-sprite.png +0 -0
  306. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov-report/sorter.js +158 -0
  307. data/_assets/yarn/scrollreveal/.ignore/coverage/PhantomJS 2.1.1 (Mac OS X 0.0.0)/lcov.info +1016 -0
  308. data/_assets/yarn/scrollreveal/.ignore/coverage/server.coverage.js +11 -0
  309. data/_assets/yarn/scrollreveal/.ignore/sandbox/css/styles.css +32 -0
  310. data/_assets/yarn/scrollreveal/.ignore/sandbox/index.html +68 -0
  311. data/_assets/yarn/scrollreveal/.ignore/sandbox/js/scrollreveal.js +1271 -0
  312. data/_assets/yarn/scrollreveal/.ignore/sandbox/rollup.conf.sandbox.js +15 -0
  313. data/_assets/yarn/scrollreveal/.ignore/sandbox/server.sandbox.js +11 -0
  314. data/_assets/yarn/scrollreveal/.npmignore +8 -0
  315. data/_assets/yarn/scrollreveal/CHANGELOG.md +268 -0
  316. data/_assets/yarn/scrollreveal/LICENSE.md +12 -0
  317. data/_assets/yarn/scrollreveal/README.md +413 -0
  318. data/_assets/yarn/scrollreveal/bower.json +24 -0
  319. data/_assets/yarn/scrollreveal/dist/scrollreveal.js +860 -0
  320. data/_assets/yarn/scrollreveal/dist/scrollreveal.min.js +1 -0
  321. data/_assets/yarn/scrollreveal/gulpfile.js +33 -0
  322. data/_assets/yarn/scrollreveal/lib/gulp/gulp-clean.js +7 -0
  323. data/_assets/yarn/scrollreveal/lib/gulp/gulp-dev.js +6 -0
  324. data/_assets/yarn/scrollreveal/lib/gulp/gulp-dist-min.js +19 -0
  325. data/_assets/yarn/scrollreveal/lib/gulp/gulp-dist.js +6 -0
  326. data/_assets/yarn/scrollreveal/lib/gulp/gulp-server.js +9 -0
  327. data/_assets/yarn/scrollreveal/lib/gulp/gulp-validate-bower.js +13 -0
  328. data/_assets/yarn/scrollreveal/lib/gulp/gulp-watch.js +6 -0
  329. data/_assets/yarn/scrollreveal/src/scrollreveal.js +860 -0
  330. data/_assets/yarn/throttle-debounce-fn/.jscsrc +5 -0
  331. data/_assets/yarn/throttle-debounce-fn/.jshintrc +13 -0
  332. data/_assets/yarn/throttle-debounce-fn/.npmignore +1 -0
  333. data/_assets/yarn/throttle-debounce-fn/Gruntfile.js +76 -0
  334. data/_assets/yarn/throttle-debounce-fn/LICENSE.md +22 -0
  335. data/_assets/yarn/throttle-debounce-fn/README.md +55 -0
  336. data/_assets/yarn/throttle-debounce-fn/dist/throttle-debounce-fn.js +164 -0
  337. data/_assets/yarn/throttle-debounce-fn/dist/throttle-debounce-fn.min.js +10 -0
  338. data/_assets/yarn/throttle-debounce-fn/package.json +36 -0
  339. data/_assets/yarn/throttle-debounce-fn/src/throttle-debounce-fn.js +156 -0
  340. data/_assets/yarn/turbolinks/LICENSE +20 -0
  341. data/_assets/yarn/turbolinks/README.md +473 -0
  342. data/_assets/yarn/turbolinks/dist/turbolinks.js +6 -0
  343. data/_assets/yarn/turbolinks/src/turbolinks/BANNER.js.erb +4 -0
  344. data/_assets/yarn/turbolinks/src/turbolinks/VERSION +1 -0
  345. data/_assets/yarn/turbolinks/src/turbolinks/browser_adapter.coffee +61 -0
  346. data/_assets/yarn/turbolinks/src/turbolinks/compatibility.coffee +30 -0
  347. data/_assets/yarn/turbolinks/src/turbolinks/controller.coffee +239 -0
  348. data/_assets/yarn/turbolinks/src/turbolinks/error_renderer.coffee +21 -0
  349. data/_assets/yarn/turbolinks/src/turbolinks/head_details.coffee +51 -0
  350. data/_assets/yarn/turbolinks/src/turbolinks/helpers.coffee +57 -0
  351. data/_assets/yarn/turbolinks/src/turbolinks/history.coffee +48 -0
  352. data/_assets/yarn/turbolinks/src/turbolinks/http_request.coffee +88 -0
  353. data/_assets/yarn/turbolinks/src/turbolinks/index.coffee +18 -0
  354. data/_assets/yarn/turbolinks/src/turbolinks/location.coffee +70 -0
  355. data/_assets/yarn/turbolinks/src/turbolinks/progress_bar.coffee +83 -0
  356. data/_assets/yarn/turbolinks/src/turbolinks/renderer.coffee +27 -0
  357. data/_assets/yarn/turbolinks/src/turbolinks/scroll_manager.coffee +28 -0
  358. data/_assets/yarn/turbolinks/src/turbolinks/snapshot.coffee +47 -0
  359. data/_assets/yarn/turbolinks/src/turbolinks/snapshot_cache.coffee +43 -0
  360. data/_assets/yarn/turbolinks/src/turbolinks/snapshot_renderer.coffee +88 -0
  361. data/_assets/yarn/turbolinks/src/turbolinks/start.coffee +18 -0
  362. data/_assets/yarn/turbolinks/src/turbolinks/view.coffee +34 -0
  363. data/_assets/yarn/turbolinks/src/turbolinks/visit.coffee +162 -0
  364. data/_assets/yarn/webfontloader/CHANGELOG +419 -0
  365. data/_assets/yarn/webfontloader/LICENSE +176 -0
  366. data/_assets/yarn/webfontloader/README.md +394 -0
  367. data/_assets/yarn/webfontloader/package.json +37 -0
  368. data/_assets/yarn/webfontloader/src/closure.js +2 -0
  369. data/_assets/yarn/webfontloader/src/core/cssclassname.js +46 -0
  370. data/_assets/yarn/webfontloader/src/core/domhelper.js +405 -0
  371. data/_assets/yarn/webfontloader/src/core/eventdispatcher.js +195 -0
  372. data/_assets/yarn/webfontloader/src/core/font.js +140 -0
  373. data/_assets/yarn/webfontloader/src/core/fontmodule.js +16 -0
  374. data/_assets/yarn/webfontloader/src/core/fontmoduleloader.js +47 -0
  375. data/_assets/yarn/webfontloader/src/core/fontruler.js +60 -0
  376. data/_assets/yarn/webfontloader/src/core/fontwatcher.js +171 -0
  377. data/_assets/yarn/webfontloader/src/core/fontwatchrunner.js +249 -0
  378. data/_assets/yarn/webfontloader/src/core/initialize.js +97 -0
  379. data/_assets/yarn/webfontloader/src/core/nativefontwatchrunner.js +69 -0
  380. data/_assets/yarn/webfontloader/src/core/stylesheetwaiter.js +48 -0
  381. data/_assets/yarn/webfontloader/src/core/webfont.js +97 -0
  382. data/_assets/yarn/webfontloader/src/modules/custom.js +63 -0
  383. data/_assets/yarn/webfontloader/src/modules/fontdeck.js +66 -0
  384. data/_assets/yarn/webfontloader/src/modules/google/fontapiparser.js +181 -0
  385. data/_assets/yarn/webfontloader/src/modules/google/fontapiurlbuilder.js +77 -0
  386. data/_assets/yarn/webfontloader/src/modules/google/googlefontapi.js +54 -0
  387. data/_assets/yarn/webfontloader/src/modules/monotype.js +110 -0
  388. data/_assets/yarn/webfontloader/src/modules/typekit.js +73 -0
  389. data/_assets/yarn/webfontloader/webfontloader.js +17 -0
  390. data/_includes/footer.html +7 -0
  391. data/_includes/head.html +41 -0
  392. data/_includes/image.html +5 -0
  393. data/_includes/javascript.html +1 -0
  394. data/_includes/javascripts.html +19 -0
  395. data/_includes/navigation.html +75 -0
  396. data/_includes/stylesheet.html +1 -0
  397. data/_layouts/articles_by_tag.html +38 -0
  398. data/_layouts/default.html +16 -0
  399. data/_layouts/post.html +65 -0
  400. data/about.html +18 -0
  401. data/favicon.ico +0 -0
  402. data/feed.xml +20 -0
  403. data/index.html +49 -0
  404. data/robots.txt +5 -0
  405. metadata +596 -0
@@ -0,0 +1,20 @@
1
+ Copyright 2017 Basecamp, LLC
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,473 @@
1
+ # Turbolinks™
2
+
3
+ **Turbolinks makes navigating your web application faster.** Get the performance benefits of a single-page application without the added complexity of a client-side JavaScript framework. Use HTML to render your views on the server side and link to pages as usual. When you follow a link, Turbolinks automatically fetches the page, swaps in its `<body>`, and merges its `<head>`, all without incurring the cost of a full page load.
4
+
5
+ ![Turbolinks](https://s3.amazonaws.com/turbolinks-docs/images/turbolinks.gif)
6
+
7
+ ## Features
8
+
9
+ - **Optimizes navigation automatically.** No need to annotate links or specify which parts of the page should change.
10
+ - **No server-side cooperation necessary.** Respond with full HTML pages, not partial page fragments or JSON.
11
+ - **Respects the web.** The Back and Reload buttons work just as you’d expect. Search engine-friendly by design.
12
+ - **Supports mobile apps.** Adapters for [iOS](https://github.com/turbolinks/turbolinks-ios) and [Android](https://github.com/turbolinks/turbolinks-android) let you build hybrid applications using native navigation controls.
13
+
14
+ ## Supported Browsers
15
+
16
+ Turbolinks works in all modern desktop and mobile browsers. It depends on the [HTML5 History API](http://caniuse.com/#search=pushState) and [Window.requestAnimationFrame](http://caniuse.com/#search=requestAnimationFrame). In unsupported browsers, Turbolinks gracefully degrades to standard navigation.
17
+
18
+ ## Installation
19
+
20
+ Include [`dist/turbolinks.js`](dist/turbolinks.js) in your application’s JavaScript bundle.
21
+
22
+ Turbolinks automatically initializes itself when loaded via a standalone `<script>` tag or a traditional concatenated JavaScript bundle. If you load Turbolinks as a CommonJS or AMD module, first require the module, then call the provided `start()` function.
23
+
24
+ ### Installation Using Ruby on Rails
25
+
26
+ Your Ruby on Rails application can use the [`turbolinks` RubyGem](https://github.com/turbolinks/turbolinks-rails) to install Turbolinks. This gem contains a Rails engine which integrates seamlessly with the Rails asset pipeline.
27
+
28
+ 1. Add the `turbolinks` gem, version 5, to your Gemfile: `gem 'turbolinks', '~> 5.0.0'`
29
+ 2. Run `bundle install`.
30
+ 3. Add `//= require turbolinks` to your JavaScript manifest file (usually found at `app/assets/javascripts/application.js`).
31
+
32
+ The gem also provides server-side support for Turbolinks redirection.
33
+
34
+ ### Installation Using npm
35
+
36
+ Your application can use the [`turbolinks` npm package](https://www.npmjs.com/package/turbolinks) to install Turbolinks as a module for build tools like [webpack](http://webpack.github.io/).
37
+
38
+ 1. Add the `turbolinks` package to your application: `npm install --save turbolinks`.
39
+ 2. Require and start Turbolinks in your JavaScript bundle:
40
+
41
+ ```js
42
+ var Turbolinks = require("turbolinks")
43
+ Turbolinks.start()
44
+ ```
45
+
46
+ #### Table of Contents
47
+
48
+ [Navigating with Turbolinks](#navigating-with-turbolinks)
49
+ - [Each Navigation is a Visit](#each-navigation-is-a-visit)
50
+ - [Application Visits](#application-visits)
51
+ - [Restoration Visits](#restoration-visits)
52
+ - [Canceling Visits Before They Start](#canceling-visits-before-they-start)
53
+ - [Disabling Turbolinks on Specific Links](#disabling-turbolinks-on-specific-links)
54
+
55
+ [Building Your Turbolinks Application](#building-your-turbolinks-application)
56
+ - [Running JavaScript When a Page Loads](#running-javascript-when-a-page-loads)
57
+ - [Working with Script Elements](#working-with-script-elements)
58
+ - [Understanding Caching](#understanding-caching)
59
+ - [Preparing the Page to be Cached](#preparing-the-page-to-be-cached)
60
+ - [Detecting When a Preview is Visible](#detecting-when-a-preview-is-visible)
61
+ - [Opting Out of Caching](#opting-out-of-caching)
62
+ - [Making Transformations Idempotent](#making-transformations-idempotent)
63
+ - [Responding to Page Updates](#responding-to-page-updates)
64
+ - [Persisting Elements Across Page Loads](#persisting-elements-across-page-loads)
65
+
66
+ [Advanced Usage](#advanced-usage)
67
+ - [Displaying Progress](#displaying-progress)
68
+ - [Reloading When Assets Change](#reloading-when-assets-change)
69
+ - [Setting a Root Location](#setting-a-root-location)
70
+ - [Following Redirects](#following-redirects)
71
+ - [Redirecting After a Form Submission](#redirecting-after-a-form-submission)
72
+ - [Setting Custom HTTP Headers](#setting-custom-http-headers)
73
+
74
+ [API Reference](#api-reference)
75
+ - [Turbolinks.visit](#turbolinksvisit)
76
+ - [Turbolinks.clearCache](#turbolinksclearcache)
77
+ - [Turbolinks.supported](#turbolinkssupported)
78
+ - [Full List of Events](#full-list-of-events)
79
+
80
+ [Contributing to Turbolinks](#contributing-to-turbolinks)
81
+ - [Building From Source](#building-from-source)
82
+ - [Running Tests](#running-tests)
83
+
84
+ # Navigating with Turbolinks
85
+
86
+ Turbolinks intercepts all clicks on `<a href>` links to the same domain. When you click an eligible link, Turbolinks prevents the browser from following it. Instead, Turbolinks changes the browser’s URL using the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History), requests the new page using [`XMLHttpRequest`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest), and then renders the HTML response.
87
+
88
+ During rendering, Turbolinks replaces the current `<body>` element outright and merges the contents of the `<head>` element. The JavaScript `window` and `document` objects, and the HTML `<html>` element, persist from one rendering to the next.
89
+
90
+ ## Each Navigation is a Visit
91
+
92
+ Turbolinks models navigation as a *visit* to a *location* (URL) with an *action*.
93
+
94
+ Visits represent the entire navigation lifecycle from click to render. That includes changing browser history, issuing the network request, restoring a copy of the page from cache, rendering the final response, and updating the scroll position.
95
+
96
+ There are two types of visit: an _application visit_, which has an action of _advance_ or _replace_, and a _restoration visit_, which has an action of _restore_.
97
+
98
+ ## Application Visits
99
+
100
+ Application visits are initiated by clicking a Turbolinks-enabled link, or programmatically by calling [`Turbolinks.visit(location)`](#turbolinksvisit).
101
+
102
+ An application visit always issues a network request. When the response arrives, Turbolinks renders its HTML and completes the visit.
103
+
104
+ If possible, Turbolinks will render a preview of the page from cache immediately after the visit starts. This improves the perceived speed of frequent navigation between the same pages.
105
+
106
+ If the visit’s location includes an anchor, Turbolinks will attempt to scroll to the anchored element. Otherwise, it will scroll to the top of the page.
107
+
108
+ Application visits result in a change to the browser’s history; the visit’s _action_ determines how.
109
+
110
+ ![Advance visit action](https://s3.amazonaws.com/turbolinks-docs/images/advance.svg)
111
+
112
+ The default visit action is _advance_. During an advance visit, Turbolinks pushes a new entry onto the browser’s history stack using [`history.pushState`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState).
113
+
114
+ Applications using the Turbolinks [iOS adapter](https://github.com/turbolinks/turbolinks-ios) typically handle advance visits by pushing a new view controller onto the navigation stack. Similarly, applications using the [Android adapter](https://github.com/turbolinks/turbolinks-android) typically push a new activity onto the back stack.
115
+
116
+ ![Replace visit action](https://s3.amazonaws.com/turbolinks-docs/images/replace.svg)
117
+
118
+ You may wish to visit a location without pushing a new history entry onto the stack. The _replace_ visit action uses [`history.replaceState`](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState) to discard the topmost history entry and replace it with the new location.
119
+
120
+ To specify that following a link should trigger a replace visit, annotate the link with `data-turbolinks-action="replace"`:
121
+
122
+ ```html
123
+ <a href="/edit" data-turbolinks-action="replace">Edit</a>
124
+ ```
125
+
126
+ To programmatically visit a location with the replace action, pass the `action: "replace"` option to [`Turbolinks.visit`](#turbolinksvisit):
127
+
128
+ ```js
129
+ Turbolinks.visit("/edit", { action: "replace" })
130
+ ```
131
+
132
+ Applications using the Turbolinks [iOS adapter](https://github.com/turbolinks/turbolinks-ios) typically handle replace visits by dismissing the topmost view controller and pushing a new view controller onto the navigation stack without animation.
133
+
134
+ ## Restoration Visits
135
+
136
+ Turbolinks automatically initiates a restoration visit when you navigate with the browser’s Back or Forward buttons. Applications using the [iOS](https://github.com/turbolinks/turbolinks-ios) or [Android](https://github.com/turbolinks/turbolinks-android) adapters initiate a restoration visit when moving backward in the navigation stack.
137
+
138
+ ![Restore visit action](https://s3.amazonaws.com/turbolinks-docs/images/restore.svg)
139
+
140
+ If possible, Turbolinks will render a copy of the page from cache without making a request. Otherwise, it will retrieve a fresh copy of the page over the network. See [Understanding Caching](#understanding-caching) for more details.
141
+
142
+ Turbolinks saves the scroll position of each page before navigating away and automatically returns to this saved position on restoration visits.
143
+
144
+ Restoration visits have an action of _restore_ and Turbolinks reserves them for internal use. You should not attempt to annotate links or invoke [`Turbolinks.visit`](#turbolinksvisit) with an action of `restore`.
145
+
146
+ ## Canceling Visits Before They Start
147
+
148
+ Application visits can be canceled before they start, regardless of whether they were initiated by a link click or a call to [`Turbolinks.visit`](#turbolinksvisit).
149
+
150
+ Listen for the `turbolinks:before-visit` event to be notified when a visit is about to start, and use `event.data.url` (or `$event.originalEvent.data.url`, when using jQuery) to check the visit’s location. Then cancel the visit by calling `event.preventDefault()`.
151
+
152
+ Restoration visits cannot be canceled and do not fire `turbolinks:before-visit`. Turbolinks issues restoration visits in response to history navigation that has *already taken place*, typically via the browser’s Back or Forward buttons.
153
+
154
+ ## Disabling Turbolinks on Specific Links
155
+
156
+ Turbolinks can be disabled on a per-link basis by annotating a link or any of its ancestors with `data-turbolinks="false"`.
157
+
158
+ ```html
159
+ <a href="/" data-turbolinks="false">Disabled</a>
160
+
161
+ <div data-turbolinks="false">
162
+ <a href="/">Disabled</a>
163
+ </div>
164
+ ```
165
+
166
+ To reenable when an ancestor has opted out, use `data-turbolinks="true"`:
167
+
168
+ ```html
169
+ <div data-turbolinks="false">
170
+ <a href="/" data-turbolinks="true">Enabled</a>
171
+ </div>
172
+ ```
173
+
174
+ Links with Turbolinks disabled will be handled normally by the browser.
175
+
176
+ # Building Your Turbolinks Application
177
+
178
+ Turbolinks is fast because it doesn’t reload the page when you follow a link. Instead, your application becomes a persistent, long-running process in the browser. This requires you to rethink the way you structure your JavaScript.
179
+
180
+ In particular, you can no longer depend on a full page load to reset your environment every time you navigate. The JavaScript `window` and `document` objects retain their state across page changes, and any other objects you leave in memory will stay in memory.
181
+
182
+ With awareness and a little extra care, you can design your application to gracefully handle this constraint without tightly coupling it to Turbolinks.
183
+
184
+ ## Running JavaScript When a Page Loads
185
+
186
+ You may be used to installing JavaScript behavior in response to the `window.onload`, `DOMContentLoaded`, or jQuery `ready` events. With Turbolinks, these events will fire only in response to the initial page load—not after any subsequent page changes.
187
+
188
+ In many cases, you can simply adjust your code to listen for the `turbolinks:load` event, which fires once on the initial page load and again after every Turbolinks visit.
189
+
190
+ ```js
191
+ document.addEventListener("turbolinks:load", function() {
192
+ // ...
193
+ })
194
+ ```
195
+
196
+ When possible, avoid using the `turbolinks:load` event to add event listeners directly to elements on the page body. Instead, consider using [event delegation](https://learn.jquery.com/events/event-delegation/) to register event listeners once on `document` or `window`.
197
+
198
+ ## Working with Script Elements
199
+
200
+ Your browser automatically loads and evaluates any `<script>` elements present on the initial page load.
201
+
202
+ When you navigate to a new page, Turbolinks looks for any `<script>` elements in the new page’s `<head>` that aren’t present on the current page. Then it appends them to the current `<head>` where they’re loaded and evaluated by the browser. You can use this to load additional JavaScript files on-demand.
203
+
204
+ Turbolinks evaluates `<script>` elements in a page’s `<body>` each time it renders the page. You can use inline body scripts to set up per-page JavaScript state or bootstrap client-side models. To install behavior, or to perform more complex operations when the page changes, avoid script elements and use the `turbolinks:load` event instead.
205
+
206
+ Annotate `<script>` elements with `data-turbolinks-eval="false"` if you do not want Turbolinks to evaluate them after rendering. Note that this annotation will not prevent your browser from evaluating scripts on the initial page load.
207
+
208
+ ## Understanding Caching
209
+
210
+ Turbolinks maintains a cache of recently visited pages. This cache serves two purposes: to display pages without accessing the network during restoration visits, and to improve perceived performance by showing temporary previews during application visits.
211
+
212
+ When navigating by history (via [Restoration Visits](#restoration-visits)), Turbolinks will restore the page from cache without loading a fresh copy from the network, if possible.
213
+
214
+ Otherwise, during standard navigation (via [Application Visits](#application-visits)), Turbolinks will immediately restore the page from cache and display it as a preview while simultaneously loading a fresh copy from the network. This gives the illusion of instantaneous page loads for frequently accessed locations.
215
+
216
+ Turbolinks saves a copy of the current page to its cache just before rendering a new page. Note that Turbolinks copies the page using [`cloneNode(true)`](https://developer.mozilla.org/en-US/docs/Web/API/Node/cloneNode), which means any attached event listeners and associated data are discarded.
217
+
218
+ ### Preparing the Page to be Cached
219
+
220
+ Listen for the `turbolinks:before-cache` event if you need to prepare the document before Turbolinks caches it. You can use this event to reset forms, collapse expanded UI elements, or tear down any third-party widgets so the page is ready to be displayed again.
221
+
222
+ ```js
223
+ document.addEventListener("turbolinks:before-cache", function() {
224
+ // ...
225
+ })
226
+ ```
227
+
228
+ ### Detecting When a Preview is Visible
229
+
230
+ Turbolinks adds a `data-turbolinks-preview` attribute to the `<html>` element when it displays a preview from cache. You can check for the presence of this attribute to selectively enable or disable behavior when a preview is visible.
231
+
232
+ ```js
233
+ if (document.documentElement.hasAttribute("data-turbolinks-preview")) {
234
+ // Turbolinks is displaying a preview
235
+ }
236
+ ```
237
+
238
+ ### Opting Out of Caching
239
+
240
+ You can control caching behavior on a per-page basis by including a `<meta name="turbolinks-cache-control">` element in your page’s `<head>` and declaring a caching directive.
241
+
242
+ Use the `no-preview` directive to specify that a cached version of the page should not be shown as a preview during an application visit. Pages marked no-preview will only be used for restoration visits.
243
+
244
+ To specify that a page should not be cached at all, use the `no-cache` directive. Pages marked no-cache will always be fetched over the network, including during restoration visits.
245
+
246
+ ```html
247
+ <head>
248
+ ...
249
+ <meta name="turbolinks-cache-control" content="no-cache">
250
+ </head>
251
+ ```
252
+
253
+ To completely disable caching in your application, ensure every page contains a no-cache directive.
254
+
255
+ ## Making Transformations Idempotent
256
+
257
+ Often you’ll want to perform client-side transformations to HTML received from the server. For example, you might want to use the browser’s knowledge of the user’s current time zone to group a collection of elements by date.
258
+
259
+ Suppose you have annotated a set of elements with `data-timestamp` attributes indicating the elements’ creation times in UTC. You have a JavaScript function that queries the document for all such elements, converts the timestamps to local time, and inserts date headers before each element that occurs on a new day.
260
+
261
+ Consider what happens if you’ve configured this function to run on `turbolinks:load`. When you navigate to the page, your function inserts date headers. Navigate away, and Turbolinks saves a copy of the transformed page to its cache. Now press the Back button—Turbolinks restores the page, fires `turbolinks:load` again, and your function inserts a second set of date headers.
262
+
263
+ To avoid this problem, make your transformation function _idempotent_. An idempotent transformation is safe to apply multiple times without changing the result beyond its initial application.
264
+
265
+ One technique for making a transformation idempotent is to keep track of whether you’ve already performed it by setting a `data` attribute on each processed element. When Turbolinks restores your page from cache, these attributes will still be present. Detect these attributes in your transformation function to determine which elements have already been processed.
266
+
267
+ A more robust technique is simply to detect the transformation itself. In the date grouping example above, that means checking for the presence of a date divider before inserting a new one. This approach gracefully handles newly inserted elements that weren’t processed by the original transformation.
268
+
269
+ ## Responding to Page Updates
270
+
271
+ Turbolinks may not be the only source of page updates in your application. New HTML can appear at any time from Ajax requests, WebSocket connections, or other client-side rendering operations, and this content will need to be initialized as if it came from a fresh page load.
272
+
273
+ You can handle all of these updates, including updates from Turbolinks page loads, in a single place with the precise lifecycle callbacks provided by [`MutationObserver`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) and [Custom Elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Custom_Elements).
274
+
275
+ In particular, these APIs give you callbacks when elements are attached to and removed from the document. You can use these callbacks to perform transformations and register or tear down behavior as soon as matching elements appear on the page, regardless of how they were added.
276
+
277
+ By taking advantage of `MutationObserver`, Custom Elements, and [idempotent transformations](#making-transformations-idempotent), there’s little need to couple your application to Turbolinks’ events.
278
+
279
+ ## Persisting Elements Across Page Loads
280
+
281
+ Turbolinks allows you to mark certain elements as _permanent_. Permanent elements persist across page loads, so that any changes you make to those elements do not need to be reapplied after navigation.
282
+
283
+ Consider a Turbolinks application with a shopping cart. At the top of each page is an icon with the number of items currently in the cart. This counter is updated dynamically with JavaScript as items are added and removed.
284
+
285
+ Now imagine a user who has navigated to several pages in this application. She adds an item to her cart, then presses the Back button in her browser. Upon navigation, Turbolinks restores the previous page’s state from cache, and the cart item count erroneously changes from 1 to 0.
286
+
287
+ You can avoid this problem by marking the counter element as permanent. Designate permanent elements by giving them an HTML `id` and annotating them with `data-turbolinks-permanent`.
288
+
289
+ ```html
290
+ <div id="cart-counter" data-turbolinks-permanent>1 item</div>
291
+ ```
292
+
293
+ Before each render, Turbolinks matches all permanent elements by `id` and transfers them from the original page to the new page, preserving their data and event listeners.
294
+
295
+ # Advanced Usage
296
+
297
+ ## Displaying Progress
298
+
299
+ During Turbolinks navigation, the browser will not display its native progress indicator. Turbolinks installs a CSS-based progress bar to provide feedback while issuing a request.
300
+
301
+ The progress bar is enabled by default. It appears automatically for any page that takes longer than 500ms to load.
302
+
303
+ The progress bar is a `<div>` element with the class name `turbolinks-progress-bar`. Its default styles appear first in the document and can be overridden by rules that come later.
304
+
305
+ For example, the following CSS will result in a thick green progress bar:
306
+
307
+ ```css
308
+ .turbolinks-progress-bar {
309
+ height: 5px;
310
+ background-color: green;
311
+ }
312
+ ```
313
+
314
+ To disable the progress bar entirely, set its `visibility` style to `hidden`:
315
+
316
+ ```css
317
+ .turbolinks-progress-bar {
318
+ visibility: hidden;
319
+ }
320
+ ```
321
+
322
+ ## Reloading When Assets Change
323
+
324
+ Turbolinks can track the URLs of asset elements in `<head>` from one page to the next, and automatically issue a full reload if they change. This ensures that users always have the latest versions of your application’s scripts and styles.
325
+
326
+ Annotate asset elements with `data-turbolinks-track="reload"` and include a version identifier in your asset URLs. The identifier could be a number, a last-modified timestamp, or better, a digest of the asset’s contents, as in the following example.
327
+
328
+ ```html
329
+ <head>
330
+ ...
331
+ <link rel="stylesheet" href="/application-258e88d.css" data-turbolinks-track="reload">
332
+ <script src="/application-cbd3cd4.js" data-turbolinks-track="reload"></script>
333
+ </head>
334
+ ```
335
+
336
+ You can use asset tracking with any HTML element, such as `<link>`, `<script>`, or even `<meta>`. An element annotated with `data-turbolinks-track="reload"` will trigger a full reload if it changes in any way, e.g. if its attributes are not identical, or if the element is present on one page but not on the next.
337
+
338
+ Note that Turbolinks will only consider tracked assets in `<head>` and not elsewhere on the page.
339
+
340
+ ## Setting a Root Location
341
+
342
+ By default, Turbolinks only loads URLs with the same origin—i.e. the same protocol, domain name, and port—as the current document. A visit to any other URL falls back to a full page load.
343
+
344
+ In some cases, you may want to further scope Turbolinks to a path on the same origin. For example, if your Turbolinks application lives at `/app`, and the non-Turbolinks help site lives at `/help`, links from the app to the help site shouldn’t use Turbolinks.
345
+
346
+ Include a `<meta name="turbolinks-root">` element in your pages’ `<head>` to scope Turbolinks to a particular root location. Turbolinks will only load same-origin URLs that are prefixed with this path.
347
+
348
+ ```html
349
+ <head>
350
+ ...
351
+ <meta name="turbolinks-root" content="/app">
352
+ </head>
353
+ ```
354
+
355
+ ## Following Redirects
356
+
357
+ When you visit location `/one` and the server redirects you to location `/two`, you expect the browser’s address bar to display the redirected URL.
358
+
359
+ However, Turbolinks makes requests using `XMLHttpRequest`, which transparently follows redirects. There’s no way for Turbolinks to tell whether a request resulted in a redirect without additional cooperation from the server.
360
+
361
+ To work around this problem, send the `Turbolinks-Location` header in response to a visit that was redirected, and Turbolinks will replace the browser’s topmost history entry with the value you provide.
362
+
363
+ The Turbolinks Rails engine sets `Turbolinks-Location` automatically when using `redirect_to` in response to a Turbolinks visit.
364
+
365
+ ## Redirecting After a Form Submission
366
+
367
+ Submitting an HTML form to the server and redirecting in response is a common pattern in web applications. Standard form submission is similar to navigation, resulting in a full page load. Using Turbolinks you can improve the performance of form submission without complicating your server-side code.
368
+
369
+ Instead of submitting forms normally, submit them with XHR. In response to an XHR submit on the server, return JavaScript that performs a [`Turbolinks.visit`](#turbolinksvisit) to be evaluated by the browser.
370
+
371
+ If form submission results in a state change on the server that affects cached pages, consider clearing Turbolinks’ cache with [`Turbolinks.clearCache()`](#turbolinksclearcache).
372
+
373
+ The Turbolinks Rails engine performs this optimization automatically for non-GET XHR requests that redirect with the `redirect_to` helper.
374
+
375
+ ## Setting Custom HTTP Headers
376
+
377
+ You can observe the `turbolinks:request-start` event to set custom headers on Turbolinks requests. Access the request’s XMLHttpRequest object via `event.data.xhr`, then call the [`setRequestHeader`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) method as many times as you wish.
378
+
379
+ For example, you might want to include a request ID with every Turbolinks link click and programmatic visit.
380
+
381
+ ```javascript
382
+ document.addEventListener("turbolinks:request-start", function(event) {
383
+ var xhr = event.data.xhr
384
+ xhr.setRequestHeader("X-Request-Id", "123...")
385
+ })
386
+ ```
387
+
388
+ # API Reference
389
+
390
+ ## Turbolinks.visit
391
+
392
+ Usage:
393
+ ```js
394
+ Turbolinks.visit(location)
395
+ Turbolinks.visit(location, { action: action })
396
+ ```
397
+
398
+ Performs an [Application Visit](#application-visits) to the given _location_ (a string containing a URL or path) with the specified _action_ (a string, either `"advance"` or `"replace"`).
399
+
400
+ If _location_ is a cross-origin URL, or falls outside of the specified root (see [Setting a Root Location](#setting-a-root-location)), or if the value of [`Turbolinks.supported`](#turbolinkssupported) is `false`, Turbolinks performs a full page load by setting `window.location`.
401
+
402
+ If _action_ is unspecified, Turbolinks assumes a value of `"advance"`.
403
+
404
+ Before performing the visit, Turbolinks fires a `turbolinks:before-visit` event on `document`. Your application can listen for this event and cancel the visit with `event.preventDefault()` (see [Canceling Visits Before They Start](#canceling-visits-before-they-start)).
405
+
406
+ ## Turbolinks.clearCache
407
+
408
+ Usage:
409
+ ```js
410
+ Turbolinks.clearCache()
411
+ ```
412
+
413
+ Removes all entries from the Turbolinks page cache. Call this when state has changed on the server that may affect cached pages.
414
+
415
+ ## Turbolinks.supported
416
+
417
+ Usage:
418
+ ```js
419
+ if (Turbolinks.supported) {
420
+ // ...
421
+ }
422
+ ```
423
+
424
+ Detects whether Turbolinks is supported in the current browser (see [Supported Browsers](#supported-browsers)).
425
+
426
+ ## Full List of Events
427
+
428
+ Turbolinks emits events that allow you to track the navigation lifecycle and respond to page loading. Except where noted, Turbolinks fires events on the `document` object.
429
+
430
+ * `turbolinks:click` fires when you click a Turbolinks-enabled link. The clicked element is the event target. Access the requested location with `event.data.url`. Cancel this event to let the click fall through to the browser as normal navigation.
431
+
432
+ * `turbolinks:before-visit` fires before visiting a location, except when navigating by history. Access the requested location with `event.data.url`. Cancel this event to prevent navigation.
433
+
434
+ * `turbolinks:visit` fires immediately after a visit starts.
435
+
436
+ * `turbolinks:request-start` fires before Turbolinks issues a network request to fetch the page. Access the XMLHttpRequest object with `event.data.xhr`.
437
+
438
+ * `turbolinks:request-end` fires after the network request completes. Access the XMLHttpRequest object with `event.data.xhr`.
439
+
440
+ * `turbolinks:before-cache` fires before Turbolinks saves the current page to cache.
441
+
442
+ * `turbolinks:before-render` fires before rendering the page. Access the new `<body>` element with `event.data.newBody`.
443
+
444
+ * `turbolinks:render` fires after Turbolinks renders the page. This event fires twice during an application visit to a cached location: once after rendering the cached version, and again after rendering the fresh version.
445
+
446
+ * `turbolinks:load` fires once after the initial page load, and again after every Turbolinks visit. Access visit timing metrics with the `event.data.timing` object.
447
+
448
+ # Contributing to Turbolinks
449
+
450
+ Turbolinks is open-source software, freely distributable under the terms of an [MIT-style license](LICENSE). The [source code is hosted on GitHub](https://github.com/turbolinks/turbolinks).
451
+ Development is sponsored by [Basecamp](https://basecamp.com/).
452
+
453
+ We welcome contributions in the form of bug reports, pull requests, or thoughtful discussions in the [GitHub issue tracker](https://github.com/turbolinks/turbolinks/issues).
454
+
455
+ Please note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.
456
+
457
+ ## Building From Source
458
+
459
+ Turbolinks is written in [CoffeeScript](https://github.com/jashkenas/coffee-script) and compiled to JavaScript with [Blade](https://github.com/javan/blade). To build from source you’ll need a recent version of Ruby. From the root of your Turbolinks directory, issue the following commands to build the distributable files in `dist/`:
460
+
461
+ ```
462
+ $ gem install bundler
463
+ $ bundle install
464
+ $ bin/blade build
465
+ ```
466
+
467
+ ## Running Tests
468
+
469
+ Follow the instructions for _Building From Source_ above. Then run `bin/blade runner` and visit the displayed URL in your browser. The Turbolinks test suite will start automatically.
470
+
471
+ ---
472
+
473
+ © 2017 Basecamp, LLC