1google.load('visualization', '1.0', {'packages':['corechart']}); 2(function( $ ) { 3 'use strict'; 4 $(function() { 5 $("#uws-interactive-data-form select[name='type']").change(function(){ 6 var type = $(this).val(); 7 $(".uws-sub-dropdown").hide(); 8 $('.uws-sub-dropdown > select option:first-child').attr("selected", "selected"); 9 //$("#uws-interactive-form-response").fadeOut("slow"); 10 switch(type) { 11 case "waitlists_by_organ": 12 $("#uws-state-sub-dropdown").show(); 13 get_charts(type); 14 break; 15 case "waitlists_by_age": 16 $("#uws-organ-sub-dropdown").show(); 17 get_charts(type); 18 break; 19 case "transplants_by_organ_type": 20 $("#uws-year-sub-dropdown").show(); 21 // select previous year by default (all, current year, previous year) 22 $('#uws-year-select option:eq(2)').attr('selected', 'selected').trigger('change'); 23 break; 24 case "transplants_by_recipient_age": 25 $("#uws-year-sub-dropdown").show(); 26 // select previous year by default (all, current year, previous year) 27 $('#uws-year-select option:eq(2)').attr('selected', 'selected').trigger('change'); 28 break; 29 case "transplants_by_donor_type": 30 $("#uws-organ-sub-dropdown").show(); 31 get_charts(type); 32 break; 33 case "ped_transplants_by_recipient_age": 34 $("#uws-year-sub-dropdown").show(); 35 // select previous year by default (all, current year, previous year) 36 $('#uws-year-select option:eq(2)').attr('selected', 'selected').trigger('change'); 37 break; 38 } 39 }); 40 $(".uws-sub-dropdown select").change(function(){ 41 var sub = $(this).val(); 42 var sub_type = $(this).attr("name"); 43 var type = $("#uws-interactive-data-form select[name='type']").val(); 44 //$("#uws-interactive-form-response").fadeOut("slow"); 45 get_charts(type, sub_type, sub); 46 }); 47 48 function get_charts(short, sub_type, sub){ 49 $.post(UWS_AJAX.ajaxurl, { 50 action : 'get_charts', 51 short: short, 52 sub_type: sub_type, 53 sub: sub 54 }, function (response) { 55 var new_hash = short; 56 if(typeof sub_type !== 'undefined' && typeof sub !== 'undefined') { 57 new_hash += "+" + sub_type + "+" + sub; 58 } 59 document.location.hash = new_hash; 60 recentHash = new_hash; 61 $("#uws-interactive-form-response").fadeOut(200, function(){ 62 $("#uws-interactive-form-response").html(); 63 $("#uws-interactive-form-response").html(response); 64 $("#uws-interactive-form-response").fadeIn(100, function(){ 65 if($('.uws-graph').length > 0) { 66 drawChart(); 67 } 68 }); 69 70 }); 71 }, 'html'); 72 } 73 74 var recentHash = ""; 75 var checkHash = function() { 76 var hash = document.location.hash; 77 if (hash) { 78 hash = hash.substr(1); 79 if (hash == recentHash) { 80 return; 81 } 82 recentHash = hash; 83 var params = hash.split("+"); 84 $(".uws-sub-dropdown").hide(); 85 $("#uws-interactive-data-form select[name='type']").val(params[0]) 86 if(params[1] !== undefined && params[2] !== undefined) { 87 $("#uws-" + params[1] + "-sub-dropdown").show(); 88 $("#uws-" + params[1] + "-sub-dropdown select").val(params[2]).trigger('change'); 89 } else { 90 $("#uws-interactive-data-form select[name='type']").trigger('change'); 91 } 92 //get_charts(params[0], params[1], params[2]); 93 } 94 } 95 setInterval(checkHash, 1000); 96 97 }); 98 99})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.