Permalink
Browse files

Update pe-analogclock-oldie.js

Corrected the name of the font family and tried to correct the loop for adding the icon element.
  • Loading branch information...
1 parent 7210035 commit d38bb2930fcaf95d6597773b4b24a8061ccb8107 J. Hogue committed Sep 13, 2012
Showing with 11 additions and 6 deletions.
  1. +11 −6 pe-analogclock-oldie.js
View
@@ -10,7 +10,7 @@
window.onload = function() {
function addIcon(el, entity) {
var html = el.innerHTML;
- el.innerHTML = '<span style="font-family: \'pe-analogtime\'">' + entity + '</span>' + html;
+ el.innerHTML = '<span style="font-family: \'pe-analogclock\'">' + entity + '</span>' + html;
}
var icons = {
'.minute-00' : '&#x21;',
@@ -89,17 +89,22 @@ window.onload = function() {
'hour-11' : '&#x30;'
},
els = document.getElementsByTagName('*'),
- i, attr, html, c, el;
+ i, attr, html, h, m, el;
for (i = 0; i < els.length; i += 1) {
el = els[i];
attr = el.getAttribute('data-icon');
if (attr) {
addIcon(el, attr);
}
- c = el.className;
- c = c.match(/icon-[^\s'"]+/);
- if (c) {
- addIcon(el, icons[c[0]]);
+ h = el.className;
+ h = h.match(/hour-[^\s'"]+/);
+ if (h) {
+ addIcon(el, icons[h[0]]);
+ }
+ m = el.className;
+ m = m.match(/minute-[^\s'"]+/);
+ if (m) {
+ addIcon(el, icons[m[0]]);
}
}
};

0 comments on commit d38bb29

Please sign in to comment.