Sadik B
Well-known member
Hi so I was looking at the implementation of ratings in the RM and found an interesting bug.
1. Let's say we open this resource -> http://xenforo.com/community/resources/template-modification-system-tms.293/
2. Obviously, this is a GREAT addon and it's rating is 5/5. But let's change the rating value to 3.4, through Firebug or similar tool. We can do this by changing the contents inside RatingValue Number <span> tag.
So we make it,
3. Now since we obviously changed it through Firebug, we won't get a page refresh. But the classes "star Half" or "star Half Full" get employed on mouseover.
4. So if we mouseover over the stars and then leave the mouse from the stars, we expect 3 and a half stars, because the star classes got updated with jQuery but instead of 3 and a half stars we get 4 stars!
5. Now instead of 3.4 if we change the span value to 3.5, that is,
And then mouse hover over it and mouse leave, then we DO get 3 and a half stars correctly!
Yeah pretty minor I know and most likely a Javascript ceiling/floor issue so maybe not even worth fixing it immediately, but when you have too much time and a brand new toy, this is what happens!
1. Let's say we open this resource -> http://xenforo.com/community/resources/template-modification-system-tms.293/
2. Obviously, this is a GREAT addon and it's rating is 5/5. But let's change the rating value to 3.4, through Firebug or similar tool. We can do this by changing the contents inside RatingValue Number <span> tag.
HTML:
<span class="RatingValue"><span class="Number">5</span>/5,</span>
HTML:
<span class="RatingValue"><span class="Number">3.4</span>/5,</span>
3. Now since we obviously changed it through Firebug, we won't get a page refresh. But the classes "star Half" or "star Half Full" get employed on mouseover.
4. So if we mouseover over the stars and then leave the mouse from the stars, we expect 3 and a half stars, because the star classes got updated with jQuery but instead of 3 and a half stars we get 4 stars!
5. Now instead of 3.4 if we change the span value to 3.5, that is,
HTML:
<span class="RatingValue"><span class="Number">3.5</span>/5,</span>
And then mouse hover over it and mouse leave, then we DO get 3 and a half stars correctly!
Yeah pretty minor I know and most likely a Javascript ceiling/floor issue so maybe not even worth fixing it immediately, but when you have too much time and a brand new toy, this is what happens!
