Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function rating(votes){
	var html = '<table class="rating-table">' +
					'<tbody>' +
						'<tr>';
	var intvalue = Math.floor( votes );
	
	if (votes == 0){
		for (var i =0; i<5; i++){
			html += '<td><img class="'+ i + '" src="images/empty.png" /></td>';
		}
	} else {
	
		for (var i=0; i<intvalue; i++){	
			html += '<td><img class="'+ i + '" src="images/full.png" /></td>';
		}
	
		if(votes % 1 !== 0){//is float
			html += '<td><img class="'+ i + '" src="images/semi.png" /></td>';
		}
	}
	
	if(votes > 0 && votes < 5){
		var empty = 5 - votes;
		intvalue = Math.floor( empty );
		for(var i = 0; i<intvalue; i++){
			html += '<td><img class="'+ i + '" src="images/empty.png" /></td>';
		}
	}
	
	return html += '</tr></tbody></table>';
}

function formatDate(date){
	var date = new Date(date);
	var day = date.getDate();
	var monthIndex = date.getMonth();
	var year = date.getFullYear();
	var hours = date.getHours();
	var mins = date.getMinutes();
	
	return day + "-" + monthIndex + "-" + year + ", " + hours + ":" + mins;
}

Commits for Nextrek/Web/Smartcharging_search/js/scripts.js

Diff revisions: vs.
Revision Author Commited Message
1047 Diff Diff LZicari picture LZicari Mon 21 Dec, 2015 07:50:46 +0000
1035 Diff Diff LZicari picture LZicari Thu 17 Dec, 2015 11:50:10 +0000
1034 Diff Diff LZicari picture LZicari Thu 17 Dec, 2015 09:30:59 +0000
1033 LZicari picture LZicari Tue 15 Dec, 2015 17:48:58 +0000