From 1faf201e8608dfa4d7af3460fd3d1fc7ebec398b Mon Sep 17 00:00:00 2001 From: talasila Date: Tue, 7 Feb 2017 11:47:55 -0500 Subject: Initial OpenECOMP Portal SDK commit Change-Id: I66a3491600a4b9ea241128dc29267eed6a78ed76 Signed-off-by: talasila --- .../fusion/raptor/js/ajax_dynamic_content.js | 97 ++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 ecomp-sdk/sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js (limited to 'ecomp-sdk/sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js') diff --git a/ecomp-sdk/sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js b/ecomp-sdk/sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js new file mode 100644 index 00000000..077932e1 --- /dev/null +++ b/ecomp-sdk/sdk-app/src/main/webapp/static/fusion/raptor/js/ajax_dynamic_content.js @@ -0,0 +1,97 @@ + +/*********************************************** +* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com) +* This notice MUST stay intact for legal use +* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code +***********************************************/ + +var loadedobjects="" +var rootdomain="http://"+window.location.hostname + +function ajaxpage(url, containerid){ + +var page_request = false; + try { + netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); + } catch (e) { + //alert("Permission UniversalBrowserRead denied."); + } +if (window.XMLHttpRequest) // if Mozilla, Safari etc +page_request = new XMLHttpRequest() +else if (window.ActiveXObject){ // if IE +try { +page_request = new ActiveXObject("Msxml2.XMLHTTP") +} +catch (e1){ +try{ +page_request = new ActiveXObject("Microsoft.XMLHTTP") +} +catch (e1){ page_request = null; alert('permission denied'); +} +} +} +else +return false +page_request.onreadystatechange=function(){ +loadpage(page_request, containerid) +} +// This is a fix made since IE doesn't refresh the page +var ajaxRightNow = new Date(); +var noCacheAjaxurl = url + ((/\?/.test(url)) ? "&" : "?") + "ajaxRandomTimestamp=" + ajaxRightNow.getTime(); +page_request.open('GET', noCacheAjaxurl, true) +page_request.send(null) +} + +function loadpage(page_request, containerid){ +var div = document.getElementById(containerid); +if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) + div.innerHTML=page_request.responseText; + var x = div.getElementsByTagName("script"); + for(var i=0;i=0) + eval(x[i].text); + } +} + +function resizeDivScrollbar(){ + var frame = document.getElementById("scrollableTableResult"); + var parentBody = window.parent.document.body; + var parentMenu = window.parent.document.getElementById("application"); + if(frame!=null) { + //alert(frame.clientHeight + " " + window.parent.document.body.clientHeight); + if (frame.clientHeight > window.parent.document.body.clientHeight) { + frame.style.height = window.parent.document.body.clientHeight-350; + } else + frame.style.height = window.parent.document.body.clientHeight; + parentMenu.style.width = frame.clientWidth+200; + } +} + + +function loadobjs(){ +if (!document.getElementById) +return +for (i=0; i