webfontloader 1.6.11 → 1.6.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2613d53543cbede96569f20652acc63f6d9f4531
4
- data.tar.gz: 0bf80a7cb8ca4af372ea56382af7d5a961631b54
3
+ metadata.gz: 6faeba41642774e5a27e4723d16cb346f83e0cbd
4
+ data.tar.gz: a72f21834f3781ee10c9e499f2cfca7ecee11026
5
5
  SHA512:
6
- metadata.gz: 3e45ba99933335f6bdc4c8cf20c4c97bfd15008e4ee6d0406895b0323e07eae4160c798eb8cac5fda6ecc516ee31e82100a64d3db9579a019c9624e5010176d8
7
- data.tar.gz: 2152fe4f24824f3ca42b1fa6a9874fab655c4bdc6e8cf87d43cfcd71562ddcf59030f3fef6a47dfed087b4e18d7f13ce74f7520f7b886707bf66c9a2c129bbab
6
+ metadata.gz: aea620022efe85c3f3207c1b2b2a7592739abc7d862e009f49abb68f77a05c9fd0de18aba366f2fadfe036d65ea1b27c0e17fa3b17f66b9fcf712bf70de7e949
7
+ data.tar.gz: fe2a1683b5762f299de149694407af72730d93bcb87c84fd54e52cfe04663733edc88a206d2aa9f26019dccae65cc6ce45d8ddbc08d0591934c5583c909167e1
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ v1.6.12 (November 23, 2015)
2
+
3
+ * Fix bug that sometimes caused wf-inactive to show when asynchronously loading CSS.
4
+
1
5
  v1.6.11 (November 17, 2015)
2
6
 
3
7
  * Only include production build in npm package
data/lib/webfontloader.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'webfontloader/modules'
4
4
 
5
5
  module WebFontLoader
6
- VERSION = '1.6.11'
6
+ VERSION = '1.6.12'
7
7
 
8
8
  ProjectRoot = File.expand_path(File.dirname(__FILE__) + "/..")
9
9
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webfontloader",
3
- "version": "1.6.10",
3
+ "version": "1.6.11",
4
4
  "description": "Web Font Loader gives you added control when using linked fonts via @font-face.",
5
5
  "main": "webfontloader.js",
6
6
  "scripts": {
@@ -338,7 +338,7 @@ goog.scope(function () {
338
338
  }, 0);
339
339
  }
340
340
 
341
- function onAvailable(callback) {
341
+ function onStylesheetAvailable(callback) {
342
342
  for (var i = 0; i < sheets.length; i++) {
343
343
  if (sheets[i].href && sheets[i].href.indexOf(href) !== -1) {
344
344
  return callback();
@@ -346,20 +346,32 @@ goog.scope(function () {
346
346
  }
347
347
 
348
348
  setTimeout(function () {
349
- onAvailable(callback);
349
+ onStylesheetAvailable(callback);
350
350
  }, 0);
351
351
  }
352
352
 
353
+ function onMediaAvailable(callback) {
354
+ if (link.sheet && link.sheet.media[0] === "all") {
355
+ callback();
356
+ } else {
357
+ setTimeout(function () {
358
+ onMediaAvailable(callback);
359
+ }, 0);
360
+ }
361
+ }
362
+
353
363
  this.insertInto('head', link);
354
364
 
355
365
  if (opt_async) {
356
- onAvailable(function () {
366
+ onStylesheetAvailable(function () {
357
367
  link.media = "all";
358
- // Give another tick to ensure the @media change takes effect.
359
- setTimeout(function() {
368
+ // The media type change doesn't take effect immediately on Chrome, so
369
+ // we'll query the media attribute on the stylesheet until it changes
370
+ // to "all".
371
+ onMediaAvailable(function () {
360
372
  asyncResolved = true;
361
373
  mayInvokeCallback();
362
- }, 0);
374
+ });
363
375
  });
364
376
  }
365
377
 
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'webfontloader'
16
- s.version = '1.6.11'
17
- s.date = '2015-11-17'
16
+ s.version = '1.6.12'
17
+ s.date = '2015-11-23'
18
18
 
19
19
  ## Make sure your summary is short. The description may be as long
20
20
  ## as you like.
data/webfontloader.js CHANGED
@@ -1,4 +1,4 @@
1
- /* Web Font Loader v1.6.11 - (c) Adobe Systems, Google. License: Apache 2.0 */
1
+ /* Web Font Loader v1.6.12 - (c) Adobe Systems, Google. License: Apache 2.0 */
2
2
  (function(){function aa(a,b,c){return a.call.apply(a.bind,arguments)}function ba(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}}function n(a,b,c){n=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?aa:ba;return n.apply(null,arguments)}var p=Date.now||function(){return+new Date};function q(a,b){this.F=a;this.k=b||a;this.H=this.k.document}var ca=!!window.FontFace;q.prototype.createElement=function(a,b,c){a=this.H.createElement(a);if(b)for(var d in b)b.hasOwnProperty(d)&&("style"==d?a.style.cssText=b[d]:a.setAttribute(d,b[d]));c&&a.appendChild(this.H.createTextNode(c));return a};function s(a,b,c){a=a.H.getElementsByTagName(b)[0];a||(a=document.documentElement);a.insertBefore(c,a.lastChild)}
3
3
  function t(a,b,c){b=b||[];c=c||[];for(var d=a.className.split(/\s+/),e=0;e<b.length;e+=1){for(var f=!1,g=0;g<d.length;g+=1)if(b[e]===d[g]){f=!0;break}f||d.push(b[e])}b=[];for(e=0;e<d.length;e+=1){f=!1;for(g=0;g<c.length;g+=1)if(d[e]===c[g]){f=!0;break}f||b.push(d[e])}a.className=b.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function u(a,b){for(var c=a.className.split(/\s+/),d=0,e=c.length;d<e;d++)if(c[d]==b)return!0;return!1}
4
4
  function v(a){if("string"===typeof a.fa)return a.fa;var b=a.k.location.protocol;"about:"==b&&(b=a.F.location.protocol);return"https:"==b?"https:":"http:"}function x(a,b,c){function d(){l&&e&&f&&(l(g),l=null)}b=a.createElement("link",{rel:"stylesheet",href:b,media:"all"});var e=!1,f=!0,g=null,l=c||null;ca?(b.onload=function(){e=!0;d()},b.onerror=function(){e=!0;g=Error("Stylesheet failed to load");d()}):setTimeout(function(){e=!0;d()},0);s(a,"head",b)}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webfontloader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.11
4
+ version: 1.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Carver
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-11-17 00:00:00.000000000 Z
12
+ date: 2015-11-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake