annotate gnv/src/main/webapp/scripts/gnviewer.js @ 26:01e5ae4e7a12

Added existing JavaScripte-Code to the Project gnv/trunk@128 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 24 Sep 2009 12:30:26 +0000
parents
children d93ea867406b
rev   line source
26
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
1 function showSpatialSelection(theObj) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
2 var theIdValue = theObj.value;
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
3
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
4 var theDivElems = document.getElementById('spatialselection').getElementsByTagName("DIV");
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
5
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
6 for (var i = 0; i < theDivElems.length; i++) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
7 theDivElems[i].style.display = "none";
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
8 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
9 document.getElementById(theIdValue).style.display = "block";
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
10
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
11 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
12 function displayOverlay() {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
13 adjustOverlaySize();
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
14 showDiv("overlay");
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
15 showDiv("overlayContent");
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
16 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
17
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
18 function adjustOverlaySize() {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
19 var lHeight = document.getElementById("page").scrollHeight;
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
20 //alert(lHeight);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
21 var lOverlay = document.getElementById("overlay");
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
22 lOverlay.style.height = lHeight + 'px';
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
23 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
24
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
25 function displayDiv(pName) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
26 var el = document.getElementById(pName);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
27 el.style.display = (el.style.display == "none" || el.style.display == "") ? "block" : "none";
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
28 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
29 function showDiv(pName) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
30 var el = document.getElementById(pName);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
31 el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
32 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
33
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
34 function hideDiv(pName) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
35 var el = document.getElementById(pName);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
36 el.style.visibility = "hidden";
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
37 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
38
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
39 function sendAjaxForm(pFormId, pTarget, pIdOfResponseDiv) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
40 new Ajax.Updater(pIdOfResponseDiv, pTarget, { method:'post',
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
41 parameters: $(pFormId).serialize(true),
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
42 onSuccess: function(transport) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
43 //var response = transport.responseText || "no response text";
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
44 //alert("Success! \n\n" + response);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
45 },
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
46 onFailure: function() { //alert('Something went wrong...')
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
47 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
48 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
49 );
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
50 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
51 function resetOptionsForm(pForm) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
52 //alert("resetOptionsForm"+!pForm.overrideSize[0].checked+" "+pForm.overridenWidth.value);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
53 // Levels abgeklemmt sendDiagramOptions(pForm.action, !pForm.overrideSize[0].checked, pForm.overridenWidth.value, pForm.useUpperDataLevel.checked, pForm.useLowerDataLevel.checked, pForm.upperLevel.value, pForm.lowerLevel.value)
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
54 sendDiagramOptions(pForm.action, false, 500);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
55 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
56
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
57 function sendOptionsForm(pForm) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
58 //alert("sendOptionsForm"+!pForm.overrideSize[0].checked+" "+pForm.overridenWidth.value);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
59 // Levels abgeklemmt sendDiagramOptions(pForm.action, !pForm.overrideSize[0].checked, pForm.overridenWidth.value, pForm.useUpperDataLevel.checked, pForm.useLowerDataLevel.checked, pForm.upperLevel.value, pForm.lowerLevel.value)
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
60 sendDiagramOptions(pForm.action, !pForm.overrideSize[0].checked, pForm.overridenWidth.value);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
61 }
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
62
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
63
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
64 //function sendDiagramOptions(pActionTarget, pOverrideSize, pOverridenWidth, pUseUpperLevel, pUseLowerLevel, pUpper, pLower) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
65 // new Ajax.Updater('diagramOptionsContent', pActionTarget, {method: 'post',
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
66 // parameters: {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
67 // overrideSize: pOverrideSize,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
68 // useUpperDataLevel: pUseUpperLevel,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
69 // useLowerDataLevel: pUseLowerLevel,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
70 // overridenWidth: pOverridenWidth,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
71 // upperLevel: pUpper,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
72 // lowerLevel: pLower,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
73 // cmd : 'setOptions'
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
74 // }});
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
75 //}
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
76 function sendDiagramOptions(pActionTarget, pOverrideSize, pOverridenWidth) {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
77 //alert("sendDiagramOptions"+pOverrideSize+" "+pOverridenWidth);
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
78 new Ajax.Updater('diagramOptionsContent', pActionTarget, {method: 'post',
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
79 parameters: {
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
80 overrideSize: pOverrideSize,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
81 overridenWidth: pOverridenWidth,
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
82 cmd : 'setOptions'
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
83 }});
01e5ae4e7a12 Added existing JavaScripte-Code to the Project
Tim Englich <tim.englich@intevation.de>
parents:
diff changeset
84 }

http://dive4elements.wald.intevation.org