diff --git a/templates/js/entities.js b/templates/js/entities.js index 22ce17ce3c8b71aa4c3334756505d5e8102634d7..992512027360f621f8a578a8b12491b144fa7d40 100644 --- a/templates/js/entities.js +++ b/templates/js/entities.js @@ -1,358 +1,352 @@ -<script tyle="text/javascript"> - - var xx; - var yy; - var link; - var coco_ecid='http://www.geant.net/uri/dataprotection-code-of-conduct/v1' - - var $entity_details = undefined; - -$(function(){ - $entity_details = $("#entity_details"); - $("button").button(); - - $entity_details.dialog({ - autoOpen: false, - width: 800, - close: function(event, ui){ - $(".entity_links").css('color','#336699').css('background-color', 'inherit'); - $("#entity_details_content").html(""); - }, - }); -}); - - - $("#close_entity_details").on("click",function(event) { - // event.preventDefault(); - $entity_details.dialog("close"); - }); - - $("#close_entity_details_bottom").click(function(event) { - // event.preventDefault(); - $entity_details.dialog("close"); - }); - - $("#show_xml").mouseover(function(event) { - event.preventDefault(); - $("#show_xml_warn").show(); - }) - - - $("#show_xml").mouseout(function(event) { - event.preventDefault(); - $("#show_xml_warn").hide(); - }) - - - $("#show_xml").click(function(event) { - event.preventDefault(); - var win = window.open("api.php?action=show_entity&row_id="+current_id,'_blank'); - win.focus(); - }) - - - $("#show_met").click(function(event) { - event.preventDefault(); - var win = window.open("https://met.refeds.org/met/search_service/?entityid="+entityid,'_blank'); - win.focus(); - }) - - function show_eccs(e_id) { - var win = window.open(eccs_url+"?idp="+e_id,'_blank'); - win.focus(); - } - - $("#show_eccs").click(function(event) { - event.preventDefault(); - show_eccs(entityid); - }); - - function show_coco(c_id) { - var win = window.open("http://monitor.edugain.org/coco/?f_id_sp="+c_id+"&page=1&f_order=ts+desc&show=list_sp_tests&f_is_changed=0"); - win.focus(); - } - - $("#show_coco").click(function(event) { - if(coco_id == 0) - return; - event.preventDefault(); - show_coco(coco_id); - }); - - function show_clash(id) { - $.get("api.php",{action: 'show_entity_clashes', row_id: id}, function(data) { - var h = "<p>supplying federation: <strong>"+data.fed+"</strong><p>other federations: <strong>"+data.other_fed.join('</strong>, <strong>')+"<p>click the tooltip to close.</strong>"; - $("#clash_info").html(h); - $("#clash_info").css({'left':xx,'top':yy}); - $("#clash_info").show(); - }, 'json'); - } - -$("#clash_info").on("click",function(event) { - $(this).hide(); -}); - - $("#clear_all").click(function(event) { - event.preventDefault(); - $('#entites_form').trigger("reset"); - $("#entities").html(''); - $('#feds').find('option').show(); - }); - - function quickSearch(input) { - return _participants.filter(function(federation){ - return federation.searchString.indexOf(input) !== -1; - }); - } - - $('#fed_search_box').keyup(function(){ - var input = $(this).val().toLowerCase().replace('~', ''); - if (input == '') { - $('#feds').find('option').show(); - return; - } - var results = quickSearch(input); - $('#feds').find('option').hide(); - - for(index in results) { - var federation_code = results[index].fed.code; - console.log(federation_code); - $('#' + federation_code).show(); - } - }); - - $("#list_entities").click(function(event) { - var ec = 0; - var ecs = 0; - event.preventDefault(); - var id = $("#entity_cat option:selected").val(); - var proto = $("#protocol option:selected").val(); - var clashes = $("#clashes option:selected").val(); - var warnings = $("#validator option:selected").val(); - var coco = $("#coco option:selected").val(); - var sirtfi = $("#sirtfi option:selected").val(); - var eccs_status = $("#eccs_status option:selected").val(); - var datepicker = $("#datepicker").val(); - $("#clash_info").hide(); - if($("#category_type_selection").css("display") == 'none') { - if(entity_cat_support[id] > 0) - ecs=1; - if(entity_cat[id] > 0) - ec=1; - } else { - if($("#entity_category").prop("checked")) - ec=1; - if($("#entity_category_support").prop("checked")) - ecs=1; - } - if(ecs == 0 && ec == 0) { - alert("At least one of the Enity category boxes needs to be checked!"); - return; - } - - $("#loading").show(); - $("body").addClass("busy"); - $("#list_entities").addClass("busy"); - $("#entities").html(''); - var feds = ''; - $("#feds option:selected").each(function() { - feds = feds+':'+$(this).attr('id'); - }); - var e_id = $.trim($("#entity_search").val()); - - $.get("api.php",{action: 'list_entities', type: $('input[name=type]:checked').val(), fed_id: feds, entity_cat: $("#entity_cat option:selected").val(), search_type: $('input[name=search_type]:checked').val(), ec: ec, ecs: ecs, entityid: e_id, proto: proto, clashes: clashes, eccs_status: eccs_status, warnings: warnings, coco: coco, sirtfi: sirtfi, new_entities: $('input[name=new_entities]:checked').val(), start_date: datepicker, format: 'internal'}, function(data) { - $("#stat_feds").html(data.stats.feds); - $("#stat_all").html(data.stats.all); - $("#stat_idp").html(data.stats.idp); - $("#stat_sp").html(data.stats.sp); - $("#stat_aa").html(data.stats.aa); - $("#entities").html(data.html); -// $("body").css("cursor", "default"); - $("body").removeClass("busy"); - $("#loading").hide(); - $("#list_entities").removeClass("busy"); - },'json'); - }); - - -$("#download_entities").click(function(event) { - var ec = 0; - var ecs = 0; - event.preventDefault(); - var id = $("#entity_cat option:selected").val(); - var proto = $("#protocol option:selected").val(); - var clashes = $("#clashes option:selected").val(); - var warnings = $("#validator option:selected").val(); - var coco = $("#coco option:selected").val(); - var sirtfi = $("#sirtfi option:selected").val(); - var eccs_status = $("#eccs_status option:selected").val(); - $("#clash_info").hide(); - if($("#category_type_selection").css("display") == 'none') { - if(entity_cat_support[id] > 0) - ecs=1; - if(entity_cat[id] > 0) - ec=1; - } else { - if($("#entity_category").prop("checked")) - ec=1; - if($("#entity_category_support").prop("checked")) - ecs=1; - } - if(ecs == 0 && ec == 0) { - alert("At least one of the Enity category boxes needs to be checked!"); - return; - } - - $("#loading").show(); - $("body").addClass("busy"); - $("#download_entities").addClass("busy"); - $("#entities").html(''); - var feds = ''; - $("#feds option:selected").each(function() { - feds = feds+':'+$(this).attr('id'); - }); - var e_id = $.trim($("#entity_search").val()); - - var link = 'api.php?action=list_entities&format=csv&type='+$('input[name=type]:checked').val()+'&fed_id='+feds+'&entity_cat='+$("#entity_cat option:selected").val()+'&search_type='+$('input[name=search_type]:checked').val()+'&ec='+ec+'&ecs='+ecs+'&entityid='+e_id+'&proto='+proto+'&clashes='+clashes+'&eccs_status='+eccs_status+'&warnings='+warnings+'&coco='+coco+'&sirtfi='+sirtfi; - $("#loading").hide(); - $("body").removeClass("busy"); - $("#download_entities").removeClass("busy"); - window.location = link; -}); - -function show_entity(id) { - var win = window.open("api.php?action=show_entity&row_id="+id,'_blank'); - win.focus(); -} - -function show_next(new_id) { - $("#link_"+new_id).focus(); - var h = $("#link_"+new_id).attr("href"); - a = h.slice(24,-1).split(','); - if(a[0]) - show_details(a[0],a[1],a[2]); - -} - -function show_details(id,next,prev) { - $("#link_"+id).addClass("busy"); - $("#show_prev").attr('href','javascript:show_next('+prev+')'); - $("#show_next").attr('href','javascript:show_next('+next+')'); - $("#loading").show(); - $("body").addClass("busy"); - current_id = id; - coco_id = 0; -<<<<<<< c28805094cc5060a7fe60193a013cf617453db8f - $(".entity_links").css('color','#336699').css('background-color', 'inherit'); - $("#link_"+id).css('color','white').css('background-color', '#F1893B'); - -======= - $(".entity_links").css('color','#336699'); - $(".entity_links").css('font-weight','normal'); - $("#link_"+id).css('color','green'); - $("#link_"+id).css('font-weight','bold'); ->>>>>>> 1a6a3158d46fd77807720cb38e4f047dde5a3863 - $.get("api.php",{action: 'show_entity_details', row_id: id, format: 'html', opt: 'internal'}, function(data) { - $("#loading").hide(); - $("body").removeClass("busy"); - $("#link_"+id).removeClass("busy"); - $("#entity_details").dialog("open"); - $("#entity_details").parent().css("top", $(window).scrollTop()+30).css("left", "30px"); - $("#entity_details_content").html(data); - if(coco_id != 0) - $("#show_coco").show(); - else - $("#show_coco").hide(); - if(eccs_status != 0) - $("#show_eccs").show(); - else - $("#show_eccs").hide(); - },'html'); -} - -$("#entity_cat").change(function(event) { - var id = $("#entity_cat option:selected").val(); - $("#category_type_desc").hide(); - $("#category_type_selection").hide(); - if(entity_cat_no_fn[id]) { - $("#entity_cat_uri").html(''); - $("#entity_cat_legend").css("visibility","hidden"); - } else { - $("#entity_cat_uri").html(id); - $("#entity_cat_legend").css("visibility","visible"); - } -//alert("ecs="+entity_cat_support[id]+"; ec="+entity_cat[id]); - if(entity_cat_support[id] > 0 && entity_cat[id] > 0) { - $("#category_type_selection").show(); - } else { - if(entity_cat[id] > 0) - $("#category_type_desc").html("Entity category"); - if(entity_cat_support[id] > 0) - $("#category_type_desc").html("Entity category support"); - if(id !== "-2") - $("#category_type_desc").show(); - } - if(coco_always || id == "-1" || id == coco_ecid) { - $("#coco_header").css("visibility","visible"); - $("#coco").css("visibility","visible"); - } else { - $("#coco_header").css("visibility","hidden"); - $("#coco").css("visibility","hidden"); - } -} ); - -$("input[name=search_type]").bind("change",function(event) { - var type = $('input[name=search_type]:checked').val(); -//alert(type); - var txt; - var hlp; - if(type == 'entityid') { - txt = 'EntityID substring search'; - hlp = 'Enter string for a substring matching. Only EntityID is searched.'; - } - if(type == 'text') { - txt = 'Fulltext mysql style search'; - hlp = 'Enter multiple words, and the match will be against any of them, put several words in double quotes to match the whole phrase, precede words or phrases with plus signs to make them required in the search or minus signs to filter out the unwanted (<a href="http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html" target="_blank">more info</a>).' - } - if(type == 'rev-text') { - txt = 'Fulltext mysql style search'; - hlp = 'Same as <i>matching EntityDescriptions (multiple words)</i> but provide the full list from other filters with matched rows excluded.' - } - $("#entity_search").attr("placeholder",txt); - $("#entity_search_help").html(hlp); - -}); - -$("#help").on("click",function(event) { - $(this).hide(); -}); - -$(".entities_help").on("click",function(event) { - $("#help").html('<p>'+Help[$(this).attr('id')]+'<p><strong>Click on this pop-up to close it.</strong>'); - var y = Math.max($(this).offset().top - $("#help").height() + 10,0); - var x = Math.min($(this).offset().left +20,$(window).width() -230); - $("#help").css({'left':x,'top':y}); - $("#help").show(); -}); - -if(coco_always) { - $("#coco_header").css("visibility","visible"); - $("#coco").css("visibility","visible"); -} -$("#datepicker" ).datepicker({ - dateFormat: "yy-mm-dd", - defaultDate: 0, - minDate: new Date(2017,3,14), - maxDate: 0, - onClose: function(dateText,inst) { - $("input[name=new_entities][value='1']").prop("checked",true); - } -}); - -$("input[name=new_entities]").on("click",function(event) { - if($('input[name=new_entities]:checked').val() != 1) - $( "#datepicker" ).val(""); -} -); - -</script> +<script tyle="text/javascript"> + + var xx; + var yy; + var link; + var coco_ecid='http://www.geant.net/uri/dataprotection-code-of-conduct/v1' + + var $entity_details = undefined; + +$(function(){ + $entity_details = $("#entity_details"); + $("button").button(); + + $entity_details.dialog({ + autoOpen: false, + width: 800, + close: function(event, ui){ + $(".entity_links").css('color','#336699').css('background-color', 'inherit'); + $("#entity_details_content").html(""); + }, + }); +}); + + + $("#close_entity_details").on("click",function(event) { + // event.preventDefault(); + $entity_details.dialog("close"); + }); + + $("#close_entity_details_bottom").click(function(event) { + // event.preventDefault(); + $entity_details.dialog("close"); + }); + + $("#show_xml").mouseover(function(event) { + event.preventDefault(); + $("#show_xml_warn").show(); + }) + + + $("#show_xml").mouseout(function(event) { + event.preventDefault(); + $("#show_xml_warn").hide(); + }) + + + $("#show_xml").click(function(event) { + event.preventDefault(); + var win = window.open("api.php?action=show_entity&row_id="+current_id,'_blank'); + win.focus(); + }) + + + $("#show_met").click(function(event) { + event.preventDefault(); + var win = window.open("https://met.refeds.org/met/search_service/?entityid="+entityid,'_blank'); + win.focus(); + }) + + function show_eccs(e_id) { + var win = window.open(eccs_url+"?idp="+e_id,'_blank'); + win.focus(); + } + + $("#show_eccs").click(function(event) { + event.preventDefault(); + show_eccs(entityid); + }); + + function show_coco(c_id) { + var win = window.open("http://monitor.edugain.org/coco/?f_id_sp="+c_id+"&page=1&f_order=ts+desc&show=list_sp_tests&f_is_changed=0"); + win.focus(); + } + + $("#show_coco").click(function(event) { + if(coco_id == 0) + return; + event.preventDefault(); + show_coco(coco_id); + }); + + function show_clash(id) { + $.get("api.php",{action: 'show_entity_clashes', row_id: id}, function(data) { + var h = "<p>supplying federation: <strong>"+data.fed+"</strong><p>other federations: <strong>"+data.other_fed.join('</strong>, <strong>')+"<p>click the tooltip to close.</strong>"; + $("#clash_info").html(h); + $("#clash_info").css({'left':xx,'top':yy}); + $("#clash_info").show(); + }, 'json'); + } + +$("#clash_info").on("click",function(event) { + $(this).hide(); +}); + + $("#clear_all").click(function(event) { + event.preventDefault(); + $('#entites_form').trigger("reset"); + $("#entities").html(''); + $('#feds').find('option').show(); + }); + + function quickSearch(input) { + return _participants.filter(function(federation){ + return federation.searchString.indexOf(input) !== -1; + }); + } + + $('#fed_search_box').keyup(function(){ + var input = $(this).val().toLowerCase().replace('~', ''); + if (input == '') { + $('#feds').find('option').show(); + return; + } + var results = quickSearch(input); + $('#feds').find('option').hide(); + + for(index in results) { + var federation_code = results[index].fed.code; + console.log(federation_code); + $('#' + federation_code).show(); + } + }); + + $("#list_entities").click(function(event) { + var ec = 0; + var ecs = 0; + event.preventDefault(); + var id = $("#entity_cat option:selected").val(); + var proto = $("#protocol option:selected").val(); + var clashes = $("#clashes option:selected").val(); + var warnings = $("#validator option:selected").val(); + var coco = $("#coco option:selected").val(); + var sirtfi = $("#sirtfi option:selected").val(); + var eccs_status = $("#eccs_status option:selected").val(); + var datepicker = $("#datepicker").val(); + $("#clash_info").hide(); + if($("#category_type_selection").css("display") == 'none') { + if(entity_cat_support[id] > 0) + ecs=1; + if(entity_cat[id] > 0) + ec=1; + } else { + if($("#entity_category").prop("checked")) + ec=1; + if($("#entity_category_support").prop("checked")) + ecs=1; + } + if(ecs == 0 && ec == 0) { + alert("At least one of the Enity category boxes needs to be checked!"); + return; + } + + $("#loading").show(); + $("body").addClass("busy"); + $("#list_entities").addClass("busy"); + $("#entities").html(''); + var feds = ''; + $("#feds option:selected").each(function() { + feds = feds+':'+$(this).attr('id'); + }); + var e_id = $.trim($("#entity_search").val()); + + $.get("api.php",{action: 'list_entities', type: $('input[name=type]:checked').val(), fed_id: feds, entity_cat: $("#entity_cat option:selected").val(), search_type: $('input[name=search_type]:checked').val(), ec: ec, ecs: ecs, entityid: e_id, proto: proto, clashes: clashes, eccs_status: eccs_status, warnings: warnings, coco: coco, sirtfi: sirtfi, new_entities: $('input[name=new_entities]:checked').val(), start_date: datepicker, format: 'internal'}, function(data) { + $("#stat_feds").html(data.stats.feds); + $("#stat_all").html(data.stats.all); + $("#stat_idp").html(data.stats.idp); + $("#stat_sp").html(data.stats.sp); + $("#stat_aa").html(data.stats.aa); + $("#entities").html(data.html); +// $("body").css("cursor", "default"); + $("body").removeClass("busy"); + $("#loading").hide(); + $("#list_entities").removeClass("busy"); + },'json'); + }); + + +$("#download_entities").click(function(event) { + var ec = 0; + var ecs = 0; + event.preventDefault(); + var id = $("#entity_cat option:selected").val(); + var proto = $("#protocol option:selected").val(); + var clashes = $("#clashes option:selected").val(); + var warnings = $("#validator option:selected").val(); + var coco = $("#coco option:selected").val(); + var sirtfi = $("#sirtfi option:selected").val(); + var eccs_status = $("#eccs_status option:selected").val(); + $("#clash_info").hide(); + if($("#category_type_selection").css("display") == 'none') { + if(entity_cat_support[id] > 0) + ecs=1; + if(entity_cat[id] > 0) + ec=1; + } else { + if($("#entity_category").prop("checked")) + ec=1; + if($("#entity_category_support").prop("checked")) + ecs=1; + } + if(ecs == 0 && ec == 0) { + alert("At least one of the Enity category boxes needs to be checked!"); + return; + } + + $("#loading").show(); + $("body").addClass("busy"); + $("#download_entities").addClass("busy"); + $("#entities").html(''); + var feds = ''; + $("#feds option:selected").each(function() { + feds = feds+':'+$(this).attr('id'); + }); + var e_id = $.trim($("#entity_search").val()); + + var link = 'api.php?action=list_entities&format=csv&type='+$('input[name=type]:checked').val()+'&fed_id='+feds+'&entity_cat='+$("#entity_cat option:selected").val()+'&search_type='+$('input[name=search_type]:checked').val()+'&ec='+ec+'&ecs='+ecs+'&entityid='+e_id+'&proto='+proto+'&clashes='+clashes+'&eccs_status='+eccs_status+'&warnings='+warnings+'&coco='+coco+'&sirtfi='+sirtfi; + $("#loading").hide(); + $("body").removeClass("busy"); + $("#download_entities").removeClass("busy"); + window.location = link; +}); + +function show_entity(id) { + var win = window.open("api.php?action=show_entity&row_id="+id,'_blank'); + win.focus(); +} + +function show_next(new_id) { + $("#link_"+new_id).focus(); + var h = $("#link_"+new_id).attr("href"); + a = h.slice(24,-1).split(','); + if(a[0]) + show_details(a[0],a[1],a[2]); + +} + +function show_details(id,next,prev) { + $("#link_"+id).addClass("busy"); + $("#show_prev").attr('href','javascript:show_next('+prev+')'); + $("#show_next").attr('href','javascript:show_next('+next+')'); + $("#loading").show(); + $("body").addClass("busy"); + current_id = id; + coco_id = 0; + $(".entity_links").css('color','#336699').css('background-color', 'inherit'); + $("#link_"+id).css('color','white').css('background-color', '#F1893B'); + + $.get("api.php",{action: 'show_entity_details', row_id: id, format: 'html', opt: 'internal'}, function(data) { + $("#loading").hide(); + $("body").removeClass("busy"); + $("#link_"+id).removeClass("busy"); + $("#entity_details").dialog("open"); + $("#entity_details").parent().css("top", $(window).scrollTop()+30).css("left", "30px"); + $("#entity_details_content").html(data); + if(coco_id != 0) + $("#show_coco").show(); + else + $("#show_coco").hide(); + + if(eccs_status != 0) + $("#show_eccs").show(); + else + $("#show_eccs").hide(); + },'html'); +} + +$("#entity_cat").change(function(event) { + var id = $("#entity_cat option:selected").val(); + $("#category_type_desc").hide(); + $("#category_type_selection").hide(); + if(entity_cat_no_fn[id]) { + $("#entity_cat_uri").html(''); + $("#entity_cat_legend").css("visibility","hidden"); + } else { + $("#entity_cat_uri").html(id); + $("#entity_cat_legend").css("visibility","visible"); + } +//alert("ecs="+entity_cat_support[id]+"; ec="+entity_cat[id]); + if(entity_cat_support[id] > 0 && entity_cat[id] > 0) { + $("#category_type_selection").show(); + } else { + if(entity_cat[id] > 0) + $("#category_type_desc").html("Entity category"); + if(entity_cat_support[id] > 0) + $("#category_type_desc").html("Entity category support"); + if(id !== "-2") + $("#category_type_desc").show(); + } + if(coco_always || id == "-1" || id == coco_ecid) { + $("#coco_header").css("visibility","visible"); + $("#coco").css("visibility","visible"); + } else { + $("#coco_header").css("visibility","hidden"); + $("#coco").css("visibility","hidden"); + } +} ); + +$("input[name=search_type]").bind("change",function(event) { + var type = $('input[name=search_type]:checked').val(); +//alert(type); + var txt; + var hlp; + if(type == 'entityid') { + txt = 'EntityID substring search'; + hlp = 'Enter string for a substring matching. Only EntityID is searched.'; + } + if(type == 'text') { + txt = 'Fulltext mysql style search'; + hlp = 'Enter multiple words, and the match will be against any of them, put several words in double quotes to match the whole phrase, precede words or phrases with plus signs to make them required in the search or minus signs to filter out the unwanted (<a href="http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html" target="_blank">more info</a>).' + } + if(type == 'rev-text') { + txt = 'Fulltext mysql style search'; + hlp = 'Same as <i>matching EntityDescriptions (multiple words)</i> but provide the full list from other filters with matched rows excluded.' + } + $("#entity_search").attr("placeholder",txt); + $("#entity_search_help").html(hlp); + +}); + +$("#help").on("click",function(event) { + $(this).hide(); +}); + +$(".entities_help").on("click",function(event) { + $("#help").html('<p>'+Help[$(this).attr('id')]+'<p><strong>Click on this pop-up to close it.</strong>'); + var y = Math.max($(this).offset().top - $("#help").height() + 10,0); + var x = Math.min($(this).offset().left +20,$(window).width() -230); + $("#help").css({'left':x,'top':y}); + $("#help").show(); +}); + +if(coco_always) { + $("#coco_header").css("visibility","visible"); + $("#coco").css("visibility","visible"); +} +$("#datepicker" ).datepicker({ + dateFormat: "yy-mm-dd", + defaultDate: 0, + minDate: new Date(2017,3,14), + maxDate: 0, + onClose: function(dateText,inst) { + $("input[name=new_entities][value='1']").prop("checked",true); + } +}); + +$("input[name=new_entities]").on("click",function(event) { + if($('input[name=new_entities]:checked').val() != 1) + $( "#datepicker" ).val(""); +} +); + +</script>