ie7.js
1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* To avoid CSS expressions while still supporting IE 7 and IE 6, use this script */
/* The script tag referencing this file must be placed before the ending body tag. */
/* Use conditional comments in order to target IE 7 and older:
<!--[if lt IE 8]><!-->
<script src="ie7/ie7.js"></script>
<!--<![endif]-->
*/
(function() {
function addIcon(el, entity) {
var html = el.innerHTML;
el.innerHTML = '<span style="font-family: \'icon-document\'">' + entity + '</span>' + html;
}
var icons = {
'icon-document-doc': '',
'icon-document-del': '',
'icon-document-File': '',
'icon-document-Invalid': '',
'icon-document-Mandatory-check-in': '',
'icon-document-Open-void': '',
'icon-document-Release': '',
'icon-document-Reopen-Archive': '',
'icon-document-To-void': '',
'icon-document-Catalog': '',
'icon-document-department': '',
'icon-document-Refresh': '',
'icon-document-Partner': '',
'icon-document-Ranking': '',
'icon-document-Recommend-doc': '',
'icon-document-No-response': '',
'icon-document-currency': '',
'icon-document-excel': '',
'icon-document-html': '',
'icon-document-pdf': '',
'icon-document-pic': '',
'icon-document-ppt': '',
'icon-document-rar': '',
'icon-document-word': '',
'icon-document-reply': '',
'icon-document-attachment': '',
'0': 0
},
els = document.getElementsByTagName('*'),
i, c, el;
for (i = 0; ; i += 1) {
el = els[i];
if(!el) {
break;
}
c = el.className;
c = c.match(/icon-[^\s'"]+/);
if (c && icons[c[0]]) {
addIcon(el, icons[c[0]]);
}
}
}());