cmspreview.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" type="text/css" href="/x_desktop/res/css/style.css" charset="UTF-8" />
  5. <link rel="stylesheet" href="/x_desktop/res/css/mBoxNotice.css" charset="UTF-8" />
  6. <link rel="stylesheet" href="/x_desktop/res/css/mBoxTooltip.css" charset="UTF-8" />
  7. <script src="/x_desktop/res/common.js?v=0.3.19"></script>
  8. <!--<script src="/x_desktop/res/framework/mootools/mootools-core-1.4.5-full-nocompat.js"></script>-->
  9. <!--<script src="/x_desktop/res/framework/mootools/mootools-more-1.4.0.1-all_2.js"></script>-->
  10. <script src="res/framework/mootools/mootools-1.6.0.min.js"></script>
  11. <script src="res/framework/Decimal.js"></script>
  12. <title>FORM PREVIEW</title>
  13. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  14. <script>
  15. layout = window.layout || {};
  16. //layout.desktop = layout;
  17. COMMON.DOM.addReady(function(){
  18. COMMON.AjaxModule.load("/x_desktop/res/framework/mootools/plugin/mBox.Notice.js", null, false);
  19. COMMON.AjaxModule.load("/x_desktop/res/framework/mootools/plugin/mBox.Tooltip.js", null, false);
  20. COMMON.setContentPath("/x_desktop");
  21. COMMON.AjaxModule.load("mwf", function(){
  22. MWF.defaultPath = "/x_desktop"+MWF.defaultPath;
  23. MWF.loadLP("zh-cn");
  24. MWF.require("MWF.xDesktop.Layout", function(){
  25. //MWF.require("MWF.xDesktop.Authentication", null, false);
  26. (function(){
  27. layout.load = function(){
  28. // if (this.isAuthentication()){
  29. var preview = window.frameElement.retrieve("preview");
  30. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  31. MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
  32. layout.appForm = new MWF.CMSForm($("layout"), preview.data);
  33. layout.appForm.app = {"content": document.body};
  34. MWF.getJSON("res/preview/cmsdoc.json", function(data){
  35. layout.appForm.businessData = {
  36. "data": data.data,
  37. "document": data.document,
  38. "attachmentList": data.attachmentList,
  39. "status": {
  40. //"readonly": (this.options.readonly) ? true : false
  41. "readonly": true //this.readonly
  42. }
  43. };
  44. layout.appForm.load();
  45. });
  46. });
  47. // }
  48. };
  49. // layout.authentication = new MWF.xDesktop.Authentication({
  50. // "onLogin": layout.load.bind(layout)
  51. // });
  52. // layout.isAuthentication = function(){
  53. // var returnValue = true;
  54. // this.authentication.isAuthenticated(function(json){
  55. // this.user = json.data;
  56. // }.bind(this), function(){
  57. // this.authentication.loadLogin(this.node);
  58. // returnValue = false;
  59. // }.bind(this));
  60. // return returnValue;
  61. // };
  62. // layout.getServiceAddress = function(callback){
  63. // var uri = "http://"+layout.config.center+"/x_program_center/jaxrs/distribute/assemble";
  64. // MWF.restful("get", uri, null, function(json){
  65. // this.serviceAddressList = json.data;
  66. // if (callback) callback();
  67. // }.bind(this));
  68. // };
  69. //
  70. // MWF.getJSON("res/config/config.json", function(config){
  71. // layout.config = config;
  72. //
  73. // layout.getServiceAddress(function(){
  74. // layout.load();
  75. // });
  76. // });
  77. layout.load();
  78. })();
  79. });
  80. });
  81. });
  82. </script>
  83. </head>
  84. <body style="overflow: auto">
  85. <div id="layout" style="overflow: auto">
  86. <div id="layout_top">
  87. </div>
  88. <div id="layout_form">
  89. </div>
  90. </div>
  91. </body>
  92. </html>