154 lines
4.4 KiB
JavaScript
154 lines
4.4 KiB
JavaScript
/* 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-home' : '!',
|
|
'icon-user' : '"',
|
|
'icon-locked' : '#',
|
|
'icon-comments' : '$',
|
|
'icon-comments-2' : '%',
|
|
'icon-out' : '&',
|
|
'icon-redo' : ''',
|
|
'icon-undo' : '(',
|
|
'icon-file-add' : ')',
|
|
'icon-plus' : '*',
|
|
'icon-pencil' : '+',
|
|
'icon-pencil-2' : ',',
|
|
'icon-folder' : '-',
|
|
'icon-folder-2' : '.',
|
|
'icon-picture' : '/',
|
|
'icon-pictures' : '0',
|
|
'icon-list-view' : '1',
|
|
'icon-power-cord' : '2',
|
|
'icon-cube' : '3',
|
|
'icon-puzzle' : '4',
|
|
'icon-flag' : '5',
|
|
'icon-tools' : '6',
|
|
'icon-cogs' : '7',
|
|
'icon-cog' : '8',
|
|
'icon-equalizer' : '9',
|
|
'icon-wrench' : ':',
|
|
'icon-brush' : ';',
|
|
'icon-eye' : '<',
|
|
'icon-checkbox-unchecked' : '=',
|
|
'icon-checkbox' : '>',
|
|
'icon-checkbox-partial' : '?',
|
|
'icon-star' : '@',
|
|
'icon-star-2' : 'A',
|
|
'icon-star-3' : 'B',
|
|
'icon-calendar' : 'C',
|
|
'icon-calendar-2' : 'D',
|
|
'icon-help' : 'E',
|
|
'icon-support' : 'F',
|
|
'icon-warning' : 'H',
|
|
'icon-checkmark' : 'G',
|
|
'icon-cancel' : 'J',
|
|
'icon-minus' : 'K',
|
|
'icon-remove' : 'L',
|
|
'icon-mail' : 'M',
|
|
'icon-mail-2' : 'N',
|
|
'icon-drawer' : 'O',
|
|
'icon-drawer-2' : 'P',
|
|
'icon-box-add' : 'Q',
|
|
'icon-box-remove' : 'R',
|
|
'icon-search' : 'S',
|
|
'icon-filter' : 'T',
|
|
'icon-camera' : 'U',
|
|
'icon-play' : 'V',
|
|
'icon-music' : 'W',
|
|
'icon-grid-view' : 'X',
|
|
'icon-grid-view-2' : 'Y',
|
|
'icon-menu' : 'Z',
|
|
'icon-thumbs-up' : '[',
|
|
'icon-thumbs-down' : '\',
|
|
'icon-cancel-2' : 'I',
|
|
'icon-plus-2' : ']',
|
|
'icon-minus-2' : '^',
|
|
'icon-key' : '_',
|
|
'icon-quote' : '`',
|
|
'icon-quote-2' : 'a',
|
|
'icon-database' : 'b',
|
|
'icon-location' : 'c',
|
|
'icon-zoom-in' : 'd',
|
|
'icon-zoom-out' : 'e',
|
|
'icon-expand' : 'f',
|
|
'icon-contract' : 'g',
|
|
'icon-expand-2' : 'h',
|
|
'icon-contract-2' : 'i',
|
|
'icon-health' : 'j',
|
|
'icon-wand' : 'k',
|
|
'icon-refresh' : 'l',
|
|
'icon-vcard' : 'm',
|
|
'icon-clock' : 'n',
|
|
'icon-compass' : 'o',
|
|
'icon-address' : 'p',
|
|
'icon-feed' : 'q',
|
|
'icon-flag-2' : 'r',
|
|
'icon-pin' : 's',
|
|
'icon-lamp' : 't',
|
|
'icon-chart' : 'u',
|
|
'icon-bars' : 'v',
|
|
'icon-pie' : 'w',
|
|
'icon-dashboard' : 'x',
|
|
'icon-lightning' : 'y',
|
|
'icon-move' : 'z',
|
|
'icon-next' : '{',
|
|
'icon-previous' : '|',
|
|
'icon-first' : '}',
|
|
'icon-last' : '',
|
|
'icon-loop' : '',
|
|
'icon-shuffle' : '',
|
|
'icon-arrow-first' : '',
|
|
'icon-arrow-last' : '',
|
|
'icon-arrow-up' : '',
|
|
'icon-arrow-right' : '',
|
|
'icon-arrow-down' : '',
|
|
'icon-arrow-left' : '',
|
|
'icon-arrow-up-2' : '',
|
|
'icon-arrow-right-2' : '',
|
|
'icon-arrow-down-2' : '',
|
|
'icon-arrow-left-2' : '',
|
|
'icon-play-2' : '',
|
|
'icon-menu-2' : '',
|
|
'icon-arrow-up-3' : '',
|
|
'icon-arrow-right-3' : '',
|
|
'icon-arrow-down-3' : '',
|
|
'icon-arrow-left-3' : '',
|
|
'icon-printer' : '',
|
|
'icon-color-palette' : '',
|
|
'icon-camera-2' : '',
|
|
'icon-file' : '',
|
|
'icon-file-remove' : '',
|
|
'icon-copy' : '',
|
|
'icon-cart' : '',
|
|
'icon-basket' : '',
|
|
'icon-broadcast' : '',
|
|
'icon-screen' : '',
|
|
'icon-tablet' : '',
|
|
'icon-mobile' : '',
|
|
'icon-users' : '',
|
|
'icon-briefcase' : '',
|
|
'icon-download' : '',
|
|
'icon-upload' : '',
|
|
'icon-bookmark' : '',
|
|
'icon-out-2' : ''
|
|
},
|
|
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]]);
|
|
}
|
|
}
|
|
}; |