root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / lte-ie7.js @ 1b2adfd1
History | View | Annotate | Download (2.8 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-trash' : '$', |
10 |
'snf-eye' : 'A', |
11 |
'snf-radio-checked' : 'B', |
12 |
'snf-radio-unchecked' : 'C', |
13 |
'snf-close' : 'D', |
14 |
'snf-www' : 'I', |
15 |
'snf-arrow-up' : 'L', |
16 |
'snf-arrow-down' : 'M', |
17 |
'snf-checkbox-unchecked' : 'a', |
18 |
'snf-checkbox-checked' : 'b', |
19 |
'snf-cancel-circled' : 'c', |
20 |
'snf-search' : 'd', |
21 |
'snf-twitter-logo' : 'g', |
22 |
'snf-ok' : 'h', |
23 |
'snf-switch' : 'i', |
24 |
'snf-ban-circle' : 'j', |
25 |
'snf-ok-sign' : 'l', |
26 |
'snf-minus-sign' : 'n', |
27 |
'snf-edit' : 'q', |
28 |
'snf-listview' : 's', |
29 |
'snf-gridview' : 't', |
30 |
'snf-dashboard-outline' : 'z', |
31 |
'snf-pithos-outline' : 'y', |
32 |
'snf-info-full' : 'p', |
33 |
'snf-volume-create-full' : '6', |
34 |
'snf-image-full' : 'Q', |
35 |
'snf-pc-create-full' : 'S', |
36 |
'snf-network-create-outline' : 'T', |
37 |
'snf-network-create-full' : 'U', |
38 |
'snf-ram-outline' : 'J', |
39 |
'snf-nic-outline' : 'P', |
40 |
'snf-ram-full' : 'R', |
41 |
'snf-nic-full' : 'r', |
42 |
'snf-network-broken-1-full' : 'V', |
43 |
'snf-network-broken-2-full' : 'W', |
44 |
'snf-pc-broken-full' : 'X', |
45 |
'snf-pc-reboot-full' : 'Y', |
46 |
'snf-pc-switch-full' : 'Z', |
47 |
'snf-key-full' : '1', |
48 |
'snf-router-full' : '2', |
49 |
'snf-chip-full' : '3', |
50 |
'snf-plus-full' : '4', |
51 |
'snf-snapshot-full' : 'N', |
52 |
'snf-pithos-full' : '5', |
53 |
'snf-volume-full' : 'O', |
54 |
'snf-network-full' : 'K', |
55 |
'snf-pc-full' : 'x', |
56 |
'snf-network-broken-1-outline' : '7', |
57 |
'snf-network-broken-2-outline' : '8', |
58 |
'snf-pc-broken-outline' : '9', |
59 |
'snf-volume-broken-outline' : '0', |
60 |
'snf-pc-reboot-outline' : '!', |
61 |
'snf-pc-switch-outline' : '@', |
62 |
'snf-key-outline' : '#', |
63 |
'snf-router-outline' : 'H', |
64 |
'snf-chip-outline' : 'E', |
65 |
'snf-image-outline' : 'f', |
66 |
'snf-plus-outilne' : 'm', |
67 |
'snf-snapshot-outline' : 'e', |
68 |
'snf-volume-outline' : 'u', |
69 |
'snf-network-outline' : 'v', |
70 |
'snf-pc-outline' : 'w', |
71 |
'snf-info-outline' : 'o', |
72 |
'snf-thunder-full' : 'k', |
73 |
'snf-lock-closed-full' : 'F', |
74 |
'snf-lock-open-full' : 'G' |
75 |
}, |
76 |
els = document.getElementsByTagName('*'),
|
77 |
i, attr, c, el; |
78 |
for (i = 0; ; i += 1) { |
79 |
el = els[i]; |
80 |
if(!el) {
|
81 |
break;
|
82 |
} |
83 |
attr = el.getAttribute('data-icon');
|
84 |
if (attr) {
|
85 |
addIcon(el, attr); |
86 |
} |
87 |
c = el.className; |
88 |
c = c.match(/snf-[^\s'"]+/);
|
89 |
if (c && icons[c[0]]) { |
90 |
addIcon(el, icons[c[0]]);
|
91 |
} |
92 |
} |
93 |
}; |