123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: pps
- //
- // (C) Copyright IBM Corp. 2009, 2017
- //
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- /*****************************************************/
- /************* Dashboard (BUX) Support *************/
- /*****************************************************/
- // Determines if we are running inside a Dashboard "iWidget".
- function isDashboard() {
- var isdsh = getGlobal("is_dashboard");
-
- if ( isdsh != null && typeof isdsh != "undefined") {
- return isdsh;
- } else {
- if (window.frameElement != null && window.frameElement.id != null && window.frameElement.id.indexOf("_pps_iframe") != -1) {
- setGlobal("is_dashboard", true);
- return true;
- }
- else {
- setGlobal("is_dashboard", false);
- return false;
- }
- }
- }
- function getIContext() {
- if(typeof window.name != "undefined" && /^[a-zA-Z][a-zA-Z0-9]*$/.test(window.name) ) {
- var str = "window.parent." + window.name + "iContext";
- var icontext = eval(str);
- if (icontext != null && typeof icontext != "undefined" && icontext.iEvents != null && icontext.iEvents.fireEvent != null) {
- return icontext;
- }
- }
-
- return null;
- }
- function updateToolbar() {
- var icontext = getIContext();
- if (icontext != null && icontext.scope && icontext.scope.initOnDemandToolbar) {
- icontext.scope.initOnDemandToolbar();
- }
- }
- function enableDrill() {
- var icontext = getIContext();
- if (icontext != null && icontext.scope && icontext.scope.enableDrill) {
- icontext.scope.enableDrill();
- }
- }
- function disableDrill() {
- var icontext = getIContext();
- if (icontext != null && icontext.scope && icontext.scope.disableDrill) {
- icontext.scope.disableDrill();
- }
- }
- function fireEvent(evt, params, payload) {
- var icontext = getIContext();
-
- if (icontext != null) {
- icontext.iEvents.fireEvent(evt, params, payload);
- }
- }
- function handleSaveDone() {
- setGlobal('is_save', false);
- getIContext().getiWidgetAttributes().setItemValue('savedReport', getGlobal('bux_report'));
- setGlobal("treeVisible", false); // in BUX, tree is not visible by default.
- getMainFrameset().cols = '0,*'; // make sure the dimtree is closed...
- fireEvent('com.ibm.bux.widget.save.done', null, {'status':true});
- fireEvent('com.ibm.bux.widget.modified', null, { 'modified': false });
- }
- function handleInitialOpen() {
-
- setGlobal("initial_open", false);
- setGlobal("is_save", false);
-
- setGlobal("treeVisible", false); // in BUX, tree is not visible by default.
- getMainFrameset().cols = '0,*'; // make sure the dimtree is closed...
-
- fireEvent('com.ibm.bux.widget.render.done', { noAutoResize: getGlobal('no_auto_resize') });
- }
- // On an initial open of a report in BUX, we want to fire
- // an autoResize event when all content has been loaded.
- function doneLoadingFrameset( framesetName ) {
- if (isDashboard()) {
-
- // If this is a split-view report, we want to perform the action when the inner frameset loads.
- if ( getGlobal("isSplitView") && framesetName == 'Data' ) {
- return;
- }
-
- if (getGlobal("initial_open")) {
- if (getGlobal('is_save')) {
- handleSaveDone();
- } else {
- handleInitialOpen(); // only do AutoResize on the initial open.
- }
- } else {
- fireEvent('com.ibm.bux.widget.modified', null, { 'modified': true });
- }
- updateToolbar();
- }
- }
|