;(function(window) { var svgsprite = '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' var script = function() { var scripts = document.getelementsbytagname('script') return scripts[scripts.length - 1] }() var shouldinjectcss = script.getattribute("data-injectcss") /** * document ready */ var ready = function(fn) { if (document.addeventlistener) { if (~["complete", "loaded", "interactive"].indexof(document.readystate)) { settimeout(fn, 0) } else { var loadfn = function() { document.removeeventlistener("domcontentloaded", loadfn, false) fn() } document.addeventlistener("domcontentloaded", loadfn, false) } } else if (document.attachevent) { iecontentloaded(window, fn) } function iecontentloaded(w, fn) { var d = w.document, done = false, // only fire once init = function() { if (!done) { done = true fn() } } // polling for no errors var polling = function() { try { // throws errors until after ondocumentready d.documentelement.doscroll('left') } catch (e) { settimeout(polling, 50) return } // no errors, fire init() }; polling() // trying to always fire before onload d.onreadystatechange = function() { if (d.readystate == 'complete') { d.onreadystatechange = null init() } } } } /** * insert el before target * * @param {element} el * @param {element} target */ var before = function(el, target) { target.parentnode.insertbefore(el, target) } /** * prepend el to target * * @param {element} el * @param {element} target */ var prepend = function(el, target) { if (target.firstchild) { before(el, target.firstchild) } else { target.appendchild(el) } } function appendsvg() { var div, svg div = document.createelement('div') div.innerhtml = svgsprite svgsprite = null svg = div.getelementsbytagname('svg')[0] if (svg) { svg.setattribute('aria-hidden', 'true') svg.style.position = 'absolute' svg.style.width = 0 svg.style.height = 0 svg.style.overflow = 'hidden' prepend(svg, document.body) } } if (shouldinjectcss && !window.__iconfont__svg__cssinject__) { window.__iconfont__svg__cssinject__ = true try { document.write(""); } catch (e) { console && console.log(e) } } ready(appendsvg) })(window)