Skip to content

Commit

Permalink
Fix 'fontfaceobserver.standalone.js' 404 error
Browse files Browse the repository at this point in the history
Fixing issue wikimedia#351.
  • Loading branch information
olawanlejoel authored and Volker-E committed May 15, 2020
1 parent f0d467b commit bc8a02a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion js/src/fonts-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
html.classList.add( 'fonts-loaded' );
} else {
var script = document.createElement( 'script' );
script.src = './js/vendor/fontfaceobserver/fontfaceobserver.standalone.js';
// Use absolute path to address root files and /components/ directory ones.
script.src = '/style-guide/js/vendor/fontfaceobserver/fontfaceobserver.standalone.js';

script.onload = function () {
var serif = new FontFaceObserver( 'Charter' ); /* eslint-disable-line no-undef */
Expand Down
3 changes: 2 additions & 1 deletion js/wikimedia-design-style-guide.concat.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/wikimedia-design-style-guide.concat.js.map.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":3,"sources":["src/fonts-loader.js"],"names":[],"mappings":"AAAA,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AACzC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACf;AACA,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9C,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;AACtC;AACA,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,GAAG,IAA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AACF,GAAG,CAAC,EAAE","file":"wikimedia-design-style-guide.concat.js","sourcesContent":["/* eslint-disable vars-on-top, one-var */\n( function () {\n\n\tif ( document.head && 'Promise' in window ) {\n\t\tvar html = document.documentElement;\n\n\t\tif ( sessionStorage.getItem( 'fontsLoaded' ) ) {\n\t\t\thtml.classList.add( 'fonts-loaded' );\n\t\t} else {\n\t\t\tvar script = document.createElement( 'script' );\n\t\t\tscript.src = './js/vendor/fontfaceobserver/fontfaceobserver.standalone.js';\n\n\t\t\tscript.onload = function () {\n\t\t\t\tvar serif = new FontFaceObserver( 'Charter' ); /* eslint-disable-line no-undef */\n\n\t\t\t\tPromise.all( [ /* eslint-disable-line no-undef */\n\t\t\t\t\tserif.load()\n\t\t\t\t] ).then( function () {\n\t\t\t\t\thtml.classList.add( 'fonts-loaded' );\n\t\t\t\t\tsessionStorage.setItem( 'fontsLoaded', 1 );\n\t\t\t\t} );\n\t\t\t};\n\t\t\tdocument.head.appendChild( script );\n\t\t}\n\t}\n}() );\n"]}
{"version":3,"sources":["src/fonts-loader.js"],"names":[],"mappings":"AAAA,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;AACzC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AACf;AACA,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC9C,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC;AACtC;AACA,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,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;AAChD,IAAI,CAAC,CAAC,EAAE;AACR,GAAG,EAAE;AACL,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,EAAE;AACvC,EAAE,CAAC;AACH,CAAC,CAAC;AACF,GAAG,CAAC,EAAE","file":"wikimedia-design-style-guide.concat.js","sourcesContent":["/* eslint-disable vars-on-top, one-var */\n( function () {\n\n\tif ( document.head && 'Promise' in window ) {\n\t\tvar html = document.documentElement;\n\n\t\tif ( sessionStorage.getItem( 'fontsLoaded' ) ) {\n\t\t\thtml.classList.add( 'fonts-loaded' );\n\t\t} else {\n\t\t\tvar script = document.createElement( 'script' );\n\t\t\t// Use absolute path to address root files and /components/ directory ones.\n\t\t\tscript.src = '/style-guide/js/vendor/fontfaceobserver/fontfaceobserver.standalone.js';\n\n\t\t\tscript.onload = function () {\n\t\t\t\tvar serif = new FontFaceObserver( 'Charter' ); /* eslint-disable-line no-undef */\n\n\t\t\t\tPromise.all( [ /* eslint-disable-line no-undef */\n\t\t\t\t\tserif.load()\n\t\t\t\t] ).then( function () {\n\t\t\t\t\thtml.classList.add( 'fonts-loaded' );\n\t\t\t\t\tsessionStorage.setItem( 'fontsLoaded', 1 );\n\t\t\t\t} );\n\t\t\t};\n\t\t\tdocument.head.appendChild( script );\n\t\t}\n\t}\n}() );\n"]}
2 changes: 1 addition & 1 deletion js/wikimedia-design-style-guide.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/wikimedia-design-style-guide.min.js.map.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":3,"sources":["wikimedia-design-style-guide.concat.js"],"names":["document","head","window","html","documentElement","sessionStorage","getItem","classList","add","script","createElement","src","onload","serif","FontFaceObserver","Promise","all","load","then","setItem","appendChild"],"mappings":"CACE,WAED,GAAKA,SAASC,MAAQ,YAAaC,OAAS,CAC3C,IAAIC,EAAOH,SAASI,gBAEpB,GAAKC,eAAeC,QAAS,eAC5BH,EAAKI,UAAUC,IAAK,oBACd,CACN,IAAIC,EAAST,SAASU,cAAe,UACrCD,EAAOE,IAAM,8DAEbF,EAAOG,OAAS,WACf,IAAIC,EAAQ,IAAIC,iBAAkB,WAElCC,QAAQC,IAAK,CACZH,EAAMI,SACHC,KAAM,WACTf,EAAKI,UAAUC,IAAK,gBACpBH,eAAec,QAAS,cAAe,MAGzCnB,SAASC,KAAKmB,YAAaX,KArB9B","file":"wikimedia-design-style-guide.min.js"}
{"version":3,"sources":["wikimedia-design-style-guide.concat.js"],"names":["document","head","window","html","documentElement","sessionStorage","getItem","classList","add","script","createElement","src","onload","serif","FontFaceObserver","Promise","all","load","then","setItem","appendChild"],"mappings":"CACE,WAED,GAAKA,SAASC,MAAQ,YAAaC,OAAS,CAC3C,IAAIC,EAAOH,SAASI,gBAEpB,GAAKC,eAAeC,QAAS,eAC5BH,EAAKI,UAAUC,IAAK,oBACd,CACN,IAAIC,EAAST,SAASU,cAAe,UAErCD,EAAOE,IAAM,yEAEbF,EAAOG,OAAS,WACf,IAAIC,EAAQ,IAAIC,iBAAkB,WAElCC,QAAQC,IAAK,CACZH,EAAMI,SACHC,KAAM,WACTf,EAAKI,UAAUC,IAAK,gBACpBH,eAAec,QAAS,cAAe,MAGzCnB,SAASC,KAAKmB,YAAaX,KAtB9B","file":"wikimedia-design-style-guide.min.js"}

0 comments on commit bc8a02a

Please sign in to comment.