banner.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // Licensed Materials - Property of IBM
  2. //
  3. // IBM Cognos Products: pps
  4. //
  5. // (C) Copyright IBM Corp. 2005, 2017
  6. //
  7. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. // This forms the javascript functions used for the Banner of
  9. // PowerPlay Studio 8.3.
  10. // The functions handle any minor browser differences.
  11. var loginWindow = null;
  12. function doLogOnMenu(event)
  13. {
  14. var contextItems = new Array();
  15. contextItems[contextItems.length] = new BannerMenuItem(c8webcontentLocation + "/branding/tools_logon.gif",strLogon,function() { logOn() });
  16. contextItems[contextItems.length] = new BannerMenuItem(c8webcontentLocation + "/branding/tools_logoff.gif",strLogoff,function() { logOff() });
  17. ContextMenu.display(event, contextItems);
  18. }
  19. function doHelp() {
  20. var lang = "";
  21. var fh = topparent.getXtabFrame().document.fhidden;
  22. if (fh && fh.LA)
  23. lang = fh.LA.value;
  24. help(lang);
  25. }
  26. function doMenuHelp() {
  27. //In order to ensure the correct relative URL when the CCL help function
  28. //is called, invoke the onclick of the toolbar button directly.
  29. var button = document.getElementById("helpButton");
  30. if (button.fireEvent) {
  31. button.fireEvent('onclick');
  32. } else {
  33. var eventObject = document.createEvent('MouseEvents');
  34. eventObject.initMouseEvent('click',true,true,window,0,0,0,0,0,false,false,false,false,0,null);
  35. button.dispatchEvent(eventObject);
  36. }
  37. }
  38. function doAbout() {
  39. topparent.getXtabFrame().doit('MA');
  40. }
  41. function doHelpMenu(event)
  42. {
  43. var contextItems = new Array();
  44. contextItems[contextItems.length] = new BannerMenuItem('',strHelp,function () { doMenuHelp(); });
  45. contextItems[contextItems.length] = new BannerMenuItem('',strHelpWeb,function () { cognosOnWeb(); });
  46. contextItems[contextItems.length] = new BannerMenuDivider();
  47. contextItems[contextItems.length] = new BannerMenuItem('',strHelpWelcome,function() { topparent.gotoLocation(welcomeURL, false); } );
  48. contextItems[contextItems.length] = new BannerMenuDivider();
  49. contextItems[contextItems.length] = new BannerMenuItem('',strHelpAbout,function() { doAbout(); });
  50. ContextMenu.display(event, contextItems);
  51. }
  52. function logOff() {
  53. topparent.gotoLocation(c8LogOffUrl, false);
  54. }
  55. function cognosOnWeb() {
  56. topparent.location.href = "http://www.ibm.com/cognos";
  57. }
  58. function ccModalCallBack(command, data)
  59. {
  60. if (loginWindow != null) {
  61. loginWindow.close();
  62. loginWindow = null;
  63. }
  64. if (command == "ok") {
  65. //Resubmit the hidden form to re-render the current page with the new capabilities";
  66. var fh = topparent.getXtabFrame().document.fhidden;
  67. fh.CNCT.value = 13;
  68. fh.target = topparent.window.name;
  69. fh.submit();
  70. }
  71. }
  72. function logOn() {
  73. if (window.delCookie)
  74. delCookie('cc_state');
  75. if (loggedIntoANamespace) {
  76. var location = c8cgi + "?h_CAM_action=logon&m=portal/close.xts&md.callBack=";
  77. loginWindow = window.open(location,"ppesLogin","location=0,menubar=0,scrollbars=0,status=0,titlebar=0,toolbar=0,height=400,width=600,directories=0,resizable=0");
  78. } else {
  79. topparent.gotoLocation(c8Home + "&h_CAM_action=logon&m_reload=", false);
  80. }
  81. }