Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / lte-ie7.js @ 9ac09101

History | View | Annotate | Download (1.9 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-cancel-circled2' : '&#x64;',
14
                        'snf-cancel-circled-outline' : '&#x65;',
15
                        'snf-cancel-outline' : '&#x66;',
16
                        'snf-ok' : '&#x68;',
17
                        'snf-remove' : '&#x69;',
18
                        'snf-ban-circle' : '&#x6a;',
19
                        'snf-ok-circle' : '&#x6b;',
20
                        'snf-ok-sign' : '&#x6c;',
21
                        'snf-remove-sign' : '&#x6d;',
22
                        'snf-minus-sign' : '&#x6e;',
23
                        'snf-pencil' : '&#x6f;',
24
                        'snf-edit' : '&#x70;',
25
                        'snf-edit-1' : '&#x71;',
26
                        'snf-pencil-circled' : '&#x72;',
27
                        'snf-icon-compute-outline' : '&#x73;',
28
                        'snf-icon-networks-fill' : '&#x74;',
29
                        'snf-HDD' : '&#x75;',
30
                        'snf-network' : '&#x76;',
31
                        'snf-PC' : '&#x77;',
32
                        'snf-PC_fill' : '&#x78;',
33
                        'snf-Pithos' : '&#x79;',
34
                        'snf-DASHboard' : '&#x7a;',
35
                        'snf-eye' : '&#x41;',
36
                        'snf-radio-checked' : '&#x42;',
37
                        'snf-radio-unchecked' : '&#x43;',
38
                        'snf-close' : '&#x44;',
39
                        'snf-cpu' : '&#x45;',
40
                        'snf-lock_closed' : '&#x46;',
41
                        'snf-lock_open' : '&#x47;',
42
                        'snf-modem' : '&#x48;',
43
                        'snf-www' : '&#x49;',
44
                        'snf-ram' : '&#x4a;',
45
                        'snf-network_full' : '&#x4b;'
46
                        'snf-arrow-up' : '&#x4c;',
47
                        'snf-arrow-down-2' : '&#x4e;',
48
                        'snf-arrow-up-2' : '&#x4f;',
49
                        'snf-arrow-down' : '&#x4d;' /* rename of snf-arrow-right */
50
                },
51
                els = document.getElementsByTagName('*'),
52
                i, attr, c, el;
53
        for (i = 0; ; i += 1) {
54
                el = els[i];
55
                if(!el) {
56
                        break;
57
                }
58
                attr = el.getAttribute('data-icon');
59
                if (attr) {
60
                        addIcon(el, attr);
61
                }
62
                c = el.className;
63
                c = c.match(/snf-[^\s'"]+/);
64
                if (c && icons[c[0]]) {
65
                        addIcon(el, icons[c[0]]);
66
                }
67
        }
68
};