ie7.js 1.73 KB
/* 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': '&#xe90e;',
		'icon-document-del': '&#xe906;',
		'icon-document-File': '&#xe907;',
		'icon-document-Invalid': '&#xe908;',
		'icon-document-Mandatory-check-in': '&#xe909;',
		'icon-document-Open-void': '&#xe90a;',
		'icon-document-Release': '&#xe90b;',
		'icon-document-Reopen-Archive': '&#xe90c;',
		'icon-document-To-void': '&#xe90d;',
		'icon-document-Catalog': '&#xe904;',
		'icon-document-department': '&#xe905;',
		'icon-document-Refresh': '&#xe903;',
		'icon-document-Partner': '&#xe900;',
		'icon-document-Ranking': '&#xe901;',
		'icon-document-Recommend-doc': '&#xe902;',
		'icon-document-No-response': '&#xe934;',
		'icon-document-currency': '&#xe933;',
		'icon-document-excel': '&#xe932;',
		'icon-document-html': '&#xe931;',
		'icon-document-pdf': '&#xe930;',
		'icon-document-pic': '&#xe935;',
		'icon-document-ppt': '&#xe92f;',
		'icon-document-rar': '&#xe92e;',
		'icon-document-word': '&#xe92d;',
		'icon-document-reply': '&#xe61a;',
		'icon-document-attachment': '&#xe61b;',
		'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]]);
		}
	}
}());