Skip to content
Snippets Groups Projects
Commit a915b787 authored by Tomasz Wolniewicz's avatar Tomasz Wolniewicz
Browse files

restoring the cerrect version

parent d4dff7d6
No related branches found
No related tags found
2 merge requests!3Align master branch with twoln-dev,!2Synchronising towards version 2.5
<script tyle="text/javascript"> <script tyle="text/javascript">
var xx; var xx;
var yy; var yy;
var link; var link;
var coco_ecid='http://www.geant.net/uri/dataprotection-code-of-conduct/v1' var coco_ecid='http://www.geant.net/uri/dataprotection-code-of-conduct/v1'
var $entity_details = undefined; var $entity_details = undefined;
$(function(){ $(function(){
$entity_details = $("#entity_details"); $entity_details = $("#entity_details");
$("button").button(); $("button").button();
$entity_details.dialog({ $entity_details.dialog({
autoOpen: false, autoOpen: false,
width: 800, width: 800,
close: function(event, ui){ close: function(event, ui){
$(".entity_links").css('color','#336699').css('background-color', 'inherit'); $(".entity_links").css('color','#336699').css('background-color', 'inherit');
$("#entity_details_content").html(""); $("#entity_details_content").html("");
}, },
}); });
}); });
$("#close_entity_details").on("click",function(event) { $("#close_entity_details").on("click",function(event) {
// event.preventDefault(); // event.preventDefault();
$entity_details.dialog("close"); $entity_details.dialog("close");
}); });
$("#close_entity_details_bottom").click(function(event) { $("#close_entity_details_bottom").click(function(event) {
// event.preventDefault(); // event.preventDefault();
$entity_details.dialog("close"); $entity_details.dialog("close");
}); });
$("#show_xml").mouseover(function(event) { $("#show_xml").mouseover(function(event) {
event.preventDefault(); event.preventDefault();
$("#show_xml_warn").show(); $("#show_xml_warn").show();
}) })
$("#show_xml").mouseout(function(event) { $("#show_xml").mouseout(function(event) {
event.preventDefault(); event.preventDefault();
$("#show_xml_warn").hide(); $("#show_xml_warn").hide();
}) })
$("#show_xml").click(function(event) { $("#show_xml").click(function(event) {
event.preventDefault(); event.preventDefault();
var win = window.open("api.php?action=show_entity&row_id="+current_id,'_blank'); var win = window.open("api.php?action=show_entity&row_id="+current_id,'_blank');
win.focus(); win.focus();
}) })
$("#show_met").click(function(event) { $("#show_met").click(function(event) {
event.preventDefault(); event.preventDefault();
var win = window.open("https://met.refeds.org/met/search_service/?entityid="+entityid,'_blank'); var win = window.open("https://met.refeds.org/met/search_service/?entityid="+entityid,'_blank');
win.focus(); win.focus();
}) })
function show_eccs(e_id) { function show_eccs(e_id) {
var win = window.open(eccs_url+"?idp="+e_id,'_blank'); var win = window.open(eccs_url+"?idp="+e_id,'_blank');
win.focus(); win.focus();
} }
$("#show_eccs").click(function(event) { $("#show_eccs").click(function(event) {
event.preventDefault(); event.preventDefault();
show_eccs(entityid); show_eccs(entityid);
}); });
function show_coco(c_id) { 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"); 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(); win.focus();
} }
$("#show_coco").click(function(event) { $("#show_coco").click(function(event) {
if(coco_id == 0) if(coco_id == 0)
return; return;
event.preventDefault(); event.preventDefault();
show_coco(coco_id); show_coco(coco_id);
}); });
function show_clash(id) { function show_clash(id) {
$.get("api.php",{action: 'show_entity_clashes', row_id: id}, function(data) { $.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>"; 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").html(h);
$("#clash_info").css({'left':xx,'top':yy}); $("#clash_info").css({'left':xx,'top':yy});
$("#clash_info").show(); $("#clash_info").show();
}, 'json'); }, 'json');
} }
$("#clash_info").on("click",function(event) { $("#clash_info").on("click",function(event) {
$(this).hide(); $(this).hide();
}); });
$("#clear_all").click(function(event) { $("#clear_all").click(function(event) {
event.preventDefault(); event.preventDefault();
$('#entites_form').trigger("reset"); $('#entites_form').trigger("reset");
$("#entities").html(''); $("#entities").html('');
$('#feds').find('option').show(); $('#feds').find('option').show();
}); });
function quickSearch(input) { function quickSearch(input) {
return _participants.filter(function(federation){ return _participants.filter(function(federation){
return federation.searchString.indexOf(input) !== -1; return federation.searchString.indexOf(input) !== -1;
}); });
} }
$('#fed_search_box').keyup(function(){ $('#fed_search_box').keyup(function(){
var input = $(this).val().toLowerCase().replace('~', ''); var input = $(this).val().toLowerCase().replace('~', '');
if (input == '') { if (input == '') {
$('#feds').find('option').show(); $('#feds').find('option').show();
return; return;
} }
var results = quickSearch(input); var results = quickSearch(input);
$('#feds').find('option').hide(); $('#feds').find('option').hide();
for(index in results) { for(index in results) {
var federation_code = results[index].fed.code; var federation_code = results[index].fed.code;
console.log(federation_code); console.log(federation_code);
$('#' + federation_code).show(); $('#' + federation_code).show();
} }
}); });
$("#list_entities").click(function(event) { $("#list_entities").click(function(event) {
var ec = 0; var ec = 0;
var ecs = 0; var ecs = 0;
event.preventDefault(); event.preventDefault();
var id = $("#entity_cat option:selected").val(); var id = $("#entity_cat option:selected").val();
var proto = $("#protocol option:selected").val(); var proto = $("#protocol option:selected").val();
var clashes = $("#clashes option:selected").val(); var clashes = $("#clashes option:selected").val();
var warnings = $("#validator option:selected").val(); var warnings = $("#validator option:selected").val();
var coco = $("#coco option:selected").val(); var coco = $("#coco option:selected").val();
var sirtfi = $("#sirtfi option:selected").val(); var sirtfi = $("#sirtfi option:selected").val();
var eccs_status = $("#eccs_status option:selected").val(); var eccs_status = $("#eccs_status option:selected").val();
var datepicker = $("#datepicker").val(); var datepicker = $("#datepicker").val();
$("#clash_info").hide(); $("#clash_info").hide();
if($("#category_type_selection").css("display") == 'none') { if($("#category_type_selection").css("display") == 'none') {
if(entity_cat_support[id] > 0) if(entity_cat_support[id] > 0)
ecs=1; ecs=1;
if(entity_cat[id] > 0) if(entity_cat[id] > 0)
ec=1; ec=1;
} else { } else {
if($("#entity_category").prop("checked")) if($("#entity_category").prop("checked"))
ec=1; ec=1;
if($("#entity_category_support").prop("checked")) if($("#entity_category_support").prop("checked"))
ecs=1; ecs=1;
} }
if(ecs == 0 && ec == 0) { if(ecs == 0 && ec == 0) {
alert("At least one of the Enity category boxes needs to be checked!"); alert("At least one of the Enity category boxes needs to be checked!");
return; return;
} }
$("#loading").show(); $("#loading").show();
$("body").addClass("busy"); $("body").addClass("busy");
$("#list_entities").addClass("busy"); $("#list_entities").addClass("busy");
$("#entities").html(''); $("#entities").html('');
var feds = ''; var feds = '';
$("#feds option:selected").each(function() { $("#feds option:selected").each(function() {
feds = feds+':'+$(this).attr('id'); feds = feds+':'+$(this).attr('id');
}); });
var e_id = $.trim($("#entity_search").val()); 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) { $.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_feds").html(data.stats.feds);
$("#stat_all").html(data.stats.all); $("#stat_all").html(data.stats.all);
$("#stat_idp").html(data.stats.idp); $("#stat_idp").html(data.stats.idp);
$("#stat_sp").html(data.stats.sp); $("#stat_sp").html(data.stats.sp);
$("#stat_aa").html(data.stats.aa); $("#stat_aa").html(data.stats.aa);
$("#entities").html(data.html); $("#entities").html(data.html);
// $("body").css("cursor", "default"); // $("body").css("cursor", "default");
$("body").removeClass("busy"); $("body").removeClass("busy");
$("#loading").hide(); $("#loading").hide();
$("#list_entities").removeClass("busy"); $("#list_entities").removeClass("busy");
},'json'); },'json');
}); });
$("#download_entities").click(function(event) { $("#download_entities").click(function(event) {
var ec = 0; var ec = 0;
var ecs = 0; var ecs = 0;
event.preventDefault(); event.preventDefault();
var id = $("#entity_cat option:selected").val(); var id = $("#entity_cat option:selected").val();
var proto = $("#protocol option:selected").val(); var proto = $("#protocol option:selected").val();
var clashes = $("#clashes option:selected").val(); var clashes = $("#clashes option:selected").val();
var warnings = $("#validator option:selected").val(); var warnings = $("#validator option:selected").val();
var coco = $("#coco option:selected").val(); var coco = $("#coco option:selected").val();
var sirtfi = $("#sirtfi option:selected").val(); var sirtfi = $("#sirtfi option:selected").val();
var eccs_status = $("#eccs_status option:selected").val(); var eccs_status = $("#eccs_status option:selected").val();
$("#clash_info").hide(); $("#clash_info").hide();
if($("#category_type_selection").css("display") == 'none') { if($("#category_type_selection").css("display") == 'none') {
if(entity_cat_support[id] > 0) if(entity_cat_support[id] > 0)
ecs=1; ecs=1;
if(entity_cat[id] > 0) if(entity_cat[id] > 0)
ec=1; ec=1;
} else { } else {
if($("#entity_category").prop("checked")) if($("#entity_category").prop("checked"))
ec=1; ec=1;
if($("#entity_category_support").prop("checked")) if($("#entity_category_support").prop("checked"))
ecs=1; ecs=1;
} }
if(ecs == 0 && ec == 0) { if(ecs == 0 && ec == 0) {
alert("At least one of the Enity category boxes needs to be checked!"); alert("At least one of the Enity category boxes needs to be checked!");
return; return;
} }
$("#loading").show(); $("#loading").show();
$("body").addClass("busy"); $("body").addClass("busy");
$("#download_entities").addClass("busy"); $("#download_entities").addClass("busy");
$("#entities").html(''); $("#entities").html('');
var feds = ''; var feds = '';
$("#feds option:selected").each(function() { $("#feds option:selected").each(function() {
feds = feds+':'+$(this).attr('id'); feds = feds+':'+$(this).attr('id');
}); });
var e_id = $.trim($("#entity_search").val()); 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; 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(); $("#loading").hide();
$("body").removeClass("busy"); $("body").removeClass("busy");
$("#download_entities").removeClass("busy"); $("#download_entities").removeClass("busy");
window.location = link; window.location = link;
}); });
function show_entity(id) { function show_entity(id) {
var win = window.open("api.php?action=show_entity&row_id="+id,'_blank'); var win = window.open("api.php?action=show_entity&row_id="+id,'_blank');
win.focus(); win.focus();
} }
function show_next(new_id) { function show_next(new_id) {
$("#link_"+new_id).focus(); $("#link_"+new_id).focus();
var h = $("#link_"+new_id).attr("href"); var h = $("#link_"+new_id).attr("href");
a = h.slice(24,-1).split(','); a = h.slice(24,-1).split(',');
if(a[0]) if(a[0])
show_details(a[0],a[1],a[2]); show_details(a[0],a[1],a[2]);
} }
function show_details(id,next,prev) { function show_details(id,next,prev) {
$("#link_"+id).addClass("busy"); $("#link_"+id).addClass("busy");
$("#show_prev").attr('href','javascript:show_next('+prev+')'); $("#show_prev").attr('href','javascript:show_next('+prev+')');
$("#show_next").attr('href','javascript:show_next('+next+')'); $("#show_next").attr('href','javascript:show_next('+next+')');
$("#loading").show(); $("#loading").show();
$("body").addClass("busy"); $("body").addClass("busy");
current_id = id; current_id = id;
coco_id = 0; coco_id = 0;
<<<<<<< c28805094cc5060a7fe60193a013cf617453db8f $(".entity_links").css('color','#336699').css('background-color', 'inherit');
$(".entity_links").css('color','#336699').css('background-color', 'inherit'); $("#link_"+id).css('color','white').css('background-color', '#F1893B');
$("#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();
$(".entity_links").css('color','#336699'); $("body").removeClass("busy");
$(".entity_links").css('font-weight','normal'); $("#link_"+id).removeClass("busy");
$("#link_"+id).css('color','green'); $("#entity_details").dialog("open");
$("#link_"+id).css('font-weight','bold'); $("#entity_details").parent().css("top", $(window).scrollTop()+30).css("left", "30px");
>>>>>>> 1a6a3158d46fd77807720cb38e4f047dde5a3863 $("#entity_details_content").html(data);
$.get("api.php",{action: 'show_entity_details', row_id: id, format: 'html', opt: 'internal'}, function(data) { if(coco_id != 0)
$("#loading").hide(); $("#show_coco").show();
$("body").removeClass("busy"); else
$("#link_"+id).removeClass("busy"); $("#show_coco").hide();
$("#entity_details").dialog("open");
$("#entity_details").parent().css("top", $(window).scrollTop()+30).css("left", "30px"); if(eccs_status != 0)
$("#entity_details_content").html(data); $("#show_eccs").show();
if(coco_id != 0) else
$("#show_coco").show(); $("#show_eccs").hide();
else },'html');
$("#show_coco").hide(); }
if(eccs_status != 0)
$("#show_eccs").show(); $("#entity_cat").change(function(event) {
else var id = $("#entity_cat option:selected").val();
$("#show_eccs").hide(); $("#category_type_desc").hide();
},'html'); $("#category_type_selection").hide();
} if(entity_cat_no_fn[id]) {
$("#entity_cat_uri").html('');
$("#entity_cat").change(function(event) { $("#entity_cat_legend").css("visibility","hidden");
var id = $("#entity_cat option:selected").val(); } else {
$("#category_type_desc").hide(); $("#entity_cat_uri").html(id);
$("#category_type_selection").hide(); $("#entity_cat_legend").css("visibility","visible");
if(entity_cat_no_fn[id]) { }
$("#entity_cat_uri").html(''); //alert("ecs="+entity_cat_support[id]+"; ec="+entity_cat[id]);
$("#entity_cat_legend").css("visibility","hidden"); if(entity_cat_support[id] > 0 && entity_cat[id] > 0) {
} else { $("#category_type_selection").show();
$("#entity_cat_uri").html(id); } else {
$("#entity_cat_legend").css("visibility","visible"); if(entity_cat[id] > 0)
} $("#category_type_desc").html("Entity category");
//alert("ecs="+entity_cat_support[id]+"; ec="+entity_cat[id]); if(entity_cat_support[id] > 0)
if(entity_cat_support[id] > 0 && entity_cat[id] > 0) { $("#category_type_desc").html("Entity category support");
$("#category_type_selection").show(); if(id !== "-2")
} else { $("#category_type_desc").show();
if(entity_cat[id] > 0) }
$("#category_type_desc").html("Entity category"); if(coco_always || id == "-1" || id == coco_ecid) {
if(entity_cat_support[id] > 0) $("#coco_header").css("visibility","visible");
$("#category_type_desc").html("Entity category support"); $("#coco").css("visibility","visible");
if(id !== "-2") } else {
$("#category_type_desc").show(); $("#coco_header").css("visibility","hidden");
} $("#coco").css("visibility","hidden");
if(coco_always || id == "-1" || id == coco_ecid) { }
$("#coco_header").css("visibility","visible"); } );
$("#coco").css("visibility","visible");
} else { $("input[name=search_type]").bind("change",function(event) {
$("#coco_header").css("visibility","hidden"); var type = $('input[name=search_type]:checked').val();
$("#coco").css("visibility","hidden"); //alert(type);
} var txt;
} ); var hlp;
if(type == 'entityid') {
$("input[name=search_type]").bind("change",function(event) { txt = 'EntityID substring search';
var type = $('input[name=search_type]:checked').val(); hlp = 'Enter string for a substring matching. Only EntityID is searched.';
//alert(type); }
var txt; if(type == 'text') {
var hlp; txt = 'Fulltext mysql style search';
if(type == 'entityid') { 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>).'
txt = 'EntityID substring search'; }
hlp = 'Enter string for a substring matching. Only EntityID is searched.'; if(type == 'rev-text') {
} txt = 'Fulltext mysql style search';
if(type == 'text') { hlp = 'Same as <i>matching EntityDescriptions (multiple words)</i> but provide the full list from other filters with matched rows excluded.'
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>).' $("#entity_search").attr("placeholder",txt);
} $("#entity_search_help").html(hlp);
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.'
} $("#help").on("click",function(event) {
$("#entity_search").attr("placeholder",txt); $(this).hide();
$("#entity_search_help").html(hlp); });
}); $(".entities_help").on("click",function(event) {
$("#help").html('<p>'+Help[$(this).attr('id')]+'<p><strong>Click on this pop-up to close it.</strong>');
$("#help").on("click",function(event) { var y = Math.max($(this).offset().top - $("#help").height() + 10,0);
$(this).hide(); var x = Math.min($(this).offset().left +20,$(window).width() -230);
}); $("#help").css({'left':x,'top':y});
$("#help").show();
$(".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); if(coco_always) {
var x = Math.min($(this).offset().left +20,$(window).width() -230); $("#coco_header").css("visibility","visible");
$("#help").css({'left':x,'top':y}); $("#coco").css("visibility","visible");
$("#help").show(); }
}); $("#datepicker" ).datepicker({
dateFormat: "yy-mm-dd",
if(coco_always) { defaultDate: 0,
$("#coco_header").css("visibility","visible"); minDate: new Date(2017,3,14),
$("#coco").css("visibility","visible"); maxDate: 0,
} onClose: function(dateText,inst) {
$("#datepicker" ).datepicker({ $("input[name=new_entities][value='1']").prop("checked",true);
dateFormat: "yy-mm-dd", }
defaultDate: 0, });
minDate: new Date(2017,3,14),
maxDate: 0, $("input[name=new_entities]").on("click",function(event) {
onClose: function(dateText,inst) { if($('input[name=new_entities]:checked').val() != 1)
$("input[name=new_entities][value='1']").prop("checked",true); $( "#datepicker" ).val("");
} }
}); );
$("input[name=new_entities]").on("click",function(event) { </script>
if($('input[name=new_entities]:checked').val() != 1)
$( "#datepicker" ).val("");
}
);
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment