Mercurial > hg > events2kml
diff WebContent/mmpa/mmpa.js @ 3:f198c86dd1f6
umstellung fuer dariah browser
author | dwinter |
---|---|
date | Wed, 09 Jan 2013 14:37:39 +0100 |
parents | |
children | 6d286ce1a64f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WebContent/mmpa/mmpa.js Wed Jan 09 14:37:39 2013 +0100 @@ -0,0 +1,49 @@ +var QueryString = function () { + // This function is anonymous, is executed immediately and + // the return value is assigned to QueryString! + var query_string = {}; + var query = window.location.search.substring(1); + var vars = query.split("&"); + for (var i=0;i<vars.length;i++) { + var pair = vars[i].split("="); + // If first entry with this name + if (typeof query_string[pair[0]] === "undefined") { + query_string[pair[0]] = pair[1]; + // If second entry with this name + } else if (typeof query_string[pair[0]] === "string") { + var arr = [ query_string[pair[0]], pair[1] ]; + query_string[pair[0]] = arr; + // If third or later entry with this name + } else { + query_string[pair[0]].push(pair[1]); + } + } + return query_string; +} (); + + +$(function(){ + $("#toggleMainNavigation").click(function(){ + $("#mainNavigation").toggle(); + }); + $("#toggleBrowseFacet").click(function(){ + $("#browseFacet").toggle(); + }); + +$("#locations").click(function(){ + $("#displayChoice").load("/m/locations"); +}); +$("#species").click(function(){ + $("#displayChoice").load("/m/species"); +}); +$("#applicants").click(function(){ + $("#displayChoice").load("/m/applicants"); +}); + + kml1=QueryString['kml1']; + $("#restrictionChoiceApplicant").load("/m/restricted?path="+kml1+"&newRestriction=http%3A%2F%2Flocalhost%2Fm%2Fxpath%2F%2F%2Fapplicant%2Fname%2Ftext%28%29&select=%20distinct%20cast%28xpath%28%27//applicant/name/text%28%29%27,%20data%29%20as%20text[]%29%20AS%20name"); + + $("#restrictionChoiceSpecies").load("/m/restricted?path="+kml1+"&newRestriction=http%3A%2F%2Flocalhost%2Fm%2Fxpath%2F%2F%2Fspecies%2Ftext%28%29&select=%20distinct%20cast%28xpath%28%27//species/text%28%29%27,%20data%29%20as%20text[]%29%20AS%20name"); + + +}); \ No newline at end of file