mobile_cw.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <!-- Licensed Materials - Property of IBM
  3. BI and PM: Mobile
  4. (C) Copyright IBM Corp. 2013
  5. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. -->
  7. <html>
  8. <head>
  9. <script type="text/javascript" src="../icd/cwApi.js"></script>
  10. <script type="text/javascript" src="com.ibm.mobile.client/mobile_cw.js"></script>
  11. <script type="text/javascript">
  12. var cognosWorkspaceAPI = null;
  13. function loadWorkspace(sGatewayUrl, sWorkspaceId) {
  14. var oProperties = {
  15. baseurl: sGatewayUrl,
  16. workspaceId: sWorkspaceId,
  17. api: "cwcontainer",
  18. inline: true,
  19. container: "mobile",
  20. listenTo: [
  21. ["contextmenu", "onRender", cbfOnContextMenu],
  22. ["workspace", "onTabChanged", cbfOnTabChanged],
  23. ["workspace", "onOpenView", cbfOnOpenView],
  24. ["workspace", "onLoad", cbfWorkspaceOnLoad],
  25. ["workspace", "onError", cbfWorkspaceOnError]
  26. ]
  27. };
  28. if ( cognosWorkspaceAPI === null ) {
  29. cognosWorkspaceAPI = new cwApi(oProperties, "cwcontainer", cbfOnLoad);
  30. } else {
  31. cognosWorkspaceAPI.load( oProperties, cbfOnLoad );
  32. }
  33. }
  34. function unloadWorkspace() {
  35. if ( cognosWorkspaceAPI !== null ) {
  36. cognosWorkspaceAPI.unload();
  37. }
  38. }
  39. function setViewport (w, h, s) {
  40. var str = 'width=' + (w == 0 ? 'device-width' : w) + ', height=' + (h == 0 ? 'device-height' : h);
  41. if (s > 0) {
  42. var dscale = Math.floor(s * 10000) / 10000;
  43. if (dscale == 0) {
  44. dscale = 0.1;
  45. }
  46. str = str + ', initial-scale=' + dscale.toFixed(4);
  47. }
  48. str += " ,minimum-scale=0.25, maximum-scale=10, user-scalable=yes";
  49. var vp = document.querySelector('meta[name=viewport]');
  50. if (vp) {
  51. vp.setAttribute('content', str);
  52. } else {
  53. vp = document.createElement('meta');
  54. vp.name = 'viewport';
  55. vp.content = str;
  56. document.getElementsByTagName('head')[0].appendChild(vp);
  57. }
  58. }
  59. function setContainerStyle(styleStr) {
  60. var container = document.getElementById("cwcontainer");
  61. container.setAttribute('style', styleStr);
  62. }
  63. </script>
  64. <title> </title>
  65. </head>
  66. <body onload="bodyOnLoad()">
  67. <div id="cwcontainer" style="display:block;width:100%;height:100%"> </div>
  68. </body>
  69. </html>