cmspreview.html 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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="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?v=2.0.0"></script>
  9. <script src="../o2_core/compatible.min.js?v=2.0.0"></script>
  10. <script src="../o2_lib/Decimal.js"></script>
  11. <title>FORM PREVIEW</title>
  12. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  13. <script>
  14. layout = window.layout || {};
  15. var href = window.location.href;
  16. if (href.indexOf("debugger")!=-1) layout["debugger"] = true;
  17. var mode = (new URI(href)).get("data").mode;
  18. if (mode){
  19. if (mode=="mobile") layout.mobile = true;
  20. }
  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.defaultPath = "/x_desktop"+MWF.defaultPath;
  25. MWF.loadLP("zh-cn");
  26. MWF.require("MWF.xDesktop.Layout", function(){
  27. //MWF.require("MWF.xDesktop.Authentication", null, false);
  28. (function(){
  29. layout.load = function(){
  30. // if (this.isAuthentication()){
  31. var preview = window.frameElement.retrieve("preview");
  32. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  33. MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
  34. layout.appForm = new MWF.CMSForm($("layout"), preview.data);
  35. layout.appForm.app = {
  36. "options" : {
  37. "name" : "CMSDocument"
  38. },
  39. "content": document.body,
  40. "addEvent" : function(){}
  41. };
  42. MWF.getJSON("res/preview/cmsdoc.json", function(data){
  43. layout.appForm.businessData = {
  44. "data": data.data,
  45. "document": data.document,
  46. "attachmentList": data.attachmentList,
  47. "status": {
  48. //"readonly": (this.options.readonly) ? true : false
  49. "readonly": true //this.readonly
  50. },
  51. "control" : data.control
  52. };
  53. layout.appForm.load();
  54. });
  55. });
  56. // }
  57. };
  58. layout.load();
  59. })();
  60. });
  61. });
  62. });
  63. </script>
  64. </head>
  65. <body style="overflow: auto">
  66. <div id="layout" style="overflow: auto">
  67. <div id="layout_top">
  68. </div>
  69. <div id="layout_form">
  70. </div>
  71. </div>
  72. </body>
  73. </html>