comparison 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
comparison
equal deleted inserted replaced
25:13ba9f6e87a2 26:01e5ae4e7a12
1 function showSpatialSelection(theObj) {
2 var theIdValue = theObj.value;
3
4 var theDivElems = document.getElementById('spatialselection').getElementsByTagName("DIV");
5
6 for (var i = 0; i < theDivElems.length; i++) {
7 theDivElems[i].style.display = "none";
8 }
9 document.getElementById(theIdValue).style.display = "block";
10
11 }
12 function displayOverlay() {
13 adjustOverlaySize();
14 showDiv("overlay");
15 showDiv("overlayContent");
16 }
17
18 function adjustOverlaySize() {
19 var lHeight = document.getElementById("page").scrollHeight;
20 //alert(lHeight);
21 var lOverlay = document.getElementById("overlay");
22 lOverlay.style.height = lHeight + 'px';
23 }
24
25 function displayDiv(pName) {
26 var el = document.getElementById(pName);
27 el.style.display = (el.style.display == "none" || el.style.display == "") ? "block" : "none";
28 }
29 function showDiv(pName) {
30 var el = document.getElementById(pName);
31 el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
32 }
33
34 function hideDiv(pName) {
35 var el = document.getElementById(pName);
36 el.style.visibility = "hidden";
37 }
38
39 function sendAjaxForm(pFormId, pTarget, pIdOfResponseDiv) {
40 new Ajax.Updater(pIdOfResponseDiv, pTarget, { method:'post',
41 parameters: $(pFormId).serialize(true),
42 onSuccess: function(transport) {
43 //var response = transport.responseText || "no response text";
44 //alert("Success! \n\n" + response);
45 },
46 onFailure: function() { //alert('Something went wrong...')
47 }
48 }
49 );
50 }
51 function resetOptionsForm(pForm) {
52 //alert("resetOptionsForm"+!pForm.overrideSize[0].checked+" "+pForm.overridenWidth.value);
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)
54 sendDiagramOptions(pForm.action, false, 500);
55 }
56
57 function sendOptionsForm(pForm) {
58 //alert("sendOptionsForm"+!pForm.overrideSize[0].checked+" "+pForm.overridenWidth.value);
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)
60 sendDiagramOptions(pForm.action, !pForm.overrideSize[0].checked, pForm.overridenWidth.value);
61 }
62
63
64 //function sendDiagramOptions(pActionTarget, pOverrideSize, pOverridenWidth, pUseUpperLevel, pUseLowerLevel, pUpper, pLower) {
65 // new Ajax.Updater('diagramOptionsContent', pActionTarget, {method: 'post',
66 // parameters: {
67 // overrideSize: pOverrideSize,
68 // useUpperDataLevel: pUseUpperLevel,
69 // useLowerDataLevel: pUseLowerLevel,
70 // overridenWidth: pOverridenWidth,
71 // upperLevel: pUpper,
72 // lowerLevel: pLower,
73 // cmd : 'setOptions'
74 // }});
75 //}
76 function sendDiagramOptions(pActionTarget, pOverrideSize, pOverridenWidth) {
77 //alert("sendDiagramOptions"+pOverrideSize+" "+pOverridenWidth);
78 new Ajax.Updater('diagramOptionsContent', pActionTarget, {method: 'post',
79 parameters: {
80 overrideSize: pOverrideSize,
81 overridenWidth: pOverridenWidth,
82 cmd : 'setOptions'
83 }});
84 }

http://dive4elements.wald.intevation.org