123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: pps
- //
- // (C) Copyright IBM Corp. 2005, 2019
- //
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- // This forms the javascript functions used for PowerPlay Studio.
- // except for those functions involved with HTML4
- // The functions handle any minor browser differences.
- // Browser detection code
- var version = parseInt(navigator.appVersion);
- var isIE = navigator.appVersion.indexOf("MSIE")>0;
- var isNS = navigator.appName.indexOf("Netscape")>=0;
- if( navigator.appVersion == "" )
- isIE = true;
- var isIE3 = isIE && version<4;
- var isIE4 = isIE && version>=4;
- var isNS3 = isNS && version<4;
- var isNS4 = isNS && version>=4;
- var fh, fdb, fm, img, iconHelp;
- var imgNm;
- var FTok = false;
- var _fhchanged = false;
- var _fhtarget;
- var _fhaction;
- var _fhRA;
- var gparent = getGrandParentofFXWindow();
- var sparent = getGrandParentofFXWindowAsString();
- var hasFinishedLoading = 0;
- var pdb; //for primitive debugger...
- //used in formURL()
- var _essHidden = new Array();
- _essHidden[0] = "DC";
- _essHidden[1] = "E";
- _essHidden[2] = "I";
- _essHidden[3] = "LA";
- _essHidden[4] = "LO";
- _essHidden[5] = "M";
- _essHidden[6] = "RC";
- _essHidden[7] = "DM";
- _essHidden[8] = "DX";
- _essHidden[9] = "PH";
- _essHidden[10] = "PT";
- _essHidden[11] = "FC";
- _essHidden[12] = "Y";
- _essHidden[13] = "G";
- _essHidden[14] = "H";
- _essHidden[15] = "J";
- _essHidden[16] = "K";
- _essHidden[17] = "SHN";
- function winFocus(w) {
- if(w!=null&&w.focus!=null)
- w.focus();
- }
- function checkFrame() {
- var fh=document.fhidden;
- if (parent == self || !gparent.sync) {
- resetHiddenForm();
- // Invoked without frameset
- fh.CNCT.value=0;
- fh.submit();
- }
- }
- function sync( ){
- img=gparent.FT.img;
- iconHelp=gparent.FT.iconHelp1;
- FTok = true;
- }
- function NoDebugger () {
- window.onerror=function (msg,url,line){ return true };
- this.out = noFunc;
- this.dump = noFunc;
- this.dumpArgs = noFunc;
- this.getObjectName = noFunc;
- this.getFunctionName = noFunc;
- this.checkHide = noFunc;
- }
- function noFunc() { return true; }
- function initDebug() {
- if (typeof Debugger != "undefined") {
- pdb = new Debugger ();
- } else {
- pdb = new NoDebugger ();
- }
- }
- function initVars(){
- initDebug();
- fh=document.fhidden;
- fh.CO.value = "";
-
- if (!gparent.is_save && fh.DSHSP) {
- fh.removeChild(fh.DSHSP);
- }
- captureScreenRes(fh);
- fdb=document.fdimbar;
- if (isIE3)
- fm=document.fmeasure;
- else
- fm=document.fmain;
- if(gparent.FXloaded!=null){
- if (!fh.YS)
- gparent.FXloaded=1;
- else {
- if (window.name == "FX1") {
- gparent.FX1loaded=1;
- }
- if (window.name == "FX2") {
- gparent.FX2loaded=1;
- }
- if (gparent.FX1loaded && gparent.FX2loaded) {
- gparent.FXloaded=1;
- }
- }
- gparent.sync();
- }
- }
- function captureScreenRes(fh){
- setCookie("BRes",screen.availWidth + "*" + screen.availHeight,(10*365),cookieSecure);
- }
- function initNormal(){
- checkFrame();
- if ( parseInt(QPversion) != parseInt(JavaScriptVersion) )
- alert(invalidVersion);
- }
- function getIContext() {
- var str = "window.parent.parent.parent." + window.parent.parent.name + "iContext";
- var icontext = eval(str);
- if (icontext != null && typeof icontext != "undefined" && icontext.iEvents != null && icontext.iEvents.fireEvent != null) {
- return icontext;
- }
-
- return null;
- }
- function fireEvent(evt, params, payload) {
- var icontext = getIContext();
-
- if (icontext != null) {
- icontext.iEvents.fireEvent(evt, params, payload);
- }
- }
- function updateToolbar() {
- var icontext = getIContext();
- if (icontext != null && icontext.scope) {
- icontext.scope.initOnDemandToolbar();
- }
- }
- function init(){
- initVars();
- fh.RA.value = "";
- initNormal();
-
- updateToolbar();
-
- if (gparent.initialOpen) {
- gparent.initialOpen = false;
-
- if (!gparent.is_save && !gparent.no_auto_resize) {
- fireEvent('com.ibm.bux.widget.autoResize', null);
- } else {
- handleSaveDone();
- }
- } else {
- fireEvent('com.ibm.bux.widget.modified', null, { 'modified': true });
- }
- }
- function resize(){
- initVars();
- }
- function finish(){
- if(gparent.FXloaded!=null)
- gparent.FXloaded=0;
- if(gparent.FX1loaded!=null)
- gparent.FX1loaded=0;
- if(gparent.FX2loaded!=null)
- gparent.FX2loaded=0;
-
- FTok = false;
- }
- function resetHiddenForm(){
- if ( _fhchanged ) {
- fh.RA.value = _fhRA;
- fh.action = _fhaction;
- fh.target = _fhtarget;
- }
- if (fh.RA.value > 0) fh.RA.value = 0;
-
- }
- function isLeftPaneManipulateCmd() {
- var sCommand = fh.CO.value;
- var cmd = sCommand.charAt(0);
- var cmdOption = sCommand.charAt(1);
- if ( cmd != "M" )
- return false;
- if ( cmdOption != "X" && cmdOption != "E" &&
- cmdOption != "A" && cmdOption != "F" && cmdOption != "T" && cmdOption != "P")
- return false;
-
- return true;
- }
- function isLeftPaneUp() {
- var returnVal = false;
- if (fh.EXPL.value != 0 || fh.CUSX.value != 0 || fh.FIND.value != 0 || fh.OPTS.value != 0 || fh.PDFPO.value != 0 || fh.ZS_OPTS.value != 0)
- returnVal = true;
- return returnVal;
- }
- function crosstab()
- {
- if( parent.FE ) {
- var sTemplate = "";
- var sCommand = fh.CO.value;
-
- if (fh.TMPL) {
- sTemplate = fh.TMPL.value;
- }
- if (fh.CNCT.value != 11 && fh.target != "_self" && fh.CO.value.substring(0,2)!='GE') {
- fh.CNCT.value=4;
- }
- }
-
- else if ( fh.target == "_self"){
- if(parent.name == "")
- parent.name= "parentname";
- fh.target = parent.name;
- }
- FTok=false;
- fh.submit();
- resetAllForms();
- }
- function setFormValue(aForm, name, value) {
- for (var j=0; j<aForm.elements.length; j++) {
- if (aForm.elements[j].name == name) {
- aForm.elements[j].value = value;
- break;
- }
- }
- }
- function doit(action){
- initVars(); // required for NS3 as it does not trap the resize event
- if (action.charAt(0) == "!") {
- eval(action.substring(1));
- } else {
- if(fh) {
- if(fh.RA.value != 2)
- resetHiddenForm();
- if( action.substring(0,2) == "LM" ){
- fh.LM.value=action;
- } else {
- fh.CO.value=action;
- }
- if (fh.CNCT.value == 5) {
- fh.CNCT.value = 1;
- fh.target = "_self";
- }
- crosstab();
- }
- }
- }
- function doParent(action){
- initVars(); // required for NS3 as it does not trap the resize event
- if(fh) {
- resetHiddenForm();
- fh.CO.value=action;
- if( isLeftPaneUp() || parent.FX1 || parent.FX2 ) {
- if (self.parent.parent.name == "")
- self.parent.parent.name = "FR";
- fh.target = self.parent.parent.name;
- }
- else
- fh.target = "_parent";
- FTok=false;
- fh.submit();
- resetAllForms();
- }
- }
- function doSelect(action){
- action = eval("'" + action + "'"); // needed to interpret \t
- resetAllForms();
- doit(action);
- }
- function doOver(a,n,r){
- if(FTok && !isIE3){
- if (!isNS3 || a.indexOf("sort")!=0)
- document.images[a].src=img[n][r].src;
- window.status=iconHelp[n];
- }
- return true;
- }
- function doClick(a,n,it){
- doOver(a,n,2);
- eval("doit('" + it + "')");
- }
- function what(t){
- window.status=t;
- return true;
- }
- function resetForm(f){
- if(f!=null&&f.reset!=null)
- f.reset();
- }
- function resetAllForms(){
- if(document.forms!=null) {
- for(var f=0; f<document.forms.length; f++) {
- resetForm(document.forms[f]);
- }
- }
- }
- function hp(topic){
- fh=document.fhidden;
- var lang = "";
-
- if (fh && fh.LA)
- lang = fh.LA.value;
-
- help(lang, topic);
- }
- function getGrandParentofFXWindow()
- {
- return window.parent.parent;
- }
- function getGrandParentofFXWindowAsString()
- {
- return "window.parent.parent";
- }
- function cgiEscape(str) {
- var str2=escape(str);
- var str2=str2.replace(/\+/g, "%2b");
- return (str2);
- }
- function formURL(){
- var form=document.fhidden;
- var q="?";
- var url = form.action;
- for (var i = 0; i < _essHidden.length; i++) {
- var str = "form.";
- str += _essHidden[i];
- var ele = eval(str);
- if ( ele ) {
- if ( ele.value.length > 0) {
- url += q;
- url += cgiEscape(ele.name);
- url += "=";
- if ( ele.name == "E" )
- url += form.EC.value;
- else
- url += cgiEscape(ele.value);
- q="&";
- }
- }
- }
- return (url);
- }
|