source: main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/js/eurovision.js@ 34873

Last change on this file since 34873 was 34873, checked in by davidb, 3 years ago

Supporting JS and CSS files for document.xsl page/view

File size: 1.0 KB
Line 
1
2function append_from_country_votes(vote_label, votes_json_type)
3{
4 // TODO
5 // Figure out why "United Kingdom-J" and not "UnitedKingdom-J"
6
7 if (gs.documentMetadata[votes_json_type]) {
8 var $vote_div = $('<div>').attr("class","voting-label").append(vote_label);
9 $('#from-country-votes').append($vote_div);
10
11 var JuryVotesJSON = eval(gs.documentMetadata[votes_json_type]);
12 var num_countries = JuryVotesJSON.length;
13
14 for (var i=0; i<num_countries; i++) {
15 var from_country = JuryVotesJSON[i];
16 var from_country_points = gs.documentMetadata[from_country];
17
18 if (typeof from_country_points !== 'undefined') {
19 var pp_from_country = from_country.replace(/-(T|J)$/,"");
20
21 var $from_country_name = $('<div>').attr("class","voting voting-country").append(pp_from_country + ":");
22 var $from_country_points = $('<div>').attr("class","voting voting-points").append(from_country_points);
23
24 $('#from-country-votes')
25 .append($from_country_name)
26 .append($from_country_points);
27 }
28 }
29 }
30}
31
Note: See TracBrowser for help on using the repository browser.