cmspreview.html 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  5. <link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
  6. <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
  7. <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
  8. <script src="../o2_core/o2.min.js"></script>
  9. <script src="../o2_lib/Decimal.js"></script>
  10. <title>FORM PREVIEW</title>
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  12. <script>
  13. layout = window.layout || {};
  14. var href = window.location.href;
  15. if (href.indexOf("debugger")!=-1) layout["debugger"] = true;
  16. var mode = (new URI(href)).get("data").mode;
  17. if (mode){
  18. if (mode=="mobile") layout.mobile = true;
  19. }
  20. layout.session = window.frameElement.ownerDocument.window.layout.session || {};
  21. //layout.desktop = layout;
  22. o2.addReady(function(){
  23. o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], {"sequence": true}, function(){
  24. MWF.getJSON("res/config/config.json", function(config){
  25. layout.config = config;
  26. if (layout.config.app_protocol=="auto"){
  27. layout.config.app_protocol = window.location.protocol;
  28. }
  29. //MWF.defaultPath = "../x_desktop"+MWF.defaultPath;
  30. MWF.loadLP(MWF.language);
  31. MWF.require("MWF.widget.Common", null, false);
  32. MWF.require("MWF.xDesktop.Common", null, false);
  33. MWF.require("MWF.xAction.RestActions", null, false);
  34. MWF.require("MWF.xDesktop.Layout", function(){
  35. //MWF.require("MWF.xDesktop.Authentication", null, false);
  36. MWF.require("MWF.xDesktop.Actions.RestActions", null, false);
  37. (function(){
  38. layout.load = function(){
  39. // if (this.isAuthentication()){
  40. var preview = window.frameElement.retrieve("preview");
  41. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  42. MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
  43. layout.appForm = new MWF.CMSForm($("layout"), preview.data);
  44. layout.appForm.app = {
  45. "options" : {
  46. "name" : "CMSDocument"
  47. },
  48. "content": document.body,
  49. "addEvent" : function(){}
  50. };
  51. MWF.getJSON("res/preview/cmsdoc.json", function(data){
  52. layout.appForm.businessData = {
  53. "data": data.data,
  54. "document": data.document,
  55. "attachmentList": data.attachmentList,
  56. "status": {
  57. //"readonly": (this.options.readonly) ? true : false
  58. "readonly": true //this.readonly
  59. },
  60. "control" : data.control
  61. };
  62. layout.appForm.load();
  63. });
  64. });
  65. // }
  66. };
  67. // layout.load();
  68. MWF.xDesktop.getServiceAddress(layout.config, function (service, center) {
  69. layout.serviceAddressList = service;
  70. layout.centerServer = center;
  71. layout.load();
  72. }.bind(this));
  73. })();
  74. });
  75. }.bind(this));
  76. });
  77. });
  78. </script>
  79. </head>
  80. <body style="overflow: auto">
  81. <div id="layout" style="overflow: auto">
  82. <div id="layout_top">
  83. </div>
  84. <div id="layout_form">
  85. </div>
  86. </div>
  87. </body>
  88. </html>