123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: pps
- //
- // (C) Copyright IBM Corp. 2005, 2017
- //
- // 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 Toolbar
- // 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 isIE5 = isIE && version>4
- var isNS3 = isNS && version<4
- var isNS4 = isNS && version>=4
- // Variables and constants
- //var _postable = isIE5 || isNS; //uncomments this line if support IE version before IE4 SP2. 4.72,3612,1713 update version SP2, 3283
- var _postable = isIE4 || isNS;; //comments this line if support IE version before IIE4 SP2. 4.72,3612,1713 update version SP2, 3283.
- function winFocus(w){
- if(w!=null&&w.focus!=null)
- w.focus();
- }
- function compTail(s1, s2) {
- if (s1.indexOf(s2) == s1.length - s2.length)
- return true;
- return false;
- }
- function doOver(n,r,noStatus){
- if (iconState[n] != -1/* hidden */) {
- if (!isIE3 && !bRenderAsIE3) {
- if(iconState[n]==2) // ignore rollover if disabled
- r=0;
- document.images[iconName[n]].src=img[n][iconState[n]*2+r].src;
- }
-
- if (!noStatus)
- {
- if(iconState[n]==1&&iconHelp2[n]!=null)
- window.status=iconHelp2[n];
- else
- window.status=iconHelp1[n];
- }
- }
- return true;
- }
- function set(n){
- if(iconPress[n]){
- for(var i=0;i<max;i++){
- if(iconPress[i]==iconPress[n]){
- if (iconState[i] != -1) {
- iconState[i]=0;
- doOver(i,0);
- }
- }
- }
- iconState[n]=1;
- }else{
- doOver(n,2); // show depressed state of icon without changing state variable
- }
- }
- function clear(n){
- if(iconUnpress[n]){
- for(var i=0;i<max;i++){
- if(iconUnpress[i]==iconUnpress[n]){
- if (iconState[i] != -1) {
- iconState[i]=1;
- doOver(i,0);
- }
- }
- }
- iconState[n]=0;
- }
- }
- function doClick(n){
- if(iconState[n]==2)
- return;
- // bug fix 381158- replaced code from new UI
- else if(iconState[n]==1)
- {
- if(iconUnpress[n] > 1)
- iconState[n]=0;
- }
- else
- {
- if(iconPress[n] > 1)
- iconState[n]=1;
- }
-
- doOver(n,0);
- eval(iconAction[n]);
- }
- function doit(s){
- var winFX = parent.getWindow();
- if(parent.FXloaded!=null && parent.FXloaded==1)
- winFX.doit(s);
- }
- // this function is used by alert agent
- function doit2(s){
- var gparent = parent.parent;
- var winFX = gparent.getWindow();
- if(gparent.FXloaded!=null && gparent.FXloaded==1)
- winFX.doit(s);
- }
- function isLeftPaneUp() {
- var winFX = parent.getWindow();
- var fh = winFX.document.fhidden;
- var returnVal = false;
- if (fh.EXPL.value != 0 || fh.CUSX.value != 0 || fh.FIND.value != 0 || fh.OPTS.value != 0 || fh.PDFPO.value != 0)
- returnVal = true;
- return returnVal;
- }
- function ra( as ) {
- if( !parent.FXloaded || parent.FXloaded != 1 )
- return;
- var winFX = parent.getWindow();
- var fh = winFX.document.fhidden;
- if ( !winFX._fhchanged ) {
- winFX._fhchanged = true;
- winFX._fhtarget = fh.target;
- winFX._fhaction = fh.action;
- winFX._fhRA = fh.RA.value;
- }
- var RA_CSV = 1,
- RA_XLS = 11,
- RA_PDF = 12,
- RA_DRILLTHRU = 4,
- RA_BOOKMARK = 7,
- RA_SPECS = 98;
- RA_XLSX=13;
- var cnctTemp = fh.CNCT.value;
- if( as == RA_CSV || as == RA_PDF || as == RA_DRILLTHRU || as == RA_BOOKMARK || as == RA_XLS || as == RA_SPECS || as == RA_XLSX) {
- FTok = false;
-
- fh.RA.value = as;
- // self.window is the toolbar window (FT) so the target is our
- // parent window -- whatever that is.
- var targetWindow = self.window.parent;
- if( ! targetWindow.name || targetWindow.length == 0 )
- targetWindow.name = "PPESTarget";
- fh.target = targetWindow.name;
- if( as == RA_BOOKMARK ) {
- if( parent.parent != parent ) {
- fh.target = "_blank"; // open a new window because bookmarks set the location
- }
- fh.HTTPSBM.value = location.protocol.toLowerCase();
- } else if (as == RA_DRILLTHRU ){
- fh.target = "_blank";
- } else if( as == RA_CSV ) {
- fh.action += "?MIME=.CSV";
- } else if( as == RA_XLS ) {
- fh.action += "?MIME=.XLS";
- fh.CNCT.value = 24;
- } else if( as == RA_XLSX ) {
- fh.action += "?MIME=.XLSX";
- fh.CNCT.value = 24;
- }else if( as == RA_PDF ) {
- fh.action += "?MIME=.PDF";
- fh.CO.value = "";
- } else if( as == RA_SPECS ) { /* Show Specs (PPX & CFX) */
- fh.target = "_blank";
- }
- if( as == RA_PDF && document.cookie.length != 0 && getCookie("PageOrientation") )
- submitExportIcon( winFX );
- else
- fh.submit();
- fh.CNCT.value=cnctTemp;
- } else {
- // We're not expecting it -- eat it
- }
- }
- function doParent(action){
- var winFX = parent.getWindow();
- if(parent.FXloaded!=null && parent.FXloaded==1)
- winFX.doParent(action);
- }
- function doSelect(action){
- var winFX = parent.getWindow();
- if(parent.FXloaded!=null && parent.FXloaded==1)
- winFX.doSelect(action);
- }
- function what(t){
- window.status=t;
- return true;
- }
- function ret()
- {
- if( document.pqr != null )
- document.pqr.submit();
- }
- function hp(sTopic) {
- parent.getWindow().hp(sTopic);
- }
- function syncpg(){
- if (ftr && ftr.R) {
- for(var i=0;i<ftr.R.length;i++){
- if(compTail(ftr.R.options[i].value, ':' + fh.G.value))
- ftr.R.selectedIndex=i;
- }
- }
- if (ftc && ftc.C) {
- for(var i=0;i<ftc.C.length;i++){
- if(compTail(ftc.C.options[i].value, ':' + fh.H.value))
- ftc.C.selectedIndex=i;
- }
- }
- }
- function sync(){
- var winFX=parent.getWindow();
- iconState=winFX.iconState;
- if (isIE3 || bRenderAsIE3) {
- ftr=document.ftoolbarr;
- ftc=document.ftoolbarc;
- for(var n=0;n<max;n++) {
- if (iconState[n] != -1/* hidden */) {
- document.images[iconName[n]].src=img[n][iconState[n]*2].src;
- }
- }
- } else {
- ftr=document.ftoolbar;
- ftc=document.ftoolbar;
- for(var i=0;i<max;i++)
- doOver(i,0,true);
- }
- fh=winFX.document.fhidden;
- syncpg();
- winFocus(winFX);
- }
- function init(){
- if(parent.FXloaded!=null){
- parent.FTloaded=1;
- parent.sync();
- }
- }
- function finish(){
- if(parent.FXloaded!=null)
- parent.FTloaded=0;
- }
|