root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / lte-ie7.js @ 7883f0bb
History | View | Annotate | Download (1.5 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\'">' + 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-ok' : 'h', |
14 |
'snf-ban-circle' : 'j', |
15 |
'snf-ok-sign' : 'l', |
16 |
'snf-minus-sign' : 'n', |
17 |
'snf-edit-1' : 'q', |
18 |
'snf-HDD' : 'u', |
19 |
'snf-network' : 'v', |
20 |
'snf-PC' : 'w', |
21 |
'snf-PC_fill' : 'x', |
22 |
'snf-Pithos' : 'y', |
23 |
'snf-DASHboard' : 'z', |
24 |
'snf-eye' : 'A', |
25 |
'snf-radio-checked' : 'B', |
26 |
'snf-radio-unchecked' : 'C', |
27 |
'snf-close' : 'D', |
28 |
'snf-cpu' : 'E', |
29 |
'snf-lock_closed' : 'F', |
30 |
'snf-lock_open' : 'G', |
31 |
'snf-modem' : 'H', |
32 |
'snf-www' : 'I', |
33 |
'snf-ram' : 'J', |
34 |
'snf-network_full' : 'K' |
35 |
'snf-arrow-up' : 'L', |
36 |
'snf-arrow-down' : 'M' /* rename of snf-arrow-right */ |
37 |
'snf-list' : 'Q', |
38 |
'snf-layout' : 'R', |
39 |
'snf-search' : 'P' |
40 |
}, |
41 |
els = document.getElementsByTagName('*'),
|
42 |
i, attr, c, el; |
43 |
for (i = 0; ; i += 1) { |
44 |
el = els[i]; |
45 |
if(!el) {
|
46 |
break;
|
47 |
} |
48 |
attr = el.getAttribute('data-icon');
|
49 |
if (attr) {
|
50 |
addIcon(el, attr); |
51 |
} |
52 |
c = el.className; |
53 |
c = c.match(/snf-[^\s'"]+/);
|
54 |
if (c && icons[c[0]]) { |
55 |
addIcon(el, icons[c[0]]);
|
56 |
} |
57 |
} |
58 |
}; |