From c6103c7c9a6b6971d2aa0b8e3997608cb5f2c36f Mon Sep 17 00:00:00 2001 From: lresende Date: Mon, 2 Nov 2009 22:22:29 +0000 Subject: Move the das folder as new trunk for das sub project git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@832144 13f79535-47bb-0310-9956-ffa450edef68 --- .../advanced-webapp/src/main/webapp/js/dasmenu.js | 112 +++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 das-java/trunk/samples/advanced-webapp/src/main/webapp/js/dasmenu.js (limited to 'das-java/trunk/samples/advanced-webapp/src/main/webapp/js/dasmenu.js') diff --git a/das-java/trunk/samples/advanced-webapp/src/main/webapp/js/dasmenu.js b/das-java/trunk/samples/advanced-webapp/src/main/webapp/js/dasmenu.js new file mode 100644 index 0000000000..96b5d5288e --- /dev/null +++ b/das-java/trunk/samples/advanced-webapp/src/main/webapp/js/dasmenu.js @@ -0,0 +1,112 @@ +// +var dbstatus; +var brwsrDB; +var reqDB; + +function showSubMenu(){ + var objThis = this; + + for(var i = 0; i < objThis.childNodes.length; i++) + { + if(objThis.childNodes.item(i).nodeName == "UL") + { + objThis.childNodes.item(i).style.display = "block"; + } + } +} + +function hideSubMenu() +{ + var objThis = this; + + for(var i = 0; i < objThis.childNodes.length; i++) + { + if(objThis.childNodes.item(i).nodeName == "UL") + { + objThis.childNodes.item(i).style.display = "none"; + return; + } + } +} + +function initialiseMenu() +{ + var objLICollection = document.body.getElementsByTagName("LI"); + for(var i = 0; i < objLICollection.length; i++) + { + var objLI = objLICollection[i]; + for(var j = 0; j < objLI.childNodes.length; j++) + { + if(objLI.childNodes.item(j).nodeName == "UL") + { + objLI.onmouseover=showSubMenu; + objLI.onmouseout=hideSubMenu; + + for(var j = 0; j < objLI.childNodes.length; j++) + { + if(objLI.childNodes.item(j).nodeName == "A") + { + objLI.childNodes.item(j).className = "hassubmenu"; + } + } + } + } + } +} + +function refreshdb(){ + if (window.XMLHttpRequest) { + brwsrDB='NOIE'; + reqDB = new XMLHttpRequest(); + } else if (window.ActiveXObject) { + brwsrDB='IE'; + reqDB = new ActiveXObject("Microsoft.XMLHTTP"); + } + + var dbRefreshMsg = document.getElementById('dbmsg'); + if(brwsrDB=='NOIE'){ + var x = document.createTextNode('Refreshing database..please wait'); + dbRefreshMsg.appendChild(x); + } + else{ + dbmsg.innerHTML = 'Refreshing database..please wait'; + } + + //TODO + var urlDB = "../CommandServlet"; + reqDB.open("POST", urlDB, true); + reqDB.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + reqDB.onreadystatechange = dbresultHandler; + reqDB.send('refreshDB=yes'); +} + +function dbresultHandler() { + if (reqDB.readyState == 4) { + if (reqDB.status == 200) { + var dbRefreshMsg = document.getElementById('dbmsg'); + if(brwsrDB=='NOIE'){ + dbRefreshMsg.removeChild(dbRefreshMsg.childNodes[0]);//remove wait message + var x = document.createTextNode('Refreshed database!'); + dbRefreshMsg.appendChild(x); + } + else{ + dbmsg.innerHTML = 'Refreshed database!'; + } + return; + } + } +} -- cgit v1.2.3