// 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 the edit title
// action pane for PowerPlay Studio.
// The functions handle any minor browser differences.
var isNSBrowser = navigator.appName.indexOf("Netscape")>=0;
if( navigator.appVersion == "" )
isNSBrowser = false;
var isNSMac = isNSBrowser && navigator.platform.indexOf("Mac") >= 0;
var isSplitPane = parent.parent.getWindow().name == "FX1";
var caretPos;
var open_var = "";
var close_var = "";
function getParentFX() {
if (isSplitPane) {
return parent.FX2;
} else {
return parent.FX;
}
}
function closeit() {
getParentFX().doit('MI');
}
function onOK() {
var userTitle = new String(getUserEditTitle());
//remove any tabs
var rExp = new RegExp("\t", "gi");
userTitle = userTitle.replace(rExp, " ");
userTitle = translateVariables(userTitle, true);
var command = 'IP:"' + userTitle + '"';
getParentFX().doit(command);
}
//Tab delimited value string:
//append PDF Title (1 = yes, 0 = no)
//Use User Defined Title (1 = yes, 0 = no)( if yes then append :titleText)
function getUserEditTitle() {
var aptCheck, opt;
if (document.editTitleForm.append_PDF_Title.checked) {
aptCheck = "1";
}
else {
aptCheck = "0";
}
if (document.editTitleForm.Default[1].checked) {
opt = "1" + aptCheck + document.editTitleForm.titleText.value;
}
else {
opt = "0" + aptCheck;
}
return opt;
}
function translateVariables(titleText, toInternal) {
var selectBox = document.editTitleForm.Variable;
for (i=0;i