Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / new_ui / ui / javascripts / lte-ie7.js @ 8db75456

History | View | Annotate | Download (1.4 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
                },
37
                els = document.getElementsByTagName('*'),
38
                i, attr, c, el;
39
        for (i = 0; ; i += 1) {
40
                el = els[i];
41
                if(!el) {
42
                        break;
43
                }
44
                attr = el.getAttribute('data-icon');
45
                if (attr) {
46
                        addIcon(el, attr);
47
                }
48
                c = el.className;
49
                c = c.match(/snf-[^\s'"]+/);
50
                if (c && icons[c[0]]) {
51
                        addIcon(el, icons[c[0]]);
52
                }
53
        }
54
};