////////////////////////////////////////////////////////////////////// // COPYRIGHT (C) 1999-2004 PeopleSoft(R), Inc. All Rights Reserved // ////////////////////////////////////////////////////////////////////// // We will stop render of portlets as soon as we detect there are portlets from more than one release on the same page. var userAgent = navigator.userAgent.toUpperCase(); var isSafari = (userAgent.indexOf("SAFARI")!=-1); var isIOS = (userAgent.indexOf("IPAD") > -1) || (userAgent.indexOf("IPOD") > -1) || (userAgent.indexOf("IPHONE") > -1); function setAndValidateVersion(currentVersion) { if (window.storedVersion && window.storedVersion != currentVersion) { var message = "Portlets from different releases are not supported on the same page. Please contact your administrator to put these portlets in separate pages."; alert(message); if (document.all) // stop scrip processing in IE document.execCommand('Stop'); else { // stop script processing in FF. We have to clear the inner HTML since // otherwise Firefox by default renders all portlets from the first release // and stops only at the first portlet of the second release. document.body.innerHTML=""; window.stop(); } } window.storedVersion = currentVersion; } setAndValidateVersion("898_200"); var webguiDebug = false; function webguiDebugToggle() { webguiDebug = !webguiDebug; if (webguiDebug) alert("WebGUI debug is enabled."); else alert("WebGUI debug is disabled."); } /////////////////////////////////////////////////////////////////////// // START OF SCRIPTS FOR COLLAPSIBLE TREES function jdeWebGuiToggleTreeNode(domObjectID, toggleType/*unused*/, overrideExpandedURL, overrideCollapsedURL) { var theToggledObject = document.getElementById(domObjectID); var theToggleButton = document.getElementById(domObjectID+"_BUTTON"); if (theToggledObject.style.display == "none") { theToggledObject.style.display = "block"; if (overrideExpandedURL) theToggleButton.src = overrideExpandedURL; else theToggleButton.src = window["WEBGUIRES_images_treeexpanded_gif"]; } else { theToggledObject.style.display = "none"; if (overrideCollapsedURL) theToggleButton.src = overrideCollapsedURL; else { var treeCollapsedImg = window["WEBGUIRES_images_treecollapsed_gif"]; if (document.documentElement.dir == "rtl") treeCollapsedImg = window["WEBGUIRES_images_treecollapsed_rtl_gif"]; theToggleButton.src = treeCollapsedImg; } } } // END OF SCRIPTS FOR COLLAPSIBLE TREES ////////////////////////////////// // START OF SCRIPTS FOR INTERACTIVE TREES self.webGuiInteractiveTree = new function() { this.isFocusableElement = function(node) { return ( (node != null) && node.getAttribute && (node.getAttribute("arrownav") == "yes") ); }; this.getFirstFocusableElement = function(nodesToExamine) { for (var i=0; i=0; i--) { var currentNode = nodesToExamine[i]; if (this.isFocusableElement(currentNode)) { return currentNode; // we found it! } var lastFocusableElementInChild = this.getLastFocusableElement(currentNode.childNodes); if (lastFocusableElementInChild != null) { return lastFocusableElementInChild; } } return null; // didn't find the element }; this.getDeepestChildNode = function(ancestorNode) { if (ancestorNode.hasChildNodes()) { return this.getDeepestChildNode(ancestorNode.lastChild); } else { return ancestorNode; } }; this.getPreviousFocusableElement = function(currentNode, overallParentNode) { if (currentNode == overallParentNode) { return null; } var potentialNode; if (currentNode.previousSibling) { potentialNode = this.getDeepestChildNode(currentNode.previousSibling); if (this.isFocusableElement(potentialNode)) { return potentialNode; } return this.getPreviousFocusableElement(potentialNode, overallParentNode); } else if (currentNode.parentNode) { potentialNode = currentNode.parentNode; if (this.isFocusableElement(potentialNode)) { return potentialNode; } return this.getPreviousFocusableElement(potentialNode, overallParentNode); } return null; }; this.getFirstFocusableChild = function(parent) { if (parent.hasChildNodes()) { var childNodes = parent.childNodes; for (var i=0; i " + loadingMessage + ""; } var iframeDiv = document.getElementById("treeiframediv" + treeId); // IFRAME_DIV_ID iframeDiv.style.display = ""; var callBackUrlPrefix = document.getElementById("callBackUrlPrefix" + treeId).value; var nodeIdParam = document.getElementById("nodeIdParam" + treeId).value; var indentLevelParam = document.getElementById("indentLevelParam" + treeId).value; iframeDiv.innerHTML = ""; } function doLoadActiveNodeWebGUI(activeNodeRememberedInCookie, treeId) { try { var nodeId = jdeWebGUIgetSubCookie("webguiinteractivetree", treeId + "ActiveNodeId"); var parentNodeId = jdeWebGUIgetSubCookie("webguiinteractivetree", treeId + "ActiveParent"); var indentLevel = jdeWebGUIgetSubCookie("webguiinteractivetree", treeId + "ActiveIndent"); var indentLevelInt = 0; if (indentLevel != "") indentLevelInt = parseInt(indentLevel); if (nodeId != "") doActivateNodeWebGUI(nodeId, parentNodeId, indentLevelInt, activeNodeRememberedInCookie, treeId); } catch (problem) {} } // END OF SCRIPTS FOR INTERACTIVE TREES ////////////////////////////////// // START OF SCRIPTS FOR MULTISELECTS function jdeWebGuiMultiSelectCategory(category_id, category_desc) { this.category_id = category_id; this.category_desc = category_desc; } function jdeWebGuiMultiSelectItem(item_id, item_name, item_desc, category_id) { this.item_id = item_id; this.item_name = item_name; this.item_desc = item_desc; this.category_id = category_id; } // END OF SCRIPTS FOR MULTISELECTS ////////////////////////////////// // START OF SCRIPTS FOR MENUS var g_jdeWebGUIMenuShown=false; var g_PrevFocusedElement = null; function jdeWebGUISaveFocusedElement(evt) { g_PrevFocusedElement = document.all?document.activeElement:evt.target; } function jdeWebGUICheckToRestorePrevFocus() { if(g_jdeWebGUIMenuShown==false && g_PrevFocusedElement) { try{ g_PrevFocusedElement.focus(); } catch(error){ } g_PrevFocusedElement = null; } } function jdeWebGUIUpdateMenuShownFlag() { if(jdeWebGUIGetMenuStackDepth() >0 ) g_jdeWebGUIMenuShown = true; else g_jdeWebGUIMenuShown = false; } function jdeWebGUIOnMenuUpKey() { var activeMenuItem = jdeWebGUIGetActiveMenuItem(); if(activeMenuItem != null) { var nextElement = jdeWebGUIGetPreviousVisibleElementWithFlag(activeMenuItem, "jdeMenuHighlightable", "yes"); if(nextElement != null){ jdeWebGUIHighlightMenuItem(nextElement); return true; } } return false; } function jdeWebGUIOnMenuDownKey() { var activeMenuItem = jdeWebGUIGetActiveMenuItem(); if(activeMenuItem != null) { var nextElement = jdeWebGUIGetNextVisibleElementWithFlag(activeMenuItem, "jdeMenuHighlightable", "yes"); if(nextElement != null){ jdeWebGUIHighlightMenuItem(nextElement); return true; } } return false; } function jdeWebGUIOnMenuExpandKey(evt) { var activeMenuItem = jdeWebGUIGetActiveMenuItem(); if(activeMenuItem != null) { var subMenuId = activeMenuItem.getAttribute("id"); //truncate the substring "-show" to get the ID of the submenu subMenuId = subMenuId.substring(0, subMenuId.lastIndexOf("-")); jdeWebGUIdoToggleSubMenuOnKeyDown(activeMenuItem, subMenuId, false, evt); return true; } return false; } function jdeWebGUIOnMenuEnterKey(evt) { var activeMenuItem = jdeWebGUIGetActiveMenuItem(); if(activeMenuItem != null) { if(jdeWebGUIIsElementAttributeOn(activeMenuItem, "subMenu", "yes")) { jdeWebGUIOnMenuExpandKey(evt); } else{ var menuItemId = activeMenuItem.getAttribute("id"); //strip out the prefix "outer" menuItemId = menuItemId.substring(5); jdeWebGUIhideAllMenus(null, null, null); jdeWebGUICheckToRestorePrevFocus(); document.getElementById(menuItemId).onclick(); } return true; } return false; } function jdeWebGUIOnDefaultKeyDown(e) { var event=document.all?window.event:e; jdeWebGUIhideAllMenus(null, null, null); jdeWebGUICheckToRestorePrevFocus(); return true; } function jdeWebGUIOnMenuKeyDown(e) { var event=document.all?window.event:e; var cancelBubbling = false; if(g_jdeWebGUIMenuShown==false) return false; if(event.keyCode==38) //Up Arrow { jdeWebGUIOnMenuUpKey(); cancelBubbling = true; } else if(event.keyCode==40) //Down Arrow { jdeWebGUIOnMenuDownKey(); cancelBubbling = true; } else if(event.keyCode==39) //right arrow key { var activeMenuItem = jdeWebGUIGetActiveMenuItem(); if(activeMenuItem != null) { if(jdeWebGUIIsElementAttributeOn(activeMenuItem, "subMenu", "yes")) { jdeWebGUIOnMenuExpandKey(event); } } cancelBubbling = true; } else if(event.keyCode==37) //left arrow { if(jdeWebGUIGetMenuStackDepth() > 1) { jdeWebGUIHideLastLevelMenu(); } cancelBubbling = true; } else if(event.keyCode==13){ //Enter key jdeWebGUIOnMenuEnterKey(event) cancelBubbling = true; } else { jdeWebGUIOnDefaultKeyDown(event) if(event.keyCode!=17 && event.keyCode!=18) //For Ctrl and Alt key, leave it to document level cancelBubbling = true; } if(cancelBubbling) { if(document.all){ event.cancelBubble = true; event.returnValue = false; } else{ event.stopPropagation(); event.preventDefault(); } } return cancelBubbling; } function jdeWebGUIexecuteLinkInFrame(linkurl, linktarget) { // linktarget must be a valid frame or iframe name or nothing will happen ("_new" will not work) eval(linktarget + ".location=\"" + linkurl + "\""); } function jdeWebGUIstartMenu(menuID) { writeString = "