jekyll-theme-hydejack 7.5.2 → 8.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +1 -4
  3. data/README.md +139 -86
  4. data/_includes/body/analytics.html +36 -0
  5. data/_includes/{comments.html → body/comments.html} +0 -0
  6. data/_includes/{footer.html → body/footer.html} +4 -2
  7. data/_includes/body/index.html +22 -0
  8. data/_includes/body/main.html +18 -0
  9. data/_includes/{menu.html → body/menu.html} +1 -0
  10. data/_includes/{nav.html → body/nav.html} +0 -0
  11. data/_includes/body/scripts.html +22 -0
  12. data/_includes/{sidebar.html → body/sidebar.html} +19 -6
  13. data/_includes/{about.html → components/about.html} +1 -1
  14. data/_includes/{author.html → components/author.html} +3 -3
  15. data/_includes/{avatar-tag.html → components/avatar-tag.html} +0 -0
  16. data/_includes/{srcset-img.html → components/hy-img.html} +24 -8
  17. data/_includes/{link.html → components/link.html} +0 -0
  18. data/_includes/{message.html → components/message.html} +0 -0
  19. data/_includes/{pagination.html → components/pagination.html} +2 -2
  20. data/_includes/{post-list-item.html → components/post-list-item.html} +0 -0
  21. data/_includes/{post.html → components/post.html} +21 -10
  22. data/_includes/{related-posts.html → components/related-posts.html} +1 -1
  23. data/_includes/components/social-list-item.html +40 -0
  24. data/_includes/components/social.html +23 -0
  25. data/_includes/{tag-list.html → components/tag-list.html} +0 -0
  26. data/_includes/head/index.html +9 -0
  27. data/_includes/head/links.html +7 -5
  28. data/_includes/head/meta.html +3 -3
  29. data/_includes/{page-style.html → head/page-style.html} +1 -1
  30. data/_includes/head/scripts.html +10 -39
  31. data/_includes/head/styles.html +42 -15
  32. data/_includes/header.txt +1 -1
  33. data/_includes/my-body.html +42 -0
  34. data/_includes/my-scripts.html +55 -0
  35. data/_includes/scripts/load-js.js +60 -0
  36. data/_includes/scripts/load-js.min.js +1 -0
  37. data/_includes/{smart-url → smart-url.txt} +0 -0
  38. data/_includes/styles/inline.scss +15 -19
  39. data/_includes/styles/style.scss +20 -17
  40. data/_includes/templates/animation.html +1 -1
  41. data/_includes/templates/back.html +1 -1
  42. data/_includes/templates/cookies-banner.html +1 -1
  43. data/_includes/templates/error.html +1 -1
  44. data/_includes/{templates.html → templates/index.html} +1 -2
  45. data/_includes/templates/loading.html +1 -1
  46. data/_includes/templates/permalink.html +1 -1
  47. data/_layouts/about.html +29 -30
  48. data/_layouts/base.html +20 -62
  49. data/_layouts/blog.html +20 -22
  50. data/_layouts/compress.html +1 -1
  51. data/_layouts/default.html +13 -18
  52. data/_layouts/home.html +11 -16
  53. data/_layouts/list.html +13 -18
  54. data/_layouts/not-found.html +11 -16
  55. data/_layouts/page.html +12 -17
  56. data/_layouts/post.html +15 -20
  57. data/_layouts/redirect.html +11 -16
  58. data/_sass/_mixins.scss +10 -15
  59. data/_sass/_spinner.scss +10 -15
  60. data/_sass/_variables.scss +35 -19
  61. data/_sass/hydejack/__inline/_avatar.scss +33 -32
  62. data/_sass/hydejack/__inline/_base.scss +30 -68
  63. data/_sass/hydejack/__inline/_break-layout.scss +19 -26
  64. data/_sass/hydejack/__inline/_content.scss +29 -34
  65. data/_sass/hydejack/__inline/_footer.scss +19 -26
  66. data/_sass/hydejack/__inline/_images.scss +38 -0
  67. data/_sass/hydejack/__inline/_katex.scss +19 -26
  68. data/_sass/hydejack/__inline/_links.scss +45 -0
  69. data/_sass/hydejack/__inline/_mark-external.scss +19 -26
  70. data/_sass/hydejack/__inline/_menu.scss +28 -35
  71. data/_sass/hydejack/__inline/_sidebar.scss +76 -76
  72. data/_sass/hydejack/__inline/_social.scss +25 -31
  73. data/_sass/hydejack/__inline/_utilities.scss +42 -0
  74. data/_sass/hydejack/__link/_avatar.scss +29 -28
  75. data/_sass/hydejack/__link/_base.scss +19 -83
  76. data/_sass/hydejack/__link/_break-layout.scss +35 -34
  77. data/_sass/hydejack/__link/_content.scss +19 -26
  78. data/_sass/hydejack/__link/_footer.scss +19 -26
  79. data/_sass/hydejack/__link/_images.scss +84 -0
  80. data/_sass/hydejack/__link/_katex.scss +19 -26
  81. data/_sass/hydejack/__link/_links.scss +53 -0
  82. data/_sass/hydejack/__link/_mark-external.scss +19 -26
  83. data/_sass/hydejack/__link/_menu.scss +29 -50
  84. data/_sass/hydejack/__link/_sidebar.scss +71 -118
  85. data/_sass/hydejack/__link/_social.scss +19 -26
  86. data/_sass/hydejack/__link/_utilities.scss +51 -0
  87. data/_sass/hydejack/_avatar.pre.scss +26 -20
  88. data/_sass/hydejack/_base.pre.scss +22 -88
  89. data/_sass/hydejack/_break-layout.pre.scss +26 -23
  90. data/_sass/hydejack/_content.pre.scss +20 -23
  91. data/_sass/hydejack/_footer.pre.scss +10 -15
  92. data/_sass/hydejack/_images.pre.scss +77 -0
  93. data/_sass/hydejack/_katex.pre.scss +10 -15
  94. data/_sass/hydejack/_links.pre.scss +47 -0
  95. data/_sass/hydejack/_mark-external.pre.scss +10 -15
  96. data/_sass/hydejack/_menu.pre.scss +31 -38
  97. data/_sass/hydejack/_sidebar.pre.scss +98 -116
  98. data/_sass/hydejack/_social.pre.scss +16 -20
  99. data/_sass/hydejack/_utilities.pre.scss +43 -0
  100. data/_sass/my-variables.scss +0 -8
  101. data/_sass/pooleparty/__inline/_base.scss +19 -28
  102. data/_sass/pooleparty/__inline/_code.scss +19 -26
  103. data/_sass/pooleparty/__inline/_footer.scss +19 -26
  104. data/_sass/pooleparty/__inline/_footnotes.scss +19 -26
  105. data/_sass/pooleparty/__inline/_message.scss +19 -26
  106. data/_sass/pooleparty/__inline/_pagination.scss +19 -26
  107. data/_sass/pooleparty/__inline/_posts.scss +19 -26
  108. data/_sass/pooleparty/__inline/_read-more.scss +25 -0
  109. data/_sass/pooleparty/__inline/_related.scss +19 -26
  110. data/_sass/pooleparty/__inline/_table.scss +19 -26
  111. data/_sass/pooleparty/__inline/_type.scss +25 -39
  112. data/_sass/pooleparty/__link/_base.scss +19 -26
  113. data/_sass/pooleparty/__link/_code.scss +19 -26
  114. data/_sass/pooleparty/__link/_footer.scss +19 -26
  115. data/_sass/pooleparty/__link/_footnotes.scss +30 -26
  116. data/_sass/pooleparty/__link/_message.scss +19 -26
  117. data/_sass/pooleparty/__link/_pagination.scss +19 -26
  118. data/_sass/pooleparty/__link/_posts.scss +20 -27
  119. data/_sass/pooleparty/__link/_read-more.scss +45 -0
  120. data/_sass/pooleparty/__link/_related.scss +19 -26
  121. data/_sass/pooleparty/__link/_table.scss +19 -26
  122. data/_sass/pooleparty/__link/_type.scss +27 -48
  123. data/_sass/pooleparty/_base.pre.scss +10 -17
  124. data/_sass/pooleparty/_code.pre.scss +10 -15
  125. data/_sass/pooleparty/_footer.pre.scss +10 -15
  126. data/_sass/pooleparty/_footnotes.pre.scss +21 -15
  127. data/_sass/pooleparty/_message.pre.scss +10 -15
  128. data/_sass/pooleparty/_pagination.pre.scss +10 -15
  129. data/_sass/pooleparty/_posts.pre.scss +11 -16
  130. data/_sass/pooleparty/_read-more.pre.scss +36 -0
  131. data/_sass/pooleparty/_related.pre.scss +10 -15
  132. data/_sass/pooleparty/_table.pre.scss +10 -15
  133. data/_sass/pooleparty/_type.pre.scss +24 -50
  134. data/assets/Resume.pdf +0 -0
  135. data/assets/bower.json +3 -3
  136. data/assets/bower_components/fontfaceobserver/.bower.json +33 -0
  137. data/assets/bower_components/fontfaceobserver/.gitignore +2 -0
  138. data/assets/bower_components/fontfaceobserver/.travis.yml +16 -0
  139. data/assets/bower_components/fontfaceobserver/Gruntfile.js +101 -0
  140. data/assets/bower_components/fontfaceobserver/LICENSE +23 -0
  141. data/assets/bower_components/fontfaceobserver/bower.json +22 -0
  142. data/assets/bower_components/fontfaceobserver/exports.js +8 -0
  143. data/assets/bower_components/fontfaceobserver/externs-commonjs.js +10 -0
  144. data/assets/bower_components/fontfaceobserver/externs.js +15 -0
  145. data/assets/bower_components/fontfaceobserver/fontfaceobserver.js +12 -0
  146. data/assets/bower_components/fontfaceobserver/fontfaceobserver.standalone.js +8 -0
  147. data/assets/bower_components/fontfaceobserver/package.json +57 -0
  148. data/assets/bower_components/fontfaceobserver/src/descriptors.js +10 -0
  149. data/assets/bower_components/fontfaceobserver/src/observer.js +349 -0
  150. data/assets/bower_components/fontfaceobserver/src/ruler.js +130 -0
  151. data/assets/bower_components/fontfaceobserver/test/assets/index.html +8 -0
  152. data/assets/bower_components/fontfaceobserver/test/assets/late.css +1 -0
  153. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.eot +0 -0
  154. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.ttf +0 -0
  155. data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.woff +0 -0
  156. data/assets/bower_components/fontfaceobserver/test/assets/subset.eot +0 -0
  157. data/assets/bower_components/fontfaceobserver/test/assets/subset.ttf +0 -0
  158. data/assets/bower_components/fontfaceobserver/test/assets/subset.woff +0 -0
  159. data/assets/bower_components/fontfaceobserver/test/deps.js +5 -0
  160. data/assets/bower_components/fontfaceobserver/test/index.html +97 -0
  161. data/assets/bower_components/fontfaceobserver/test/observer-test.js +465 -0
  162. data/assets/bower_components/fontfaceobserver/test/ruler-test.js +112 -0
  163. data/assets/bower_components/fontfaceobserver/vendor/google/base.js +1489 -0
  164. data/assets/bower_components/katex/.bower.json +7 -6
  165. data/assets/bower_components/katex/dist/contrib/auto-render.js +790 -0
  166. data/assets/bower_components/katex/dist/contrib/auto-render.min.js +1 -1
  167. data/assets/bower_components/katex/dist/contrib/copy-tex.css +12 -0
  168. data/assets/bower_components/katex/dist/contrib/copy-tex.js +174 -0
  169. data/assets/bower_components/katex/dist/contrib/copy-tex.min.css +1 -0
  170. data/assets/bower_components/katex/dist/contrib/copy-tex.min.js +1 -0
  171. data/assets/bower_components/katex/dist/contrib/mathtex-script-type.js +113 -0
  172. data/assets/bower_components/katex/dist/contrib/mathtex-script-type.min.js +1 -0
  173. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
  174. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
  175. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  176. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  177. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  178. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  179. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  180. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  181. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  182. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  183. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  184. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  185. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  186. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  187. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  188. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
  189. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff +0 -0
  190. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
  191. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  192. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  193. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  194. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
  195. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff +0 -0
  196. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
  197. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
  198. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff +0 -0
  199. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
  200. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
  201. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff +0 -0
  202. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
  203. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  204. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  205. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  206. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  207. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  208. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  209. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  210. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  211. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  212. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
  213. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff +0 -0
  214. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
  215. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
  216. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
  217. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  218. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
  219. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
  220. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  221. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
  222. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
  223. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  224. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
  225. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
  226. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  227. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  228. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  229. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  230. data/assets/bower_components/katex/dist/katex.css +129 -209
  231. data/assets/bower_components/katex/dist/katex.js +14381 -9023
  232. data/assets/bower_components/katex/dist/katex.min.css +1 -1
  233. data/assets/bower_components/katex/dist/katex.min.js +1 -6
  234. data/assets/bower_components/katex/flow-typed/match-at.js +3 -0
  235. data/assets/bower_components/katex/flow-typed/object-assign.js +6 -0
  236. data/assets/bower_components/katex/package-lock.json +13848 -0
  237. data/assets/css/hydejack-8.0.0.css +3 -0
  238. data/assets/img/default-1.jpg +0 -0
  239. data/assets/img/example-content-ii.jpg +0 -0
  240. data/assets/img/example-content-iii.jpg +0 -0
  241. data/assets/img/hydejack-8.jpg +0 -0
  242. data/assets/img/hydejack-8@0,25x.jpg +0 -0
  243. data/assets/img/hydejack-8@0,5x.jpg +0 -0
  244. data/assets/img/projects/hy-drawer.svg +12 -0
  245. data/assets/img/projects/hy-img.svg +17 -0
  246. data/assets/img/projects/hy-push-state.svg +13 -0
  247. data/assets/img/resume.png +0 -0
  248. data/assets/img/sidebar-bg.jpg +0 -0
  249. data/assets/img/swipe.svg +22 -0
  250. data/assets/img/w3m.png +0 -0
  251. data/assets/js/hydejack-8.0.0.js +46 -0
  252. data/assets/js/sw.js +318 -0
  253. data/assets/manifest.json +4 -3
  254. data/assets/version.json +1 -1
  255. data/licenses/Apache-2.0.md +1 -4
  256. data/licenses/GPL-3.0.md +1 -4
  257. data/licenses/MIT.md +1 -4
  258. data/licenses/PRO.md +2 -6
  259. data/licenses/README.md +10 -0
  260. data/licenses/W3C.md +31 -0
  261. metadata +107 -94
  262. data/_includes/blog.html +0 -5
  263. data/_includes/body.html +0 -25
  264. data/_includes/head.html +0 -5
  265. data/_includes/scripts/load-js-deferred.js +0 -68
  266. data/_includes/scripts/load-js-deferred.min.js +0 -1
  267. data/_includes/social-list-item.html +0 -34
  268. data/_includes/social.html +0 -20
  269. data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.eot +0 -0
  270. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.eot +0 -0
  271. data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.eot +0 -0
  272. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.eot +0 -0
  273. data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.eot +0 -0
  274. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.eot +0 -0
  275. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.eot +0 -0
  276. data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.eot +0 -0
  277. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.eot +0 -0
  278. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  279. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  280. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  281. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.eot +0 -0
  282. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.eot +0 -0
  283. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.ttf +0 -0
  284. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.woff +0 -0
  285. data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.woff2 +0 -0
  286. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.eot +0 -0
  287. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.eot +0 -0
  288. data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.eot +0 -0
  289. data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.eot +0 -0
  290. data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.eot +0 -0
  291. data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.eot +0 -0
  292. data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.eot +0 -0
  293. data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.eot +0 -0
  294. data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.eot +0 -0
  295. data/assets/bower_components/webfontloader/.bower.json +0 -38
  296. data/assets/bower_components/webfontloader/CHANGELOG +0 -419
  297. data/assets/bower_components/webfontloader/Gemfile +0 -3
  298. data/assets/bower_components/webfontloader/LICENSE +0 -176
  299. data/assets/bower_components/webfontloader/Rakefile +0 -269
  300. data/assets/bower_components/webfontloader/bower.json +0 -23
  301. data/assets/bower_components/webfontloader/browsers.json +0 -133
  302. data/assets/bower_components/webfontloader/externs.js +0 -19
  303. data/assets/bower_components/webfontloader/package.json +0 -37
  304. data/assets/bower_components/webfontloader/src/closure.js +0 -2
  305. data/assets/bower_components/webfontloader/src/core/cssclassname.js +0 -46
  306. data/assets/bower_components/webfontloader/src/core/domhelper.js +0 -405
  307. data/assets/bower_components/webfontloader/src/core/eventdispatcher.js +0 -195
  308. data/assets/bower_components/webfontloader/src/core/font.js +0 -140
  309. data/assets/bower_components/webfontloader/src/core/fontmodule.js +0 -16
  310. data/assets/bower_components/webfontloader/src/core/fontmoduleloader.js +0 -47
  311. data/assets/bower_components/webfontloader/src/core/fontruler.js +0 -60
  312. data/assets/bower_components/webfontloader/src/core/fontwatcher.js +0 -171
  313. data/assets/bower_components/webfontloader/src/core/fontwatchrunner.js +0 -249
  314. data/assets/bower_components/webfontloader/src/core/initialize.js +0 -97
  315. data/assets/bower_components/webfontloader/src/core/nativefontwatchrunner.js +0 -69
  316. data/assets/bower_components/webfontloader/src/core/stylesheetwaiter.js +0 -48
  317. data/assets/bower_components/webfontloader/src/core/webfont.js +0 -97
  318. data/assets/bower_components/webfontloader/src/modules.yml +0 -34
  319. data/assets/bower_components/webfontloader/src/modules/custom.js +0 -63
  320. data/assets/bower_components/webfontloader/src/modules/fontdeck.js +0 -66
  321. data/assets/bower_components/webfontloader/src/modules/google/fontapiparser.js +0 -181
  322. data/assets/bower_components/webfontloader/src/modules/google/fontapiurlbuilder.js +0 -77
  323. data/assets/bower_components/webfontloader/src/modules/google/googlefontapi.js +0 -54
  324. data/assets/bower_components/webfontloader/src/modules/monotype.js +0 -110
  325. data/assets/bower_components/webfontloader/src/modules/typekit.js +0 -73
  326. data/assets/bower_components/webfontloader/webfontloader.gemspec +0 -191
  327. data/assets/bower_components/webfontloader/webfontloader.js +0 -17
  328. data/assets/js/hydejack-7.5.2.js +0 -249
