Statistics
| Branch: | Tag: | Revision:

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' : '&#x24;',
10
                        'snf-eye' : '&#x41;',
11
                        'snf-radio-checked' : '&#x42;',
12
                        'snf-radio-unchecked' : '&#x43;',
13
                        'snf-close' : '&#x44;',
14
                        'snf-www' : '&#x49;',
15
                        'snf-arrow-up' : '&#x4c;',
16
                        'snf-arrow-down' : '&#x4d;',
17
                        'snf-checkbox-unchecked' : '&#x61;',
18
                        'snf-checkbox-checked' : '&#x62;',
19
                        'snf-cancel-circled' : '&#x63;',
20
                        'snf-search' : '&#x64;',
21
                        'snf-twitter-logo' : '&#x67;',
22
                        'snf-ok' : '&#x68;',
23
                        'snf-switch' : '&#x69;',
24
                        'snf-ban-circle' : '&#x6a;',
25
                        'snf-ok-sign' : '&#x6c;',
26
                        'snf-minus-sign' : '&#x6e;',
27
                        'snf-edit' : '&#x71;',
28
                        'snf-listview' : '&#x73;',
29
                        'snf-gridview' : '&#x74;',
30
                        'snf-dashboard-outline' : '&#x7a;',
31
                        'snf-pithos-outline' : '&#x79;',
32
                        'snf-info-full' : '&#x70;',
33
                        'snf-volume-create-full' : '&#x36;',
34
                        'snf-image-full' : '&#x51;',
35
                        'snf-pc-create-full' : '&#x53;',
36
                        'snf-network-create-outline' : '&#x54;',
37
                        'snf-network-create-full' : '&#x55;',
38
                        'snf-ram-outline' : '&#x4a;',
39
                        'snf-nic-outline' : '&#x50;',
40
                        'snf-ram-full' : '&#x52;',
41
                        'snf-nic-full' : '&#x72;',
42
                        'snf-network-broken-1-full' : '&#x56;',
43
                        'snf-network-broken-2-full' : '&#x57;',
44
                        'snf-pc-broken-full' : '&#x58;',
45
                        'snf-pc-reboot-full' : '&#x59;',
46
                        'snf-pc-switch-full' : '&#x5a;',
47
                        'snf-key-full' : '&#x31;',
48
                        'snf-router-full' : '&#x32;',
49
                        'snf-chip-full' : '&#x33;',
50
                        'snf-plus-full' : '&#x34;',
51
                        'snf-snapshot-full' : '&#x4e;',
52
                        'snf-pithos-full' : '&#x35;',
53
                        'snf-volume-full' : '&#x4f;',
54
                        'snf-network-full' : '&#x4b;',
55
                        'snf-pc-full' : '&#x78;',
56
                        'snf-network-broken-1-outline' : '&#x37;',
57
                        'snf-network-broken-2-outline' : '&#x38;',
58
                        'snf-pc-broken-outline' : '&#x39;',
59
                        'snf-volume-broken-outline' : '&#x30;',
60
                        'snf-pc-reboot-outline' : '&#x21;',
61
                        'snf-pc-switch-outline' : '&#x40;',
62
                        'snf-key-outline' : '&#x23;',
63
                        'snf-router-outline' : '&#x48;',
64
                        'snf-chip-outline' : '&#x45;',
65
                        'snf-image-outline' : '&#x66;',
66
                        'snf-plus-outilne' : '&#x6d;',
67
                        'snf-snapshot-outline' : '&#x65;',
68
                        'snf-volume-outline' : '&#x75;',
69
                        'snf-network-outline' : '&#x76;',
70
                        'snf-pc-outline' : '&#x77;',
71
                        'snf-info-outline' : '&#x6f;',
72
                        'snf-thunder-full' : '&#x6b;',
73
                        'snf-lock-closed-full' : '&#x46;',
74
                        'snf-lock-open-full' : '&#x47;'
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
};