cmspreview.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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_lib/mootools/mootools-1.6.0.min.js"></script>
  9. <script src="../o2_core/o2.min.js"></script>
  10. <script src="../o2_core/compatible.min.js"></script>
  11. <script src="../o2_lib/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. var href = window.location.href;
  17. if (href.indexOf("debugger")!=-1) layout["debugger"] = true;
  18. var mode = (new URI(href)).get("data").mode;
  19. if (mode){
  20. if (mode=="mobile") layout.mobile = true;
  21. }
  22. layout.session = window.frameElement.ownerDocument.window.layout.session || {};
  23. //layout.desktop = layout;
  24. o2.addReady(function(){
  25. o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], {"sequence": true}, function(){
  26. MWF.getJSON("res/config/config.json", function(config){
  27. layout.config = config;
  28. if (layout.config.app_protocol=="auto"){
  29. layout.config.app_protocol = window.location.protocol;
  30. }
  31. //MWF.defaultPath = "/x_desktop"+MWF.defaultPath;
  32. MWF.loadLP(MWF.language);
  33. MWF.require("MWF.widget.Common", null, false);
  34. MWF.require("MWF.xDesktop.Common", null, false);
  35. MWF.require("MWF.xAction.RestActions", null, false);
  36. MWF.require("MWF.xDesktop.Layout", function(){
  37. //MWF.require("MWF.xDesktop.Authentication", null, false);
  38. MWF.require("MWF.xDesktop.Actions.RestActions", null, false);
  39. (function(){
  40. layout.load = function(){
  41. // if (this.isAuthentication()){
  42. var preview = window.frameElement.retrieve("preview");
  43. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  44. MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
  45. layout.appForm = new MWF.CMSForm($("layout"), preview.data);
  46. layout.appForm.app = {
  47. "options" : {
  48. "name" : "CMSDocument"
  49. },
  50. "content": document.body,
  51. "addEvent" : function(){}
  52. };
  53. MWF.getJSON("res/preview/cmsdoc.json", function(data){
  54. layout.appForm.businessData = {
  55. "data": data.data,
  56. "document": data.document,
  57. "attachmentList": data.attachmentList,
  58. "status": {
  59. //"readonly": (this.options.readonly) ? true : false
  60. "readonly": true //this.readonly
  61. },
  62. "control" : data.control
  63. };
  64. layout.appForm.load();
  65. });
  66. });
  67. // }
  68. };
  69. // layout.load();
  70. MWF.xDesktop.getServiceAddress(layout.config, function (service, center) {
  71. layout.serviceAddressList = service;
  72. layout.centerServer = center;
  73. layout.load();
  74. }.bind(this));
  75. })();
  76. });
  77. }.bind(this));
  78. });
  79. });
  80. </script>
  81. </head>
  82. <body style="overflow: auto">
  83. <div id="layout" style="overflow: auto">
  84. <div id="layout_top">
  85. </div>
  86. <div id="layout_form">
  87. </div>
  88. </div>
  89. </body>
  90. </html>