Subversion Repositories SmartDukaan

Rev

Rev 16679 | Rev 16858 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16679 Rev 16704
Line 1038... Line 1038...
1038
			}
1038
			}
1039
			keys.push(key);
1039
			keys.push(key);
1040
		};
1040
		};
1041
		return properties;
1041
		return properties;
1042
	}
1042
	}
1043
}
-
 
1044
1043
}
-
 
1044
//App page
-
 
1045
$.fn.stars = function() {
-
 
1046
    return $(this).each(function() {
-
 
1047
        // Get the value
-
 
1048
        var val = parseFloat($(this).html());
-
 
1049
        // Make sure that the value is in 0 - 5 range, multiply to get width
-
 
1050
        val = Math.round(val * 2) / 2;
-
 
1051
        var size = Math.max(0, (Math.min(5, val))) * 16;
-
 
1052
        // Create stars holder
-
 
1053
        var $span = $('<span />').width(size);
-
 
1054
        // Replace the numerical value with stars
-
 
1055
        $(this).html($span);
-
 
1056
    });
-
 
1057
}
-
 
1058
$(function() {
-
 
1059
    $('span.stars').stars();	
-
 
1060
});
-
 
1061
1045
1062