Mercurial > hg > events2kml
comparison WebContent/mmpa/mmpa.js @ 3:f198c86dd1f6
umstellung fuer dariah browser
author | dwinter |
---|---|
date | Wed, 09 Jan 2013 14:37:39 +0100 |
parents | |
children | 6d286ce1a64f |
comparison
equal
deleted
inserted
replaced
2:d8af0ff76407 | 3:f198c86dd1f6 |
---|---|
1 var QueryString = function () { | |
2 // This function is anonymous, is executed immediately and | |
3 // the return value is assigned to QueryString! | |
4 var query_string = {}; | |
5 var query = window.location.search.substring(1); | |
6 var vars = query.split("&"); | |
7 for (var i=0;i<vars.length;i++) { | |
8 var pair = vars[i].split("="); | |
9 // If first entry with this name | |
10 if (typeof query_string[pair[0]] === "undefined") { | |
11 query_string[pair[0]] = pair[1]; | |
12 // If second entry with this name | |
13 } else if (typeof query_string[pair[0]] === "string") { | |
14 var arr = [ query_string[pair[0]], pair[1] ]; | |
15 query_string[pair[0]] = arr; | |
16 // If third or later entry with this name | |
17 } else { | |
18 query_string[pair[0]].push(pair[1]); | |
19 } | |
20 } | |
21 return query_string; | |
22 } (); | |
23 | |
24 | |
25 $(function(){ | |
26 $("#toggleMainNavigation").click(function(){ | |
27 $("#mainNavigation").toggle(); | |
28 }); | |
29 $("#toggleBrowseFacet").click(function(){ | |
30 $("#browseFacet").toggle(); | |
31 }); | |
32 | |
33 $("#locations").click(function(){ | |
34 $("#displayChoice").load("/m/locations"); | |
35 }); | |
36 $("#species").click(function(){ | |
37 $("#displayChoice").load("/m/species"); | |
38 }); | |
39 $("#applicants").click(function(){ | |
40 $("#displayChoice").load("/m/applicants"); | |
41 }); | |
42 | |
43 kml1=QueryString['kml1']; | |
44 $("#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"); | |
45 | |
46 $("#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"); | |
47 | |
48 | |
49 }); |