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.
- checksums.yaml +4 -4
- data/LICENSE.md +1 -4
- data/README.md +139 -86
- data/_includes/body/analytics.html +36 -0
- data/_includes/{comments.html → body/comments.html} +0 -0
- data/_includes/{footer.html → body/footer.html} +4 -2
- data/_includes/body/index.html +22 -0
- data/_includes/body/main.html +18 -0
- data/_includes/{menu.html → body/menu.html} +1 -0
- data/_includes/{nav.html → body/nav.html} +0 -0
- data/_includes/body/scripts.html +22 -0
- data/_includes/{sidebar.html → body/sidebar.html} +19 -6
- data/_includes/{about.html → components/about.html} +1 -1
- data/_includes/{author.html → components/author.html} +3 -3
- data/_includes/{avatar-tag.html → components/avatar-tag.html} +0 -0
- data/_includes/{srcset-img.html → components/hy-img.html} +24 -8
- data/_includes/{link.html → components/link.html} +0 -0
- data/_includes/{message.html → components/message.html} +0 -0
- data/_includes/{pagination.html → components/pagination.html} +2 -2
- data/_includes/{post-list-item.html → components/post-list-item.html} +0 -0
- data/_includes/{post.html → components/post.html} +21 -10
- data/_includes/{related-posts.html → components/related-posts.html} +1 -1
- data/_includes/components/social-list-item.html +40 -0
- data/_includes/components/social.html +23 -0
- data/_includes/{tag-list.html → components/tag-list.html} +0 -0
- data/_includes/head/index.html +9 -0
- data/_includes/head/links.html +7 -5
- data/_includes/head/meta.html +3 -3
- data/_includes/{page-style.html → head/page-style.html} +1 -1
- data/_includes/head/scripts.html +10 -39
- data/_includes/head/styles.html +42 -15
- data/_includes/header.txt +1 -1
- data/_includes/my-body.html +42 -0
- data/_includes/my-scripts.html +55 -0
- data/_includes/scripts/load-js.js +60 -0
- data/_includes/scripts/load-js.min.js +1 -0
- data/_includes/{smart-url → smart-url.txt} +0 -0
- data/_includes/styles/inline.scss +15 -19
- data/_includes/styles/style.scss +20 -17
- data/_includes/templates/animation.html +1 -1
- data/_includes/templates/back.html +1 -1
- data/_includes/templates/cookies-banner.html +1 -1
- data/_includes/templates/error.html +1 -1
- data/_includes/{templates.html → templates/index.html} +1 -2
- data/_includes/templates/loading.html +1 -1
- data/_includes/templates/permalink.html +1 -1
- data/_layouts/about.html +29 -30
- data/_layouts/base.html +20 -62
- data/_layouts/blog.html +20 -22
- data/_layouts/compress.html +1 -1
- data/_layouts/default.html +13 -18
- data/_layouts/home.html +11 -16
- data/_layouts/list.html +13 -18
- data/_layouts/not-found.html +11 -16
- data/_layouts/page.html +12 -17
- data/_layouts/post.html +15 -20
- data/_layouts/redirect.html +11 -16
- data/_sass/_mixins.scss +10 -15
- data/_sass/_spinner.scss +10 -15
- data/_sass/_variables.scss +35 -19
- data/_sass/hydejack/__inline/_avatar.scss +33 -32
- data/_sass/hydejack/__inline/_base.scss +30 -68
- data/_sass/hydejack/__inline/_break-layout.scss +19 -26
- data/_sass/hydejack/__inline/_content.scss +29 -34
- data/_sass/hydejack/__inline/_footer.scss +19 -26
- data/_sass/hydejack/__inline/_images.scss +38 -0
- data/_sass/hydejack/__inline/_katex.scss +19 -26
- data/_sass/hydejack/__inline/_links.scss +45 -0
- data/_sass/hydejack/__inline/_mark-external.scss +19 -26
- data/_sass/hydejack/__inline/_menu.scss +28 -35
- data/_sass/hydejack/__inline/_sidebar.scss +76 -76
- data/_sass/hydejack/__inline/_social.scss +25 -31
- data/_sass/hydejack/__inline/_utilities.scss +42 -0
- data/_sass/hydejack/__link/_avatar.scss +29 -28
- data/_sass/hydejack/__link/_base.scss +19 -83
- data/_sass/hydejack/__link/_break-layout.scss +35 -34
- data/_sass/hydejack/__link/_content.scss +19 -26
- data/_sass/hydejack/__link/_footer.scss +19 -26
- data/_sass/hydejack/__link/_images.scss +84 -0
- data/_sass/hydejack/__link/_katex.scss +19 -26
- data/_sass/hydejack/__link/_links.scss +53 -0
- data/_sass/hydejack/__link/_mark-external.scss +19 -26
- data/_sass/hydejack/__link/_menu.scss +29 -50
- data/_sass/hydejack/__link/_sidebar.scss +71 -118
- data/_sass/hydejack/__link/_social.scss +19 -26
- data/_sass/hydejack/__link/_utilities.scss +51 -0
- data/_sass/hydejack/_avatar.pre.scss +26 -20
- data/_sass/hydejack/_base.pre.scss +22 -88
- data/_sass/hydejack/_break-layout.pre.scss +26 -23
- data/_sass/hydejack/_content.pre.scss +20 -23
- data/_sass/hydejack/_footer.pre.scss +10 -15
- data/_sass/hydejack/_images.pre.scss +77 -0
- data/_sass/hydejack/_katex.pre.scss +10 -15
- data/_sass/hydejack/_links.pre.scss +47 -0
- data/_sass/hydejack/_mark-external.pre.scss +10 -15
- data/_sass/hydejack/_menu.pre.scss +31 -38
- data/_sass/hydejack/_sidebar.pre.scss +98 -116
- data/_sass/hydejack/_social.pre.scss +16 -20
- data/_sass/hydejack/_utilities.pre.scss +43 -0
- data/_sass/my-variables.scss +0 -8
- data/_sass/pooleparty/__inline/_base.scss +19 -28
- data/_sass/pooleparty/__inline/_code.scss +19 -26
- data/_sass/pooleparty/__inline/_footer.scss +19 -26
- data/_sass/pooleparty/__inline/_footnotes.scss +19 -26
- data/_sass/pooleparty/__inline/_message.scss +19 -26
- data/_sass/pooleparty/__inline/_pagination.scss +19 -26
- data/_sass/pooleparty/__inline/_posts.scss +19 -26
- data/_sass/pooleparty/__inline/_read-more.scss +25 -0
- data/_sass/pooleparty/__inline/_related.scss +19 -26
- data/_sass/pooleparty/__inline/_table.scss +19 -26
- data/_sass/pooleparty/__inline/_type.scss +25 -39
- data/_sass/pooleparty/__link/_base.scss +19 -26
- data/_sass/pooleparty/__link/_code.scss +19 -26
- data/_sass/pooleparty/__link/_footer.scss +19 -26
- data/_sass/pooleparty/__link/_footnotes.scss +30 -26
- data/_sass/pooleparty/__link/_message.scss +19 -26
- data/_sass/pooleparty/__link/_pagination.scss +19 -26
- data/_sass/pooleparty/__link/_posts.scss +20 -27
- data/_sass/pooleparty/__link/_read-more.scss +45 -0
- data/_sass/pooleparty/__link/_related.scss +19 -26
- data/_sass/pooleparty/__link/_table.scss +19 -26
- data/_sass/pooleparty/__link/_type.scss +27 -48
- data/_sass/pooleparty/_base.pre.scss +10 -17
- data/_sass/pooleparty/_code.pre.scss +10 -15
- data/_sass/pooleparty/_footer.pre.scss +10 -15
- data/_sass/pooleparty/_footnotes.pre.scss +21 -15
- data/_sass/pooleparty/_message.pre.scss +10 -15
- data/_sass/pooleparty/_pagination.pre.scss +10 -15
- data/_sass/pooleparty/_posts.pre.scss +11 -16
- data/_sass/pooleparty/_read-more.pre.scss +36 -0
- data/_sass/pooleparty/_related.pre.scss +10 -15
- data/_sass/pooleparty/_table.pre.scss +10 -15
- data/_sass/pooleparty/_type.pre.scss +24 -50
- data/assets/Resume.pdf +0 -0
- data/assets/bower.json +3 -3
- data/assets/bower_components/fontfaceobserver/.bower.json +33 -0
- data/assets/bower_components/fontfaceobserver/.gitignore +2 -0
- data/assets/bower_components/fontfaceobserver/.travis.yml +16 -0
- data/assets/bower_components/fontfaceobserver/Gruntfile.js +101 -0
- data/assets/bower_components/fontfaceobserver/LICENSE +23 -0
- data/assets/bower_components/fontfaceobserver/bower.json +22 -0
- data/assets/bower_components/fontfaceobserver/exports.js +8 -0
- data/assets/bower_components/fontfaceobserver/externs-commonjs.js +10 -0
- data/assets/bower_components/fontfaceobserver/externs.js +15 -0
- data/assets/bower_components/fontfaceobserver/fontfaceobserver.js +12 -0
- data/assets/bower_components/fontfaceobserver/fontfaceobserver.standalone.js +8 -0
- data/assets/bower_components/fontfaceobserver/package.json +57 -0
- data/assets/bower_components/fontfaceobserver/src/descriptors.js +10 -0
- data/assets/bower_components/fontfaceobserver/src/observer.js +349 -0
- data/assets/bower_components/fontfaceobserver/src/ruler.js +130 -0
- data/assets/bower_components/fontfaceobserver/test/assets/index.html +8 -0
- data/assets/bower_components/fontfaceobserver/test/assets/late.css +1 -0
- data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.eot +0 -0
- data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.ttf +0 -0
- data/assets/bower_components/fontfaceobserver/test/assets/sourcesanspro-regular.woff +0 -0
- data/assets/bower_components/fontfaceobserver/test/assets/subset.eot +0 -0
- data/assets/bower_components/fontfaceobserver/test/assets/subset.ttf +0 -0
- data/assets/bower_components/fontfaceobserver/test/assets/subset.woff +0 -0
- data/assets/bower_components/fontfaceobserver/test/deps.js +5 -0
- data/assets/bower_components/fontfaceobserver/test/index.html +97 -0
- data/assets/bower_components/fontfaceobserver/test/observer-test.js +465 -0
- data/assets/bower_components/fontfaceobserver/test/ruler-test.js +112 -0
- data/assets/bower_components/fontfaceobserver/vendor/google/base.js +1489 -0
- data/assets/bower_components/katex/.bower.json +7 -6
- data/assets/bower_components/katex/dist/contrib/auto-render.js +790 -0
- data/assets/bower_components/katex/dist/contrib/auto-render.min.js +1 -1
- data/assets/bower_components/katex/dist/contrib/copy-tex.css +12 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.js +174 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.css +1 -0
- data/assets/bower_components/katex/dist/contrib/copy-tex.min.js +1 -0
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.js +113 -0
- data/assets/bower_components/katex/dist/contrib/mathtex-script-type.min.js +1 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/katex.css +129 -209
- data/assets/bower_components/katex/dist/katex.js +14381 -9023
- data/assets/bower_components/katex/dist/katex.min.css +1 -1
- data/assets/bower_components/katex/dist/katex.min.js +1 -6
- data/assets/bower_components/katex/flow-typed/match-at.js +3 -0
- data/assets/bower_components/katex/flow-typed/object-assign.js +6 -0
- data/assets/bower_components/katex/package-lock.json +13848 -0
- data/assets/css/hydejack-8.0.0.css +3 -0
- data/assets/img/default-1.jpg +0 -0
- data/assets/img/example-content-ii.jpg +0 -0
- data/assets/img/example-content-iii.jpg +0 -0
- data/assets/img/hydejack-8.jpg +0 -0
- data/assets/img/hydejack-8@0,25x.jpg +0 -0
- data/assets/img/hydejack-8@0,5x.jpg +0 -0
- data/assets/img/projects/hy-drawer.svg +12 -0
- data/assets/img/projects/hy-img.svg +17 -0
- data/assets/img/projects/hy-push-state.svg +13 -0
- data/assets/img/resume.png +0 -0
- data/assets/img/sidebar-bg.jpg +0 -0
- data/assets/img/swipe.svg +22 -0
- data/assets/img/w3m.png +0 -0
- data/assets/js/hydejack-8.0.0.js +46 -0
- data/assets/js/sw.js +318 -0
- data/assets/manifest.json +4 -3
- data/assets/version.json +1 -1
- data/licenses/Apache-2.0.md +1 -4
- data/licenses/GPL-3.0.md +1 -4
- data/licenses/MIT.md +1 -4
- data/licenses/PRO.md +2 -6
- data/licenses/README.md +10 -0
- data/licenses/W3C.md +31 -0
- metadata +107 -94
- data/_includes/blog.html +0 -5
- data/_includes/body.html +0 -25
- data/_includes/head.html +0 -5
- data/_includes/scripts/load-js-deferred.js +0 -68
- data/_includes/scripts/load-js-deferred.min.js +0 -1
- data/_includes/social-list-item.html +0 -34
- data/_includes/social.html +0 -20
- data/assets/bower_components/katex/dist/fonts/KaTeX_AMS-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Bold.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Caligraphic-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Bold.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Fraktur-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Bold.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Italic.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Main-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Italic.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.ttf +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.woff +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Math-Regular.woff2 +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Bold.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Italic.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_SansSerif-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Script-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size1-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size2-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size3-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Size4-Regular.eot +0 -0
- data/assets/bower_components/katex/dist/fonts/KaTeX_Typewriter-Regular.eot +0 -0
- data/assets/bower_components/webfontloader/.bower.json +0 -38
- data/assets/bower_components/webfontloader/CHANGELOG +0 -419
- data/assets/bower_components/webfontloader/Gemfile +0 -3
- data/assets/bower_components/webfontloader/LICENSE +0 -176
- data/assets/bower_components/webfontloader/Rakefile +0 -269
- data/assets/bower_components/webfontloader/bower.json +0 -23
- data/assets/bower_components/webfontloader/browsers.json +0 -133
- data/assets/bower_components/webfontloader/externs.js +0 -19
- data/assets/bower_components/webfontloader/package.json +0 -37
- data/assets/bower_components/webfontloader/src/closure.js +0 -2
- data/assets/bower_components/webfontloader/src/core/cssclassname.js +0 -46
- data/assets/bower_components/webfontloader/src/core/domhelper.js +0 -405
- data/assets/bower_components/webfontloader/src/core/eventdispatcher.js +0 -195
- data/assets/bower_components/webfontloader/src/core/font.js +0 -140
- data/assets/bower_components/webfontloader/src/core/fontmodule.js +0 -16
- data/assets/bower_components/webfontloader/src/core/fontmoduleloader.js +0 -47
- data/assets/bower_components/webfontloader/src/core/fontruler.js +0 -60
- data/assets/bower_components/webfontloader/src/core/fontwatcher.js +0 -171
- data/assets/bower_components/webfontloader/src/core/fontwatchrunner.js +0 -249
- data/assets/bower_components/webfontloader/src/core/initialize.js +0 -97
- data/assets/bower_components/webfontloader/src/core/nativefontwatchrunner.js +0 -69
- data/assets/bower_components/webfontloader/src/core/stylesheetwaiter.js +0 -48
- data/assets/bower_components/webfontloader/src/core/webfont.js +0 -97
- data/assets/bower_components/webfontloader/src/modules.yml +0 -34
- data/assets/bower_components/webfontloader/src/modules/custom.js +0 -63
- data/assets/bower_components/webfontloader/src/modules/fontdeck.js +0 -66
- data/assets/bower_components/webfontloader/src/modules/google/fontapiparser.js +0 -181
- data/assets/bower_components/webfontloader/src/modules/google/fontapiurlbuilder.js +0 -77
- data/assets/bower_components/webfontloader/src/modules/google/googlefontapi.js +0 -54
- data/assets/bower_components/webfontloader/src/modules/monotype.js +0 -110
- data/assets/bower_components/webfontloader/src/modules/typekit.js +0 -73
- data/assets/bower_components/webfontloader/webfontloader.gemspec +0 -191
- data/assets/bower_components/webfontloader/webfontloader.js +0 -17
- 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 @@
|
|
1
|
+
@font-face { font-family: observer-test9; src: url(sourcesanspro-regular.woff) format('woff'), url(sourcesanspro-regular.ttf) format('truetype'); }
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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
|
+
});
|