alerterrormsg.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // Licensed Materials - Property of IBM
  2. //
  3. // IBM Cognos Products: pps
  4. //
  5. // (C) Copyright IBM Corp. 2005, 2017
  6. //
  7. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  8. // This forms the javascript functions used for displaying error messages in the actionpane
  9. // PowerPlay Studio.
  10. // The functions handle any minor browser differences.
  11. var dialogContent;
  12. var preContent;
  13. var renameContent;
  14. var deleteContent;
  15. var previousContent;
  16. function initErrorVars() {
  17. dialogContent = document.getElementById("dialogContent");
  18. preContent = document.getElementById("preContent");
  19. renameContent = document.getElementById("renameContent");
  20. deleteContent = document.getElementById("deleteContent");
  21. presentContent = null;
  22. }
  23. function displayContent() {
  24. if (previousContent != "display") {
  25. hideAllContent();
  26. showContent(dialogContent);
  27. previousContent = "display";
  28. }
  29. }
  30. function displayPreContent() {
  31. if (previousContent != "pre") {
  32. hideAllContent();
  33. showContent(preContent);
  34. previousContent = "pre";
  35. }
  36. }
  37. function displayRenameContent() {
  38. if (previousContent != "rename") {
  39. hideAllContent();
  40. showContent(renameContent);
  41. previousContent = "rename";
  42. }
  43. }
  44. function displayDeleteContent() {
  45. if (previousContent != "delete") {
  46. hideAllContent()
  47. showContent(deleteContent);
  48. previousContent = "delete";
  49. }
  50. }
  51. function showContent(content) {
  52. var contentArea = document.getElementById("contentArea");
  53. if (!content)
  54. return false;
  55. contentArea.appendChild(content);
  56. }
  57. function hideAllContent() {
  58. var contentArea = document.getElementById("contentArea");
  59. while(contentArea.childNodes.length > 1)
  60. contentArea.removeChild(contentArea.childNodes[contentArea.childNodes.length - 1])
  61. }