Sha256: aabc11c1ab82498a9216e558e0c26aea84b2826eeec85de9a5676ae04bbbe0a5
Contents?: true
Size: 733 Bytes
Versions: 3
Compression:
Stored size: 733 Bytes
Contents
/* Use this script if you need to support IE 7 and IE 6. */ window.onload = function() { function addIcon(el, entity) { var html = el.innerHTML; el.innerHTML = '<span style="font-family: \'icomoon\'">' + entity + '</span>' + html; } var icons = { 'icon-bold' : '!', 'icon-font-size' : '"', 'icon-italic' : '#', 'icon-underline' : '$', 'icon-list' : '&', 'icon-out' : '%' }, els = document.getElementsByTagName('*'), i, attr, html, c, el; for (i = 0; i < els.length; i += 1) { el = els[i]; attr = el.getAttribute('data-icon'); if (attr) { addIcon(el, attr); } c = el.className; c = c.match(/icon-[^s'"]+/); if (c) { addIcon(el, icons[c[0]]); } } };
Version data entries
3 entries across 3 versions & 1 rubygems