// Licensed Materials - Property of IBM // // IBM Cognos Products: pps // // (C) Copyright IBM Corp. 2010, 2017 // // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. /*****************************************************/ /************* Dashboard (BUX) Support *************/ /*****************************************************/ // used to calculate the proper width of the iWidget for an AutoResize event function getPowerPlayScrollWidth() { var xtabWidth = getXtabWidth(); var chartWidth = getChartWidth(); var actionPaneWidth = getActionPaneWidth(); var contentWidth = Math.max(xtabWidth, chartWidth); var powerPlayWidth = Math.max(contentWidth, actionPaneWidth); if (topparent.getGlobal("treeVisible")) powerPlayWidth = powerPlayWidth + 192 ; return powerPlayWidth + 30; } // used to calculate the proper height of the iWidget for an AutoResize event function getPowerPlayScrollHeight() { var xtabHeight = getXtabHeight(); var chartHeight = getChartHeight(); var actionPaneHeight = getActionPaneHeight(); return xtabHeight + chartHeight + actionPaneHeight + 40; } function getXtabWidth() { if (noXtabFrame()) { return 0; } var xtabDoc = topparent.getXtabFrame().window.document; var titleWidth = getTitleWidth(xtabDoc); var divWidth = xtabDoc.getElementById("innerNice1-tab0").scrollWidth; var tableWidth = xtabDoc.getElementById("xtab").scrollWidth; var statusLineWidth = getStatusLineWidth(xtabDoc); return Math.max(titleWidth, Math.max(divWidth, Math.max(tableWidth, statusLineWidth))); } function getXtabHeight() { if (noXtabFrame()) { return 0; // no Xtab } var xtabDoc = topparent.getXtabFrame().window.document; var titleHeight = getTitleHeight(xtabDoc); var statusLineHeight = getStatusLineHeight(xtabDoc); var xtabHeight = xtabDoc.getElementById("xtab").scrollHeight; return xtabHeight + titleHeight + statusLineHeight + 20; } function getChartWidth() { if (noChartFrame()) { return 0; // no Chart } var chartDoc = topparent.getChartFrame().window.document; var titleWidth = getTitleWidth(chartDoc); var statusLineWidth = getStatusLineWidth(chartDoc); var divWidth = chartDoc.getElementById("innerNice1-tab0").scrollWidth; var chartWidth = chartDoc.getElementById("chart").scrollWidth; return Math.max(titleWidth, Math.max(divWidth, Math.max(chartWidth, statusLineWidth))); } function getChartHeight() { if (noChartFrame()) { return 0; // no Chart } var chartDoc = topparent.getChartFrame().window.document; var titleHeight = getTitleHeight(chartDoc); var statusLineHeight = getStatusLineHeight(chartDoc); var chartHeight = chartDoc.getElementById("chart").scrollHeight; return chartHeight + titleHeight + statusLineHeight + 20; } function getActionPaneWidth() { var rows = topparent.document.getElementById("rightFrameset").rows; rows = rows.split(','); if (parseInt(rows) == 0) { return 0; } return topparent.getActionFrame().window.document.body.scrollWidth; } function getActionPaneHeight() { var rows = topparent.document.getElementById("rightFrameset").rows; rows = rows.split(','); return parseInt(rows[1]); } function getTitleWidth(doc) { if (doc && doc.getElementById("titleDiv")) return doc.getElementById("titleDiv").scrollWidth; return 0; } function getTitleHeight(doc) { if (doc && doc.getElementById("titleDiv")) return doc.getElementById("titleDiv").scrollHeight; return 0; } function getStatusLineWidth(doc) { if (doc && doc.getElementById("status_line")) return doc.getElementById("status_line").scrollWidth; return 0; } function getStatusLineHeight(doc) { if (doc && doc.getElementById("status_line")) return doc.getElementById("status_line").scrollHeight + 15; return 0; } function noXtabFrame() { return topparent.getGlobal("isChart") && !topparent.getGlobal("isSplitView"); } function noChartFrame() { return !topparent.getGlobal("isChart") && !topparent.getGlobal("isSplitView"); } function saveAsToDashboard(evt) { var payload = evt.payload; var dashboardStoreID = payload.cm$storeID; topparent.setGlobal("is_save", true); addToHiddenForm("DSHSP", 'storeID("' + dashboardStoreID + '")'); doParent('RU:5') } function saveToDashboard(evt) { var payload = evt.payload; var dashboardStoreID = payload.cm$storeID; topparent.setGlobal("is_save", true); addToHiddenForm("DSHSP", 'storeID("' + dashboardStoreID + '")'); doParent('RU:6') } function addToHiddenForm(name, value) { var input = document.createElement("input"); input.name = name; input.value = value; input.type = "hidden"; fh.appendChild(input); }