cmspreview.html 4.5 KB
Newer Older
NoSubject's avatar
NoSubject 已提交
1
<!DOCTYPE html>
R
roo00 已提交
2
<html lang="zh-CN">
NoSubject's avatar
NoSubject 已提交
3 4
<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" />
R
roo00 已提交
8
    <script src="../o2_core/o2.min.js"></script>
NoSubject's avatar
NoSubject 已提交
9
    <script src="../o2_lib/Decimal.js"></script>
NoSubject's avatar
NoSubject 已提交
10 11 12 13 14 15 16 17 18 19 20 21

    <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 已提交
22
        layout.session = window.frameElement.ownerDocument.window.layout.session || {};
NoSubject's avatar
NoSubject 已提交
23
        //layout.desktop = layout;
NoSubject's avatar
NoSubject 已提交
24
        o2.addReady(function(){
NoSubject's avatar
NoSubject 已提交
25
            o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], {"sequence": true}, function(){
R
roo00 已提交
26 27 28 29 30
                MWF.getJSON("res/config/config.json", function(config){
                    layout.config = config;
                    if (layout.config.app_protocol=="auto"){
                        layout.config.app_protocol = window.location.protocol;
                    }
U
unknown 已提交
31 32


33
                    //MWF.defaultPath = "../x_desktop"+MWF.defaultPath;
R
roo00 已提交
34
                    MWF.loadLP(MWF.language);
U
unknown 已提交
35 36 37
                    MWF.require("MWF.widget.Common", null, false);
                    MWF.require("MWF.xDesktop.Common", null, false);
                    MWF.require("MWF.xAction.RestActions", null, false);
R
roo00 已提交
38 39
                    MWF.require("MWF.xDesktop.Layout", function(){
                        //MWF.require("MWF.xDesktop.Authentication", null, false);
U
unknown 已提交
40
                        MWF.require("MWF.xDesktop.Actions.RestActions", null, false);
R
roo00 已提交
41 42 43 44 45
                        (function(){
                            layout.load = function(){
                                //        if (this.isAuthentication()){
                                var preview = window.frameElement.retrieve("preview");
                                layout.desktop = window.frameElement.ownerDocument.window.layout.desktop;
NoSubject's avatar
NoSubject 已提交
46

R
roo00 已提交
47 48 49 50 51
                                MWF.xDesktop.requireApp("cms.Xform", "Form", function(){
                                    layout.appForm = new MWF.CMSForm($("layout"), preview.data);
                                    layout.appForm.app = {
                                        "options" : {
                                            "name" : "CMSDocument"
NoSubject's avatar
NoSubject 已提交
52
                                        },
R
roo00 已提交
53 54
                                        "content": document.body,
                                        "addEvent" : function(){}
NoSubject's avatar
NoSubject 已提交
55
                                    };
R
roo00 已提交
56 57 58 59 60 61 62 63 64 65 66 67 68
                                    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 已提交
69
                                });
R
roo00 已提交
70 71
                                //        }
                            };
NoSubject's avatar
NoSubject 已提交
72

U
unknown 已提交
73 74 75 76 77 78
                            // layout.load();
                            MWF.xDesktop.getServiceAddress(layout.config, function (service, center) {
                                layout.serviceAddressList = service;
                                layout.centerServer = center;
                                layout.load();
                            }.bind(this));
R
roo00 已提交
79
                        })();
NoSubject's avatar
NoSubject 已提交
80

R
roo00 已提交
81 82 83
                    });

                }.bind(this));
NoSubject's avatar
NoSubject 已提交
84 85 86 87 88
            });
        });
    </script>
</head>
<body style="overflow: auto">
NoSubject's avatar
NoSubject 已提交
89
<div id="appContent" style="overflow: auto">
NoSubject's avatar
NoSubject 已提交
90 91 92 93 94 95 96
    <div id="layout_top">

    </div>
    <div id="layout_form">
    </div>
</div>
</body>
R
roo00 已提交
97
</html>