cmspreview.html 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.js?v=2.0.0"></script>
  9. <script src="../o2_core/compatible.js?v=2.0.0"></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.desktop = layout;
  21. o2.addReady(function(){
  22. o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], {"sequence": true}, function(){
  23. MWF.defaultPath = "/x_desktop"+MWF.defaultPath;
  24. MWF.loadLP("zh-cn");
  25. MWF.require("MWF.xDesktop.Layout", function(){
  26. //MWF.require("MWF.xDesktop.Authentication", null, false);
  27. (function(){
  28. layout.load = function(){
  29. // if (this.isAuthentication()){
  30. var preview = window.frameElement.retrieve("preview");
  31. layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
  32. MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
  33. layout.appForm = new MWF.CMSForm($("layout"), preview.data);
  34. layout.appForm.app = {
  35. "options" : {
  36. "name" : "CMSDocument"
  37. },
  38. "content": document.body,
  39. "addEvent" : function(){}
  40. };
  41. MWF.getJSON("res/preview/cmsdoc.json", function(data){
  42. layout.appForm.businessData = {
  43. "data": data.data,
  44. "document": data.document,
  45. "attachmentList": data.attachmentList,
  46. "status": {
  47. //"readonly": (this.options.readonly) ? true : false
  48. "readonly": true //this.readonly
  49. },
  50. "control" : data.control
  51. };
  52. layout.appForm.load();
  53. });
  54. });
  55. // }
  56. };
  57. layout.load();
  58. })();
  59. });
  60. });
  61. });
  62. </script>
  63. </head>
  64. <body style="overflow: auto">
  65. <div id="layout" style="overflow: auto">
  66. <div id="layout_top">
  67. </div>
  68. <div id="layout_form">
  69. </div>
  70. </div>
  71. </body>
  72. </html>