Sha256: cd5db51eebc6acdae86cfbd2fcef97c1fdcfe9c979420473505fe06e0a47d4f5
Contents?: true
Size: 1.1 KB
Versions: 14
Compression:
Stored size: 1.1 KB
Contents
/** * * WebFont.load({ * custom: { * families: ['Font1', 'Font2'], * urls: [ 'http://moo', 'http://meuh' ] } * }); * * @constructor */ webfont.CustomCss = function(domHelper, configuration) { this.domHelper_ = domHelper; this.configuration_ = configuration; }; webfont.CustomCss.NAME = 'custom'; webfont.CustomCss.prototype.load = function(onReady) { var urls = this.configuration_['urls'] || []; var families = this.configuration_['families'] || []; for (var i = 0, len = urls.length; i < len; i++) { var url = urls[i]; this.domHelper_.insertInto('head', this.domHelper_.createCssLink(url)); } onReady(families); }; webfont.CustomCss.prototype.supportUserAgent = function(userAgent, support) { return support(userAgent.isSupportingWebFont()); }; window['WebFont'].addModule(webfont.CustomCss.NAME, function(configuration) { var userAgentParser = new webfont.UserAgentParser(navigator.userAgent, document); var userAgent = userAgentParser.parse(); var domHelper = new webfont.DomHelper(document, userAgent); return new webfont.CustomCss(domHelper, configuration); });
Version data entries
14 entries across 14 versions & 1 rubygems