CCognosViewer_override.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Viewer
  5. *| (C) Copyright IBM Corp. 2001, 2012
  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. CCognosViewer.prototype.isMobile = function() { return true; };
  13. /**
  14. * When in mobile we don't want to submit the drill through form like we usually do.
  15. * Instead we need to dispatch a request with all the drill through form fields
  16. * so that it can go through Mobiles proxy
  17. */
  18. CCognosViewer.prototype.sendDrillThroughRequest = function(form) {
  19. var aCells = getChildElementsByAttribute(form, "input", "name", "ui.action");
  20. if (aCells && aCells.length > 0) {
  21. aCells[0].setAttribute("value", "authoredDrillThroughMobile");
  22. }
  23. ViewerMobileRequest.passFormFieldsToMobile(form);
  24. };
  25. CCognosViewer.prototype.launchGotoPage = function(form) {
  26. ViewerMobileRequest.passFormFieldsToMobile(form);
  27. };
  28. /**
  29. * Never show the page links when we're generating
  30. * output for Mobile
  31. */
  32. CCognosViewer.prototype.shouldWriteNavLinks = function() {
  33. return false;
  34. };
  35. /**
  36. * For cancel requests make sure we use a ViewerDispatcherEntry class
  37. * since it will call into the Mobile code to do the request
  38. */
  39. CCognosViewer.prototype.getCancelDispatcherEntry = function() {
  40. return new ViewerDispatcherEntry(this);
  41. };
  42. CCognosViewer.prototype.notifyTabChange = function(newTabId) {
  43. var payload = {
  44. "action" : "savedOutputTabChange",
  45. "tabId" : newTabId
  46. };
  47. if (typeof window.onAction == "function") {
  48. window.onAction(payload);
  49. }
  50. else if(typeof console != "undefined") {
  51. // must not be in Mobile, log it to the console
  52. console.log(payload);
  53. }
  54. };