| Total Complexity | 4 |
| Complexity/F | 1 |
| Lines of Code | 29 |
| Function Count | 4 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | /* global kirkiWebfonts, WebFont */ |
||
| 4 | ( function( document ) { |
||
| 5 | let wfScript = document.createElement( 'script' ), |
||
| 6 | scripts = document.scripts[0]; |
||
| 7 | |||
| 8 | wfScript.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js'; |
||
| 9 | wfScript.id = 'webfontloader'; |
||
| 10 | wfScript.async = true; |
||
| 11 | |||
| 12 | scripts.parentNode.insertBefore( wfScript, scripts ); |
||
| 13 | } )( document ); |
||
| 14 | |||
| 15 | jQuery( document ).ready( function() { |
||
| 16 | let script = document.querySelector( '#webfontloader' ); |
||
| 17 | |||
| 18 | // Check when the webfontloader finishes loading. |
||
| 19 | script.addEventListener( 'load', function() { |
||
| 20 | |||
| 21 | // Loop fonts. |
||
| 22 | _.each( kirkiWebfonts, function( weights, family ) { |
||
| 23 | |||
| 24 | // Add font. |
||
| 25 | WebFont.load( { |
||
| 26 | google:{ |
||
| 27 | families: [ family + ':' + weights.join( ',' ) + 'cyrillic,cyrillic-ext,devanagari,greek,greek-ext,khmer,latin,latin-ext,vietnamese,hebrew,arabic,bengali,gujarati,tamil,telugu,thai' ] |
||
| 28 | } |
||
| 29 | } ); |
||
| 30 | } ); |
||
| 31 | } ); |
||
| 32 | } ); |
||
| 33 |