diff media/js/downloads/rating.js @ 255:2ba1a6d3b984

Close #104; downloads javascript has incorrect hard-coded path to star graphics. Also correct count fields in downloads category fixture.
author Brian Neal <bgneal@gmail.com>
date Tue, 21 Sep 2010 00:52:55 +0000
parents b43e1288ff80
children
line wrap: on
line diff
--- a/media/js/downloads/rating.js	Tue Sep 21 00:26:38 2010 +0000
+++ b/media/js/downloads/rating.js	Tue Sep 21 00:52:55 2010 +0000
@@ -5,7 +5,7 @@
     for (var i = 0; i <= event.data; ++i)
     {
         var star = $(stars[i]);
-        star.attr('src', '/static/downloads/stars/rating_over.gif');
+        star.attr('src', '/media/downloads/stars/rating_over.gif');
     }
 }
 
@@ -16,7 +16,7 @@
     for (var i = 0; i <= event.data; ++i)
     {
         var star = $(stars[i]);
-        star.attr('src', '/static/downloads/stars/rating_' + star.attr('class') + '.gif');
+        star.attr('src', '/media/downloads/stars/rating_' + star.attr('class') + '.gif');
     }
 }
 
@@ -48,19 +48,19 @@
                     s.removeClass(s.attr('class'));
                     if (rating >= 1.0)
                     {
-                        s.attr('src', '/static/downloads/stars/rating_on.gif');
+                        s.attr('src', '/media/downloads/stars/rating_on.gif');
                         s.addClass('on')
                         rating -= 1.0;
                     }
                     else if (rating >= 0.5)
                     {
-                        s.attr('src', '/static/downloads/stars/rating_half.gif');
+                        s.attr('src', '/media/downloads/stars/rating_half.gif');
                         s.addClass('half')
                         rating = 0;
                     }
                     else
                     {
-                        s.attr('src', '/static/downloads/stars/rating_off.gif');
+                        s.attr('src', '/media/downloads/stars/rating_off.gif');
                         s.addClass('off')
                     }
                 }
@@ -89,19 +89,19 @@
             var star = $('<img />');
             if (rating >= 1)
             {
-                star.attr('src', '/static/downloads/stars/rating_on.gif');
+                star.attr('src', '/media/downloads/stars/rating_on.gif');
                 star.addClass('on')
                 --rating;
             }
             else if (rating >= 0.5)
             {
-                star.attr('src', '/static/downloads/stars/rating_half.gif');
+                star.attr('src', '/media/downloads/stars/rating_half.gif');
                 star.addClass('half')
                 rating = 0;
             }
             else
             {
-                star.attr('src', '/static/downloads/stars/rating_off.gif');
+                star.attr('src', '/media/downloads/stars/rating_off.gif');
                 star.addClass('off')
             }
             star.attr('alt', 'star');