当前位置: 首页>>代码示例>>C#>>正文


C# Editor.LoadEditor方法代码示例

本文整理汇总了C#中Editor.LoadEditor方法的典型用法代码示例。如果您正苦于以下问题:C# Editor.LoadEditor方法的具体用法?C# Editor.LoadEditor怎么用?C# Editor.LoadEditor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Editor的用法示例。


在下文中一共展示了Editor.LoadEditor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: App

        public App(Server server, HttpContext context)
        {
            //the Pipeline.App is simply the first page request for a Rennder website.
            //Scaffold the HTML, load the Rennder Core, then load a web page.

            R = new Core(server, context, "", "app");
            R.App = this;
            R.isFirstLoad = true;

            //setup scaffolding variables
            scaffold = new Scaffold(R, "/app/pipeline/app.html", "", new string[]
            { "title", "description", "facebook", "theme-css", "website-css", "editor-css", "head-css", "favicon", "font-faces", "body-class", "custom-css",
              "background", "editor","webpage-class", "body-sides","body", "scripts", "https-url", "http-url"});

            //default favicon
            scaffold.Data["favicon"] = "/images/favicon.gif";

            //check for web bots such as gogle bot
            string agent = context.Request.Headers["User-Agent"].ToLower();
            if (agent.Contains("bot") | agent.Contains("crawl") | agent.Contains("spider"))
            {
                R.Page.useAJAX = false;
                R.Page.isBot = true;
            }

            //check for mobile agent
            if (agent.Contains("mobile") | agent.Contains("blackberry") | agent.Contains("android") | agent.Contains("symbian") | agent.Contains("windows ce") |
                agent.Contains("fennec") | agent.Contains("phone") | agent.Contains("iemobile") | agent.Contains("iris") | agent.Contains("midp") | agent.Contains("minimo") |
                agent.Contains("kindle") | agent.Contains("opera mini") | agent.Contains("opera mobi") | agent.Contains("ericsson") | agent.Contains("iphone") | agent.Contains("ipad"))
            {
                R.Page.isMobile = true;
            }

            //get browser type
            scaffold.Data["body-class"] = R.Util.GetBrowserType();

            //parse URL
            R.Page.GetPageUrl();
            if(R.isLocal == true)
            {
                scaffold.Data["https-url"] = "http://" + R.Page.Url.host.Replace("/","");
            }else
            {
                scaffold.Data["https-url"] = "https://" + R.Page.Url.host.Replace("/", "");
            }

            //get page Info
            SqlReader reader = R.Page.GetPageInfoFromUrlPath();
            if(reader.Rows.Count > 0)
            {
                //load initial web page
                R.Page.LoadPageInfo(reader);

                if(R.Page.pageId > 0)
                {
                    string js = "";

                    //load page
                    R.Page.LoadPage(R.Page.pageFolder + "page.xml", 1, R.Page.pageId, R.Page.pageTitle);

                    //load website.css
                    scaffold.Data["website-css"] = "/content/websites/" + R.Page.websiteId + "/website.css?v=" + R.Version;

                    //load iframe resize code, so if a Rennder web page is loaded within an iframe, it can communicate
                    //with the parent web page whenever the iframe resizes.
                    if (R.Request.Query[ "ifr"] == "1")
                    {
                        js += "var frameSize = 0;" + "function checkResize(){" + "var wurl = \"" + R.Request.Query["w"] + "\";" + "if(frameHeight != frameSize){" + "parent.postMessage(\"resize|\"+(frameHeight),wurl);" + "}" + "frameSize = frameHeight;" + "setTimeout(\"checkResize();\",1000);" + "}" + "checkResize();";
                        R.Page.isEditable = false;
                    }

                    //register app javascript
                    js += "R.init(" + R.Page.useAJAX.ToString().ToLower() + ",'" + R.ViewStateId + "',R.page.title);";
                    R.Page.RegisterJS("app", js);

                    //display Page Editor
                    if (R.Page.isEditable == true)
                    {
                        Editor editor = new Editor(R);
                        string[] result = editor.LoadEditor();
                        scaffold.Data["editor"] = result[0];
                        R.Page.RegisterJS("editor", result[1]);
                    }

                    //setup scripts
                    string scripts;
                    if(R.isLocal == true)
                    {
                        scripts = "<script type=\"text/javascript\" src=\"/scripts/utility/jquery-2.1.3.min.js\"></script>\n" +
                            "<script type=\"text/javascript\" src=\"/scripts/core/global.js\"></script>\n" +
                            "<script type=\"text/javascript\" src=\"/scripts/core/fixes.js\"></script>\n" +
                            "<script type=\"text/javascript\" src=\"/scripts/core/rml.js\"></script>\n" +
                            "<script type=\"text/javascript\" src=\"/scripts/core/view.js\"></script>\n" +
                            //"<script type=\"text/javascript\" src=\"/scripts/core/responsive.js\"></script>\n" +
                            "<script type=\"text/javascript\" src=\"/scripts/utility.js?v=" + R.Version + "\"></script>";
                        if(R.Page.isEditable == true)
                        {
                            scripts += "<script type=\"text/javascript\" src=\"/scripts/core/editor.js?v=" + R.Version + "\"></script>\n" +
                                "<script type=\"text/javascript\" src=\"/scripts/rangy/rangy-compiled.js?v=" + R.Version + "\"></script>\n" +
                                "<script type=\"text/javascript\" src=\"/scripts/utility/dropzone.js?v=" + R.Version + "\"></script>\n" +
//.........这里部分代码省略.........
开发者ID:nhtera,项目名称:Home,代码行数:101,代码来源:App.cs


注:本文中的Editor.LoadEditor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。