view 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
line wrap: on
line source
function showSpatialSelection(theObj) {
    var theIdValue = theObj.value;

    var theDivElems = document.getElementById('spatialselection').getElementsByTagName("DIV");

    for (var i = 0; i < theDivElems.length; i++) {
        theDivElems[i].style.display = "none";
    }
    document.getElementById(theIdValue).style.display = "block";

}
function displayOverlay() {
    adjustOverlaySize();
    showDiv("overlay");
    showDiv("overlayContent");
}

function adjustOverlaySize() {
    var lHeight = document.getElementById("page").scrollHeight;
    //alert(lHeight);
    var lOverlay = document.getElementById("overlay");
    lOverlay.style.height = lHeight + 'px';
}

function displayDiv(pName) {
    var el = document.getElementById(pName);
    el.style.display = (el.style.display == "none" || el.style.display == "") ? "block" : "none";
}
function showDiv(pName) {
    var el = document.getElementById(pName);
    el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible";
}

function hideDiv(pName) {
	var el = document.getElementById(pName);
	el.style.visibility = "hidden";
}

function sendAjaxForm(pFormId, pTarget, pIdOfResponseDiv) {
    new Ajax.Updater(pIdOfResponseDiv, pTarget, {    method:'post',
        parameters: $(pFormId).serialize(true),
        onSuccess: function(transport) {
            //var response = transport.responseText || "no response text";
            //alert("Success! \n\n" + response);
        },
        onFailure: function() { //alert('Something went wrong...')
        }
    }
            );
}
function resetOptionsForm(pForm) {
	//alert("resetOptionsForm"+!pForm.overrideSize[0].checked+"  "+pForm.overridenWidth.value);
    // Levels abgeklemmt sendDiagramOptions(pForm.action, !pForm.overrideSize[0].checked, pForm.overridenWidth.value, pForm.useUpperDataLevel.checked, pForm.useLowerDataLevel.checked, pForm.upperLevel.value, pForm.lowerLevel.value)
    sendDiagramOptions(pForm.action, false, 500);
    }

function sendOptionsForm(pForm) {
	//alert("sendOptionsForm"+!pForm.overrideSize[0].checked+"  "+pForm.overridenWidth.value);
    // Levels abgeklemmt sendDiagramOptions(pForm.action, !pForm.overrideSize[0].checked, pForm.overridenWidth.value, pForm.useUpperDataLevel.checked, pForm.useLowerDataLevel.checked, pForm.upperLevel.value, pForm.lowerLevel.value)
    sendDiagramOptions(pForm.action, !pForm.overrideSize[0].checked, pForm.overridenWidth.value);
    }


//function sendDiagramOptions(pActionTarget, pOverrideSize, pOverridenWidth, pUseUpperLevel, pUseLowerLevel, pUpper, pLower) {
//    new Ajax.Updater('diagramOptionsContent', pActionTarget, {method: 'post',
//        parameters: {
//            overrideSize: pOverrideSize,
//            useUpperDataLevel: pUseUpperLevel,
//            useLowerDataLevel: pUseLowerLevel,
//            overridenWidth: pOverridenWidth,
//            upperLevel: pUpper,
//            lowerLevel: pLower,
//            cmd : 'setOptions'
//        }});
//}
function sendDiagramOptions(pActionTarget, pOverrideSize, pOverridenWidth) {
	//alert("sendDiagramOptions"+pOverrideSize+" "+pOverridenWidth);
	new Ajax.Updater('diagramOptionsContent', pActionTarget, {method: 'post',
        parameters: {
            overrideSize: pOverrideSize,
            overridenWidth: pOverridenWidth,
             cmd : 'setOptions'
        }});
}

http://dive4elements.wald.intevation.org