lte-ie7.js 731 B

123456789101112131415161718192021222324252627282930
  1. /* Load this script using conditional IE comments if you need to support IE 7 and IE 6. */
  2. window.onload = function() {
  3. function addIcon(el, entity) {
  4. var html = el.innerHTML;
  5. el.innerHTML = '<span style="font-family: \'phpdocumentor-clean-icons\'">' + entity + '</span>' + html;
  6. }
  7. var icons = {
  8. 'icon-trait' : '&#xe000;',
  9. 'icon-interface' : '&#xe001;',
  10. 'icon-class' : '&#xe002;'
  11. },
  12. els = document.getElementsByTagName('*'),
  13. i, attr, html, c, el;
  14. for (i = 0; ; i += 1) {
  15. el = els[i];
  16. if(!el) {
  17. break;
  18. }
  19. attr = el.getAttribute('data-icon');
  20. if (attr) {
  21. addIcon(el, attr);
  22. }
  23. c = el.className;
  24. c = c.match(/icon-[^\s'"]+/);
  25. if (c && icons[c[0]]) {
  26. addIcon(el, icons[c[0]]);
  27. }
  28. }
  29. };