Permalink
Browse files

now uses JSON for iheart data

  • Loading branch information...
1 parent a78c40f commit 2ec94111f5a6d54079b8a0d88fde275788bd9331 @barbie committed Mar 24, 2013
Showing with 25 additions and 0 deletions.
  1. +1 −0 MANIFEST
  2. +24 −0 vhost/html/js/iheart.js
View
@@ -140,6 +140,7 @@ vhost/html/images/layout/smoke-100.jpg
vhost/html/images/layout/smoke-150.jpg
vhost/html/images/layout/yellow.png
vhost/html/js/admin.js
+vhost/html/js/iheart.js
vhost/html/js/tiny_mce/langs/en.js
vhost/html/js/tiny_mce/license.txt
vhost/html/js/tiny_mce/plugins/advhr/css/advhr.css
View
@@ -0,0 +1,24 @@
+var html;
+$(document).ready(
+ $.getJSON('/sponsors.json', function(data) {
+ $('#iheart').empty();
+ html = '<div id="iheart">';
+ $.each(data, function(entryIndex, entry) {
+ html += '<h2>'+entry.category+'</h2><ul>';
+ $.each(entry.links, function(itemIndex, item) {
+ if(item.image) {
+ html += '<li><a href="' + item.href + '" title="link to ' + item.title + '"><img src="' + item.image + '" alt="' + item.title + '" ';
+ if(item.width > 150) { html += 'width="150"' } else { html += 'height="50"' }
+ html += ' /></a></li>';
+ } else if(item.title) {
+ html += '<li><a href="' + item.href + '" title="link to ' + item.title + '">' + item.title + '</a></li>';
+ } else {
+ html += '<li><a href="' + item.href + '" title="link to ' + item.href + '">' + item.href + '</a></li>';
+ }
+ });
+ html += '</ul>';
+ });
+ html += '</div>';
+ $('#iheart').append(html);
+ })
+);

0 comments on commit 2ec9411

Please sign in to comment.