示例#1
0
        protected override void Render(HtmlTextWriter writer)
        {
            StringBuilder  sb         = new StringBuilder();
            HtmlTextWriter tempWriter = new HtmlTextWriter(new StringWriter(sb));

            base.Render(tempWriter);
            tempWriter.Flush();
            tempWriter.Close();
            string page = MyCompany.Data.Localizer.Replace("Pages", Path.GetFileName(Request.PhysicalPath), sb.ToString());

            if (page.Contains("data-content-framework=\"bootstrap\""))
            {
                if (ApplicationServices.EnableCombinedCss)
                {
                    page = Regex.Replace(page, "_cf=\"", "_cf=bootstrap\"");
                }
                else
                if (ApplicationServices.IsTouchClient)
                {
                    page = Regex.Replace(page, "(<link\\s+href=\"[.\\w\\/]+?touch\\-theme\\..+?\".+?/>)", (("<link href=\"" + ResolveClientUrl(("~/css/sys/bootstrap.css?" + ApplicationServices.Version)))
                                                                                                           + "\" type=\"text/css\" rel=\"stylesheet\" />$1"));
                }
                else
                {
                    page = Regex.Replace(page, "\\/>\\s*<title>", (("/><link href=\"" + ResolveClientUrl(("~/css/sys/bootstrap.css?" + ApplicationServices.Version)))
                                                                   + "\" type=\"text/css\" rel=\"stylesheet\" /><title>"));
                }
            }
            ApplicationServices.CompressOutput(Context, HideUnauthorizedDataViews(page));
        }
示例#2
0
        protected override void Render(HtmlTextWriter writer)
        {
            // create page content
            StringBuilder  sb = new StringBuilder();
            HtmlTextWriter w  = new HtmlTextWriter(new StringWriter(sb));

            base.Render(w);
            w.Flush();
            w.Close();
            string content = sb.ToString();

            if (_isTouchUI)
            {
                // perform cleanup for super lightweight output
                content = Regex.Replace(content, "(<body([\\s\\S]*?)>\\s*)<form\\s+([\\s\\S]*?)</div>\\s*", "$1");
                content = Regex.Replace(content, "\\s*</form>\\s*(</body>)", "\r\n$1");
                content = Regex.Replace(content, "<script(?\'Attributes\'[\\s\\S]*?)>(?\'Script\'[\\s\\S]*?)</script>\\s*", DoValidateScript);
                content = Regex.Replace(content, "<title>\\s*([\\s\\S]+?)\\s*</title>", "<title>$1</title>");
                content = Regex.Replace(content, "<div>\\s*<input([\\s\\S]+?)VIEWSTATEGENERATOR([\\s\\S]+?)</div>", String.Empty);
                content = Regex.Replace(content, "<div.+?></div>.+?(<div.+?class=\"PageMenuBar\"></div>)\\s*", String.Empty);
                content = Regex.Replace(content, "\\$get\\(\".*?mb_d\"\\)", "null");
                content = Regex.Replace(content, "\\s*(<footer[\\s\\S]+?</small></footer>)\\s*", "$1");
                content = Regex.Replace(content, "\\s*type=\"text/javascript\"\\s*", " ");
            }
            content = Regex.Replace(content, "(>\\s+)//<\\!\\[CDATA\\[\\s*", "$1");
            content = Regex.Replace(content, "\\s*//\\]\\]>\\s*</script>", "\r\n</script>");
            content = Regex.Replace(content, "<div\\s+data-role\\s*=\"placeholder\"\\s+(?\'Attributes\'[\\s\\S]+?)>(?\'DefaultContent\'[\\s" +
                                    "\\S]*?)</div>", DoReplacePlaceholder);
            content = ResolveAppUrl(content);
            ApplicationServices.CompressOutput(Context, content);
        }
示例#3
0
        protected override void Render(HtmlTextWriter writer)
        {
            StringBuilder  sb         = new StringBuilder();
            HtmlTextWriter tempWriter = new HtmlTextWriter(new StringWriter(sb));

            base.Render(tempWriter);
            tempWriter.Flush();
            tempWriter.Close();
            ApplicationServices.CompressOutput(Context, MyLaboratorio.Data.Localizer.Replace("Pages", Path.GetFileName(Request.PhysicalPath), sb.ToString()));
        }
示例#4
0
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            string theme  = context.Request.QueryString["theme"];
            string accent = context.Request.QueryString["accent"];

            if (String.IsNullOrEmpty(theme) || String.IsNullOrEmpty(accent))
            {
                throw new HttpException(400, "Bad Request");
            }
            ApplicationServices services = new ApplicationServices();
            string css = ApplicationServices.Current.CompileThemeStylesheet(String.Format("touch-theme.{0}.{1}.css", theme, accent));

            context.Response.ContentType = "text/css";
            HttpCachePolicy cache = context.Response.Cache;

            cache.SetCacheability(HttpCacheability.Public);
            cache.SetOmitVaryStar(true);
            cache.SetExpires(System.DateTime.Now.AddDays(365));
            cache.SetValidUntilExpires(true);
            cache.SetLastModifiedFromFileDependencies();
            ApplicationServices.CompressOutput(context, css);
        }
示例#5
0
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            var theme  = context.Request.QueryString["theme"];
            var accent = context.Request.QueryString["accent"];

            if (string.IsNullOrEmpty(theme) || string.IsNullOrEmpty(accent))
            {
                throw new HttpException(400, "Bad Request");
            }
            var services = new ApplicationServices();
            var css      = new StylesheetGenerator(theme, accent).ToString();

            context.Response.ContentType = "text/css";
            var cache = context.Response.Cache;

            cache.SetCacheability(HttpCacheability.Public);
            cache.SetOmitVaryStar(true);
            cache.SetExpires(System.DateTime.Now.AddDays(365));
            cache.SetValidUntilExpires(true);
            cache.SetLastModifiedFromFileDependencies();
            ApplicationServices.CompressOutput(context, css);
        }
示例#6
0
        protected override void Render(HtmlTextWriter writer)
        {
            StringBuilder  sb         = new StringBuilder();
            HtmlTextWriter tempWriter = new HtmlTextWriter(new StringWriter(sb));

            base.Render(tempWriter);
            tempWriter.Flush();
            tempWriter.Close();
            string page = MyCompany.Data.Localizer.Replace("Pages", Path.GetFileName(Request.PhysicalPath), sb.ToString());

            if (page.Contains("data-content-framework=\"bootstrap\""))
            {
                if (ApplicationServices.EnableMinifiedCss)
                {
                    page = Regex.Replace(page, "_cf=\"", "_cf=bootstrap\"");
                }
                else
                {
                    page = Regex.Replace(page, "\\/>\\s*<title>", "/><link href=\"~/touch/bootstrap.css\" type=\"text/css\" rel=\"stylesheet\" /><title>");
                }
            }
            ApplicationServices.CompressOutput(Context, HideUnauthorizedDataViews(page));
        }