init.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. var numberOfTabs = 0;
  9. var dimCache;
  10. function syncToolbar()
  11. {
  12. topparent.getToolbarFrame().sync();
  13. }
  14. function reloadToolbar() {
  15. topparent.getToolbarFrame().ButtonEnable();
  16. }
  17. function isSplitDisplay()
  18. {
  19. var fh = document.fhidden;
  20. if (!fh.YS)
  21. return false;
  22. return true;
  23. }
  24. function initxtabcache() {
  25. xtabCache.initialize(document.getElementById("innerNice1-tab0"));
  26. }
  27. function init(num, tabs) {
  28. initDebug();
  29. dimCache = topparent.getGlobal("dimCache");
  30. if (hasDimensionBar)
  31. {
  32. init_dimbar();
  33. }
  34. ContextMenu.initialize(true,false);
  35. topparent.getConfigFrame().selectedRows.length = 0;
  36. topparent.getConfigFrame().selectedColumns.length = 0;
  37. var el = document.getElementById("hideShowTree");
  38. if (el != null)
  39. {
  40. if ( !topparent.getGlobal("treeVisible") )
  41. el.src = topparent.getGlobal("imgPath") + "open_tab.gif";
  42. else
  43. el.src = topparent.getGlobal("imgPath") + "close_tab.gif";
  44. el.style.visibility = "visible";
  45. }
  46. numberOfTabs = tabs;
  47. var zIndexMax = 1;
  48. var tabIdx = 0;
  49. if (hasDimensionBar)
  50. {
  51. testDivBar = document.getElementById("testDivBar-tab0");
  52. if (testDivBar) {
  53. dimBarData = getDimBarData()[tabIdx]["testDivBar"];
  54. testDivBar.style.top = dimBarData.top;
  55. testDivBar.style.left = dimBarData.left;
  56. testDivBar.style.zIndex = dimBarData.zIndex;
  57. }
  58. }
  59. if ( isSplitDisplay() )
  60. topparent.openChartPane();
  61. syncToolbar();
  62. doResize();
  63. populateHiddenFormObject();
  64. if (topparent.initializedFrames["DimTree"])
  65. updateTree();
  66. xtabCache = new xtabCache();
  67. initxtabcache();
  68. InitDragCursor();
  69. initialize_ppwbInfo();
  70. if (!topparent.getGlobal('is_dashboard')) {
  71. var dimTreeVisible = getCookie("DimTreeVisible");
  72. if (dimTreeVisible && dimTreeVisible == "False") {
  73. if (topparent.getGlobal("treeVisible") && document.getElementById("hideShowTree"))
  74. toggleTree(null,document.getElementById("hideShowTree"));
  75. } else {
  76. if (!topparent.getGlobal("treeVisible") && document.getElementById("hideShowTree"))
  77. toggleTree(null,document.getElementById("hideShowTree"));
  78. }
  79. }
  80. var dimTreeToolbarVisible = getCookie("DimTreeToolbarVisible");
  81. if (dimTreeToolbarVisible == "False")
  82. topparent.closeTreeToolbarFrame();
  83. else
  84. topparent.openTreeToolbarFrame();
  85. }
  86. function reloadActionPane() {
  87. if(fh.ACTPANE.value != 0 && fh.ACTPANE.value != 10) {
  88. var bSelections = getSelected("r").length || getSelected("c").length;
  89. if(topparent.wasRedirected()) {
  90. topparent.setWasRedirected("0");
  91. if (topparent.getActionFrame().ppesRedirectPage)
  92. topparent.closeActionPane();
  93. return;
  94. }
  95. switch (fh.ACTPANE.value) {
  96. case "1": //reload find pane only if find in report on
  97. var findPane = topparent.getActionFrame();
  98. if(findPane.searchForm && findPane.searchForm.searchTarget && findPane.searchForm.searchTarget.value == 'C')
  99. return;
  100. break;
  101. case "4": //reload explain pane if there are selections and set it to cube explain
  102. if(fh.EXPL.value != '1')
  103. fh.EXPL.value = 1;
  104. break;
  105. case "8": //never reload custom exception pane
  106. return;
  107. default:
  108. break;
  109. }
  110. fh.CNCT.value = 19;
  111. fh.target = "ActionPane";
  112. parseAndSubmit(fh);
  113. }
  114. }
  115. function getDimBarData() {
  116. var dbData = topparent.getConfigFrame().dimBarData;
  117. if (dbData)
  118. return dbData;
  119. else
  120. return dimBarData;
  121. }
  122. //stubs all calls because the debugger is not present...
  123. function NoDebugger() {
  124. this.debugWindowString = "";
  125. this.debugWin = "";
  126. this.maxDebugLength = "";
  127. this.startTime = "";
  128. this.stack = "";
  129. this.execprofile = "";
  130. this.action = "";
  131. this.lastCaller = "";
  132. this.dumpObjects = "";
  133. this.appendOutput = "";
  134. this.fontSize = "";
  135. }
  136. NoDebugger.prototype.out = function () { return false; }
  137. NoDebugger.prototype.dumpArgs = function () { return false; }
  138. NoDebugger.prototype.dumpArguments = function () { return false; }
  139. NoDebugger.prototype.dumpObj = function () { return false; }
  140. NoDebugger.prototype.dumpObject = function () { return false; }
  141. NoDebugger.prototype.getObjectName = function () { return false; }
  142. NoDebugger.prototype.getFunctionName = function () { return false; }
  143. NoDebugger.prototype.createFunctionWrapper = function () { return false; }
  144. NoDebugger.prototype.createMethodWrapper = function () { return false; }
  145. NoDebugger.prototype.traceBefore = function () { return false; }
  146. NoDebugger.prototype.traceAfter = function () { return false; }
  147. NoDebugger.prototype.traceFunction = function () { return false; }
  148. NoDebugger.prototype.traceObject = function () { return false; }
  149. NoDebugger.prototype.dumpProfile = function () { return false; }
  150. NoDebugger.prototype.storeAsString = function () { return false; }
  151. function initDebug() {
  152. if (typeof pdb == "undefined" && typeof Debugger != "undefined")
  153. {
  154. pdb = new Debugger();
  155. pdb.out("Debugger succesfully initialized!");
  156. }
  157. else
  158. pdb = new NoDebugger();
  159. }
  160. function legendItemRec(name,id,suppressed) {
  161. this.name = name;
  162. this.id = id;
  163. this.suppressed = suppressed;
  164. }