@@ -0,0 +1,130 @@
1
+ goog.provide('fontface.Ruler');
2
+
3
+ goog.require('dom');
4
+
5
+ goog.scope(function () {
6
+ /**
7
+ * @constructor
8
+ * @param {string} text
9
+ */
10
+ fontface.Ruler = function (text) {
11
+ var style = 'max-width:none;' +
12
+ 'display:inline-block;' +
13
+ 'position:absolute;' +
14
+ 'height:100%;' +
15
+ 'width:100%;' +
16
+ 'overflow:scroll;' +
17
+ 'font-size:16px;';
18
+
19
+ this.element = dom.createElement('div');
20
+ this.element.setAttribute('aria-hidden', 'true');
21
+
22
+ dom.append(this.element, dom.createText(text));
23
+
24
+ this.collapsible = dom.createElement('span');
25
+ this.expandable = dom.createElement('span');
26
+ this.collapsibleInner = dom.createElement('span');
27
+ this.expandableInner = dom.createElement('span');
28
+
29
+ this.lastOffsetWidth = -1;
30
+
31
+ dom.style(this.collapsible, style);
32
+ dom.style(this.expandable, style);
33
+ dom.style(this.expandableInner, style);
34
+ dom.style(this.collapsibleInner, 'display:inline-block;width:200%;height:200%;font-size:16px;max-width:none;');
35
+
36
+ dom.append(this.collapsible, this.collapsibleInner);
37
+ dom.append(this.expandable, this.expandableInner);
38
+
39
+ dom.append(this.element, this.collapsible);
40
+ dom.append(this.element, this.expandable);
41
+ };
42
+
43
+ var Ruler = fontface.Ruler;
44
+
45
+ /**
46
+ * @return {Element}
47
+ */
48
+ Ruler.prototype.getElement = function () {
49
+ return this.element;
50
+ };
51
+
52
+ /**
53
+ * @param {string} font
54
+ */
55
+ Ruler.prototype.setFont = function (font) {
56
+ dom.style(this.element, 'max-width:none;' +
57
+ 'min-width:20px;' +
58
+ 'min-height:20px;' +
59
+ 'display:inline-block;' +
60
+ 'overflow:hidden;' +
61
+ 'position:absolute;' +
62
+ 'width:auto;' +
63
+ 'margin:0;' +
64
+ 'padding:0;' +
65
+ 'top:-999px;' +
66
+ 'white-space:nowrap;' +
67
+ 'font-synthesis:none;' +
68
+ 'font:' + font + ';');
69
+ };
70
+
71
+ /**
72
+ * @return {number}
73
+ */
74
+ Ruler.prototype.getWidth = function () {
75
+ return this.element.offsetWidth;
76
+ };
77
+
78
+ /**
79
+ * @param {string} width
80
+ */
81
+ Ruler.prototype.setWidth = function (width) {
82
+ this.element.style.width = width + 'px';
83
+ };
84
+
85
+ /**
86
+ * @private
87
+ *
88
+ * @return {boolean}
89
+ */
90
+ Ruler.prototype.reset = function () {
91
+ var offsetWidth = this.getWidth(),
92
+ width = offsetWidth + 100;
93
+
94
+ this.expandableInner.style.width = width + 'px';
95
+ this.expandable.scrollLeft = width;
96
+ this.collapsible.scrollLeft = this.collapsible.scrollWidth + 100;
97
+
98
+ if (this.lastOffsetWidth !== offsetWidth) {
99
+ this.lastOffsetWidth = offsetWidth;
100
+ return true;
101
+ } else {
102
+ return false;
103
+ }
104
+ };
105
+
106
+ /**
107
+ * @private
108
+ * @param {function(number)} callback
109
+ */
110
+ Ruler.prototype.onScroll = function (callback) {
111
+ if (this.reset() && this.element.parentNode !== null) {
112
+ callback(this.lastOffsetWidth);
113
+ }
114
+ };
115
+
116
+ /**
117
+ * @param {function(number)} callback
118
+ */
119
+ Ruler.prototype.onResize = function (callback) {
120
+ var that = this;
121
+
122
+ function onScroll() {
123
+ that.onScroll(callback);
124
+ }
125
+
126
+ dom.addListener(this.collapsible, 'scroll', onScroll);
127
+ dom.addListener(this.expandable, 'scroll', onScroll);
128
+ this.reset();
129
+ };
130
+ });
@@ -0,0 +1,8 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ </head>
5
+ <body>
6
+ hello
7
+ </body>
8
+ </html>
@@ -0,0 +1 @@
1
+ @font-face { font-family: observer-test9; src: url(sourcesanspro-regular.woff) format('woff'), url(sourcesanspro-regular.ttf) format('truetype'); }
@@ -0,0 +1,5 @@
1
+ // This file was autogenerated by calcdeps.js
2
+ goog.addDependency('../../node_modules/closure-dom/src/dom.js', ['dom'], []);
3
+ goog.addDependency('../../src/descriptors.js', ['fontface.Descriptors'], []);
4
+ goog.addDependency('../../src/observer.js', ['fontface.Observer'], ['fontface.Ruler','dom']);
5
+ goog.addDependency('../../src/ruler.js', ['fontface.Ruler'], ['dom']);
@@ -0,0 +1,97 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>FontFaceObserver</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <link href="../node_modules/mocha/mocha.css" rel="stylesheet">
8
+ <style>
9
+ @font-face {
10
+ font-family: observer-test1;
11
+ src: url(assets/sourcesanspro-regular.woff) format('woff'),
12
+ url(assets/sourcesanspro-regular.ttf) format('truetype');
13
+ }
14
+
15
+ @font-face {
16
+ font-family: observer-test2;
17
+ src: url(unknown.woff) format('woff'),
18
+ url(unknown.ttf) format('truetype');
19
+ }
20
+
21
+ @font-face {
22
+ font-family: observer-test3;
23
+ src: url(assets/sourcesanspro-regular.woff) format('woff'),
24
+ url(assets/sourcesanspro-regular.ttf) format('truetype');
25
+ }
26
+
27
+ @font-face {
28
+ font-family: observer-test4;
29
+ src: url(assets/subset.woff) format('woff'),
30
+ url(assets/subset.ttf) format('truetype');
31
+ unicode-range: u+0021;
32
+ }
33
+
34
+ @font-face {
35
+ font-family: observer-test5;
36
+ src: url(assets/subset.woff) format('woff'),
37
+ url(assets/subset.ttf) format('truetype');
38
+ unicode-range: u+4e2d,u+56fd;
39
+ }
40
+
41
+ @font-face {
42
+ font-family: observer-test6;
43
+ src: url(assets/subset.woff) format('woff'),
44
+ url(assets/subset.ttf) format('truetype');
45
+ unicode-range: u+10ffff;
46
+ }
47
+
48
+ @font-face {
49
+ font-family: observer-test7;
50
+ src: url(assets/subset.woff) format('woff'),
51
+ url(assets/subset.ttf) format('truetype');
52
+ unicode-range: u+23;
53
+ }
54
+
55
+ @font-face {
56
+ font-family: observer-test8;
57
+ src: url(assets/sourcesanspro-regular.woff) format('woff'),
58
+ url(assets/sourcesanspro-regular.ttf) format('truetype');
59
+ }
60
+
61
+ @font-face {
62
+ font-family: Trebuchet W01 Regular;
63
+ src: url(assets/sourcesanspro-regular.woff) format('woff'),
64
+ url(assets/sourcesanspro-regular.ttf) format('truetype');
65
+ }
66
+
67
+ @font-face {
68
+ font-family: 'Neue Frutiger 1450 W04';
69
+ src: url(assets/sourcesanspro-regular.woff) format('woff'),
70
+ url(assets/sourcesanspro-regular.ttf) format('truetype');
71
+ }
72
+ </style>
73
+ </head>
74
+ <body>
75
+ <div id="mocha"></div>
76
+ <script>CLOSURE_NO_DEPS = true;</script>
77
+ <script src="../vendor/google/base.js"></script>
78
+ <script src="../node_modules/unexpected/unexpected.js"></script>
79
+ <script src="../node_modules/mocha/mocha.js"></script>
80
+ <script src="../node_modules/sinon/pkg/sinon.js"></script>
81
+ <script src="../node_modules/promis/promise.js"></script>
82
+ <script src="deps.js"></script>
83
+ <script>
84
+ goog.require('fontface.Observer');
85
+ mocha.ui('bdd');
86
+
87
+ expect = weknowhow.expect;
88
+ </script>
89
+ <script src="./ruler-test.js"></script>
90
+ <script src="./observer-test.js"></script>
91
+ <script>
92
+ window.onload = function () {
93
+ mocha.run();
94
+ };
95
+ </script>
96
+ </body>
97
+ </html>
@@ -0,0 +1,465 @@
1
+ describe('Observer', function () {
2
+ var Observer = fontface.Observer,
3
+ Ruler = fontface.Ruler;
4
+
5
+ describe('#constructor', function () {
6
+ it('creates a new instance with the correct signature', function () {
7
+ var observer = new Observer('my family', {});
8
+ expect(observer, 'not to be', null);
9
+ expect(observer.load, 'to be a function');
10
+ });
11
+
12
+ it('parses descriptors', function () {
13
+ var observer = new Observer('my family', {
14
+ weight: 'bold'
15
+ });
16
+
17
+ expect(observer.family, 'to equal', 'my family');
18
+ expect(observer.weight, 'to equal', 'bold');
19
+ });
20
+
21
+ it('defaults descriptors that are not given', function () {
22
+ var observer = new Observer('my family', {
23
+ weight: 'bold'
24
+ });
25
+
26
+ expect(observer.style, 'to equal', 'normal');
27
+ });
28
+ });
29
+
30
+ describe('#getStyle', function () {
31
+ it('creates the correct default style', function () {
32
+ var observer = new Observer('my family', {});
33
+
34
+ if (Observer.supportStretch()) {
35
+ expect(observer.getStyle('sans-serif'), 'to equal', 'normal normal normal 100px sans-serif');
36
+ } else {
37
+ expect(observer.getStyle('sans-serif'), 'to equal', 'normal normal 100px sans-serif');
38
+ }
39
+ });
40
+
41
+ it('passes through all descriptors', function () {
42
+ var observer = new Observer('my family', {
43
+ style: 'italic',
44
+ weight: 'bold',
45
+ stretch: 'condensed'
46
+ });
47
+
48
+ if (Observer.supportStretch()) {
49
+ expect(observer.getStyle('sans-serif'), 'to equal', 'italic bold condensed 100px sans-serif');
50
+ } else {
51
+ expect(observer.getStyle('sans-serif'), 'to equal', 'italic bold 100px sans-serif');
52
+ }
53
+ });
54
+ });
55
+
56
+ describe('#load', function () {
57
+ this.timeout(5000);
58
+
59
+ it('finds a font and resolve the promise', function (done) {
60
+ var observer = new Observer('observer-test1', {}),
61
+ ruler = new Ruler('hello');
62
+
63
+ document.body.appendChild(ruler.getElement());
64
+
65
+ ruler.setFont('monospace', '');
66
+ var beforeWidth = ruler.getWidth();
67
+
68
+ ruler.setFont('100px observer-test1, monospace');
69
+ observer.load(null, 5000).then(function () {
70
+ var activeWidth = ruler.getWidth();
71
+
72
+ expect(activeWidth, 'not to equal', beforeWidth);
73
+
74
+ setTimeout(function () {
75
+ var afterWidth = ruler.getWidth();
76
+
77
+ expect(afterWidth, 'to equal', activeWidth);
78
+ expect(afterWidth, 'not to equal', beforeWidth);
79
+ document.body.removeChild(ruler.getElement());
80
+ done();
81
+ }, 0);
82
+ }, function () {
83
+ done(new Error('Timeout'));
84
+ });
85
+ });
86
+
87
+ it('finds a font and resolves the promise even though the @font-face rule is not in the CSSOM yet', function (done) {
88
+ var observer = new Observer('observer-test9', {}),
89
+ ruler = new Ruler('hello');
90
+
91
+ document.body.appendChild(ruler.getElement());
92
+
93
+ ruler.setFont('monospace', '');
94
+ var beforeWidth = ruler.getWidth();
95
+
96
+ ruler.setFont('100px observer-test9, monospace');
97
+ observer.load(null, 10000).then(function () {
98
+ var activeWidth = ruler.getWidth();
99
+
100
+ expect(activeWidth, 'not to equal', beforeWidth);
101
+
102
+ setTimeout(function () {
103
+ var afterWidth = ruler.getWidth();
104
+
105
+ expect(afterWidth, 'to equal', activeWidth);
106
+ expect(afterWidth, 'not to equal', beforeWidth);
107
+ document.body.removeChild(ruler.getElement());
108
+ done();
109
+ }, 0);
110
+ }, function () {
111
+ done(new Error('Timeout'));
112
+ });
113
+
114
+ // We don't use a style element here because IE9/10 have issues with
115
+ // dynamically inserted @font-face rules.
116
+ var link = document.createElement('link');
117
+
118
+ link.rel = 'stylesheet';
119
+ link.href = 'assets/late.css';
120
+
121
+ document.head.appendChild(link);
122
+ });
123
+
124
+ it('finds a font and resolve the promise even when the page is RTL', function (done) {
125
+ var observer = new Observer('observer-test8', {}),
126
+ ruler = new Ruler('hello');
127
+
128
+ document.body.dir = 'rtl';
129
+ document.body.appendChild(ruler.getElement());
130
+
131
+ ruler.setFont('monospace', '');
132
+ var beforeWidth = ruler.getWidth();
133
+
134
+ ruler.setFont('100px observer-test1, monospace');
135
+ observer.load(null, 5000).then(function () {
136
+ var activeWidth = ruler.getWidth();
137
+
138
+ expect(activeWidth, 'not to equal', beforeWidth);
139
+
140
+ setTimeout(function () {
141
+ var afterWidth = ruler.getWidth();
142
+
143
+ expect(afterWidth, 'to equal', activeWidth);
144
+ expect(afterWidth, 'not to equal', beforeWidth);
145
+ document.body.removeChild(ruler.getElement());
146
+ document.body.dir = 'ltr';
147
+ done();
148
+ }, 0);
149
+ }, function () {
150
+ done(new Error('Timeout'));
151
+ });
152
+ });
153
+
154
+
155
+ it('finds a font with spaces in the name and resolve the promise', function (done) {
156
+ var observer = new Observer('Trebuchet W01 Regular', {}),
157
+ ruler = new Ruler('hello');
158
+
159
+ document.body.appendChild(ruler.getElement());
160
+
161
+ ruler.setFont('100px monospace');
162
+ var beforeWidth = ruler.getWidth();
163
+
164
+ ruler.setFont('100px "Trebuchet W01 Regular", monospace');
165
+ observer.load(null, 5000).then(function () {
166
+ var activeWidth = ruler.getWidth();
167
+
168
+ expect(activeWidth, 'not to equal', beforeWidth);
169
+
170
+ setTimeout(function () {
171
+ var afterWidth = ruler.getWidth();
172
+
173
+ expect(afterWidth, 'to equal', activeWidth);
174
+ expect(afterWidth, 'not to equal', beforeWidth);
175
+ document.body.removeChild(ruler.getElement());
176
+ done();
177
+ }, 0);
178
+ }, function () {
179
+ done(new Error('Timeout'));
180
+ });
181
+ });
182
+
183
+ it('loads a font with spaces and numbers in the name and resolve the promise', function (done) {
184
+ var observer = new Observer('Neue Frutiger 1450 W04', {}),
185
+ ruler = new Ruler('hello');
186
+
187
+ document.body.appendChild(ruler.getElement());
188
+
189
+ ruler.setFont('100px monospace');
190
+ var beforeWidth = ruler.getWidth();
191
+
192
+ ruler.setFont('100px "Neue Frutiger 1450 W04", monospace');
193
+ observer.load(null, 5000).then(function () {
194
+ var activeWidth = ruler.getWidth();
195
+
196
+ expect(activeWidth, 'not to equal', beforeWidth);
197
+
198
+ setTimeout(function () {
199
+ var afterWidth = ruler.getWidth();
200
+
201
+ expect(afterWidth, 'to equal', activeWidth);
202
+ expect(afterWidth, 'not to equal', beforeWidth);
203
+ document.body.removeChild(ruler.getElement());
204
+ done();
205
+ }, 0);
206
+ }, function () {
207
+ done(new Error('Timeout'));
208
+ });
209
+ });
210
+
211
+ it('fails to find a font and reject the promise', function (done) {
212
+ var observer = new Observer('observer-test2', {});
213
+
214
+ observer.load(null, 50).then(function () {
215
+ done(new Error('Should not resolve'));
216
+ }, function () {
217
+ done();
218
+ });
219
+ });
220
+
221
+ it('finds the font even if it is already loaded', function (done) {
222
+ var observer = new Observer('observer-test3', {});
223
+
224
+ observer.load(null, 5000).then(function () {
225
+ observer.load(null, 5000).then(function () {
226
+ done();
227
+ }, function () {
228
+ done(new Error('Second call failed'));
229
+ });
230
+ }, function () {
231
+ done(new Error('Timeout'));
232
+ });
233
+ });
234
+
235
+ it('finds a font with a custom unicode range within ASCII', function (done) {
236
+ var observer = new Observer('observer-test4', {}),
237
+ ruler = new Ruler('\u0021');
238
+
239
+ ruler.setFont('monospace', '');
240
+ document.body.appendChild(ruler.getElement());
241
+
242
+ var beforeWidth = ruler.getWidth();
243
+
244
+ ruler.setFont('100px observer-test4,monospace');
245
+
246
+ observer.load('\u0021', 5000).then(function () {
247
+ var activeWidth = ruler.getWidth();
248
+
249
+ expect(activeWidth, 'not to equal', beforeWidth);
250
+
251
+ setTimeout(function () {
252
+ var afterWidth = ruler.getWidth();
253
+
254
+ expect(afterWidth, 'to equal', activeWidth);
255
+ expect(afterWidth, 'not to equal', beforeWidth);
256
+
257
+ document.body.removeChild(ruler.getElement());
258
+ done();
259
+ }, 0);
260
+ }, function () {
261
+ done(new Error('Timeout'));
262
+ });
263
+ });
264
+
265
+ it('finds a font with a custom unicode range outside ASCII (but within BMP)', function (done) {
266
+ var observer = new Observer('observer-test5', {}),
267
+ ruler = new Ruler('\u4e2d\u56fd');
268
+
269
+ ruler.setFont('100px monospace');
270
+ document.body.appendChild(ruler.getElement());
271
+
272
+ var beforeWidth = ruler.getWidth();
273
+
274
+ ruler.setFont('100px observer-test5,monospace');
275
+
276
+ observer.load('\u4e2d\u56fd', 5000).then(function () {
277
+ var activeWidth = ruler.getWidth();
278
+
279
+ expect(activeWidth, 'not to equal', beforeWidth);
280
+
281
+ setTimeout(function () {
282
+ var afterWidth = ruler.getWidth();
283
+
284
+ expect(afterWidth, 'to equal', activeWidth);
285
+ expect(afterWidth, 'not to equal', beforeWidth);
286
+
287
+ document.body.removeChild(ruler.getElement());
288
+
289
+ done();
290
+ }, 0);
291
+ }, function () {
292
+ done(new Error('Timeout'));
293
+ });
294
+ });
295
+
296
+ it('finds a font with a custom unicode range outside the BMP', function (done) {
297
+ var observer = new Observer('observer-test6', {}),
298
+ ruler = new Ruler('\udbff\udfff');
299
+
300
+ ruler.setFont('100px monospace');
301
+ document.body.appendChild(ruler.getElement());
302
+
303
+ var beforeWidth = ruler.getWidth();
304
+
305
+ ruler.setFont('100px observer-test6,monospace');
306
+
307
+ observer.load('\udbff\udfff', 5000).then(function () {
308
+ var activeWidth = ruler.getWidth();
309
+
310
+ expect(activeWidth, 'not to equal', beforeWidth);
311
+
312
+ setTimeout(function () {
313
+ var afterWidth = ruler.getWidth();
314
+
315
+ expect(afterWidth, 'to equal', activeWidth);
316
+ expect(afterWidth, 'not to equal', beforeWidth);
317
+
318
+ document.body.removeChild(ruler.getElement());
319
+
320
+ done();
321
+ }, 0);
322
+ }, function () {
323
+ done(new Error('Timeout'));
324
+ });
325
+ });
326
+
327
+ it('fails to find the font if it is available but does not contain the test string', function (done) {
328
+ var observer = new Observer('observer-test7', {});
329
+
330
+ observer.load(null, 50).then(function () {
331
+ done(new Error('Should not be called'));
332
+ }, function () {
333
+ done();
334
+ });
335
+ });
336
+
337
+ xit('finds a locally installed font', function (done) {
338
+ var observer = new Observer('sans-serif', {});
339
+
340
+ observer.load(null, 50).then(function () {
341
+ done();
342
+ }, function () {
343
+ done(new Error('Did not detect local font'));
344
+ });
345
+ });
346
+
347
+ xit('finds a locally installed font with the same metrics as the a fallback font (on OS X)', function (done) {
348
+ var observer = new Observer('serif', {});
349
+
350
+ observer.load(null, 50).then(function () {
351
+ done();
352
+ }, function () {
353
+ done(new Error('Did not detect local font'));
354
+ });
355
+ });
356
+ });
357
+
358
+ describe('hasSafari10Bug', function () {
359
+ var getUserAgent = null;
360
+ var getNavigatorVendor = null;
361
+ var supportsNativeFontLoading = null;
362
+
363
+ beforeEach(function () {
364
+ Observer.HAS_SAFARI_10_BUG = null;
365
+
366
+ getUserAgent = sinon.stub(Observer, 'getUserAgent');
367
+ getNavigatorVendor = sinon.stub(Observer, 'getNavigatorVendor');
368
+ supportsNativeFontLoading = sinon.stub(Observer, 'supportsNativeFontLoading');
369
+ });
370
+
371
+ afterEach(function () {
372
+ getUserAgent.restore();
373
+ getNavigatorVendor.restore();
374
+ supportsNativeFontLoading.restore();
375
+ });
376
+
377
+ it('returns false when the user agent is not WebKit', function () {
378
+ getUserAgent.returns('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0');
379
+ getNavigatorVendor.returns('Google');
380
+ supportsNativeFontLoading.returns(true);
381
+
382
+ expect(Observer.hasSafari10Bug(), 'to be false');
383
+ });
384
+
385
+ it('returns true if the browser is an affected version of Safari 10', function () {
386
+ getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.2.14 (KHTML, like Gecko) Version/10.0.1 Safari/602.2.14');
387
+ getNavigatorVendor.returns('Apple');
388
+ supportsNativeFontLoading.returns(true);
389
+
390
+ expect(Observer.hasSafari10Bug(), 'to be true');
391
+ });
392
+
393
+ it('returns true if the browser is an WebView with an affected version of Safari 10', function () {
394
+ getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/602.2.14 (KHTML, like Gecko) FxiOS/6.1 Safari/602.2.14');
395
+ getNavigatorVendor.returns('Apple');
396
+ supportsNativeFontLoading.returns(true);
397
+
398
+ expect(Observer.hasSafari10Bug(), 'to be true');
399
+ });
400
+
401
+ it('returns false in older versions of Safari', function () {
402
+ getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/9.3.2 Safari/537.75.14');
403
+ getNavigatorVendor.returns('Apple');
404
+ supportsNativeFontLoading.returns(false);
405
+
406
+ expect(Observer.hasSafari10Bug(), 'to be false');
407
+ });
408
+
409
+ it('returns false in newer versions of Safari', function () {
410
+ getUserAgent.returns('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/603.1.20 (KHTML, like Gecko) Version/10.1 Safari/603.1.20');
411
+ getNavigatorVendor.returns('Apple');
412
+ supportsNativeFontLoading.returns(true);
413
+
414
+ expect(Observer.hasSafari10Bug(), 'to be false');
415
+ });
416
+ });
417
+
418
+ describe('hasWebKitFallbackBug', function () {
419
+ var getUserAgent = null;
420
+
421
+ beforeEach(function () {
422
+ Observer.HAS_WEBKIT_FALLBACK_BUG = null;
423
+
424
+ getUserAgent = sinon.stub(Observer, 'getUserAgent');
425
+ });
426
+
427
+ afterEach(function () {
428
+ getUserAgent.restore();
429
+ });
430
+
431
+ it('returns false when the user agent is not WebKit', function () {
432
+ getUserAgent.returns('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0');
433
+
434
+ expect(Observer.hasWebKitFallbackBug(), 'to be false');
435
+ });
436
+
437
+ it('returns false when the user agent is WebKit but the bug is not present', function () {
438
+ getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.12 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.12');
439
+
440
+ expect(Observer.hasWebKitFallbackBug(), 'to be false');
441
+ });
442
+
443
+ it('returns true when the user agent is WebKit and the bug is present', function () {
444
+ getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.11');
445
+
446
+ expect(Observer.hasWebKitFallbackBug(), 'to be true');
447
+ });
448
+
449
+ it('returns true when the user agent is WebKit and the bug is present in an old version', function () {
450
+ getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/535.19');
451
+
452
+ expect(Observer.hasWebKitFallbackBug(), 'to be true');
453
+ });
454
+
455
+ it('caches the results', function () {
456
+ getUserAgent.returns('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.814.2 Safari/536.11');
457
+
458
+ expect(Observer.hasWebKitFallbackBug(), 'to be true');
459
+
460
+ getUserAgent.returns('Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/15.0 Firefox/14.0');
461
+
462
+ expect(Observer.hasWebKitFallbackBug(), 'to be true');
463
+ });
464
+ });
465
+ });