Changeset 35114
- Timestamp:
- 2021-04-24T15:05:10+12:00 (3 years ago)
- Location:
- main/trunk/model-sites-dev/eurovision-lod/collect/eurovision
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/js/eurovision.js
r35092 r35114 4 4 5 5 // The following needs to be kept in sync with the .voting-countries & .voting-points widths in css/eurovision.css 6 var glob_voting_country_and_points_width = (180+35); 6 var glob_voting_country_and_points_width = (180+35); 7 7 8 8 … … 77 77 78 78 79 80 function voting_mode(year) 81 { 82 83 var vote_mode = undefined; 84 85 if (year>=2013) { 86 // Separate voting: Jury and Tele 87 vote_mode = "Separated"; 88 } 89 else if ((year>=2001) && (year<=2012)) { 90 vote_mode = "Combined"; 91 } 92 else { 93 vote_mode = "Single"; 94 } 95 96 return vote_mode; 97 } 98 99 100 function nuanced_voting_type(country,year) 101 { 102 var vote_type = undefined; 103 104 if (year>=2013) { 105 // Separate voting: Jury and Tele 106 vote_type = "JT"; 107 } 108 else if ((year>=2009) && (year<=2012)) { 109 if (country=="San Marino") { 110 vote_type = "J"; 111 } 112 else { 113 // Combined Jury and Tele 114 vote_type = "C"; 115 } 116 } 117 else if ((year>=2003) && (year<=2008)) { 118 vote_type = "T"; 119 } 120 else if (year==2002) { 121 var jury_list = [ "Bosnia and Herzegovina", "Turkey", "Russia", "FYR Macedonia", "Romania"]; 122 var comb_list = [ "Cyprus", "Greece", "Spain", "Croatia", "Finland", "Malta", "Slovenia", "Lithuania" ]; 123 if (country in jury_list) { 124 vote_type = "J"; 125 } 126 else if (country in comb_list) { 127 vote_type = "C"; 128 } 129 else { 130 vote_type = "T"; 131 } 132 } 133 else if (year==2001) { 134 var jury_list = [ "Bosnia and Herzegovina", "Turkey", "Russia" ]; 135 var comb_list = [ "Croatia", "Greece", "Malta" ]; 136 if (country in jury_list) { 137 vote_type = "J"; 138 } 139 else if (country in comb_list) { 140 vote_type = "C"; 141 } 142 else { 143 vote_type = "T"; 144 } 145 } 146 else if ((year>=1998) && (year<=2000)) { 147 vote_type = "T"; 148 } 149 else if (year==1997) { 150 var tele_list = [ "Austria", "Germany", "Sweeden", "Switzerland", "United Kingdom" ]; 151 if (country in tele_list) { 152 vote_type = "T"; 153 } 154 else { 155 vote_type = "J"; 156 } 157 } 158 else { 159 vote_type = "J"; 160 } 161 162 return vote_type; 163 } 164 165 166 79 167 function create_array2d(num_cols,num_rows) 80 168 { … … 177 265 178 266 var sorted_results_mapping = create_i_to_yx_mapping(num_cols,num_rows,num_countries) 179 267 180 268 for (var y=0; y<num_rows; y++) { 181 269 for (var x=0; x<num_cols; x++) { … … 230 318 } 231 319 232 } 233 234 $('#to-country-votes').append($vote_points_div); 320 $('#to-country-votes') 321 .append("<br />"); 322 } 323 324 //$('#to-country-votes').append($vote_points_div); 235 325 236 326 } 237 327 } 238 328 329 function append_all_to_country_votes() 330 { 331 $('#to-country-votes').html(""); 332 333 append_to_country_votes("Jury Votes","JuryVotesJSON","JuryVotesTotal"); 334 append_to_country_votes("Televotes","TeleVotesJSON","TeleVotesTotal"); 335 336 append_to_country_votes("Combined Jury & Tele Votes","CombVotesJSON","CombVotesTotal"); 337 append_to_country_votes("Voting Exclusively by Jury","SingVotesJSON","SingVotesTotal"); 338 } 239 339 240 340 function compare_countries(a,b) … … 341 441 .append($a_to_country); 342 442 } 443 $('#from-country-votes') 444 .append("<br />"); 343 445 } 344 446 } … … 346 448 347 449 450 function append_all_from_country_votes() 451 { 452 $('#from-country-votes').html(""); 453 454 append_from_country_votes(gs.documentMetadata["FromCountryType"]); 455 } -
main/trunk/model-sites-dev/eurovision-lod/collect/eurovision/transform/pages/document.xsl
r35102 r35114 55 55 </td> 56 56 <td> 57 <!-- 57 58 <gsf:switch> 58 59 <gsf:metadata name='FromCountryType'/> … … 67 68 </gsf:otherwise> 68 69 </gsf:switch> 70 71 --> 72 73 <gsf:switch> 74 <gsf:metadata name='FromCountryNuancedType'/> 75 <gsf:when test="equals" test-value="J"> 76 Jury 77 </gsf:when> 78 <gsf:when test="equals" test-value="T"> 79 Televotes 80 </gsf:when> 81 <gsf:when test="equals" test-value="C"> 82 Combined Jury and Televotes 83 </gsf:when> 84 <gsf:otherwise> 85 86 <gsf:switch> 87 <gsf:metadata name='FromCountryType'/> 88 <gsf:when test="equals" test-value="J"> 89 Jury 90 </gsf:when> 91 <gsf:when test="equals" test-value="T"> 92 Televotes 93 </gsf:when> 94 <gsf:otherwise> <!-- JT --> 95 Separate Jury and Televotes Added Together 96 </gsf:otherwise> 97 </gsf:switch> 98 99 </gsf:otherwise> 100 </gsf:switch> 101 102 69 103 </td> 70 104 </tr> … … 148 182 </td> 149 183 <td> 184 185 <gsf:switch> 186 <gsf:metadata name='FlagImg'/> 187 <gsf:when test='exists'> 188 <span style="padding-right: 6px;"><gsf:metadata name="FlagImg"/></span> 189 </gsf:when> 190 </gsf:switch> 191 150 192 <gsf:metadata name="Country" highlight="highlight" /> 193 151 194 </td> 152 195 </tr> … … 162 205 </td> 163 206 <td> 164 <gsf:metadata name="Year" highlight="highlight" /> 207 <xsl:variable name="escyear"><gsf:metadata name="Year"/></xsl:variable> 208 <a target="_blank" href="https://en.wikipedia.org/wiki/Eurovision_Song_Contest_{$escyear}"> 209 Eurovision <gsf:metadata name="Year" highlight="highlight" /> 210 @ Wikipedia 211 <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=" alt="external link" /> 212 </a> 165 213 </td> 166 214 </tr> … … 174 222 <xsl:template name="documentContentFromCountry"> 175 223 <div id="from-country-votes"> 176 <gsf:script> 177 append_from_country_votes(gs.documentMetadata["FromCountryType"]); 224 <gsf:script> 225 $(document).ready(function() { 226 append_all_from_country_votes(); 227 }); 228 229 window.addEventListener("resize", function() { append_all_from_country_votes() }); 178 230 </gsf:script> 179 231 </div> … … 201 253 202 254 <gsf:script> 203 append_to_country_votes("Jury Votes","JuryVotesJSON","JuryVotesTotal");204 append_to_country_votes("Televotes","TeleVotesJSON","TeleVotesTotal");205 206 append_to_country_votes("Combined Jury & Tele Votes","CombVotesJSON","CombVotesTotal"); 207 append_to_country_votes("Voting Exclusively by Jury","SingVotesJSON","SingVotesTotal");255 $(document).ready(function() { 256 append_all_to_country_votes(); 257 }); 258 259 window.addEventListener("resize", function() { append_all_to_country_votes() }); 208 260 </gsf:script> 209 261
Note:
See TracChangeset
for help on using the changeset viewer.