cmspreview.html 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.xDesktop.Layout", function(){
  34. //MWF.require("MWF.xDesktop.Authentication", null, false);
  35. (function(){
  36. layout.load = function(){
  37. // if (this.isAuthentication()){
  38. var preview = window.frameElement.retrieve("preview");
  39. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  40. MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
  41. layout.appForm = new MWF.CMSForm($("layout"), preview.data);
  42. layout.appForm.app = {
  43. "options" : {
  44. "name" : "CMSDocument"
  45. },
  46. "content": document.body,
  47. "addEvent" : function(){}
  48. };
  49. MWF.getJSON("res/preview/cmsdoc.json", function(data){
  50. layout.appForm.businessData = {
  51. "data": data.data,
  52. "document": data.document,
  53. "attachmentList": data.attachmentList,
  54. "status": {
  55. //"readonly": (this.options.readonly) ? true : false
  56. "readonly": true //this.readonly
  57. },
  58. "control" : data.control
  59. };
  60. layout.appForm.load();
  61. });
  62. });
  63. // }
  64. };
  65. layout.load();
  66. })();
  67. });
  68. }.bind(this));
  69. });
  70. });
  71. </script>
  72. </head>
  73. <body style="overflow: auto">
  74. <div id="layout" style="overflow: auto">
  75. <div id="layout_top">
  76. </div>
  77. <div id="layout_form">
  78. </div>
  79. </div>
  80. </body>
  81. </html>