ReportInfo.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2013
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or
  8. *| disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *|
  10. *+------------------------------------------------------------------------+
  11. */
  12. dojo.provide("bux.reportViewer.ReportInfo");
  13. dojo.require("bux.Tooltip");
  14. dojo.declare("bux.reportViewer.ReportInfo", bux.TooltipBase, {
  15. templateString: "<div class=\"dijitTooltip dijitTooltipLeft\" id=\"dojoTooltip\">\n\t<div class=\"dijitTooltipContainer dijitTooltipContents\" dojoAttachPoint=\"containerNode\" waiRole='alert'></div>\n\t<div class=\"dijitTooltipConnector\"></div>\n</div>\n",
  16. title: "",
  17. text: "",
  18. linkText: null,
  19. linkScript: null,
  20. constructor: function(args) {
  21. if(args.focusElement) {
  22. //We're supposed to get this for free from dojo,
  23. //but it's not working, so have to do it manually:
  24. dojo.connect(args.focusElement, "onfocus", this, "_onHover");
  25. dojo.connect(args.focusElement, "onblur", this, "_onUnHover");
  26. }
  27. },
  28. createMarkup: function() {
  29. var linkId = this.connectId + "_linkId";
  30. var hrefTextLink = dojo.isIE || dojo.isTrident ? '"#"' : '"javascript:void(0);"';
  31. //IE is over enthusiastic to trigger window.onbeforeunload
  32. //event for clicking on link which does not intend to open a new window
  33. var content = "";
  34. content += "<table role=\"presentation\" class=\"bux-tooltip-table\" cellspacing=\"0\" cellpadding=\"0\">";
  35. content += "<tr>";
  36. content += "<td class=\"bux-tooltip-title\">";
  37. content += html_encode(this.title);
  38. content += "</td>";
  39. content += "</tr>";
  40. content += "<tr>";
  41. content += "<td class=\"bux-tooltip-text\">";
  42. content += html_encode(this.text);
  43. content += "</td>";
  44. content += "</tr>";
  45. content += "<tr>";
  46. if( this.linkScript )
  47. {
  48. content += "<td class=\"bux-tooltip-text\">";
  49. content += '<a role=\"link\" id="' + linkId + '" href=' + hrefTextLink +' onmousedown="' + this.linkScript + '">' + html_encode(this.linkText) + '</a>';
  50. content += "</td>";
  51. }
  52. else
  53. {
  54. content += "<td></td>";
  55. }
  56. content += "</tr>";
  57. content += "</table>";
  58. return content;
  59. }
  60. });