cmspreview.html 5.3 KB

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