var COOKIE_NAME = 'evidencehubmainviz'; //this list the tabs var TABS = {"home":true, "social":true, "org":true,"project":true,"issue":true, "solution":true, "evidence":true, "web":true, "user":true ,"comment":true }; var VIZ = {"overview":true,"list":true}; var USERVIZ = {"overview":true,"list":true, "usergmap":true, "nodegmap":true, "net":true}; var ORGVIZ = {"overview":true, "list":true, "gmap":true}; var COMMENTVIZ = {"list":true}; var NEWSVIZ = {"list":true}; var DEFAULT_TAB = 'home'; var DEFAULT_VIZ = 'list'; var CURRENT_VIZ = DEFAULT_VIZ; var CURRENT_TAB = DEFAULT_TAB; var DATA_LOADED = {"home":false, "org":false, "project":false, "projectoverview":false, "orgoverview":false, "challenge":false, "challengeoverview":false, "issue":false, "issueoverview":false, "solution":false, "solutionoverview":false, "claim":false, "claimoverview":false, "evidence":false, "evidenceoverview":false, "url":false, "urloverview":false, "user":false, "useroverview":false, "orgsimile":false,"issuesimile":false,"claimsimile":false,"evidencesimile":false,"orggmap":false,"projectgmap":false,"issuegmap":false,"claimgmap":false,"evidencegmap":false,"usergmap":false,"nodegmap":false, "commentlist":false, "newslist":false}; var NEGATIVE_LINKGROUP_NAME = "Negative"; var POSITIVE_LINKGROUP_NAME = "Positive"; var NEUTRAL_LINKGROUP_NAME = "Neutral"; //define events for clicking on the tabs var stpHomeOverview = setTabPushed.bindAsEventListener($('tab-home-list-obj'),'home-overview'); var stpHomeList = setTabPushed.bindAsEventListener($('tab-home-list-obj'),'home-list'); var stpHomeNet = setTabPushed.bindAsEventListener($('tab-home-list-obj'),'home-net'); var stpOrgList = setTabPushed.bindAsEventListener($('tab-org-list-obj'),'org-list'); var stpOrgGMap = setTabPushed.bindAsEventListener($('tab-org-list-obj'),'org-gmap'); var stpOrgNet = setTabPushed.bindAsEventListener($('tab-org-list-obj'),'org-net'); var stpOrgOverview = setTabPushed.bindAsEventListener($('tab-org-list-obj'),'org-overview'); var stpProjectList = setTabPushed.bindAsEventListener($('tab-project-list-obj'),'project-list'); var stpProjectGMap = setTabPushed.bindAsEventListener($('tab-project-list-obj'),'project-gmap'); var stpProjectNet = setTabPushed.bindAsEventListener($('tab-project-list-obj'),'project-net'); var stpProjectOverview = setTabPushed.bindAsEventListener($('tab-project-list-obj'),'project-overview'); var stpIssueList = setTabPushed.bindAsEventListener($('tab-issue-list-obj'),'issue-list'); var stpIssueGMap = setTabPushed.bindAsEventListener($('tab-issue-list-obj'),'issue-gmap'); var stpIssueNet = setTabPushed.bindAsEventListener($('tab-issue-list-obj'),'issue-net'); var stpIssueOverview = setTabPushed.bindAsEventListener($('tab-issue-list-obj'),'issue-overview'); var stpSolutionList = setTabPushed.bindAsEventListener($('tab-solution-list-obj'),'solution-list'); var stpSolutionGMap = setTabPushed.bindAsEventListener($('tab-solution-list-obj'),'solution-gmap'); var stpSolutionNet = setTabPushed.bindAsEventListener($('tab-solution-list-obj'),'solution-net'); var stpSolutionOverview = setTabPushed.bindAsEventListener($('tab-solution-list-obj'),'solution-overview'); var stpEvidenceList = setTabPushed.bindAsEventListener($('tab-evidence-list-obj'),'evidence-list'); var stpEvidenceGMap = setTabPushed.bindAsEventListener($('tab-evidence-list-obj'),'evidence-gmap'); var stpEvidenceNet = setTabPushed.bindAsEventListener($('tab-evidence-list-obj'),'evidence-net'); var stpEvidenceOverview = setTabPushed.bindAsEventListener($('tab-evidence-list-obj'),'evidence-overview'); var stpWebList = setTabPushed.bindAsEventListener($('tab-web-list-obj'),'web-list'); var stpWebNet = setTabPushed.bindAsEventListener($('tab-web-list-obj'),'web-net'); var stpWebOverview = setTabPushed.bindAsEventListener($('tab-web-list-obj'),'web-overview'); var stpUserList = setTabPushed.bindAsEventListener($('tab-user-list-obj'),'user-list'); var stpUserGMap = setTabPushed.bindAsEventListener($('tab-user-list-obj'),'user-usergmap'); var stpUserOverview = setTabPushed.bindAsEventListener($('tab-user-list-obj'),'user-overview'); var stpUserNet = setTabPushed.bindAsEventListener($('tab-user-list-obj'),'user-net'); var stpUserNodeGMap = setTabPushed.bindAsEventListener($('tab-user-list-obj'),'user-nodegmap'); var stpCommentList = setTabPushed.bindAsEventListener($('tab-comment-list-obj'),'comment-list'); /** * set which tab to show and load first */ Event.observe(window, 'load', function() { // add events for clicking on the main tabs Event.observe('tab-home','click', stpHomeList); Event.observe('tab-issue','click', stpIssueOverview); Event.observe('tab-evidence','click', stpEvidenceOverview); Event.observe('tab-web','click', stpWebOverview); if (hasChallenge && $("tab-challenge")) { Event.observe('tab-challenge','click', stpChallengeOverview); } if (hasSolution) { Event.observe('tab-solution','click', stpSolutionOverview); } if (hasClaim) { Event.observe('tab-claim','click', stpClaimOverview); } if ($("tab-user")) { Event.observe('tab-user','click', stpUserOverview); } if ($("tab-comment")) { Event.observe('tab-comment','click', stpCommentList); } if ($("tab-org")) { Event.observe('tab-org','click', stpOrgOverview); } if ($("tab-project")) { Event.observe('tab-project','click', stpProjectOverview); } // add events for clicking on the viz tabs if (hasChallenge && $("tab-challenge")) { Event.observe('tab-challenge-list','click', stpChallengeList); Event.observe('tab-challenge-overview','click', stpChallengeOverview); //Event.observe('tab-challenge-net','click', stpChallengeNet); } Event.observe('tab-org-overview','click', stpOrgOverview); Event.observe('tab-org-list','click', stpOrgList); //Event.observe('tab-org-net','click', stpOrgNet); Event.observe('tab-org-gmap','click', stpOrgGMap); Event.observe('tab-project-overview','click', stpProjectOverview); Event.observe('tab-project-list','click', stpProjectList); //Event.observe('tab-project-net','click', stpProjectNet); Event.observe('tab-project-gmap','click', stpProjectGMap); Event.observe('tab-issue-overview','click', stpIssueOverview); Event.observe('tab-issue-list','click', stpIssueList); //Event.observe('tab-issue-net','click', stpIssueNet); if (hasSolution) { Event.observe('tab-solution-overview','click', stpSolutionOverview); Event.observe('tab-solution-list','click', stpSolutionList); //Event.observe('tab-solution-net','click', stpSolutionNet); } if (hasClaim) { Event.observe('tab-claim-overview','click', stpClaimOverview); Event.observe('tab-claim-list','click', stpClaimList); //Event.observe('tab-claim-net','click', stpClaimNet); } Event.observe('tab-evidence-overview','click', stpEvidenceOverview); Event.observe('tab-evidence-list','click', stpEvidenceList); //Event.observe('tab-evidence-net','click', stpEvidenceNet); Event.observe('tab-web-overview','click', stpWebOverview); Event.observe('tab-web-list','click', stpWebList); //Event.observe('tab-web-net','click', stpWebNet); if ($("tab-user-overview")) { Event.observe('tab-user-overview','click', stpUserOverview); } if ($("tab-user-list")) { Event.observe('tab-user-list','click', stpUserList); } if ($("tab-user-usergmap")) { Event.observe('tab-user-usergmap','click', stpUserGMap); } if ($("tab-user-nodegmap")) { Event.observe('tab-user-nodegmap','click', stpUserNodeGMap); } if ($("tab-user-net")) { Event.observe('tab-user-net','click', stpUserNet); } if ($("tab-comment-list")) { Event.observe('tab-comment-list','click', stpCommentList); } //var viz = getViz(""); //setTabPushed($('tab-'+getAnchorVal(DEFAULT_TAB + "-" + viz)),getAnchorVal(DEFAULT_TAB + "-" + viz)); setTabPushed($('tab-'+getAnchorVal(DEFAULT_TAB + "-" + DEFAULT_VIZ)),getAnchorVal(DEFAULT_TAB + "-" + DEFAULT_VIZ)); }); /** * Return the viz and store in cookie */ function getViz(viz) { //alert("BEFORE:"+viz); if (viz == "" || (viz != 'list' && viz != "overview" && viz != "net" && viz != "usergmap" && viz != "gmap")) { viz = DEFAULT_VIZ; var allcookies = document.cookie; if (allcookies != null) { var cookiearray = allcookies.split(';'); for(var i=0; i < cookiearray.length; i++){ var param = cookiearray[i].split('=') var name = param[0]; var value = param[1]; if (name.trim() == COOKIE_NAME) { //alert("COOKIE:"+value); viz = value; } } } if (viz == "") { viz = DEFAULT_VIZ; } } else { if (viz != "net") { var date = new Date(); date.setTime(date.getTime()+(365*24*60*60*1000)); // 365 days document.cookie = COOKIE_NAME + "=" + viz + "; expires=" + date.toGMTString(); } } //alert("AFTER:"+viz); return viz; } /** * switch between tabs */ function setTabPushed(e) { var data = $A(arguments); var tabID = data[1]; // Social Sign On bug - returns strange #_=_ when calling index page if (tabID == '_=_') { tabID = 'home-overview'; window.location.hash = tabID; if (typeof window.history.replaceState == 'function') { window.history.replaceState("string", "Title", "#home-overview"); } } // get tab and the visualisation from the # var parts = tabID.split("-"); var tab = parts[0]; var viz=""; if (parts.length > 1) { viz = parts[1]; } var page=1; if (parts.length > 2) { page = parseInt(parts[2]); } //viz = getViz(viz); // Check tab is know else default to default if (!TABS.hasOwnProperty(tab)) { tab = DEFAULT_TAB; viz = DEFAULT_VIZ; } var i=""; var temptab = tab; for (i in TABS){ if(temptab == i){ if($("tab-"+i)) { $("tab-"+i).removeClassName("unselected"); $("tab-"+i).addClassName("current"); } } else { if($("tab-"+i)) { $("tab-"+i).removeClassName("current"); $("tab-"+i).addClassName("unselected"); } } if(tab == i){ if ($("tab-content-"+i+"-div")) { $("tab-content-"+i+"-div").show(); } } else { if ($("tab-content-"+i+"-div")) { $("tab-content-"+i+"-div").hide(); } } } if (tab == 'issue' || tab == 'solution' || tab == 'claim' || (tab == 'challenge' && hasChallenge) || tab == 'evidence' || tab == 'web') { for (i in VIZ){ if(viz == i){ $("tab-"+tab+"-"+i).removeClassName("unselected"); $("tab-"+tab+"-"+i).addClassName("current"); $("tab-content-"+tab+"-"+i).show(); } else { $("tab-"+tab+"-"+i).removeClassName("current"); $("tab-"+tab+"-"+i).addClassName("unselected"); $("tab-content-"+tab+"-"+i).hide(); } } } else if (tab == 'org' || tab == 'project') { for (i in ORGVIZ){ if(viz == i){ if ($("tab-"+tab+"-"+i)) { $("tab-"+tab+"-"+i).removeClassName("unselected"); $("tab-"+tab+"-"+i).addClassName("current"); } if ($("tab-content-"+tab+"-"+i)) { $("tab-content-"+tab+"-"+i).show(); } } else { if ($("tab-"+tab+"-"+i)) { $("tab-"+tab+"-"+i).removeClassName("current"); $("tab-"+tab+"-"+i).addClassName("unselected"); } if ($("tab-content-"+tab+"-"+i)) { $("tab-content-"+tab+"-"+i).hide(); } } } } else if (tab == 'user') { for (i in USERVIZ){ if(viz == i){ if ($("tab-"+tab+"-"+i)) { $("tab-"+tab+"-"+i).removeClassName("unselected"); $("tab-"+tab+"-"+i).addClassName("current"); } if ($("tab-content-"+tab+"-"+i)) { $("tab-content-"+tab+"-"+i).show(); } } else { if ($("tab-"+tab+"-"+i)) { $("tab-"+tab+"-"+i).removeClassName("current"); $("tab-"+tab+"-"+i).addClassName("unselected"); } if ($("tab-content-"+tab+"-"+i)) { $("tab-content-"+tab+"-"+i).hide(); } } } } else if (tab == 'comment' && $("tab-comment")) { for (i in COMMENTVIZ){ if(viz == i){ $("tab-"+tab+"-"+i).removeClassName("unselected"); $("tab-"+tab+"-"+i).addClassName("current"); $("tab-content-"+tab+"-"+i).show(); } else { $("tab-"+tab+"-"+i).removeClassName("current"); $("tab-"+tab+"-"+i).addClassName("unselected"); $("tab-content-"+tab+"-"+i).hide(); } } } else if (tab == 'news' && $("tab-news")) { for (i in NEWSVIZ){ if(viz == i){ $("tab-"+tab+"-"+i).removeClassName("unselected"); $("tab-"+tab+"-"+i).addClassName("current"); $("tab-content-"+tab+"-"+i).show(); } else { $("tab-"+tab+"-"+i).removeClassName("current"); $("tab-"+tab+"-"+i).addClassName("unselected"); $("tab-content-"+tab+"-"+i).hide(); } } } if (tab == 'user') { USER_ARGS['orderby'] = 'lastactive'; } CURRENT_TAB = tab; CURRENT_VIZ = viz; switch(viz){ case 'gmap': switch(tab) { case 'org': $('tab-org').setAttribute("href","#org-gmap"); Event.stopObserving('tab-org','click'); Event.observe('tab-org','click', stpOrgGMap); if(!DATA_LOADED.orggmap){ loadOrgNodesGMap(); } else { updateAddressParameters(ORG_ARGS); if (ORG_ARGS['zoomtocountry'] != 'undefined') { zoomToCountryOrg(ORG_ARGS['zoomtocountry']); } } break; case 'project': $('tab-project').setAttribute("href","#project-gmap"); Event.stopObserving('tab-project','click'); Event.observe('tab-project','click', stpProjectGMap); if(!DATA_LOADED.projectgmap){ loadProjectNodesGMap(); } else { updateAddressParameters(PROJECT_ARGS); if (PROJECT_ARGS['zoomtocountry'] != 'undefined') { zoomToCountryProject(PROJECT_ARGS['zoomtocountry']); } } break; } break; case 'usergmap': $('tab-user').setAttribute("href","#user-usergmap"); Event.stopObserving('tab-user','click'); Event.observe('tab-user','click', stpUserGMap); if(!DATA_LOADED.usergmap){ loadUserGMap(); } else { updateAddressParameters(USER_ARGS); if (USER_ARGS['zoomtocountry'] != 'undefined') { zoomToCountryUser(USER_ARGS['zoomtocountry']); } } //DATA_LOADED.user = false; break; case 'nodegmap': $('tab-user').setAttribute("href","#user-nodegmap"); Event.stopObserving('tab-user','click'); Event.observe('tab-user','click', stpUserNodeGMap); if(!DATA_LOADED.nodegmap){ loadUserNodeGMap(); } else { updateAddressParameters(USER_ARGS); if (USER_ARGS['zoomtocountry'] != 'undefined') { zoomToCountryUserNode(USER_ARGS['zoomtocountry']); } } //DATA_LOADED.user = false; break; case 'list': switch(tab) { case 'home': $('tab-home').setAttribute("href",'#home-list'); Event.observe('tab-home','click', stpHomeList); if(!DATA_LOADED.home){ NODE_ARGS['start'] = (page-1) * NODE_ARGS['max']; loadhome(CONTEXT,NODE_ARGS); } break; case 'challenge': $('tab-challenge').setAttribute("href", '#challenge-list'); Event.stopObserving('tab-challenge','click'); Event.observe('tab-challenge','click', stpChallengeList); if(!DATA_LOADED.challenge){ CHALLENGE_ARGS['start'] = (page-1) * CHALLENGE_ARGS['max']; loadchallenges(CONTEXT,CHALLENGE_ARGS); } else { updateAddressParameters(CHALLENGE_ARGS); } break; case 'org': $('tab-org').setAttribute("href",'#org-list'); Event.stopObserving('tab-org','click'); Event.observe('tab-org','click', stpOrgList); if(!DATA_LOADED.org){ ORG_ARGS['start'] = (page-1) * ORG_ARGS['max']; loadorgs(CONTEXT,ORG_ARGS); } else { updateAddressParameters(ORG_ARGS); } break; case 'project': $('tab-project').setAttribute("href","#project-list"); Event.stopObserving('tab-project','click'); Event.observe('tab-project','click', stpProjectList); if(!DATA_LOADED.project){ PROJECT_ARGS['start'] = (page-1) * PROJECT_ARGS['max']; loadprojects(CONTEXT,PROJECT_ARGS); } else { updateAddressParameters(PROJECT_ARGS); } break; case 'issue': $('tab-issue').setAttribute("href",'#issue-list'); Event.stopObserving('tab-issue','click'); Event.observe('tab-issue','click', stpIssueList); if(!DATA_LOADED.issue){ ISSUE_ARGS['start'] = (page-1) * ISSUE_ARGS['max']; loadissues(CONTEXT,ISSUE_ARGS); } else { updateAddressParameters(ISSUE_ARGS); } break; case 'solution': $('tab-solution').setAttribute("href",'#solution-list'); Event.stopObserving('tab-solution','click'); Event.observe('tab-solution','click', stpSolutionList); if(!DATA_LOADED.solution){ SOLUTION_ARGS['start'] = (page-1) * SOLUTION_ARGS['max']; loadsolutions(CONTEXT,SOLUTION_ARGS); } else { updateAddressParameters(SOLUTION_ARGS); } break; case 'claim': $('tab-claim').setAttribute("href",'#claim-list'); Event.stopObserving('tab-claim','click'); Event.observe('tab-claim','click', stpClaimList); if(!DATA_LOADED.claim){ CLAIM_ARGS['start'] = (page-1) * CLAIM_ARGS['max']; loadclaims(CONTEXT,CLAIM_ARGS); } else { updateAddressParameters(CLAIM_ARGS); } break; case 'evidence': $('tab-evidence').setAttribute("href",'#evidence-list'); Event.stopObserving('tab-evidence','click'); Event.observe('tab-evidence','click', stpEvidenceList); if(!DATA_LOADED.evidence){ EVIDENCE_ARGS['start'] = page-1 * EVIDENCE_ARGS['max']; loadevidence(CONTEXT,EVIDENCE_ARGS); } else { updateAddressParameters(EVIDENCE_ARGS); } break; case 'web': $('tab-web').setAttribute("href",'#web-list'); Event.stopObserving('tab-web','click'); Event.observe('tab-web','click', stpWebList); if(!DATA_LOADED.url){ URL_ARGS['start'] = (page-1) * URL_ARGS['max']; loadurls(CONTEXT,URL_ARGS); } else { updateAddressParameters(URL_ARGS); } break; case 'user': $('tab-user').setAttribute("href",'#user-list'); Event.stopObserving('tab-user','click'); Event.observe('tab-user','click', stpUserList); if(!DATA_LOADED.user){ USER_ARGS['start'] = (page-1) * USER_ARGS['max']; loadusers(CONTEXT,USER_ARGS); } else { updateAddressParameters(USER_ARGS); } break; case 'comment': $('tab-comment').setAttribute("href",'#comment-list'); Event.observe('tab-comment','click', stpCommentList); if(!DATA_LOADED.commentlist){ COMMENT_ARGS['start'] = (page-1) * COMMENT_ARGS['max']; loadcomments(CONTEXT,COMMENT_ARGS); } else { updateAddressParameters(COMMENT_ARGS); } break; case 'news': $('tab-news').setAttribute("href",'#news-list'); Event.observe('tab-news','click', stpNewsList); if(!DATA_LOADED.newslist){ NEWS_ARGS['start'] = (page-1) * NEWS_ARGS['max']; loadnews(CONTEXT,NEWS_ARGS); } else { updateAddressParameters(NEWS_ARGS); } break; } break; case 'overview': switch(tab){ case 'home': updateAddressParameters({}); // HERE ALSO FOR BACKWARD COMPATIBILITY $('tab-home').setAttribute("href","#home-list"); Event.observe('tab-home','click', stpHomeList); if(!DATA_LOADED.home){ loadhome(CONTEXT,NODE_ARGS); } break; case 'org': updateAddressParameters({}); $('tab-org').setAttribute("href","https://netlab.evidence-hub.net/#org-overview"); Event.stopObserving('tab-org','click'); Event.observe('tab-org','click', stpOrgOverview); if(!DATA_LOADED.orgoverview){ loadOrgOverview(CONTEXT,ORG_ARGS); } break; case 'project': updateAddressParameters({}); $('tab-project').setAttribute("href","https://netlab.evidence-hub.net/#project-overview"); Event.stopObserving('tab-project','click'); Event.observe('tab-project','click', stpProjectOverview); if(!DATA_LOADED.projectoverview){ loadProjectOverview(CONTEXT,PROJECT_ARGS); } break; case 'challenge': updateAddressParameters({}); $('tab-challenge').setAttribute("href","https://netlab.evidence-hub.net/#challenge-overview"); Event.stopObserving('tab-challenge','click'); Event.observe('tab-challenge','click', stpChallengeOverview); if(!DATA_LOADED.challengeoverview){ loadChallengeOverview(CONTEXT,CHALLENGE_ARGS); } break; case 'issue': updateAddressParameters({}); $('tab-issue').setAttribute("href","https://netlab.evidence-hub.net/#issue-overview"); Event.stopObserving('tab-issue','click'); Event.observe('tab-issue','click', stpIssueOverview); if(!DATA_LOADED.issueoverview){ loadIssueOverview(CONTEXT,ISSUE_ARGS); } break; case 'solution': updateAddressParameters({}); $('tab-solution').setAttribute("href","https://netlab.evidence-hub.net/#solution-overview"); Event.stopObserving('tab-solution','click'); Event.observe('tab-solution','click', stpSolutionOverview); if(!DATA_LOADED.solutionoverview){ loadSolutionOverview(CONTEXT,SOLUTION_ARGS); } break; case 'claim': updateAddressParameters({}); $('tab-claim').setAttribute("href","https://netlab.evidence-hub.net/#claim-overview"); Event.stopObserving('tab-claim','click'); Event.observe('tab-claim','click', stpClaimOverview); if(!DATA_LOADED.claimoverview){ loadClaimOverview(CONTEXT,CLAIM_ARGS); } break; case 'evidence': updateAddressParameters({}); $('tab-evidence').setAttribute("href","https://netlab.evidence-hub.net/#evidence-overview"); Event.stopObserving('tab-evidence','click'); Event.observe('tab-evidence','click', stpEvidenceOverview); if(!DATA_LOADED.evidenceoverview){ loadEvidenceOverview(CONTEXT,EVIDENCE_ARGS); } break; case 'web': updateAddressParameters({}); $('tab-web').setAttribute("href","https://netlab.evidence-hub.net/#web-overview"); Event.stopObserving('tab-web','click'); Event.observe('tab-web','click', stpWebOverview); if(!DATA_LOADED.urloverview){ loadWebOverview(CONTEXT,URL_ARGS); } break; case 'user': updateAddressParameters({}); $('tab-user').setAttribute("href","https://netlab.evidence-hub.net/#user-overview"); Event.stopObserving('tab-user','click'); Event.observe('tab-user','click', stpUserOverview); if(!DATA_LOADED.useroverview){ loadUserOverview(CONTEXT,USER_ARGS); } break; } break; case 'net': switch(tab){ case 'org': $('tab-org').setAttribute("href","#org-net"); Event.stopObserving('tab-org','click'); Event.observe('tab-org','click', stpOrgNet); loadOrgNet(CONTEXT,ORG_ARGS); //DATA_LOADED.org = false; break; case 'project': $('tab-project').setAttribute("href","#project-net"); Event.stopObserving('tab-project','click'); Event.observe('tab-project','click', stpProjectNet); loadProjectNet(CONTEXT,PROJECT_ARGS); //DATA_LOADED.project = false; break; case 'challenge': $('tab-challenge').setAttribute("href","#challenge-net"); Event.stopObserving('tab-challenge','click'); Event.observe('tab-challenge','click', stpChallengeNet); loadChallengeNet(CONTEXT,CHALLENGE_ARGS); //DATA_LOADED.challenge = false; break; case 'issue': $('tab-issue').setAttribute("href","#issue-net"); Event.stopObserving('tab-issue','click'); Event.observe('tab-issue','click', stpIssueNet); loadIssueNet(CONTEXT,ISSUE_ARGS); //DATA_LOADED.issue = false; break; case 'solution': $('tab-solution').setAttribute("href","#solution-net"); Event.stopObserving('tab-solution','click'); Event.observe('tab-solution','click', stpSolutionNet); loadSolutionNet(CONTEXT,SOLUTION_ARGS); //DATA_LOADED.solution = false; break; case 'claim': $('tab-claim').setAttribute("href","#claim-net"); Event.stopObserving('tab-claim','click'); Event.observe('tab-claim','click', stpClaimNet); loadClaimNet(CONTEXT,CLAIM_ARGS); //DATA_LOADED.claim = false; break; case 'evidence': $('tab-evidence').setAttribute("href","#evidence-net"); Event.stopObserving('tab-evidence','click'); Event.observe('tab-evidence','click', stpEvidenceNet); loadEvidenceNet(CONTEXT,EVIDENCE_ARGS); //DATA_LOADED.evidence = false; break; case 'web': $('tab-web').setAttribute("href","#web-net"); Event.stopObserving('tab-web','click'); Event.observe('tab-web','click', stpWebNet); loadWebNet(CONTEXT,URL_ARGS); //DATA_LOADED.web = false; break; case 'user': $('tab-user').setAttribute("href","https://netlab.evidence-hub.net/#user-net"); Event.stopObserving('tab-user','click'); Event.observe('tab-user','click', stpUserNet); loadUserNet(CONTEXT,USER_ARGS); //DATA_LOADED.usernet = false; break; } break; default: //alert("default"); } } /** * Called by forms to refresh the challenges view */ function refreshChallenges() { switch(CURRENT_VIZ){ case 'list': loadchallenges(CONTEXT,CHALLENGE_ARGS); break; case 'net': loadChallengeNet(CONTEXT,CHALLENGE_ARGS); break; default: } } /** * Called to refresh the current org view */ function refreshOrganizations() { switch(CURRENT_VIZ){ case 'list': loadorgs(CONTEXT,ORG_ARGS); break; case 'net': if ($('CohereOrgNet')) { loadOrgThemeApplet(); } else { loadOrgNet(CONTEXT,ORG_ARGS); } break; case 'gmap': loadOrgNodesGMap(CONTEXT,ORG_ARGS); break; default: } } /** * Called to refresh the current project view */ function refreshProjects() { switch(CURRENT_VIZ){ case 'list': loadprojects(CONTEXT,PROJECT_ARGS); break; case 'net': if ($('CohereProjectNet')) { loadProjectThemeApplet(); } else { loadProjectNet(CONTEXT,PROJECT_ARGS); } break; case 'gmap': loadProjectNodesGMap(CONTEXT,PROJECT_ARGS); break; default: } } /** * Called by forms to refresh the issues view */ function refreshIssues() { switch(CURRENT_VIZ){ case 'list': loadissues(CONTEXT,ISSUE_ARGS); break; case 'net': if ($('CohereIssueNet')) { loadIssueThemeApplet(); } else { loadIssueNet(CONTEXT,ISSUE_ARGS); } break; default: } } /** * Called by forms to refresh the solution view */ function refreshSolutions() { switch(CURRENT_VIZ){ case 'list': loadsolutions(CONTEXT,SOLUTION_ARGS); break; case 'net': if ($('CohereSolutionNet')) { loadSolutionThemeApplet(); } else { loadSolutionNet(CONTEXT,SOLUTION_ARGS); } break; default: } } /** * Called by forms to refresh the claims view */ function refreshClaims() { switch(CURRENT_VIZ){ case 'list': loadclaims(CONTEXT,CLAIM_ARGS); break; case 'net': if ($('CohereClaimNet')) { loadClaimThemeApplet(); } else { loadClaimNet(CONTEXT,CLAIM_ARGS); } break; default: } } /** * Called by forms to refresh the evidence view */ function refreshEvidence() { switch(CURRENT_VIZ){ case 'list': loadevidence(CONTEXT,EVIDENCE_ARGS); break; case 'net': if ($('CohereEvidenceNet')) { loadEvidenceThemeApplet(); } else { loadEvidenceNet(CONTEXT,EVIDENCE_ARGS); } break; default: } } function refreshWebsites() { switch(CURRENT_VIZ){ case 'list': loadurls(CONTEXT,URL_ARGS); break; case 'net': if ($('CohereResourceNet')) { loadResourceThemeApplet(); } else { loadResourceNet(CONTEXT,URL_ARGS); } break; default: } } function refreshUsers() { switch(CURRENT_VIZ){ case 'list': loadusers(CONTEXT,USER_ARGS); break; case 'usergmap': loadUserGMap(); break; case 'nodegmap': loadUserNodeGMap(); break; default: } } function refreshComments() { loadcomments(CONTEXT,COMMENT_ARGS); } function refreshNews() { loadnews(CONTEXT,NEWS_ARGS); } /** * load next/previous set of organisation nodes */ function loadhome(context,args){ loadHomePageOverview(context, args) //$("tab-content-home").update("Home page"); } // LOAD OVERVIEWS /** * Create the Home Overview page * @param context the current context * @param args the array of parameters for this category */ function loadHomePageOverview(context, args) { if ($("tab-content-home-overview")) { $("tab-content-home-overview").innerHTML = ""; var widget = overviewHomeNodeWidget(context, args, BASE_TYPES_STR+','+RESOURCE_TYPES_STR+','+EVIDENCE_TYPES_STR, 'date', 'DESC', '10', 230, 220, 'mostrecent'); if (widget.innerHTML == "") { $("tab-content-home-recent").style.display = "none"; } else { $("tab-content-home-overview").insert( widget ); DATA_LOADED.homeoverview = true; } } } /** * Create the Key Challenge Overview page * @param context the current context * @param args the array of parameters for this category */ function loadChallengeOverview(context, args) { $("tab-content-challenge-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recentorgs = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, '- più recenti', "Challenge", 'date', 'DESC', '5', 350, 190, 'Esplora', 'challenge', '-', 'mostrecent'); recentorgs.insert(set); var connectedorgs = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, '- più connesse', "Challenge", 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'challenge', '-', 'mostconnected'); connectedorgs.insert(set); row1.insert(recentorgs); row1.insert(connectedorgs); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var voted = new Element("div", {"class":"col-md-6 col-sm-12"}); var set3 = overviewNodeWidget(context, args, '- più votate', "Challenge", 'vote', 'DESC', '5', 350, 190, 'Esplora', 'challenge', '-', 'mostvoted'); voted.insert(set3); var poptheme = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'TEMI più popolari per -', 'Challenge', '5', 350, 201, 'Esplora', 'challenge', '-', 'mostthemes'); poptheme.insert(set2); row2.insert(voted); row2.insert(poptheme); $("tab-content-challenge-overview").insert( row1 ); $("tab-content-challenge-overview").insert( row2 ); DATA_LOADED.challengeoverview = true; } /** * Create the Issue Overview page * @param context the current context * @param args the array of parameters for this category */ function loadIssueOverview(context, args) { $("tab-content-issue-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recentorgs = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'SFIDE più recenti', "Issue", 'date', 'DESC', '5', 350, 190, 'Esplora', 'issue', 'SFIDE', 'mostrecent'); recentorgs.insert(set); var connectedorgs = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'SFIDE più connesse', "Issue", 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'issue', 'SFIDE', 'mostconnected'); connectedorgs.insert(set); row1.insert(recentorgs); row1.insert(connectedorgs); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var voted = new Element("div", {"class":"col-md-6 col-sm-12"}); var set3 = overviewNodeWidget(context, args, 'SFIDE più votate', "Issue", 'vote', 'DESC', '5', 350, 190, 'Esplora', 'issue', 'SFIDE', 'mostvoted'); voted.insert(set3); var poptheme = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'TEMI più popolari per SFIDE', 'Issue', '5', 350, 201, 'Esplora', 'issue', 'SFIDE', 'mostthemes'); poptheme.insert(set2); row2.insert(voted); row2.insert(poptheme); $("tab-content-issue-overview").insert( row1 ); $("tab-content-issue-overview").insert( row2 ); DATA_LOADED.issueoverview = true; } /** * Create the Solution Overview page * @param context the current context * @param args the array of parameters for this category */ function loadSolutionOverview(context, args) { $("tab-content-solution-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recent = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'PROPOSTE più recenti', "Solution", 'date', 'DESC', '5', 350, 190, 'Esplora', 'solution', 'PROPOSTE', 'mostrecent'); recent.insert(set); var connected = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'PROPOSTE più connesse', "Solution", 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'solution', 'PROPOSTE', 'mostconnected'); connected.insert(set); row1.insert(recent); row1.insert(connected); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var voted = new Element("div", {"class":"col-md-6 col-sm-12"}); var set3 = overviewNodeWidget(context, args, 'PROPOSTE più votate', "Solution", 'vote', 'DESC', '5', 350, 190, 'Esplora', 'solution', 'PROPOSTE', 'mostvoted'); voted.insert(set3); var poptheme = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'TEMI più votate per PROPOSTE', 'Solution', '5', 350, 201, 'Esplora', 'solution', 'PROPOSTE', 'mostthemes'); poptheme.insert(set2); row2.insert(voted); row2.insert(poptheme); $("tab-content-solution-overview").insert( row1 ); $("tab-content-solution-overview").insert( row2 ); DATA_LOADED.solutionoverview = true; } /** * Create the Claim Overview page * @param context the current context * @param args the array of parameters for this category */ function loadClaimOverview(context, args) { $("tab-content-claim-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recent = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'più recenti -', "Claim", 'date', 'DESC', '5', 350, 190, 'Esplora', 'claim', '-', 'mostrecent'); recent.insert(set); row1.insert(recent); var connected = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'più connesse -', "Claim", 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'claim', '-', 'mostconnected'); connected.insert(set); row1.insert(connected); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var voted = new Element("div", {"class":"col-md-6 col-sm-12"}); var set3 = overviewNodeWidget(context, args, 'più votate su -', "Claim", 'vote', 'DESC', '5', 350, 190, 'Esplora', 'claim', '-', 'mostvoted'); voted.insert(set3); row2.insert(voted); var poptheme = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'più popolari TEMI per -', 'Claim', '5', 350, 201, 'Esplora', 'claim', '-', 'mostthemes'); poptheme.insert(set2); row2.insert(poptheme); $("tab-content-claim-overview").insert( row1 ); $("tab-content-claim-overview").insert( row2 ); DATA_LOADED.claimoverview = true; } /** * Create the Evidence Overview page * @param context the current context * @param args the array of parameters for this category */ function loadEvidenceOverview(context, args) { $("tab-content-evidence-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recent = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'ARGOMENTAZIONI più recenti', EVIDENCE_TYPES_STR, 'date', 'DESC', '5', 350, 190, 'Esplora', 'evidence', 'ARGOMENTAZIONI', 'mostrecent'); recent.insert(set); row1.insert(recent); var connected = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'ARGOMENTAZIONI più connesse', EVIDENCE_TYPES_STR, 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'evidence', 'ARGOMENTAZIONI', 'mostconnected'); connected.insert(set); row1.insert(connected); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var voted = new Element("div", {"class":"col-md-6 col-sm-12"}); var set3 = overviewNodeWidget(context, args, 'ARGOMENTAZIONI più votate', EVIDENCE_TYPES_STR, 'vote', 'DESC', '5', 350, 190, 'Esplora', 'evidence', 'ARGOMENTAZIONI', 'mostvoted'); voted.insert(set3); row2.insert(voted); var poptheme = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'TEMI più votati nella ARGOMENTAZIONI', EVIDENCE_TYPES_STR, '5', 350, 201, 'Esplora', 'evidence', 'ARGOMENTAZIONI', 'mostthemes'); poptheme.insert(set2); row2.insert(poptheme); $("tab-content-evidence-overview").insert( row1 ); $("tab-content-evidence-overview").insert( row2 ); DATA_LOADED.evidenceoverview = true; } /** * Create the Resources Overview page * @param context the current context * @param args the array of parameters for this category */ function loadWebOverview(context, args) { $("tab-content-web-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recent = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'FONTI più recenti', RESOURCE_TYPES_STR, 'date', 'DESC', '5', 350, 190, 'Esplora', 'web', 'FONTI', 'mostrecent'); recent.insert(set); row1.insert(recent); var connected = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'FONTI più connesse', RESOURCE_TYPES_STR, 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'web', 'FONTI', 'mostconnected'); connected.insert(set); row1.insert(connected); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var poptheme = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'TEMI più votati per FONTI', RESOURCE_TYPES_STR, '5', 350, 191, 'Esplora', 'web', 'FONTI', 'mostthemes'); poptheme.insert(set2); row2.insert(poptheme); $("tab-content-web-overview").insert( row1 ); $("tab-content-web-overview").insert( row2 ); DATA_LOADED.weboverview = true; } /** * Create the Users Overview page * @param context the current context * @param args the array of parameters for this category */ function loadUserOverview(context, args) { $("tab-content-user-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recentusers = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewUserWidget(context, args, "UTENTI più recenti", 'date', 'DESC', '5', 350, 190, "Esplora", 'user', 'UTENTI'); recentusers.insert(set); row1.insert(recentusers); var followedusers = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewFollowedUserWidget(context, args, "UTENTI più seguiti", 'date', 'DESC', '5', 350, 190, "Esplora", 'user', 'UTENTI'); followedusers.insert(set); row1.insert(followedusers); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var activeusers = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewActiveUserWidget(context, args, "UTENTI più attivi nell'ultimo mese", 'date', 'DESC', '5', 350, 190, "Esplora", 'user', 'UTENTI'); activeusers.insert(set); row2.insert(activeusers); var usercountries = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = new Element("fieldset", {'class':'overviewfieldset'}); var legend2 = new Element("legend", {'class':'overviewlegend widgettextcolor'}); legend2.insert("UTENTE Paesi"); set2.insert(legend2); var main2 = new Element("div", {"class":"overviewDiv", 'style':'height: 190px; overflow-y: auto; overflow-x: hidden;'}); var tagcloud = new Element("div", {'id':'tagcloud', "class": "user-tagcloud" }); tagcloud.insert(createCountryCloud(userscountrycloud, 'users')); main2.insert(tagcloud); set2.insert(main2); var buttondiv = new Element("div", {'style':'width: 100%; clear:both;float:left;'}); var allbutton = new Element("span", {'class':'active', 'title':"clicca per esplorare tutti gli UTENTI", 'style':'float:right; font-weight:bold; margin: 5px;margin-top:0px;'}); allbutton.insert("Visualizza la mappa"); Event.observe(allbutton,'click',function(){ setTabPushed( $('tab-user-list-obj'), 'user-usergmap'); }); buttondiv.insert(allbutton); set2.insert(buttondiv); usercountries.insert(set2); row2.insert(usercountries); $("tab-content-user-overview").insert( row1 ); $("tab-content-user-overview").insert( row2 ); DATA_LOADED.useroverview = true; } /** * Create the Organization/Project Overview page * @param context the current context * @param args the array of parameters for this category */ function loadOrgOverview(context, args) { $("tab-content-org-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recentorgs = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'SOGGETTI più recenti', "Organization", 'date', 'DESC', '5', 350, 190, 'Esplora', 'org', 'SOGGETTI O ORGANIZZAZIONI', 'recentorg', 'Organization'); recentorgs.insert(set); row1.insert(recentorgs); var connectedorgs = new Element("div", {"class":"col-md-6 col-sm-12"}); var set = overviewNodeWidget(context, args, 'SOGGETTI più connessi', "Organization", 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'org', 'SOGGETTI O ORGANIZZAZIONI', 'connectorg', 'Organization'); connectedorgs.insert(set); row1.insert(connectedorgs); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var orgcountries = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = new Element("fieldset", {'class':'overviewfieldset'}); var legend2 = new Element("legend", {'class':'overviewlegend widgettextcolor'}); legend2.insert('SOGGETTO Paesi'); set2.insert(legend2); var main2 = new Element("div", {"class":"overviewDiv", 'style':'height: 190px; overflow-y: auto; overflow-x: hidden;'}); var tagcloud = new Element("div", {'id':'tagcloud','style':'width: 350px;'}); tagcloud.insert(createCountryCloud(orgcountrycloud, 'orgs')); main2.insert(tagcloud); set2.insert(main2); var buttondiv = new Element("div", {'style':'width: 100%; clear:both;float:left;'}); var allbutton = new Element("span", {'class':'active', 'title':'clicca per esplorare tutti i SOGGETTI', 'style':'float:right; font-weight:bold; margin: 5px;margin-top:0px;'}); allbutton.insert('Visualizza la mappa'); Event.observe(allbutton,'click',function(){ ORG_ARGS['filternodetypes'] = 'Project'; setTabPushed( $('tab-org-list-obj'), 'org-gmap'); }); buttondiv.insert(allbutton); set2.insert(buttondiv); orgcountries.insert(set2); row2.insert(orgcountries); var poptheme = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'TEMI più popolari per SOGGETTI', 'Organization', '5', 350, 201, 'Esplora', 'org', 'SOGGETTI O ORGANIZZAZIONI', 'mostthemes'); poptheme.insert(set2); row2.insert(poptheme); $("tab-content-org-overview").insert( row1 ); $("tab-content-org-overview").insert( row2 ); DATA_LOADED.orgoverview = true; } /** * Create the Project Overview page * @param context the current context * @param args the array of parameters for this category */ function loadProjectOverview(context, args) { $("tab-content-project-overview").innerHTML = ""; var row1 = new Element("div", {"class":"tab-content-overview row mb-3"}); var recentprojects = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewNodeWidget(context, args, 'PROGETTI più recenti', "Project", 'date', 'DESC', '5', 350, 190, 'Esplora', 'project', 'PROGETTI, SERVIZI O INIZIATIVE', 'recentprojects', 'Project'); recentprojects.insert(set2); row1.insert(recentprojects); var connectedprojects = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewNodeWidget(context, args, 'PROGETTI più connessi', "Project", 'connectedness', 'DESC', '5', 350, 190, 'Esplora', 'project', 'PROGETTI, SERVIZI O INIZIATIVE','connectedprojects', 'Project'); connectedprojects.insert(set2); row1.insert(connectedprojects); var row2 = new Element("div", {"class":"tab-content-overview row mb-3"}); var projectcountries = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = new Element("fieldset", {'class':'overviewfieldset'}); var legend2 = new Element("legend", {'class':'overviewlegend widgettextcolor'}); legend2.insert('PROGETTO Paesi'); set2.insert(legend2); var main2 = new Element("div", {'id':'tagcloud', 'style':'width:100%; float:left; height: 190px; overflow-y: auto; overflow-x: none; margin-left;5px;margin-top: 5px;'}); main2.insert(createCountryCloud(projectcountrycloud, 'projects')); set2.insert(main2); var buttondiv2 = new Element("div", {'style':'width: 100%; clear:both;float:left;'}); var allbutton = new Element("span", {'class':'active', 'title':'clicca per esplorare tutti i PROGETTI', 'style':'float:right; font-weight:bold; margin: 5px;margin-top:0px;'}); allbutton.insert('Visualizza la mappa'); Event.observe(allbutton,'click',function(){ PROJECT_ARGS['filternodetypes'] = 'Project'; setTabPushed( $('tab-project-list-obj'), 'project-gmap'); }); buttondiv2.insert(allbutton); set2.insert(buttondiv2); projectcountries.insert(set2); row2.insert(projectcountries); var poptheme2 = new Element("div", {"class":"col-md-6 col-sm-12"}); var set2 = overviewThemeWidget(context, args, 'TEMI più popolari per PROGETTI', 'Project', '5', 350, 211, 'Esplora', 'project', 'PROGETTI, SERVIZI O INIZIATIVE', 'mostthemes'); poptheme2.insert(set2); row2.insert(poptheme2); $("tab-content-project-overview").insert( row1 ); $("tab-content-project-overview").insert( row2 ); DATA_LOADED.projectoverview = true; } function gotoCountry(type, country) { if (type == 'orgs') { ORG_ARGS['filternodetypes'] = 'Project'; ORG_ARGS['zoomtocountry'] = country; $('tab-org').setAttribute("href","#org-gmap"); Event.stopObserving('tab-org','click'); Event.observe('tab-org','click', stpOrgGMap); setTabPushed( $('tab-org-list-obj'), 'org-gmap'); } else if (type == 'projects') { PROJECT_ARGS['filternodetypes'] = 'Project'; PROJECT_ARGS['zoomtocountry'] = country; $('tab-project').setAttribute("href","#project-gmap"); Event.stopObserving('tab-project','click'); Event.observe('tab-project','click', stpProjectGMap); setTabPushed( $('tab-project-list-obj'), 'project-gmap'); } else if (type == 'users') { USER_ARGS['zoomtocountry'] = country; $('tab-user').setAttribute("href","#user-usergmap"); Event.stopObserving('tab-user','click'); Event.observe('tab-user','click', stpUserGMap); setTabPushed( $('tab-org-list-obj'), 'user-usergmap'); } } function createCountryCloud(countries, type) { var cloud = ""; return cloud; } // LOAD LISTS/// /** * load next/previous set of nodes */ function loadchallenges(context,args){ args['filternodetypes'] = "Challenge"; updateAddressParameters(args); $("tab-content-challenge-list").update(getLoading("(Loading -...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('challenge-list-count').innerHTML = ""; //$('challenge-list-count').insert("("+json.nodeset[0].totalno+")"); //$('challengebuttons').innerHTML = ""; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-challenge-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"challenges")); //display nodes if(json.nodeset[0].nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni', vote:'Voti'}; tb3.insert(displaySortForm(sortOpts,args,'challenge',reorderChallenges)); tb3.insert(createThemeFilter(context, args, 'challenges')); tb3.insert(createConnectedFilter(context, args, 'challenges')); $("tab-content-challenge-list").insert(tb3); displayNodes($("tab-content-challenge-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { var tb3 = new Element("div", {'class':'toolbarrow row'}); tb3.insert(createThemeFilter(context, args, 'challenges')); tb3.insert(createConnectedFilter(context, args, 'challenges')); $("tab-content-challenge-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-challenge-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"challenges")); } } }); DATA_LOADED.challenge = true; DATA_LOADED.challengesimile = false; } /** * load next/previous set of organisation nodes */ function loadorgs(context,args){ var types = "Organization"; if (args['filternodetypes'] == "" || types.indexOf(args['filternodetypes']) == -1) { args['filternodetypes'] = types; } updateAddressParameters(args); $("tab-content-org-list").update(getLoading("(Loading SOGGETTI O ORGANIZZAZIONI...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('org-list-count').innerHTML = ""; //$('org-list-count').insert("("+json.nodeset[0].totalno+")"); //$('orgbuttons').innerHTML = ""; var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } var navbar = createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"orgs") $("tab-content-org-list").update(navbar); //display nodes if(json.nodeset[0].nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni'}; tb3.insert(displaySortForm(sortOpts,args,'org',reorderOrgs)); tb3.insert(createThemeFilter(context, args, 'orgs')); tb3.insert(createConnectedFilter(context, args, 'orgs')); $("tab-content-org-list").insert(tb3); displayNodes($("tab-content-org-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { var tb3 = new Element("div", {'class':'toolbarrow row'}); tb3.insert(createThemeFilter(context, args, 'orgs')); tb3.insert(createConnectedFilter(context, args, 'orgs')); $("tab-content-org-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-org-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"orgs")); } } }); DATA_LOADED.org = true; DATA_LOADED.orgsimile = false; } /** * load next/previous set of project nodes */ function loadprojects(context,args){ var types = "Project"; if (args['filternodetypes'] == "" || types.indexOf(args['filternodetypes']) == -1) { args['filternodetypes'] = types; } updateAddressParameters(args); $("tab-content-project-list").update(getLoading("(Loading PROGETTI, SERVIZI O INIZIATIVE...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('project-list-count').innerHTML = ""; //$('project-list-count').insert("("+json.nodeset[0].totalno+")"); //$('orgbuttons').innerHTML = ""; var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } var navbar = createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"projects") $("tab-content-project-list").update(navbar); //display nodes if(json.nodeset[0].nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni'}; tb3.insert(displaySortForm(sortOpts,args,'project',reorderProjects)); tb3.insert(createThemeFilter(context, args, 'projects')); tb3.insert(createConnectedFilter(context, args, 'projects')); $("tab-content-project-list").insert(tb3); displayNodes($("tab-content-project-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { var tb3 = new Element("div", {'class':'toolbarrow row'}); tb3.insert(createThemeFilter(context, args, 'projects')); tb3.insert(createConnectedFilter(context, args, 'projects')); $("tab-content-project-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-org-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"projects")); } } }); DATA_LOADED.project = true; } /** * load next/previous set of nodes */ function loadissues(context,args){ args['filternodetypes'] = "Issue"; updateAddressParameters(args); $("tab-content-issue-list").update(getLoading("(Loading SFIDE...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('issue-list-count').innerHTML = ""; //$('issue-list-count').insert("("+json.nodeset[0].totalno+")"); //$('issuebuttons').innerHTML = ""; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-issue-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"issues")); //display nodes if(json.nodeset[0].nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni', vote:'Voti'}; tb3.insert(displaySortForm(sortOpts,args,'issue',reorderIssues)); tb3.insert(createThemeFilter(context, args, 'issues')); tb3.insert(createConnectedFilter(context, args, 'issues')); $("tab-content-issue-list").insert(tb3); displayNodes($("tab-content-issue-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { var tb3 = new Element("div", {'class':'toolbarrow row'}); tb3.insert(createThemeFilter(context, args, 'issues')); tb3.insert(createConnectedFilter(context, args, 'issues')); $("tab-content-issue-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-issue-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"issues")); } } }); DATA_LOADED.issue = true; DATA_LOADED.issuesimile = false; } /** * load next/previous set of nodes */ function loadsolutions(context,args){ args['filternodetypes'] = "Solution"; updateAddressParameters(args); $("tab-content-solution-list").update(getLoading("(Loading PROPOSTE...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('solution-list-count').innerHTML = ""; //$('solution-list-count').insert("("+json.nodeset[0].totalno+")"); //$('solutionbuttons').innerHTML = ""; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-solution-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"solutions")); if(json.nodeset[0].nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni', vote:'Voti'}; tb3.insert(displaySortForm(sortOpts,args,'solution',reorderSolutions)); tb3.insert(createThemeFilter(context, args, 'solutions')); tb3.insert(createConnectedFilter(context, args, 'solutions')); $("tab-content-solution-list").insert(tb3); displayNodes($("tab-content-solution-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { var tb3 = new Element("div", {'class':'toolbarrow row'}); tb3.insert(createThemeFilter(context, args, 'solutions')); tb3.insert(createConnectedFilter(context, args, 'solutions')); $("tab-content-solution-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-solution-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"solutions")); } } }); DATA_LOADED.solution = true; DATA_LOADED.solutionsimile = false; } /** * load next/previous set of nodes */ function loadclaims(context,args){ args['filternodetypes'] = "Claim"; updateAddressParameters(args); $("tab-content-claim-list").update(getLoading("(Loading -...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('claim-list-count').innerHTML = ""; //$('claim-list-count').insert("("+json.nodeset[0].totalno+")"); //$('claimbuttons').innerHTML = ""; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-claim-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"claims")); if(json.nodeset[0].nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni', vote:'Voti'}; tb3.insert(displaySortForm(sortOpts,args,'claim',reorderClaims)); tb3.insert(createThemeFilter(context, args, 'claims')); tb3.insert(createConnectedFilter(context, args, 'claims')); $("tab-content-claim-list").insert(tb3); displayNodes($("tab-content-claim-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { var tb3 = new Element("div", {'class':'toolbarrow row'}); tb3.insert(createThemeFilter(context, args, 'claims')); tb3.insert(createConnectedFilter(context, args, 'claims')); $("tab-content-claim-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-claim-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"claims")); } } }); DATA_LOADED.claim = true; DATA_LOADED.claimsimile = false; } /** * load next/previous set of evidence nodes */ function loadevidence(context,args) { var types = EVIDENCE_TYPES_STR; if (args['filternodetypes'] == "" || types.indexOf(args['filternodetypes']) == -1) { args['filternodetypes'] = types; } updateAddressParameters(args); $("tab-content-evidence-list").update(getLoading("(Loading ARGOMENTAZIONI...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('evidence-list-count').innerHTML = ""; //$('evidence-list-count').insert("("+json.nodeset[0].totalno+")"); //$('evidencebuttons').innerHTML = ""; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-evidence-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"evidence")); if(json.nodeset[0].nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni', vote:'Voti'}; tb3.insert(displaySortForm(sortOpts,args,'evidence',reorderEvidence)); tb3.insert(createThemeFilter(context, args, 'evidence')); tb3.insert(createEvidenceFilter(context, args)); tb3.insert(createConnectedFilter(context, args, 'evidence')); $("tab-content-evidence-list").insert(tb3); displayNodes($("tab-content-evidence-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { // in case caused by filter. var tb3 = new Element("div", {'class':'toolbarrow row'}); tb3.insert(createThemeFilter(context, args, 'evidence')); tb3.insert(createEvidenceFilter(context, args)); tb3.insert(createConnectedFilter(context, args, 'evidence')); $("tab-content-evidence-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-evidence-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"evidence")); } } }); DATA_LOADED.evidence = true; DATA_LOADED.evidencesimile = false; } /** * load next/previous set of urls */ function loadurls(context,args){ var types = RESOURCE_TYPES_STR; if (args['filternodetypes'] == "" || types.indexOf(args['filternodetypes']) == -1) { args['filternodetypes'] = types; } updateAddressParameters(args); $("tab-content-web-list").update(getLoading("(Loading FONTI...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onSuccess: function(transport){ var json = transport.responseText.evalJSON(); if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('web-list-count').innerHTML = ""; //$('web-list-count').insert("("+json.nodeset[0].totalno+")"); //$('webbuttons').innerHTML = ""; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-web-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"urls")); $("tab-content-web-list").insert('
'); if(total > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var nodes = json.nodeset[0].nodes; var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb2 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo', moddate: 'Data di modifica',connectedness:'Connessioni'}; tb2.insert(displaySortForm(sortOpts,args,'urls',reorderURLs)); tb2.insert(createThemeFilter(context, args, 'web')); tb2.insert(createResourceFilter(context, args)); tb2.insert(createConnectedFilter(context, args, 'web')); $("tab-content-web-list").insert(tb2); displayNodes($("tab-content-web-list"),json.nodeset[0].nodes,parseInt(args['start'])+1, true); } else { // in case caused by filter. var tb2 = new Element("div", {'class':'toolbarrow row'}); tb2.insert(createThemeFilter(context, args, 'web')); tb2.insert(createResourceFilter(context, args)); tb2.insert(createConnectedFilter(context, args, 'web')); $("tab-content-web-list").insert(tb2); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-web-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"urls")); } } }); DATA_LOADED.url = true; } /** * load next/previous set of users */ function loadusers(context,args){ updateAddressParameters(args); $("tab-content-user-list").update(getLoading("(Loading UTENTI...)")); var reqUrl = SERVICE_ROOT + "&method=getusersby" + context + "&includegroups=false&" + Object.toQueryString(args); new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var json = transport.responseText.evalJSON(); if(json.error){ alert(json.error[0].message); return; } //set the count in tab header //$('user-list-count').innerHTML = ""; //$('user-list-count').insert("("+json.userset[0].totalno+")"); $("tab-content-user-list").innerHTML = ""; var tb1 = new Element("div", {'class':'toolbarrow row'}); $("tab-content-user-list").insert(tb1); //display nav var total = json.userset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.userset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-user-list").update(createNav(total,json.userset[0].start,json.userset[0].count,args,context,"users")); $("tab-content-user-list").insert('
'); if(json.userset[0].count > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var users = json.userset[0].users; var count = users.length; for (var i=0; i < count; i++) { var user = users[i].user; user.searchid = args['searchid']; } } var tb2 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {lastactive: 'Ultima attività', name: 'Nome', date: 'Data di iscrizione'}; tb2.insert(displaySortForm(sortOpts,args,'user',reorderUsers)); $("tab-content-user-list").insert(tb2); $("tab-content-user-list").insert("

"); displayUsers($("tab-content-user-list"),json.userset[0].users,parseInt(args['start'])+1); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-user-list").insert(createNav(total,json.userset[0].start,json.userset[0].count,args,context,"users")); } } }); DATA_LOADED.user = true; } /** * load next/previous set of comment nodes */ function loadcomments(context,args) { var types = 'Idea'; if (args['filternodetypes'] == "" || types.indexOf(args['filternodetypes']) == -1) { args['filternodetypes'] = types; } updateAddressParameters(args); $("tab-content-comment-list").update(getLoading("(Loading SEGNALAZIONI...)")); var reqUrl = SERVICE_ROOT + "&method=getconnectednodesby" + context + "&" + Object.toQueryString(args); //alert(reqUrl); new Ajax.Request(reqUrl, { method:'post', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } var count = 0; if (json.nodeset[0].totalno) { count = json.nodeset[0].totalno; } //set the count in tab header //if ($('comment-list-count')) { // $('comment-list-count').innerHTML = ""; // $('comment-list-count').insert("("+count+")"); //} var nodes = json.nodeset[0].nodes; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-comment-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"comments")); if(nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo'}; tb3.insert(displaySortForm(sortOpts,args,'comment',reorderComments)); var filter = createCommentFilter(context, args); tb3.insert(filter); $("tab-content-comment-list").insert(tb3); displayNodes($("tab-content-comment-list"),nodes,parseInt(args['start'])+1, true); } else { var tb3 = new Element("div", {'class':'toolbarrow row'}); var filter = createCommentFilter(context, args); tb3.insert(filter); $("tab-content-comment-list").insert(tb3); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-comment-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"comments")); } } }); DATA_LOADED.commentlist = true; } /** * load next/previous set of news nodes */ function loadnews(context,args) { var types = 'News'; args['filternodetypes'] = types; updateAddressParameters(args); $("tab-content-news-list").update(getLoading("(Loading NEWS...)")); var reqUrl = SERVICE_ROOT + "&method=getnodesby" + context + "&" + Object.toQueryString(args); //alert(reqUrl); new Ajax.Request(reqUrl, { method:'post', onSuccess: function(transport){ try { var json = transport.responseText.evalJSON(); } catch(err) { console.log(err); } if(json.error){ alert(json.error[0].message); return; } var count = 0; if (json.nodeset[0].totalno) { count = json.nodeset[0].totalno; } var nodes = json.nodeset[0].nodes; //display nav var total = json.nodeset[0].totalno; if (CURRENT_VIZ == 'list') { var currentPage = (json.nodeset[0].start/args["max"]) + 1; window.location.hash = CURRENT_TAB+"-"+CURRENT_VIZ+"-"+currentPage; } $("tab-content-news-list").update(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"comments")); if(nodes.length > 0){ //preprosses nodes to add searchid if it is there if (args['searchid'] && args['searchid'] != "") { var count = nodes.length; for (var i=0; i < count; i++) { var node = nodes[i]; node.cnode.searchid = args['searchid']; } } var tb3 = new Element("div", {'class':'toolbarrow row'}); var sortOpts = {date: 'Data di creazione', name: 'Titolo'}; tb3.insert(displaySortForm(sortOpts,args,'news',reorderNews)); $("tab-content-news-list").insert(tb3); displayNewsNodes($("tab-content-news-list"),nodes); } //display nav if (total > parseInt( args["max"] )) { $("tab-content-news-list").insert(createNav(total,json.nodeset[0].start,json.nodeset[0].count,args,context,"news")); } } }); DATA_LOADED.newslist = true; } /** * Reorder the challenge tab */ function reorderChallenges(){ // change the sort and orderby ARG values CHALLENGE_ARGS['start'] = 0; CHALLENGE_ARGS['sort'] = $('select-sort-challenge').options[$('select-sort-challenge').selectedIndex].value; CHALLENGE_ARGS['orderby'] = $('select-orderby-challenge').options[$('select-orderby-challenge').selectedIndex].value; loadchallenges(CONTEXT,CHALLENGE_ARGS); } /** * Reorder the org tab */ function reorderOrgs(){ // change the sort and orderby ARG values ORG_ARGS['start'] = 0; ORG_ARGS['sort'] = $('select-sort-org').options[$('select-sort-org').selectedIndex].value; ORG_ARGS['orderby'] = $('select-orderby-org').options[$('select-orderby-org').selectedIndex].value; loadorgs(CONTEXT,ORG_ARGS); } /** * Reorder the projects tab */ function reorderProjects(){ // change the sort and orderby ARG values PROJECT_ARGS['start'] = 0; PROJECT_ARGS['sort'] = $('select-sort-project').options[$('select-sort-project').selectedIndex].value; PROJECT_ARGS['orderby'] = $('select-orderby-project').options[$('select-orderby-project').selectedIndex].value; loadprojects(CONTEXT,PROJECT_ARGS); } /** * Reorder the issue tab */ function reorderIssues(){ // change the sort and orderby ARG values ISSUE_ARGS['start'] = 0; ISSUE_ARGS['sort'] = $('select-sort-issue').options[$('select-sort-issue').selectedIndex].value; ISSUE_ARGS['orderby'] = $('select-orderby-issue').options[$('select-orderby-issue').selectedIndex].value; loadissues(CONTEXT,ISSUE_ARGS); } /** * Reorder the solutions tab */ function reorderSolutions(){ // change the sort and orderby ARG values SOLUTION_ARGS['start'] = 0; SOLUTION_ARGS['sort'] = $('select-sort-solution').options[$('select-sort-solution').selectedIndex].value; SOLUTION_ARGS['orderby'] = $('select-orderby-solution').options[$('select-orderby-solution').selectedIndex].value; loadsolutions(CONTEXT,SOLUTION_ARGS); } /** * Reorder the claims tab */ function reorderClaims(){ // change the sort and orderby ARG values CLAIM_ARGS['start'] = 0; CLAIM_ARGS['sort'] = $('select-sort-claim').options[$('select-sort-claim').selectedIndex].value; CLAIM_ARGS['orderby'] = $('select-orderby-claim').options[$('select-orderby-claim').selectedIndex].value; loadclaims(CONTEXT,CLAIM_ARGS); } /** * Reorder the evidence tab */ function reorderEvidence(){ // change the sort and orderby ARG values EVIDENCE_ARGS['start'] = 0; EVIDENCE_ARGS['sort'] = $('select-sort-evidence').options[$('select-sort-evidence').selectedIndex].value; EVIDENCE_ARGS['orderby'] = $('select-orderby-evidence').options[$('select-orderby-evidence').selectedIndex].value; loadevidence(CONTEXT,EVIDENCE_ARGS); } /** * Reorder the urls tab */ function reorderURLs(){ // change the sort and orderby ARG values URL_ARGS['start'] = 0; URL_ARGS['sort'] = $('select-sort-urls').options[$('select-sort-urls').selectedIndex].value; URL_ARGS['orderby'] = $('select-orderby-urls').options[$('select-orderby-urls').selectedIndex].value; loadurls(CONTEXT,URL_ARGS); } /** * Reorder the users tab */ function reorderUsers(){ // change the sort and orderby ARG values USER_ARGS['start'] = 0; USER_ARGS['sort'] = $('select-sort-user').options[$('select-sort-user').selectedIndex].value; USER_ARGS['orderby'] = $('select-orderby-user').options[$('select-orderby-user').selectedIndex].value; loadusers(CONTEXT,USER_ARGS); } /** * Reorder the comments tab */ function reorderComments(){ // change the sort and orderby ARG values COMMENT_ARGS['start'] = 0; COMMENT_ARGS['sort'] = $('select-sort-comment').options[$('select-sort-comment').selectedIndex].value; COMMENT_ARGS['orderby'] = $('select-orderby-comment').options[$('select-orderby-comment').selectedIndex].value; loadcomments(CONTEXT,COMMENT_ARGS); } /** * Reorder the news tab */ function reorderNews(){ // change the sort and orderby ARG values NEWS_ARGS['start'] = 0; NEWS_ARGS['sort'] = $('select-sort-news').options[$('select-sort-news').selectedIndex].value; NEWS_ARGS['orderby'] = $('select-orderby-news').options[$('select-orderby-news').selectedIndex].value; loadnews(CONTEXT,NEWS_ARGS); } /** * Filter the challenges by search criteria */ function filterSearchChallenges() { CHALLENGE_ARGS['q'] = $('qchallenge').value; var scope = 'all'; if ($('scopechallengemy') && $('scopechallengemy').selected) { scope = 'my'; } CHALLENGE_ARGS['scope'] = scope; var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=challenge&format=text&q="+CHALLENGE_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ /*var json = transport.responseText.evalJSON(); if(json.error){ alert(json.error[0].message); return; }*/ alert(transport.responseText); DATA_LOADED.challenge = false; setTabPushed($('tab-challenge-list-obj'),'challenge-list'); } }); } /** * Filter the orgs by search criteria */ function filterSearchOrgs() { ORG_ARGS['q'] = $('qorg').value; var scope = 'all'; if ($('scopeorgmy') && $('scopeorgmy').selected) { scope = 'my'; } ORG_ARGS['scope'] = scope; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=org&format=text&q="+ORG_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { ORG_ARGS['searchid'] = searchid; } var currentLocation = getAnchorVal(); if (currentLocation == "org-gmap") { DATA_LOADED.orggmap = false; setTabPushed($('tab-org-list-obj'),'org-gmap'); } else { DATA_LOADED.org = false; setTabPushed($('tab-org-list-obj'),'org-list'); } } }); } else { var currentLocation = getAnchorVal(); if (currentLocation == "org-gmap") { DATA_LOADED.orggmap = false; setTabPushed($('tab-org-list-obj'),'org-gmap'); } else { DATA_LOADED.org = false; setTabPushed($('tab-org-list-obj'),'org-list'); } } } /** * Filter the project by search criteria */ function filterSearchProjects() { PROJECT_ARGS['q'] = $('qproject').value; var scope = 'all'; if ($('scopeprojectmy') && $('scopeprojectmy').selected) { scope = 'my'; } PROJECT_ARGS['scope'] = scope; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=project&format=text&q="+PROJECT_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { PROJECT_ARGS['searchid'] = searchid; } var currentLocation = getAnchorVal(); if (currentLocation == "project-gmap") { DATA_LOADED.projectgmap = false; setTabPushed($('tab-project-list-obj'),'project-gmap'); } else { DATA_LOADED.project = false; setTabPushed($('tab-project-list-obj'),'project-list'); } } }); } else { var currentLocation = getAnchorVal(); if (currentLocation == "project-gmap") { DATA_LOADED.projectgmap = false; setTabPushed($('tab-project-list-obj'),'project-gmap'); } else { DATA_LOADED.project = false; setTabPushed($('tab-project-list-obj'),'project-list'); } } } /** * Filter the issues by search criteria */ function filterSearchIssues() { ISSUE_ARGS['q'] = $('qissue').value; var scope = 'all'; if ($('scopeissuemy') && $('scopeissuemy').selected) { scope = 'my'; } ISSUE_ARGS['scope'] = scope; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=issue&format=text&q="+ISSUE_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { ISSUE_ARGS['searchid'] = searchid; } DATA_LOADED.issue = false; setTabPushed($('tab-issue-list-obj'),'issue-list'); } }); } else { DATA_LOADED.issue = false; setTabPushed($('tab-issue-list-obj'),'issue-list'); } } /** * Filter the solutions by search criteria */ function filterSearchSolutions() { SOLUTION_ARGS['q'] = $('qsolution').value; var scope = 'all'; if ($('scopesolutionmy') && $('scopesolutionmy').selected) { scope = 'my'; } SOLUTION_ARGS['scope'] = scope; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=solution&format=text&q="+SOLUTION_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { SOLUTION_ARGS['searchid'] = searchid; } DATA_LOADED.solution = false; setTabPushed($('tab-solution-list-obj'),'solution-list'); } }); } else { DATA_LOADED.solution = false; setTabPushed($('tab-solution-list-obj'),'solution-list'); } } /** * Filter the claims by search criteria */ function filterSearchClaims() { CLAIM_ARGS['q'] = $('qclaim').value; var scope = 'all'; if ($('scopeclaimmy') && $('scopeclaimmy').selected) { scope = 'my'; } CLAIM_ARGS['scope'] = scope; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=claim&format=text&q="+CLAIM_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { CLAIM_ARGS['searchid'] = searchid; } DATA_LOADED.claim = false; setTabPushed($('tab-claim-list-obj'),'claim-list'); } }); } else { DATA_LOADED.claim = false; setTabPushed($('tab-claim-list-obj'),'claim-list'); } } /** * Filter the evidence by search criteria */ function filterSearchEvidence() { EVIDENCE_ARGS['q'] = $('qevidence').value; var scope = 'all'; if ($('scopeevidencemy') && $('scopeevidencemy').selected) { scope = 'my'; } if (SELECTED_NODETYPES != "") { NODE_ARGS['filternodetypes'] = SELECTED_NODETYPES; } EVIDENCE_ARGS['scope'] = scope; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=evidence&format=text&q="+EVIDENCE_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { EVIDENCE_ARGS['searchid'] = searchid; } DATA_LOADED.evidence = false; setTabPushed($('tab-evidence-list-obj'),'evidence-list'); } }); } else { DATA_LOADED.evidence = false; setTabPushed($('tab-evidence-list-obj'),'evidence-list'); } } /** * Filter the websites by search criteria */ function filterSearchWebsites() { URL_ARGS['q'] = $('qweb').value; var scope = 'all'; if ($('scopewebmy') && $('scopewebmy').selected) { scope = 'my'; } URL_ARGS['scope'] = scope; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=resource&format=text&q="+URL_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { URL_ARGS['searchid'] = searchid; } DATA_LOADED.url = false; setTabPushed($('tab-web-list-obj'),'web-list'); } }); } else { DATA_LOADED.url = false; setTabPushed($('tab-web-list-obj'),'web-list'); } } /** * Filter the users by search criteria */ function filterSearchUsers() { USER_ARGS['q'] = $('quser').value; CURRENT_VIZ = 'list'; var currentLocation = getAnchorVal(); if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=user&format=text&q="+USER_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { USER_ARGS['searchid'] = searchid; } if (currentLocation == "user-usergmap") { DATA_LOADED.usergmap = false; setTabPushed($('tab-user-list-obj'),'user-usergmap'); } else { DATA_LOADED.user = false; setTabPushed($('tab-user-list-obj'),'user-list'); } } }); } else { if (currentLocation == "user-usergmap") { DATA_LOADED.usergmap = false; setTabPushed($('tab-user-list-obj'),'user-usergmap'); } else { DATA_LOADED.user = false; setTabPushed($('tab-user-list-obj'),'user-list'); } } } /** * Filter the comments by search criteria */ function filterSearchComments() { COMMENT_ARGS['q'] = $('qcomment').value; CURRENT_VIZ = 'list'; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=comment&format=text&q="+NODE_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { COMMENT_ARGS['searchid'] = searchid; } DATA_LOADED.commentlist = false; setTabPushed($('tab-comment-list-obj'),'comment-list'); } }); } else { DATA_LOADED.commentlist = false; setTabPushed($('tab-comment-list-obj'),'comment-list'); } } /** * Filter the news by search criteria */ function filterSearchNews() { NEWS_ARGS['q'] = $('qnews').value; CURRENT_VIZ = 'list'; if (USER != "") { var reqUrl = SERVICE_ROOT + "&method=auditsearch&type=news&format=text&q="+NODE_ARGS['q']; new Ajax.Request(reqUrl, { method:'get', onError: function(error) { alert(error); }, onSuccess: function(transport){ var searchid = transport.responseText; if (searchid != "") { NEWS_ARGS['searchid'] = searchid; } DATA_LOADED.newslist = false; setTabPushed($('tab-news-list-obj'),'news-list'); } }); } else { DATA_LOADED.newslist = false; setTabPushed($('tab-news-list-obj'),'news-list'); } } /** * Filter the websites tab */ function filterWebsites() { if (SELECTED_USERS != "") { URL_ARGS['filterusers'] = SELECTED_USERS; } DATA_LOADED.url = false; loadurls(CONTEXT,URL_ARGS); } /** * show the sort form */ function displaySortForm(sortOpts,args,tab,handler){ var sbTool = new Element("span", {'class':'sortback toolbar2 col-auto'}); sbTool.insert("Ordina per "); var selOrd = new Element("select"); Event.observe(selOrd,'change',handler); selOrd.id = "select-orderby-"+tab; selOrd.className = "toolbar form-select"; selOrd.name = "orderby"; selOrd.setAttribute("aria-label","Sort by"); sbTool.insert(selOrd); for(var key in sortOpts){ var opt = new Element("option"); opt.value=key; opt.insert(sortOpts[key].valueOf()); selOrd.insert(opt); if(args.orderby == key){ opt.selected = true; } } var sortBys = {ASC: 'Ascendente', DESC: 'Discendente'}; var sortBy = new Element("select"); Event.observe(sortBy,'change',handler); sortBy.id = "select-sort-"+tab; sortBy.className = "toolbar form-select"; sortBy.name = "sort"; sortBy.setAttribute("aria-label","Order by"); sbTool.insert(sortBy); for(var key in sortBys){ var opt = new Element("option"); opt.value=key; opt.insert(sortBys[key]); sortBy.insert(opt); if(args.sort == key){ opt.selected = true; } } return sbTool; } /** * Called by the node type popup after node types have been selected. */ function setSelectedNodeTypes(types) { SELECTED_NODETYPES = types; if ($('select-filter-conn')) { $('select-filter-conn').options[0].selected = true; } else if ($('select-filter-neighbourhood')) { $('select-filter-neighbourhood').options[0].selected = true; } else if ($('nodetypegroups')) { ($('nodetypegroups')).options[0].selected = true; } } /** * Called by the link type popup after link types have been selected. */ function setSelectedLinkTypes(types) { SELECTED_LINKTYES = types; if ($('select-filter-conn')) { $('select-filter-conn').options[0].selected = true; } else if ($('select-filter-neighbourhood')) { $('select-filter-neighbourhood').options[0].selected = true; } else if ($('linktypegroups')) { ($('linktypegroups')).options[0].selected = true; } } /** * Called by the users popup after users have been selected. */ function setSelectedUsers(types) { SELECTED_USERS = types; } function createOrgFilter(context, args) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("Filtra per "); var filterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); filterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Tutti'); filterMenu.insert(option); var option = new Element("option", {'value':'Organization'}); if (args['filternodetypes'] == "Organization") { option.selected = true; } option.insert("SOGGETTO O ORGANIZZAZIONE"); filterMenu.insert(option); var option2 = new Element("option", {'value':'Project'}); if (args['filternodetypes'] == "Project") { option2.selected = true; } option2.insert("PROGETTO, SERVIZIO O INIZIATIVA"); filterMenu.insert(option2); Event.observe(filterMenu,"change", function(){ switch(CURRENT_VIZ){ case 'net': if (args['filterthemes'] && args['filterthemes'] != "") { var linktype = this.value; args['filternodetypes'] = linktype; refreshOrganizations(); } else { alert('Seleziona anche TEMA'); break; } default : var linktype = this.value; args['filternodetypes'] = linktype; refreshOrganizations(); break; } }); sbTool.insert(filterMenu); return sbTool; } function createThemeFilter(context, args, type) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("Filtra per "); var filterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); filterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Tutti TEMI'); filterMenu.insert(option); for(var i=0; i < THEMES.length; i++){ var option = new Element("option", {'value':THEMES[i]}); if (args['filterthemes'] && args['filterthemes'] == THEMES[i]) { option.selected = true; } option.insert(THEMES[i]); filterMenu.insert(option); } Event.observe(filterMenu,"change", function(){ var theme = this.value; args['filterthemes'] = theme; if( type == 'orgs') { refreshOrganizations(); } else if (type == 'projects') { refreshProjects(); } else if (type == 'claims') { refreshClaims(); } else if (type == 'evidence') { refreshEvidence(); } else if (type == 'issues') { refreshIssues(); } else if (type == 'solutions') { refreshSolutions(); } else if (type == 'web') { refreshWebsites(); } else if (type == 'challenges') { refreshChallenges(); } else if (type == 'user') { refreshUsers(); } }); sbTool.insert(filterMenu); return sbTool; } function createThemeFilterNet(context, args, type) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("TEMA: "); var filterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); filterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Seleziona anche TEMA'); filterMenu.insert(option); for(var i=0; i < THEMES.length; i++){ var option = new Element("option", {'value':THEMES[i]}); if (args['filterthemes'] && args['filterthemes'] == THEMES[i]) { option.selected = true; } option.insert(THEMES[i]); filterMenu.insert(option); } Event.observe(filterMenu,"change", function(){ var theme = this.value; if (theme == "") { args['filterthemes'] = ""; if( type == 'orgs') { checkIsActiveOrgMessage(); } else if (type == 'projects') { checkIsActiveProjectMessage(); } else if (type == 'claims') { checkIsActiveClaimMessage(); } else if (type == 'evidence') { checkIsActiveEvidenceMessage(); } else if (type == 'issues') { checkIsActiveIssueMessage(); } else if (type == 'solutions') { checkIsActiveSolutionMessage(); } else if (type == 'web') { checkIsActiveWebMessage(); } else if (type == 'challenges') { checkIsActiveChallengeMessage(); } } else { args['filterthemes'] = theme; if( type == 'orgs') { refreshOrganizations(); } else if (type == 'projects') { refreshProjects(); } else if (type == 'claims') { refreshClaims(); } else if (type == 'evidence') { refreshEvidence(); } else if (type == 'issues') { refreshIssues(); } else if (type == 'solutions') { refreshSolutions(); } else if (type == 'web') { refreshWebsites(); } else if (type == 'challenges') { refreshChallenges(); } } }); sbTool.insert(filterMenu); return sbTool; } function createEvidenceFilter(context, args) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("Filtra per "); var resourceFilterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); resourceFilterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Tutti'); resourceFilterMenu.insert(option); for(var i=0; i < EVIDENCE_TYPES.length; i++){ var option = new Element("option", {'value':EVIDENCE_TYPES[i]}); if (args['filternodetypes'] == EVIDENCE_TYPES[i]) { option.selected = true; } option.insert(EVIDENCE_TYPE_NAMES[i]); resourceFilterMenu.insert(option); } Event.observe(resourceFilterMenu,"change", function(){ switch(CURRENT_VIZ){ case 'net': if (args['filterthemes'] && args['filterthemes'] != "") { var type = this.value; args['filternodetypes'] = type; refreshEvidence(); } else { alert('Seleziona anche TEMA'); break; } default : var type = this.value; args['filternodetypes'] = type; refreshEvidence(); break; } }); sbTool.insert(resourceFilterMenu); return sbTool; } function createResourceFilter(context, args) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("Filtra per "); var resourceFilterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); resourceFilterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Tutti'); resourceFilterMenu.insert(option); for(var i=0; i < RESOURCE_TYPES.length; i++){ var option = new Element("option", {'value':RESOURCE_TYPES[i]}); if (args['filternodetypes'] == RESOURCE_TYPES[i]) { option.selected = true; } option.insert(RESOURCE_TYPE_NAMES[i]); resourceFilterMenu.insert(option); } Event.observe(resourceFilterMenu,"change", function(){ switch(CURRENT_VIZ){ case 'net': if (args['filterthemes'] && args['filterthemes'] != "") { var type = this.value; args['filternodetypes'] = type; refreshWebsites(); } else { alert('Seleziona anche TEMA'); break; } default : var type = this.value; args['filternodetypes'] = type; updateAddressParameters(args); refreshWebsites(); break; } }); sbTool.insert(resourceFilterMenu); return sbTool; } function createNodeTypeFilter(context, args) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("Filtra per "); var filterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); filterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Tutti'); filterMenu.insert(option); if (hasChallenge) { var option2 = new Element("option", {'value':'Challenge'}); if (args['filternodetypes'] == "Challenge") { option2.selected = true; } option2.insert("-"); filterMenu.insert(option2); } var option = new Element("option", {'value':'Issue'}); if (args['filternodetypes'] == "Issue") { option.selected = true; } option.insert("SFIDA"); filterMenu.insert(option); if (hasClaim) { var option2 = new Element("option", {'value':'Claim'}); if (args['filternodetypes'] == "Claim") { option2.selected = true; } option2.insert("-"); filterMenu.insert(option2); } if (hasSolution) { var option2 = new Element("option", {'value':'Solution'}); if (args['filternodetypes'] == "Solution") { option2.selected = true; } option2.insert("PROPOSTA"); filterMenu.insert(option2); } var option = new Element("option", {'value':EVIDENCE_TYPES_STR}); if (args['filternodetypes'] == EVIDENCE_TYPES_STR) { option.selected = true; } option.insert("ARGOMENTAZIONE"); filterMenu.insert(option); var option = new Element("option", {'value':RESOURCE_TYPES_STR}); if (args['filternodetypes'] == RESOURCE_TYPES_STR) { option.selected = true; } option.insert("FONTE"); filterMenu.insert(option); Event.observe(filterMenu,"change", function(){ switch(CURRENT_VIZ){ case 'nodegmap': var linktype = this.value; args['filternodetypes'] = linktype; refreshUsers(); break; } }); sbTool.insert(filterMenu); return sbTool; } function createCountryFilter(context, args) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("Zoom su "); var filterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); filterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Visualizzazione predefinita...'); filterMenu.insert(option); var option = new Element("option", {'value':"Afghanistan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Afghanistan") { option.selected = true; } option.insert("Afghanistan"); filterMenu.insert(option); var option = new Element("option", {'value':"Albania"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Albania") { option.selected = true; } option.insert("Albania"); filterMenu.insert(option); var option = new Element("option", {'value':"Algeria"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Algeria") { option.selected = true; } option.insert("Algeria"); filterMenu.insert(option); var option = new Element("option", {'value':"Andorra"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Andorra") { option.selected = true; } option.insert("Andorra"); filterMenu.insert(option); var option = new Element("option", {'value':"Angola"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Angola") { option.selected = true; } option.insert("Angola"); filterMenu.insert(option); var option = new Element("option", {'value':"Anguilla"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Anguilla") { option.selected = true; } option.insert("Anguilla"); filterMenu.insert(option); var option = new Element("option", {'value':"Antartica"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Antartica") { option.selected = true; } option.insert("Antartica"); filterMenu.insert(option); var option = new Element("option", {'value':"Antigua And Barbuda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Antigua And Barbuda") { option.selected = true; } option.insert("Antigua And Barbuda"); filterMenu.insert(option); var option = new Element("option", {'value':"Arabia Saudita"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Arabia Saudita") { option.selected = true; } option.insert("Arabia Saudita"); filterMenu.insert(option); var option = new Element("option", {'value':"Argentina"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Argentina") { option.selected = true; } option.insert("Argentina"); filterMenu.insert(option); var option = new Element("option", {'value':"Armenia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Armenia") { option.selected = true; } option.insert("Armenia"); filterMenu.insert(option); var option = new Element("option", {'value':"Aruba"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Aruba") { option.selected = true; } option.insert("Aruba"); filterMenu.insert(option); var option = new Element("option", {'value':"Australia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Australia") { option.selected = true; } option.insert("Australia"); filterMenu.insert(option); var option = new Element("option", {'value':"Austria"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Austria") { option.selected = true; } option.insert("Austria"); filterMenu.insert(option); var option = new Element("option", {'value':"Azerbaijan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Azerbaijan") { option.selected = true; } option.insert("Azerbaijan"); filterMenu.insert(option); var option = new Element("option", {'value':"Bahamas"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bahamas") { option.selected = true; } option.insert("Bahamas"); filterMenu.insert(option); var option = new Element("option", {'value':"Bahrain"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bahrain") { option.selected = true; } option.insert("Bahrain"); filterMenu.insert(option); var option = new Element("option", {'value':"Bangladesh"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bangladesh") { option.selected = true; } option.insert("Bangladesh"); filterMenu.insert(option); var option = new Element("option", {'value':"Barbados"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Barbados") { option.selected = true; } option.insert("Barbados"); filterMenu.insert(option); var option = new Element("option", {'value':"Belarus"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Belarus") { option.selected = true; } option.insert("Belarus"); filterMenu.insert(option); var option = new Element("option", {'value':"Belgio"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Belgio") { option.selected = true; } option.insert("Belgio"); filterMenu.insert(option); var option = new Element("option", {'value':"Belize"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Belize") { option.selected = true; } option.insert("Belize"); filterMenu.insert(option); var option = new Element("option", {'value':"Benin"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Benin") { option.selected = true; } option.insert("Benin"); filterMenu.insert(option); var option = new Element("option", {'value':"Bermuda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bermuda") { option.selected = true; } option.insert("Bermuda"); filterMenu.insert(option); var option = new Element("option", {'value':"Bhutan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bhutan") { option.selected = true; } option.insert("Bhutan"); filterMenu.insert(option); var option = new Element("option", {'value':"Bolivia, Stato Plurinazionale di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bolivia, Stato Plurinazionale di") { option.selected = true; } option.insert("Bolivia, Stato Plurinazionale di"); filterMenu.insert(option); var option = new Element("option", {'value':"Bonaire, Sint Eustatius and Saba"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bonaire, Sint Eustatius and Saba") { option.selected = true; } option.insert("Bonaire, Sint Eustatius and Saba"); filterMenu.insert(option); var option = new Element("option", {'value':"Bosnia-Herzegovina"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bosnia-Herzegovina") { option.selected = true; } option.insert("Bosnia-Herzegovina"); filterMenu.insert(option); var option = new Element("option", {'value':"Botswana"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Botswana") { option.selected = true; } option.insert("Botswana"); filterMenu.insert(option); var option = new Element("option", {'value':"Brasile"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Brasile") { option.selected = true; } option.insert("Brasile"); filterMenu.insert(option); var option = new Element("option", {'value':"Brunei Darussalam"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Brunei Darussalam") { option.selected = true; } option.insert("Brunei Darussalam"); filterMenu.insert(option); var option = new Element("option", {'value':"Bulgaria"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Bulgaria") { option.selected = true; } option.insert("Bulgaria"); filterMenu.insert(option); var option = new Element("option", {'value':"Burkina Faso"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Burkina Faso") { option.selected = true; } option.insert("Burkina Faso"); filterMenu.insert(option); var option = new Element("option", {'value':"Burundi"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Burundi") { option.selected = true; } option.insert("Burundi"); filterMenu.insert(option); var option = new Element("option", {'value':"Cambogia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Cambogia") { option.selected = true; } option.insert("Cambogia"); filterMenu.insert(option); var option = new Element("option", {'value':"Cameroon"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Cameroon") { option.selected = true; } option.insert("Cameroon"); filterMenu.insert(option); var option = new Element("option", {'value':"Canada"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Canada") { option.selected = true; } option.insert("Canada"); filterMenu.insert(option); var option = new Element("option", {'value':"Capo Verde"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Capo Verde") { option.selected = true; } option.insert("Capo Verde"); filterMenu.insert(option); var option = new Element("option", {'value':"Chad"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Chad") { option.selected = true; } option.insert("Chad"); filterMenu.insert(option); var option = new Element("option", {'value':"Cile"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Cile") { option.selected = true; } option.insert("Cile"); filterMenu.insert(option); var option = new Element("option", {'value':"Cina"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Cina") { option.selected = true; } option.insert("Cina"); filterMenu.insert(option); var option = new Element("option", {'value':"Cipro"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Cipro") { option.selected = true; } option.insert("Cipro"); filterMenu.insert(option); var option = new Element("option", {'value':"Colombia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Colombia") { option.selected = true; } option.insert("Colombia"); filterMenu.insert(option); var option = new Element("option", {'value':"Comoros"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Comoros") { option.selected = true; } option.insert("Comoros"); filterMenu.insert(option); var option = new Element("option", {'value':"Congo"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Congo") { option.selected = true; } option.insert("Congo"); filterMenu.insert(option); var option = new Element("option", {'value':"Congo, Repubblica Democratica del"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Congo, Repubblica Democratica del") { option.selected = true; } option.insert("Congo, Repubblica Democratica del"); filterMenu.insert(option); var option = new Element("option", {'value':"Corea, Repubblica Popolare Democratica di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Corea, Repubblica Popolare Democratica di") { option.selected = true; } option.insert("Corea, Repubblica Popolare Democratica di"); filterMenu.insert(option); var option = new Element("option", {'value':"Corea, Repubblica di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Corea, Repubblica di") { option.selected = true; } option.insert("Corea, Repubblica di"); filterMenu.insert(option); var option = new Element("option", {'value':"Costa Rica"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Costa Rica") { option.selected = true; } option.insert("Costa Rica"); filterMenu.insert(option); var option = new Element("option", {'value':"Costa d'Avorio"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Costa d'Avorio") { option.selected = true; } option.insert("Costa d'Avorio"); filterMenu.insert(option); var option = new Element("option", {'value':"Croazia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Croazia") { option.selected = true; } option.insert("Croazia"); filterMenu.insert(option); var option = new Element("option", {'value':"Cuba"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Cuba") { option.selected = true; } option.insert("Cuba"); filterMenu.insert(option); var option = new Element("option", {'value':"Danimarca"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Danimarca") { option.selected = true; } option.insert("Danimarca"); filterMenu.insert(option); var option = new Element("option", {'value':"Djibouti"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Djibouti") { option.selected = true; } option.insert("Djibouti"); filterMenu.insert(option); var option = new Element("option", {'value':"Dominica"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Dominica") { option.selected = true; } option.insert("Dominica"); filterMenu.insert(option); var option = new Element("option", {'value':"Ecuador"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Ecuador") { option.selected = true; } option.insert("Ecuador"); filterMenu.insert(option); var option = new Element("option", {'value':"Egitto"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Egitto") { option.selected = true; } option.insert("Egitto"); filterMenu.insert(option); var option = new Element("option", {'value':"El Salvador"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "El Salvador") { option.selected = true; } option.insert("El Salvador"); filterMenu.insert(option); var option = new Element("option", {'value':"Emirati Arabi Uniti"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Emirati Arabi Uniti") { option.selected = true; } option.insert("Emirati Arabi Uniti"); filterMenu.insert(option); var option = new Element("option", {'value':"Eritrea"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Eritrea") { option.selected = true; } option.insert("Eritrea"); filterMenu.insert(option); var option = new Element("option", {'value':"Estonia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Estonia") { option.selected = true; } option.insert("Estonia"); filterMenu.insert(option); var option = new Element("option", {'value':"Etiopia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Etiopia") { option.selected = true; } option.insert("Etiopia"); filterMenu.insert(option); var option = new Element("option", {'value':"Federazione Russa"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Federazione Russa") { option.selected = true; } option.insert("Federazione Russa"); filterMenu.insert(option); var option = new Element("option", {'value':"Fiji"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Fiji") { option.selected = true; } option.insert("Fiji"); filterMenu.insert(option); var option = new Element("option", {'value':"Filippine"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Filippine") { option.selected = true; } option.insert("Filippine"); filterMenu.insert(option); var option = new Element("option", {'value':"Finlandia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Finlandia") { option.selected = true; } option.insert("Finlandia"); filterMenu.insert(option); var option = new Element("option", {'value':"Francia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Francia") { option.selected = true; } option.insert("Francia"); filterMenu.insert(option); var option = new Element("option", {'value':"Gabon"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Gabon") { option.selected = true; } option.insert("Gabon"); filterMenu.insert(option); var option = new Element("option", {'value':"Gambia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Gambia") { option.selected = true; } option.insert("Gambia"); filterMenu.insert(option); var option = new Element("option", {'value':"Georgia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Georgia") { option.selected = true; } option.insert("Georgia"); filterMenu.insert(option); var option = new Element("option", {'value':"Georgia del Sud e Isole Sandwich Meridionali"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Georgia del Sud e Isole Sandwich Meridionali") { option.selected = true; } option.insert("Georgia del Sud e Isole Sandwich Meridionali"); filterMenu.insert(option); var option = new Element("option", {'value':"Germania"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Germania") { option.selected = true; } option.insert("Germania"); filterMenu.insert(option); var option = new Element("option", {'value':"Ghana"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Ghana") { option.selected = true; } option.insert("Ghana"); filterMenu.insert(option); var option = new Element("option", {'value':"Giappone"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Giappone") { option.selected = true; } option.insert("Giappone"); filterMenu.insert(option); var option = new Element("option", {'value':"Gibilterra"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Gibilterra") { option.selected = true; } option.insert("Gibilterra"); filterMenu.insert(option); var option = new Element("option", {'value':"Giordania"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Giordania") { option.selected = true; } option.insert("Giordania"); filterMenu.insert(option); var option = new Element("option", {'value':"Grecia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Grecia") { option.selected = true; } option.insert("Grecia"); filterMenu.insert(option); var option = new Element("option", {'value':"Grenada"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Grenada") { option.selected = true; } option.insert("Grenada"); filterMenu.insert(option); var option = new Element("option", {'value':"Groenlandia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Groenlandia") { option.selected = true; } option.insert("Groenlandia"); filterMenu.insert(option); var option = new Element("option", {'value':"Guadalupa"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guadalupa") { option.selected = true; } option.insert("Guadalupa"); filterMenu.insert(option); var option = new Element("option", {'value':"Guam"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guam") { option.selected = true; } option.insert("Guam"); filterMenu.insert(option); var option = new Element("option", {'value':"Guatemala"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guatemala") { option.selected = true; } option.insert("Guatemala"); filterMenu.insert(option); var option = new Element("option", {'value':"Guernsey"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guernsey") { option.selected = true; } option.insert("Guernsey"); filterMenu.insert(option); var option = new Element("option", {'value':"Guiana Francese"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guiana Francese") { option.selected = true; } option.insert("Guiana Francese"); filterMenu.insert(option); var option = new Element("option", {'value':"Guinea"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guinea") { option.selected = true; } option.insert("Guinea"); filterMenu.insert(option); var option = new Element("option", {'value':"Guinea Equatoriale"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guinea Equatoriale") { option.selected = true; } option.insert("Guinea Equatoriale"); filterMenu.insert(option); var option = new Element("option", {'value':"Guinea-Bissau"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guinea-Bissau") { option.selected = true; } option.insert("Guinea-Bissau"); filterMenu.insert(option); var option = new Element("option", {'value':"Guyana"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Guyana") { option.selected = true; } option.insert("Guyana"); filterMenu.insert(option); var option = new Element("option", {'value':"Haiti"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Haiti") { option.selected = true; } option.insert("Haiti"); filterMenu.insert(option); var option = new Element("option", {'value':"Honduras"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Honduras") { option.selected = true; } option.insert("Honduras"); filterMenu.insert(option); var option = new Element("option", {'value':"Hong Kong"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Hong Kong") { option.selected = true; } option.insert("Hong Kong"); filterMenu.insert(option); var option = new Element("option", {'value':"India"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "India") { option.selected = true; } option.insert("India"); filterMenu.insert(option); var option = new Element("option", {'value':"Indonesia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Indonesia") { option.selected = true; } option.insert("Indonesia"); filterMenu.insert(option); var option = new Element("option", {'value':"Iran, Repubblica Islamica dell"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Iran, Repubblica Islamica dell") { option.selected = true; } option.insert("Iran, Repubblica Islamica dell"); filterMenu.insert(option); var option = new Element("option", {'value':"Iraq"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Iraq") { option.selected = true; } option.insert("Iraq"); filterMenu.insert(option); var option = new Element("option", {'value':"Irlanda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Irlanda") { option.selected = true; } option.insert("Irlanda"); filterMenu.insert(option); var option = new Element("option", {'value':"Islanda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Islanda") { option.selected = true; } option.insert("Islanda"); filterMenu.insert(option); var option = new Element("option", {'value':"Isola di Bouvet"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isola di Bouvet") { option.selected = true; } option.insert("Isola di Bouvet"); filterMenu.insert(option); var option = new Element("option", {'value':"Isola di Heard e Isole Mcdonald"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isola di Heard e Isole Mcdonald") { option.selected = true; } option.insert("Isola di Heard e Isole Mcdonald"); filterMenu.insert(option); var option = new Element("option", {'value':"Isola di Man"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isola di Man") { option.selected = true; } option.insert("Isola di Man"); filterMenu.insert(option); var option = new Element("option", {'value':"Isola di Natale"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isola di Natale") { option.selected = true; } option.insert("Isola di Natale"); filterMenu.insert(option); var option = new Element("option", {'value':"Isola di Norfolk"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isola di Norfolk") { option.selected = true; } option.insert("Isola di Norfolk"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Cayman"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Cayman") { option.selected = true; } option.insert("Isole Cayman"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Cocos (Keeling)"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Cocos (Keeling)") { option.selected = true; } option.insert("Isole Cocos (Keeling)"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Falkland (Malvinas)"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Falkland (Malvinas)") { option.selected = true; } option.insert("Isole Falkland (Malvinas)"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Faroe"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Faroe") { option.selected = true; } option.insert("Isole Faroe"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Marianne settentrionali"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Marianne settentrionali") { option.selected = true; } option.insert("Isole Marianne settentrionali"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Minori Esterne degli Stati Uniti"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Minori Esterne degli Stati Uniti") { option.selected = true; } option.insert("Isole Minori Esterne degli Stati Uniti"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Solomon"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Solomon") { option.selected = true; } option.insert("Isole Solomon"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Turks e Caicos"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Turks e Caicos") { option.selected = true; } option.insert("Isole Turks e Caicos"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Vergini britanniche"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Vergini britanniche") { option.selected = true; } option.insert("Isole Vergini britanniche"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Vergini, Stati Uniti"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Vergini, Stati Uniti") { option.selected = true; } option.insert("Isole Vergini, Stati Uniti"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole di Cook"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole di Cook") { option.selected = true; } option.insert("Isole di Cook"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole di Marshall"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole di Marshall") { option.selected = true; } option.insert("Isole di Marshall"); filterMenu.insert(option); var option = new Element("option", {'value':"Isole Åland"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Isole Åland") { option.selected = true; } option.insert("Isole Åland"); filterMenu.insert(option); var option = new Element("option", {'value':"Israele"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Israele") { option.selected = true; } option.insert("Israele"); filterMenu.insert(option); var option = new Element("option", {'value':"Italia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Italia") { option.selected = true; } option.insert("Italia"); filterMenu.insert(option); var option = new Element("option", {'value':"Jamaica"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Jamaica") { option.selected = true; } option.insert("Jamaica"); filterMenu.insert(option); var option = new Element("option", {'value':"Jersey"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Jersey") { option.selected = true; } option.insert("Jersey"); filterMenu.insert(option); var option = new Element("option", {'value':"Kazakhstan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Kazakhstan") { option.selected = true; } option.insert("Kazakhstan"); filterMenu.insert(option); var option = new Element("option", {'value':"Kenya"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Kenya") { option.selected = true; } option.insert("Kenya"); filterMenu.insert(option); var option = new Element("option", {'value':"Kirghizistan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Kirghizistan") { option.selected = true; } option.insert("Kirghizistan"); filterMenu.insert(option); var option = new Element("option", {'value':"Kiribati"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Kiribati") { option.selected = true; } option.insert("Kiribati"); filterMenu.insert(option); var option = new Element("option", {'value':"Kuwait"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Kuwait") { option.selected = true; } option.insert("Kuwait"); filterMenu.insert(option); var option = new Element("option", {'value':"Laos, Repubblica Democratica Popolare del"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Laos, Repubblica Democratica Popolare del") { option.selected = true; } option.insert("Laos, Repubblica Democratica Popolare del"); filterMenu.insert(option); var option = new Element("option", {'value':"Lesotho"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Lesotho") { option.selected = true; } option.insert("Lesotho"); filterMenu.insert(option); var option = new Element("option", {'value':"Lettonia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Lettonia") { option.selected = true; } option.insert("Lettonia"); filterMenu.insert(option); var option = new Element("option", {'value':"Libano"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Libano") { option.selected = true; } option.insert("Libano"); filterMenu.insert(option); var option = new Element("option", {'value':"Liberia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Liberia") { option.selected = true; } option.insert("Liberia"); filterMenu.insert(option); var option = new Element("option", {'value':"Libia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Libia") { option.selected = true; } option.insert("Libia"); filterMenu.insert(option); var option = new Element("option", {'value':"Liechtenstein"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Liechtenstein") { option.selected = true; } option.insert("Liechtenstein"); filterMenu.insert(option); var option = new Element("option", {'value':"Lituania"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Lituania") { option.selected = true; } option.insert("Lituania"); filterMenu.insert(option); var option = new Element("option", {'value':"Lussemburgo"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Lussemburgo") { option.selected = true; } option.insert("Lussemburgo"); filterMenu.insert(option); var option = new Element("option", {'value':"Macao"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Macao") { option.selected = true; } option.insert("Macao"); filterMenu.insert(option); var option = new Element("option", {'value':"Macedonia, Ex- Repubblica Yugoslava di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Macedonia, Ex- Repubblica Yugoslava di") { option.selected = true; } option.insert("Macedonia, Ex- Repubblica Yugoslava di"); filterMenu.insert(option); var option = new Element("option", {'value':"Madagascar"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Madagascar") { option.selected = true; } option.insert("Madagascar"); filterMenu.insert(option); var option = new Element("option", {'value':"Malawi"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Malawi") { option.selected = true; } option.insert("Malawi"); filterMenu.insert(option); var option = new Element("option", {'value':"Maldive"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Maldive") { option.selected = true; } option.insert("Maldive"); filterMenu.insert(option); var option = new Element("option", {'value':"Malesia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Malesia") { option.selected = true; } option.insert("Malesia"); filterMenu.insert(option); var option = new Element("option", {'value':"Mali"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Mali") { option.selected = true; } option.insert("Mali"); filterMenu.insert(option); var option = new Element("option", {'value':"Malta"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Malta") { option.selected = true; } option.insert("Malta"); filterMenu.insert(option); var option = new Element("option", {'value':"Marocco"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Marocco") { option.selected = true; } option.insert("Marocco"); filterMenu.insert(option); var option = new Element("option", {'value':"Martinica"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Martinica") { option.selected = true; } option.insert("Martinica"); filterMenu.insert(option); var option = new Element("option", {'value':"Mauritania"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Mauritania") { option.selected = true; } option.insert("Mauritania"); filterMenu.insert(option); var option = new Element("option", {'value':"Mauritius"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Mauritius") { option.selected = true; } option.insert("Mauritius"); filterMenu.insert(option); var option = new Element("option", {'value':"Mayotte"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Mayotte") { option.selected = true; } option.insert("Mayotte"); filterMenu.insert(option); var option = new Element("option", {'value':"Messico"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Messico") { option.selected = true; } option.insert("Messico"); filterMenu.insert(option); var option = new Element("option", {'value':"Micronesia, Stato Federale di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Micronesia, Stato Federale di") { option.selected = true; } option.insert("Micronesia, Stato Federale di"); filterMenu.insert(option); var option = new Element("option", {'value':"Moldavia, Republica di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Moldavia, Republica di") { option.selected = true; } option.insert("Moldavia, Republica di"); filterMenu.insert(option); var option = new Element("option", {'value':"Monaco"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Monaco") { option.selected = true; } option.insert("Monaco"); filterMenu.insert(option); var option = new Element("option", {'value':"Mongolia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Mongolia") { option.selected = true; } option.insert("Mongolia"); filterMenu.insert(option); var option = new Element("option", {'value':"Montenegro"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Montenegro") { option.selected = true; } option.insert("Montenegro"); filterMenu.insert(option); var option = new Element("option", {'value':"Montserrat"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Montserrat") { option.selected = true; } option.insert("Montserrat"); filterMenu.insert(option); var option = new Element("option", {'value':"Mozambico"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Mozambico") { option.selected = true; } option.insert("Mozambico"); filterMenu.insert(option); var option = new Element("option", {'value':"Myanmar"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Myanmar") { option.selected = true; } option.insert("Myanmar"); filterMenu.insert(option); var option = new Element("option", {'value':"Namibia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Namibia") { option.selected = true; } option.insert("Namibia"); filterMenu.insert(option); var option = new Element("option", {'value':"Nauru"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Nauru") { option.selected = true; } option.insert("Nauru"); filterMenu.insert(option); var option = new Element("option", {'value':"Nepal"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Nepal") { option.selected = true; } option.insert("Nepal"); filterMenu.insert(option); var option = new Element("option", {'value':"Nicaragua"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Nicaragua") { option.selected = true; } option.insert("Nicaragua"); filterMenu.insert(option); var option = new Element("option", {'value':"Niger"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Niger") { option.selected = true; } option.insert("Niger"); filterMenu.insert(option); var option = new Element("option", {'value':"Nigeria"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Nigeria") { option.selected = true; } option.insert("Nigeria"); filterMenu.insert(option); var option = new Element("option", {'value':"Niue"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Niue") { option.selected = true; } option.insert("Niue"); filterMenu.insert(option); var option = new Element("option", {'value':"Norvegia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Norvegia") { option.selected = true; } option.insert("Norvegia"); filterMenu.insert(option); var option = new Element("option", {'value':"Nuova Caledonia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Nuova Caledonia") { option.selected = true; } option.insert("Nuova Caledonia"); filterMenu.insert(option); var option = new Element("option", {'value':"Nuova Zealanda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Nuova Zealanda") { option.selected = true; } option.insert("Nuova Zealanda"); filterMenu.insert(option); var option = new Element("option", {'value':"Olanda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Olanda") { option.selected = true; } option.insert("Olanda"); filterMenu.insert(option); var option = new Element("option", {'value':"Oman"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Oman") { option.selected = true; } option.insert("Oman"); filterMenu.insert(option); var option = new Element("option", {'value':"Pakistan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Pakistan") { option.selected = true; } option.insert("Pakistan"); filterMenu.insert(option); var option = new Element("option", {'value':"Palau"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Palau") { option.selected = true; } option.insert("Palau"); filterMenu.insert(option); var option = new Element("option", {'value':"Panama"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Panama") { option.selected = true; } option.insert("Panama"); filterMenu.insert(option); var option = new Element("option", {'value':"Papua Nuova Guinea"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Papua Nuova Guinea") { option.selected = true; } option.insert("Papua Nuova Guinea"); filterMenu.insert(option); var option = new Element("option", {'value':"Paraguay"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Paraguay") { option.selected = true; } option.insert("Paraguay"); filterMenu.insert(option); var option = new Element("option", {'value':"Perù"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Perù") { option.selected = true; } option.insert("Perù"); filterMenu.insert(option); var option = new Element("option", {'value':"Pitcairn"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Pitcairn") { option.selected = true; } option.insert("Pitcairn"); filterMenu.insert(option); var option = new Element("option", {'value':"Polinesia Francese"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Polinesia Francese") { option.selected = true; } option.insert("Polinesia Francese"); filterMenu.insert(option); var option = new Element("option", {'value':"Polonia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Polonia") { option.selected = true; } option.insert("Polonia"); filterMenu.insert(option); var option = new Element("option", {'value':"Porto Rico"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Porto Rico") { option.selected = true; } option.insert("Porto Rico"); filterMenu.insert(option); var option = new Element("option", {'value':"Portogallo"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Portogallo") { option.selected = true; } option.insert("Portogallo"); filterMenu.insert(option); var option = new Element("option", {'value':"Qatar"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Qatar") { option.selected = true; } option.insert("Qatar"); filterMenu.insert(option); var option = new Element("option", {'value':"Regno Unito"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Regno Unito") { option.selected = true; } option.insert("Regno Unito"); filterMenu.insert(option); var option = new Element("option", {'value':"Repubblica Araba Siriana"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Repubblica Araba Siriana") { option.selected = true; } option.insert("Repubblica Araba Siriana"); filterMenu.insert(option); var option = new Element("option", {'value':"Repubblica Ceca"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Repubblica Ceca") { option.selected = true; } option.insert("Repubblica Ceca"); filterMenu.insert(option); var option = new Element("option", {'value':"Repubblica Centrafricana"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Repubblica Centrafricana") { option.selected = true; } option.insert("Repubblica Centrafricana"); filterMenu.insert(option); var option = new Element("option", {'value':"Repubblica Dominicana"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Repubblica Dominicana") { option.selected = true; } option.insert("Repubblica Dominicana"); filterMenu.insert(option); var option = new Element("option", {'value':"Romania"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Romania") { option.selected = true; } option.insert("Romania"); filterMenu.insert(option); var option = new Element("option", {'value':"Ruanda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Ruanda") { option.selected = true; } option.insert("Ruanda"); filterMenu.insert(option); var option = new Element("option", {'value':"Réunion"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Réunion") { option.selected = true; } option.insert("Réunion"); filterMenu.insert(option); var option = new Element("option", {'value':"Sahara Occidentale"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sahara Occidentale") { option.selected = true; } option.insert("Sahara Occidentale"); filterMenu.insert(option); var option = new Element("option", {'value':"Saint Kitts And Nevis"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Saint Kitts And Nevis") { option.selected = true; } option.insert("Saint Kitts And Nevis"); filterMenu.insert(option); var option = new Element("option", {'value':"Saint Martin"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Saint Martin") { option.selected = true; } option.insert("Saint Martin"); filterMenu.insert(option); var option = new Element("option", {'value':"Saint Pierre e Miquelon"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Saint Pierre e Miquelon") { option.selected = true; } option.insert("Saint Pierre e Miquelon"); filterMenu.insert(option); var option = new Element("option", {'value':"Saint Vincent e Grenadine"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Saint Vincent e Grenadine") { option.selected = true; } option.insert("Saint Vincent e Grenadine"); filterMenu.insert(option); var option = new Element("option", {'value':"Samoa"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Samoa") { option.selected = true; } option.insert("Samoa"); filterMenu.insert(option); var option = new Element("option", {'value':"Samoa Americana"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Samoa Americana") { option.selected = true; } option.insert("Samoa Americana"); filterMenu.insert(option); var option = new Element("option", {'value':"San Bartolomeo"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "San Bartolomeo") { option.selected = true; } option.insert("San Bartolomeo"); filterMenu.insert(option); var option = new Element("option", {'value':"San Marino"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "San Marino") { option.selected = true; } option.insert("San Marino"); filterMenu.insert(option); var option = new Element("option", {'value':"Sant'Elena"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sant'Elena") { option.selected = true; } option.insert("Sant'Elena"); filterMenu.insert(option); var option = new Element("option", {'value':"Santa Lucia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Santa Lucia") { option.selected = true; } option.insert("Santa Lucia"); filterMenu.insert(option); var option = new Element("option", {'value':"Sao Tome e Principe"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sao Tome e Principe") { option.selected = true; } option.insert("Sao Tome e Principe"); filterMenu.insert(option); var option = new Element("option", {'value':"Senegal"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Senegal") { option.selected = true; } option.insert("Senegal"); filterMenu.insert(option); var option = new Element("option", {'value':"Serbia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Serbia") { option.selected = true; } option.insert("Serbia"); filterMenu.insert(option); var option = new Element("option", {'value':"Seychelles"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Seychelles") { option.selected = true; } option.insert("Seychelles"); filterMenu.insert(option); var option = new Element("option", {'value':"Sierra Leone"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sierra Leone") { option.selected = true; } option.insert("Sierra Leone"); filterMenu.insert(option); var option = new Element("option", {'value':"Singapore"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Singapore") { option.selected = true; } option.insert("Singapore"); filterMenu.insert(option); var option = new Element("option", {'value':"Sint Maarten (Parte Olandese)"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sint Maarten (Parte Olandese)") { option.selected = true; } option.insert("Sint Maarten (Parte Olandese)"); filterMenu.insert(option); var option = new Element("option", {'value':"Slovacchia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Slovacchia") { option.selected = true; } option.insert("Slovacchia"); filterMenu.insert(option); var option = new Element("option", {'value':"Slovenia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Slovenia") { option.selected = true; } option.insert("Slovenia"); filterMenu.insert(option); var option = new Element("option", {'value':"Somalia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Somalia") { option.selected = true; } option.insert("Somalia"); filterMenu.insert(option); var option = new Element("option", {'value':"Spagna"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Spagna") { option.selected = true; } option.insert("Spagna"); filterMenu.insert(option); var option = new Element("option", {'value':"Sri Lanka"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sri Lanka") { option.selected = true; } option.insert("Sri Lanka"); filterMenu.insert(option); var option = new Element("option", {'value':"Stati Uniti"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Stati Uniti") { option.selected = true; } option.insert("Stati Uniti"); filterMenu.insert(option); var option = new Element("option", {'value':"Sud Africa"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sud Africa") { option.selected = true; } option.insert("Sud Africa"); filterMenu.insert(option); var option = new Element("option", {'value':"Sud Sudan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sud Sudan") { option.selected = true; } option.insert("Sud Sudan"); filterMenu.insert(option); var option = new Element("option", {'value':"Sudan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Sudan") { option.selected = true; } option.insert("Sudan"); filterMenu.insert(option); var option = new Element("option", {'value':"Suriname"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Suriname") { option.selected = true; } option.insert("Suriname"); filterMenu.insert(option); var option = new Element("option", {'value':"Svalbard e Jan Mayen"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Svalbard e Jan Mayen") { option.selected = true; } option.insert("Svalbard e Jan Mayen"); filterMenu.insert(option); var option = new Element("option", {'value':"Svezia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Svezia") { option.selected = true; } option.insert("Svezia"); filterMenu.insert(option); var option = new Element("option", {'value':"Svizzera"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Svizzera") { option.selected = true; } option.insert("Svizzera"); filterMenu.insert(option); var option = new Element("option", {'value':"Swaziland"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Swaziland") { option.selected = true; } option.insert("Swaziland"); filterMenu.insert(option); var option = new Element("option", {'value':"Tagikistan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Tagikistan") { option.selected = true; } option.insert("Tagikistan"); filterMenu.insert(option); var option = new Element("option", {'value':"Tailandia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Tailandia") { option.selected = true; } option.insert("Tailandia"); filterMenu.insert(option); var option = new Element("option", {'value':"Taiwan, Provincia della Cina"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Taiwan, Provincia della Cina") { option.selected = true; } option.insert("Taiwan, Provincia della Cina"); filterMenu.insert(option); var option = new Element("option", {'value':"Tanzania, Repubblica Unita di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Tanzania, Repubblica Unita di") { option.selected = true; } option.insert("Tanzania, Repubblica Unita di"); filterMenu.insert(option); var option = new Element("option", {'value':"Territori Palestinesi, Occupati"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Territori Palestinesi, Occupati") { option.selected = true; } option.insert("Territori Palestinesi, Occupati"); filterMenu.insert(option); var option = new Element("option", {'value':"Territori della Francia del sud"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Territori della Francia del sud") { option.selected = true; } option.insert("Territori della Francia del sud"); filterMenu.insert(option); var option = new Element("option", {'value':"Territorio britannico dell'Oceano Indiano"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Territorio britannico dell'Oceano Indiano") { option.selected = true; } option.insert("Territorio britannico dell'Oceano Indiano"); filterMenu.insert(option); var option = new Element("option", {'value':"Timor Est"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Timor Est") { option.selected = true; } option.insert("Timor Est"); filterMenu.insert(option); var option = new Element("option", {'value':"Togo"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Togo") { option.selected = true; } option.insert("Togo"); filterMenu.insert(option); var option = new Element("option", {'value':"Tokelau"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Tokelau") { option.selected = true; } option.insert("Tokelau"); filterMenu.insert(option); var option = new Element("option", {'value':"Tonga"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Tonga") { option.selected = true; } option.insert("Tonga"); filterMenu.insert(option); var option = new Element("option", {'value':"Trinidad e Tobago"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Trinidad e Tobago") { option.selected = true; } option.insert("Trinidad e Tobago"); filterMenu.insert(option); var option = new Element("option", {'value':"Tunisia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Tunisia") { option.selected = true; } option.insert("Tunisia"); filterMenu.insert(option); var option = new Element("option", {'value':"Turchia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Turchia") { option.selected = true; } option.insert("Turchia"); filterMenu.insert(option); var option = new Element("option", {'value':"Turkmenistan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Turkmenistan") { option.selected = true; } option.insert("Turkmenistan"); filterMenu.insert(option); var option = new Element("option", {'value':"Tuvalu"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Tuvalu") { option.selected = true; } option.insert("Tuvalu"); filterMenu.insert(option); var option = new Element("option", {'value':"Ucraina"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Ucraina") { option.selected = true; } option.insert("Ucraina"); filterMenu.insert(option); var option = new Element("option", {'value':"Uganda"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Uganda") { option.selected = true; } option.insert("Uganda"); filterMenu.insert(option); var option = new Element("option", {'value':"Ungeria"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Ungeria") { option.selected = true; } option.insert("Ungeria"); filterMenu.insert(option); var option = new Element("option", {'value':"Uruguay"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Uruguay") { option.selected = true; } option.insert("Uruguay"); filterMenu.insert(option); var option = new Element("option", {'value':"Uzbekistan"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Uzbekistan") { option.selected = true; } option.insert("Uzbekistan"); filterMenu.insert(option); var option = new Element("option", {'value':"Vanuatu"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Vanuatu") { option.selected = true; } option.insert("Vanuatu"); filterMenu.insert(option); var option = new Element("option", {'value':"Vaticano"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Vaticano") { option.selected = true; } option.insert("Vaticano"); filterMenu.insert(option); var option = new Element("option", {'value':"Venezuela, Repubblica Bolivariana di"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Venezuela, Repubblica Bolivariana di") { option.selected = true; } option.insert("Venezuela, Repubblica Bolivariana di"); filterMenu.insert(option); var option = new Element("option", {'value':"VietNam"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "VietNam") { option.selected = true; } option.insert("VietNam"); filterMenu.insert(option); var option = new Element("option", {'value':"Wallis e Futuna"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Wallis e Futuna") { option.selected = true; } option.insert("Wallis e Futuna"); filterMenu.insert(option); var option = new Element("option", {'value':"Yemen"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Yemen") { option.selected = true; } option.insert("Yemen"); filterMenu.insert(option); var option = new Element("option", {'value':"Zambia"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Zambia") { option.selected = true; } option.insert("Zambia"); filterMenu.insert(option); var option = new Element("option", {'value':"Zimbabwe"}); if (args['zoomtocountry'] && args['zoomtocountry'] == "Zimbabwe") { option.selected = true; } option.insert("Zimbabwe"); filterMenu.insert(option); Event.observe(filterMenu,"change", function(){ var selected = this.value; args['zoomtocountry'] = selected; updateAddressParameters(args); switch(CURRENT_VIZ){ case 'nodegmap': zoomToCountryUserNode(selected); case 'usergmap': zoomToCountryUser(selected); case 'gmap': if (CURRENT_TAB == 'org') { zoomToCountryOrg(selected); } else if (CURRENT_TAB == 'project') { zoomToCountryProject(selected); } break; } }); sbTool.insert(filterMenu); return sbTool; } function createConnectedFilter(context, args, type) { var sbTool = new Element("span", {'class':'toolbar2 col-auto'}); sbTool.insert("Filtra per "); var filterMenu= new Element("select", {'class':'subforminput hgrselecthgrselect toolbar form-select'}); filterMenu.setAttribute("aria-label","Filter by"); var option = new Element("option", {'value':''}); option.insert('Tuttigli gli elementi'); filterMenu.insert(option); var option = new Element("option", {'value':'connected'}); if (args['filterbyconnection'] && args['filterbyconnection'] == "connected") { option.selected = true; } option.insert("Elementi connessi"); filterMenu.insert(option); var option2 = new Element("option", {'value':'unconnected'}); if (args['filterbyconnection'] && args['filterbyconnection'] == "unconnected") { option2.selected = true; } option2.insert("Elementi non connessi"); filterMenu.insert(option2); Event.observe(filterMenu,"change", function(){ var selection = this.value; args['filterbyconnection'] = selection; if( type == 'orgs') { refreshOrganizations(); } else if (type == 'projects') { refreshProjects(); } else if (type == 'claims') { refreshClaims(); } else if (type == 'evidence') { refreshEvidence(); } else if (type == 'issues') { refreshIssues(); } else if (type == 'solutions') { refreshSolutions(); } else if (type == 'web') { refreshWebsites(); } else if (type == 'challenges') { refreshChallenges(); } }); sbTool.insert(filterMenu); return sbTool; } /** * display Nav */ function createNav(total, start, count, argArray, context, type){ var nav = new Element ("div",{'id':'page-nav', 'class':'toolbarrow pb-3' }); var header = createNavCounter(total, start, count, type); nav.insert(header); if (total > parseInt( argArray["max"] )) { //previous var prevSpan = new Element("span", {'id':"nav-previous", "class": "page-nav page-chevron"}); if(start > 0){ prevSpan.update("Precedente"); prevSpan.addClassName("active"); Event.observe(prevSpan,"click", function(){ var newArr = argArray; newArr["start"] = parseInt(start) - newArr["max"]; eval("load"+type+"(context,newArr)"); }); } else { prevSpan.update("No precedente"); prevSpan.addClassName("inactive"); } //pages var pageSpan = new Element("span", {'id':"nav-pages", "class": "page-nav"}); var totalPages = Math.ceil(total/argArray["max"]); var currentPage = (start/argArray["max"]) + 1; for (var i = 1; i < totalPages+1; i++){ var page = new Element("span", {'class':"nav-page"}).insert(i); if(i != currentPage){ page.addClassName("active"); var newArr = Object.clone(argArray); newArr["start"] = newArr["max"] * (i-1) ; Event.observe(page,"click", Pages.next.bindAsEventListener(Pages,type,context,newArr)); } else { page.addClassName("currentpage"); } pageSpan.insert(page); } //next var nextSpan = new Element("span", {'id':"nav-next", "class": "page-nav page-chevron"}); if(parseInt(start)+parseInt(count) < parseInt(total)){ nextSpan.update("Successivo"); nextSpan.addClassName("active"); Event.observe(nextSpan,"click", function(){ var newArr = argArray; newArr["start"] = parseInt(start) + parseInt(newArr["max"]); eval("load"+type+"(context, newArr)"); }); } else { nextSpan.update("No successivo"); nextSpan.addClassName("inactive"); } if( start>0 || (parseInt(start)+parseInt(count) < parseInt(total))){ nav.insert(prevSpan).insert(pageSpan).insert(nextSpan); } } return nav; } /** * display nav header */ function createNavCounter(total, start, count, type){ if(count != 0){ var objH = new Element("span",{'class':'nav'}); var s1 = parseInt(start)+1; var s2 = parseInt(start)+parseInt(count); objH.insert("" + s1 + " a " + s2 + " (" + total + ")"); } else { var objH = new Element("span"); if (CONTEXT == 'user' && USER_ARGS.userid == USER){ switch(type){ case 'challenge': objH.insert("Nessuna - trovata"); break; case 'orgs': objH.insert("

Nessun SOGGETTI O ORGANIZZAZIONI trovato

"); break; case 'projects': objH.insert("

Nessun PROGETTI, SERVIZI O INIZIATIVE trovato

"); break; case 'issues': objH.insert("

Nessuna SFIDE trovata

"); break; case 'solutions': objH.insert("

Nessuna PROPOSTE trovata

"); break; case 'claims': objH.insert("

Nessuna - trovata

"); break; case 'evidence': objH.insert("

Nessuna ARGOMENTAZIONI trovata

"); break; case 'urls': objH.insert("

Nessuna FONTI trovata

"); break; case 'comment': objH.insert("

Nessun SEGNALAZIONI trovato

"); break; } } else { switch(type){ case 'challenge': objH.insert("Non ci sono - da mostrare"); break; case 'evidence': objH.insert("Non ci sono ARGOMENTAZIONE da mostrare"); break; case 'orgs': objH.insert("Non ci sono SOGGETTI O ORGANIZZAZIONI da mostrare"); break; case 'projects': objH.insert("Non ci sono PROGETTI, SERVIZI O INIZIATIVE da mostrare"); break; case 'urls': objH.insert("Non ci sono FONTI da mostrare"); break; case 'issues': objH.insert("

Non ci sono SFIDE da mostrare

"); break; case 'solutions': objH.insert("

Non ci sono PROPOSTE da mostrare

"); break; case 'claims': objH.insert("

Non ci sono - da mostrare

"); break; case 'news': objH.insert("

Nessuna NEWS trovata

"); break; default: objH.insert("Non ci sono elementi da mostrare"); } } } return objH; } var Pages = { next: function(e){ var data = $A(arguments); eval("load"+data[1]+"(data[2],data[3])"); } }; /** * load JS file for creating the connection network (applet) */ function loadChallengeNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-challenge-net.js.php', 'conn-challenge-net-script'); } /** * Load JS files for creating google map */ function loadOrgNodesGMap(){ updateAddressParameters(ORG_ARGS); addScriptDynamically('https://netlab.evidence-hub.net/ui/geomaps/orggmap.js.php', 'geomaps-orggmap-script'); DATA_LOADED.orggmap = true; } /** * Load JS files for creating google map */ function loadProjectNodesGMap(){ updateAddressParameters(PROJECT_ARGS); addScriptDynamically('https://netlab.evidence-hub.net/ui/geomaps/projectgmap.js.php', 'geomaps-projectgmap-script'); DATA_LOADED.projectgmap = true; } /** * Load JS files for creating google map */ function loadUserGMap() { updateAddressParameters(USER_ARGS); addScriptDynamically('https://netlab.evidence-hub.net/ui/geomaps/usergmap.js.php', 'geomaps-usergmap-script'); DATA_LOADED.usergmap = true; } /** * Load JS files for creating google map */ function loadUserNodeGMap(){ updateAddressParameters(USER_ARGS); addScriptDynamically('https://netlab.evidence-hub.net/ui/geomaps/usernodegmap.js.php', 'geomaps-usernodegmap-script'); DATA_LOADED.nodegmap = true; } /** * load JS file for creating the connection network (applet) for Organizations */ function loadOrgNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-orgtheme-net.js.php', 'conn-orgtheme-net-script'); } /** * load JS file for creating the connection network (applet) for Projects */ function loadProjectNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-projecttheme-net.js.php', 'conn-projecttheme-net-script'); } /** * load JS file for creating the connection network (applet) for Issues */ function loadIssueNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-issue-net.js.php', 'conn-issue-net-script'); } /** * load JS file for creating the connection network (applet) for Solutions */ function loadSolutionNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-solution-net.js.php', 'conn-solution-net-script'); } /** * load JS file for creating the connection network (applet) for Claims */ function loadClaimNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-claim-net.js.php', 'conn-claim-net-script'); } /** * load JS file for creating the connection network (applet) for Evidence */ function loadEvidenceNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-evidence-net.js.php', 'conn-evidence-net-script'); } /** * load JS file for creating the connection network (applet) for Reources */ function loadWebNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/conn-resource-net.js.php', 'conn-resource-net-script'); } /** * load JS file for creating the connection network (applet) for user social network */ function loadUserNet(){ addScriptDynamically('https://netlab.evidence-hub.net/ui/networkmaps/social-net.js.php', 'social-net-script'); }