cmspreview.html 3.5 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
    <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" />
NoSubject's avatar
NoSubject 已提交
8 9 10
    <script src="../o2_lib/mootools/mootools-1.6.0.min.js?v=2.1.4"></script>
    <script src="../o2_core/o2.min.js?v=2.1.4"></script>
    <script src="../o2_core/compatible.min.js?v=2.1.4"></script>
NoSubject's avatar
NoSubject 已提交
11
    <script src="../o2_lib/Decimal.js"></script>
NoSubject's avatar
NoSubject 已提交
12 13 14 15 16 17 18 19 20 21 22 23

    <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;
        }
NoSubject's avatar
NoSubject 已提交
24
        layout.session = window.frameElement.ownerDocument.window.layout.session || {};
NoSubject's avatar
NoSubject 已提交
25
        //layout.desktop = layout;
NoSubject's avatar
NoSubject 已提交
26
        o2.addReady(function(){
NoSubject's avatar
NoSubject 已提交
27
            o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], {"sequence": true}, function(){
NoSubject's avatar
NoSubject 已提交
28
                //MWF.defaultPath = "/x_desktop"+MWF.defaultPath;
NoSubject's avatar
NoSubject 已提交
29 30 31 32 33 34
                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 已提交
35
                            //        if (this.isAuthentication()){
NoSubject's avatar
NoSubject 已提交
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
                            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 已提交
62
                            //        }
NoSubject's avatar
NoSubject 已提交
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
                        };

                        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>