root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / lte-ie7.js @ bf348d7d
History | View | Annotate | Download (1.3 kB)
1 |
/* Load this script using conditional IE comments if you need to support IE 7 and IE 6. */
|
---|---|
2 |
|
3 |
window.onload = function() { |
4 |
function addIcon(el, entity) { |
5 |
var html = el.innerHTML;
|
6 |
el.innerHTML = '<span style="font-family: \'snf-font-1\'">' + entity + '</span>' + html; |
7 |
} |
8 |
var icons = {
|
9 |
'snf-twitter-off-black' : 'g', |
10 |
'snf-cancel-circled' : 'c', |
11 |
'snf-checkbox-checked' : 'b', |
12 |
'snf-checkbox-unchecked' : 'a', |
13 |
'snf-cancel-circled2' : 'd', |
14 |
'snf-cancel-circled-outline' : 'e', |
15 |
'snf-cancel-outline' : 'f', |
16 |
'snf-ok' : 'h', |
17 |
'snf-remove' : 'i', |
18 |
'snf-ban-circle' : 'j', |
19 |
'snf-ok-circle' : 'k', |
20 |
'snf-ok-sign' : 'l', |
21 |
'snf-remove-sign' : 'm', |
22 |
'snf-minus-sign' : 'n', |
23 |
'snf-pencil' : 'o', |
24 |
'snf-edit' : 'p', |
25 |
'snf-edit-1' : 'q', |
26 |
'snf-pencil-circled' : 'r', |
27 |
'snf-icon-compute-outline' : 's', |
28 |
'snf-icon-networks-fill' : 't' |
29 |
}, |
30 |
els = document.getElementsByTagName('*'),
|
31 |
i, attr, html, c, el; |
32 |
for (i = 0; ; i += 1) { |
33 |
el = els[i]; |
34 |
if(!el) {
|
35 |
break;
|
36 |
} |
37 |
attr = el.getAttribute('data-icon');
|
38 |
if (attr) {
|
39 |
addIcon(el, attr); |
40 |
} |
41 |
c = el.className; |
42 |
c = c.match(/snf-[^\s'"]+/);
|
43 |
if (c && icons[c[0]]) { |
44 |
addIcon(el, icons[c[0]]);
|
45 |
} |
46 |
} |
47 |
}; |