122 lines
3.6 KiB
JavaScript
122 lines
3.6 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-image' : '⬔',
|
||
|
'icon-camera' : '',
|
||
|
'icon-camera-2' : '☖',
|
||
|
'icon-film' : '☗',
|
||
|
'icon-play' : '◙',
|
||
|
'icon-music' : '♫',
|
||
|
'icon-headphones' : '♬',
|
||
|
'icon-phone' : '☏',
|
||
|
'icon-phone-hang-up' : '☎',
|
||
|
'icon-address-book' : '✏',
|
||
|
'icon-notebook' : '✐',
|
||
|
'icon-image-2' : '⬓',
|
||
|
'icon-images' : '',
|
||
|
'icon-home-2' : '',
|
||
|
'icon-home-3' : '',
|
||
|
'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-spinner-2' : '☼',
|
||
|
'icon-spinner-3' : '❆',
|
||
|
'icon-search' : '',
|
||
|
'icon-cogs' : '',
|
||
|
'icon-cog' : '✸',
|
||
|
'icon-wrench' : '',
|
||
|
'icon-unlocked' : '',
|
||
|
'icon-lock' : '',
|
||
|
'icon-lock-2' : '',
|
||
|
'icon-key' : '',
|
||
|
'icon-key-2' : '',
|
||
|
'icon-zoom-out' : '',
|
||
|
'icon-zoom-in' : '',
|
||
|
'icon-cog-2' : '',
|
||
|
'icon-remove' : '',
|
||
|
'icon-remove-2' : '',
|
||
|
'icon-eye' : '⚇',
|
||
|
'icon-eye-2' : '',
|
||
|
'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-code' : '❭',
|
||
|
'icon-embed' : '❬',
|
||
|
'icon-new-tab' : '',
|
||
|
'icon-youtube' : '',
|
||
|
'icon-close' : '✕',
|
||
|
'icon-blocked' : '✘',
|
||
|
'icon-cancel-circle' : '',
|
||
|
'icon-info-2' : '',
|
||
|
'icon-minus' : '',
|
||
|
'icon-plus' : '✚',
|
||
|
'icon-checkbox-checked' : '☑',
|
||
|
'icon-checkbox-unchecked' : '⬧',
|
||
|
'icon-checkbox-partial' : '⬨',
|
||
|
'icon-radio-checked' : '⬦',
|
||
|
'icon-radio-unchecked' : '⬥',
|
||
|
'icon-busy' : '',
|
||
|
'icon-offline' : ''
|
||
|
},
|
||
|
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]]);
|
||
|
}
|
||
|
}
|
||
|
};
|