112 lines
3.3 KiB
JavaScript
112 lines
3.3 KiB
JavaScript
/* Load this script using conditional IE comments 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: \'Converse-js\'">' + entity + '</span>' + html;
|
|
}
|
|
var icons = {
|
|
'icon-home' : '',
|
|
'icon-pencil' : '✎',
|
|
'icon-camera' : '',
|
|
'icon-camera-2' : '☖',
|
|
'icon-play' : '◙',
|
|
'icon-music' : '♫',
|
|
'icon-headphones' : '♬',
|
|
'icon-phone' : '☏',
|
|
'icon-phone-hang-up' : '☎',
|
|
'icon-address-book' : '✏',
|
|
'icon-notebook' : '✐',
|
|
'icon-envelop' : '✉',
|
|
'icon-pushpin' : '',
|
|
'icon-bubble' : '◼',
|
|
'icon-bubble-2' : '◻',
|
|
'icon-bubbles' : '',
|
|
'icon-bubbles-2' : '',
|
|
'icon-bubbles-3' : '',
|
|
'icon-user' : '',
|
|
'icon-users' : '',
|
|
'icon-quotes-left' : '',
|
|
'icon-spinner' : '⌛',
|
|
'icon-search' : '',
|
|
'icon-cogs' : '',
|
|
'icon-wrench' : '',
|
|
'icon-unlocked' : '',
|
|
'icon-lock' : '',
|
|
'icon-lock-2' : '',
|
|
'icon-key' : '',
|
|
'icon-key-2' : '',
|
|
'icon-zoom-out' : '',
|
|
'icon-zoom-in' : '',
|
|
'icon-cog' : '',
|
|
'icon-remove' : '',
|
|
'icon-remove-2' : '',
|
|
'icon-eye' : '',
|
|
'icon-eye-blocked' : '',
|
|
'icon-attachment' : '',
|
|
'icon-globe' : '',
|
|
'icon-heart' : '❤',
|
|
'icon-happy' : '☻',
|
|
'icon-thumbs-up' : '☝',
|
|
'icon-smiley' : '☺',
|
|
'icon-tongue' : '',
|
|
'icon-sad' : '☹',
|
|
'icon-wink' : '',
|
|
'icon-wondering' : '⍩',
|
|
'icon-confused' : '⍨',
|
|
'icon-shocked' : '⍤',
|
|
'icon-evil' : '☟',
|
|
'icon-angry' : '',
|
|
'icon-cool' : '',
|
|
'icon-grin' : '',
|
|
'icon-info' : '⍠',
|
|
'icon-notification' : '',
|
|
'icon-warning' : '⚠',
|
|
'icon-spell-check' : '',
|
|
'icon-volume-high' : '',
|
|
'icon-volume-medium' : '',
|
|
'icon-volume-low' : '',
|
|
'icon-volume-mute' : '',
|
|
'icon-volume-mute-2' : '',
|
|
'icon-volume-decrease' : '',
|
|
'icon-volume-increase' : '',
|
|
'icon-bold' : '',
|
|
'icon-underline' : '',
|
|
'icon-italic' : '',
|
|
'icon-strikethrough' : '',
|
|
'icon-new-tab' : '',
|
|
'icon-youtube' : '',
|
|
'icon-close' : '✕',
|
|
'icon-blocked' : '✘',
|
|
'icon-cancel-circle' : '',
|
|
'icon-minus' : '',
|
|
'icon-plus' : '✚',
|
|
'icon-checkbox-checked' : '☑',
|
|
'icon-checkbox-unchecked' : '⬧',
|
|
'icon-checkbox-partial' : '⬨',
|
|
'icon-radio-checked' : '⬦',
|
|
'icon-radio-unchecked' : '⬥',
|
|
'icon-info-2' : '',
|
|
'icon-newspaper' : '',
|
|
'icon-image' : '⬔',
|
|
'icon-offline' : '',
|
|
'icon-busy' : ''
|
|
},
|
|
els = document.getElementsByTagName('*'),
|
|
i, attr, html, c, el;
|
|
for (i = 0; ; i += 1) {
|
|
el = els[i];
|
|
if(!el) {
|
|
break;
|
|
}
|
|
attr = el.getAttribute('data-icon');
|
|
if (attr) {
|
|
addIcon(el, attr);
|
|
}
|
|
c = el.className;
|
|
c = c.match(/icon-[^\s'"]+/);
|
|
if (c && icons[c[0]]) {
|
|
addIcon(el, icons[c[0]]);
|
|
}
|
|
}
|
|
}; |