This commit is contained in:
alicestrt 2021-01-15 16:25:34 +01:00
commit 59bd03dc17

79
static/js/d3_map.js vendored
View File

@ -65,21 +65,14 @@ d3.json("/static/js/group1.json", function(error, json) {
}) })
.on("click", function(i) { .on("click", function(i) {
// popup video // popup video
jQuery('.ui-widget-overlay').bind('click',function(){ // this is for next the this.parent... ;var video=document.getElementById('#video" + i.id + "');video.pause();
jQuery('#showvideo').dialog('close'); $('#showvideo').hide();
});
if (i.url) { if (i.url) {
divVideo.transition().duration(100); divVideo.transition().duration(100);
divVideo.html("<div id='showvideo'><span onclick=this.parentElement.style.display='none';pauseAllVideos(" + i.id + "); class='topleft'> &nbsp; &times&nbsp;</span><iframe id='video" + i.id + "' width='300' height='150' src='" + i.url + "' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe></div>"); divVideo.html("<div id='showvideo'><span onclick=this.parentElement.style.display='none' class='topleft'> &nbsp; &times&nbsp;</span><iframe id='video" + i.id + "' width='300' height='150' src='" + i.url + "' frameborder='0' allow='accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture' allowfullscreen></iframe></div>");
} };
divBio.transition().duration(100); divBio.transition().duration(100);
divBio.html("<div id='showbio'><span onclick=this.parentElement.style.display='none' class='topleft'> &nbsp; &times&nbsp;</span><div id='bio" + i.id + "'>" + i.bio + "</div>"); divBio.html("<div id='showbio'><span onclick=this.parentElement.style.display='none' class='topleft'> &nbsp; &times&nbsp;</span><div id='bio" + i.id + "'>" + i.bio + "</div>");
// draggable
// div.on(".drag", null);
// span.html("<span onclick='this.parentElement.style.display='none'' class='topleft'>&times</span>");
// rest pop up
popup(i.id, i.time); popup(i.id, i.time);
}) })
.on("dblclick", connectedNodes) .on("dblclick", connectedNodes)
@ -155,70 +148,6 @@ d3.json("/static/js/group1.json", function(error, json) {
// no overlapping
//var padding = 10, // separation between circles
// radius=8;
//function collide(alpha) {
// var quadtree = d3.geom.quadtree(<.nodes);
// return function(d) {
// var rb = 2*radius + padding,
// nx1 = d.x - rb,
// nx2 = d.x + rb,
// ny1 = d.y - rb,
// ny2 = d.y + rb;
// quadtree.visit(function(quad, x1, y1, x2, y2) {
// if (quad.point && (quad.point !== d)) {
// var x = d.x - quad.point.x,
// y = d.y - quad.point.y,
// l = Math.sqrt(x * x + y * y);
// if (l < rb) {
// l = (l - rb) / l * alpha;
// d.x -= x *= l;
// d.y -= y *= l;
// quad.point.x += x;
// quad.point.y += y;
// }
// }
// return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;
// });
// };
//}
// scripts for mouse events
// var stopVideo = function (name) {
// function stopVideo(name) {
// var iframe = document.querySelector( 'iframe');
// var video = document.getElementById( "#video"+name );
// if ( iframe !== null ) {
// var iframeSrc = iframe.src;
// iframe.src = iframeSrc;
// }
// if ( video !== null ) {
// video.pause();
// }
// };
// $(function (){
// $('.topleft').click(function(){
// $('iframe').attr('src', $('iframe').attr('src'));
// });
// });
// function pauseAllVideos(name)
// {
// $("#video"+name).each(function(){
// this.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}', '*')
// });
// }
function pauseAllVideos(name) {
$("video" + name).each(function() {
$(this).stopVideo();
});
};
// $(function (){ // $(function (){
// $('.topleft').click(function(){ // $('.topleft').click(function(){
// $('iframe').attr('src', $('iframe').attr('src')); // $('iframe').attr('src', $('iframe').attr('src'));