cmspreview.html 3.3 KB
Newer Older
NoSubject's avatar
NoSubject 已提交
1 2 3 4
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
NoSubject's avatar
NoSubject 已提交
5 6 7 8 9
    <link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
    <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
    <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
    <script src="../o2_core/o2.js?v=2.0.0"></script>
    <script src="../o2_core/compatible.js?v=2.0.0"></script>
NoSubject's avatar
NoSubject 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22

    <title>FORM PREVIEW</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    <script>
        layout = window.layout || {};
        var href = window.location.href;
        if (href.indexOf("debugger")!=-1) layout["debugger"] = true;
        var mode = (new URI(href)).get("data").mode;
        if (mode){
            if (mode=="mobile") layout.mobile = true;
        }
        //layout.desktop = layout;
NoSubject's avatar
NoSubject 已提交
23 24
        o2.addReady(function(){
            o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], function(){
NoSubject's avatar
NoSubject 已提交
25 26 27 28 29 30 31
                MWF.defaultPath = "/x_desktop"+MWF.defaultPath;
                MWF.loadLP("zh-cn");
                MWF.require("MWF.xDesktop.Layout", function(){
                    //MWF.require("MWF.xDesktop.Authentication", null, false);

                    (function(){
                        layout.load = function(){
NoSubject's avatar
NoSubject 已提交
32
                            //        if (this.isAuthentication()){
NoSubject's avatar
NoSubject 已提交
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
                            var preview = window.frameElement.retrieve("preview");
                            layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;

                            MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
                                layout.appForm = new MWF.CMSForm($("layout"), preview.data);
                                layout.appForm.app = {
                                    "options" : {
                                        "name" : "CMSDocument"
                                    },
                                    "content": document.body,
                                    "addEvent" : function(){}
                                };
                                MWF.getJSON("res/preview/cmsdoc.json", function(data){
                                    layout.appForm.businessData = {
                                        "data": data.data,
                                        "document": data.document,
                                        "attachmentList": data.attachmentList,
                                        "status": {
                                            //"readonly": (this.options.readonly) ? true : false
                                            "readonly": true //this.readonly
                                        },
                                        "control" : data.control
                                    };
                                    layout.appForm.load();
                                });
                            });
NoSubject's avatar
NoSubject 已提交
59
                            //        }
NoSubject's avatar
NoSubject 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
                        };

                        layout.load();
                    })();

                });
            });
        });
    </script>
</head>
<body style="overflow: auto">
<div id="layout" style="overflow: auto">
    <div id="layout_top">

    </div>
    <div id="layout_form">
    </div>
</div>
</body>
</html>