123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- // 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 caretPos;
- function onOK() {
- topparent.clearActionPane();
- 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 + '"';
- topparent.getXtabFrame().doit(command);
- }
- function translateVariables(titleText, toInternal) {
- var selectBox = document.getElementById("Variable_select");
- for (i=0;i<selectBox.options.length;i++)
- {
- var localizedVar = localizedVars[i];
- var internalVar = selectBox.options[i].value;
- if(toInternal){
- var rExp = new RegExp(localizedVar, "gi");
- titleText = titleText.replace(rExp,internalVar)
- }
- else{
- var rExp = new RegExp(internalVar, "gi");
- titleText = titleText.replace(rExp,localizedVar)
- }
- }
- return titleText;
- }
- //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.getElementById("append_PDF_Title").checked) {
- aptCheck = "1";
- }
- else {
- aptCheck = "0";
- }
- if (document.getElementById("Title_radio").checked) {
- opt = "1" + aptCheck + document.getElementById("Title_textarea").value;
- }
- else {
- opt = "0" + aptCheck;
- }
- return opt;
- }
- function storeCaret() {
-
- var textArea = document.getElementById("Title_textarea");
- if (textArea.createTextRange) {
- textArea.caretPos = document.selection.createRange().duplicate();
- }
- }
- function insertVar() {
- var textArea = document.getElementById("Title_textarea");
- if (textArea.caretPos) {
- textArea.caretPos.select();
- }
- else {
- textArea.focus();
- storeCaret();
- }
- var selectBox = document.getElementById("Variable_select");
- var text = "";
- if (selectBox.selectedIndex >= 0) {
- text = localizedVars[selectBox.selectedIndex];
- }
-
- if (textArea.createTextRange && textArea.caretPos) {
- textArea.caretPos.text = text;
- }
- else {
- textArea.value = textArea.value + text;
- }
- if (textArea.caretPos) {
- textArea.caretPos.select();
- }
- textArea.focus();
- storeCaret();
- }
- function init() {
-
- if (window.name == "ActionPane")
- topparent.openActionPane();
- ContextMenu.initialize(true,false);
- // adjust the size of the action pane to accomodate the display option pane.
- if (topparent.getGlobal("nn7"))
- topparent.setActionPaneHeight("283");
- else
- topparent.setActionPaneHeight("270");
- if (parent.isXtabStillLoading())
- {
- setTimeout('initEditTitle()', 50);
- return;
- }
- var textArea = document.getElementById("Title_textarea");
-
- textArea.value = translateVariables(textArea.value, false);
- var selectBox = document.getElementById("Variable_select");
- if (document.getElementById("Title_radio").checked) {
-
- textArea.focus();
- storeCaret();
- }
- else {
- selectBox.focus();
- }
-
- selectBox.options[0].selected = true;
- }
- function updateRadioButtons() {
- document.getElementById("Title_radio").checked = true;
- }
- function editTitleArrowMouseOver(table) {
- document.getElementById("insertVarArrowImg").className = "customSubsetsArrowButtonRollover";
- document.getElementById("insertVarArrowLink").className = "editTitleLinksRollover";
- }
- function editTitleArrowMouseOut(table) {
- document.getElementById("insertVarArrowImg").className = "customSubsetsArrowButton";
- document.getElementById("insertVarArrowLink").className = "editTitleLinks";
- }
- function editTitleArrowMouseDown(table) {
- document.getElementById("insertVarArrowImg").className = "customSubsetsArrowButtonPressed";
- document.getElementById("insertVarArrowLink").className = "editTitleLinksRollover";
- }
- function editTitleArrowMouseUp(table) {
- document.getElementById("insertVarArrowImg").className = "customSubsetsArrowButtonRollover";
- document.getElementById("insertVarArrowLink").className = "editTitleLinksRollover";
- }
|