Statistics
| Branch: | Tag: | Revision:

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' : '&#x67;',
10
                        'snf-cancel-circled' : '&#x63;',
11
                        'snf-checkbox-checked' : '&#x62;',
12
                        'snf-checkbox-unchecked' : '&#x61;',
13
                        'snf-ok' : '&#x68;',
14
                        'snf-ban-circle' : '&#x6a;',
15
                        'snf-ok-sign' : '&#x6c;',
16
                        'snf-minus-sign' : '&#x6e;',
17
                        'snf-edit-1' : '&#x71;',
18
                        'snf-HDD' : '&#x75;',
19
                        'snf-network' : '&#x76;',
20
                        'snf-PC' : '&#x77;',
21
                        'snf-PC_fill' : '&#x78;',
22
                        'snf-Pithos' : '&#x79;',
23
                        'snf-DASHboard' : '&#x7a;',
24
                        'snf-eye' : '&#x41;',
25
                        'snf-radio-checked' : '&#x42;',
26
                        'snf-radio-unchecked' : '&#x43;',
27
                        'snf-close' : '&#x44;',
28
                        'snf-cpu' : '&#x45;',
29
                        'snf-lock_closed' : '&#x46;',
30
                        'snf-lock_open' : '&#x47;',
31
                        'snf-modem' : '&#x48;',
32
                        'snf-www' : '&#x49;',
33
                        'snf-ram' : '&#x4a;',
34
                        'snf-network_full' : '&#x4b;'
35
                        'snf-arrow-up' : '&#x4c;',
36
                        'snf-arrow-down' : '&#x4d;' /* rename of snf-arrow-right */
37
                        'snf-list' : '&#x51;',
38
                        'snf-layout' : '&#x52;',
39
                        'snf-search' : '&#x50;'
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
};