예제 #1
0
        public void MsMinifierTest()
        {
            var    javaScriptMinifier = MinifierFactory.Get <JavaScriptBundle, MsMinifier>();
            string minifiedJavaScript = javaScriptMinifier.Minify(javaScript);

            Assert.AreEqual("function product(n,t){return n*t}function sum(n,t){return n+t}", minifiedJavaScript);
        }
예제 #2
0
        public void JsMinMinifierTest()
        {
            var    javaScriptMinifier = MinifierFactory.Get <JavaScriptBundle, JsMinMinifier>();
            string minifiedJavaScript = javaScriptMinifier.Minify(javaScript);

            Assert.AreEqual("\nfunction product(a,b)\n{return a*b;}\nfunction sum(a,b){return a+b;}", minifiedJavaScript);
        }
예제 #3
0
        public void YuiMinifierTest()
        {
            var    javaScriptMinifier = MinifierFactory.Get <JavaScriptBundle, YuiMinifier>();
            string minifiedJavaScript = javaScriptMinifier.Minify(javaScript);

            Assert.AreEqual("function product(c,d){return c*d}function sum(c,d){return c+d};", minifiedJavaScript);
        }
        public override RazorCodeGenerator DecorateCodeGenerator(RazorCodeGenerator incomingCodeGenerator)
        {
            var minifier      = MinifierFactory.GetMinifier();
            var codeGenerator = CodeGeneratorFactory.GetCodeGenerator(this, incomingCodeGenerator, minifier);

            return(codeGenerator);
        }
예제 #5
0
        public void NullMinifierTest()
        {
            var    javaScriptMinifier = MinifierFactory.Get <JavaScriptBundle, NullMinifier>();
            string minifiedJavaScript = javaScriptMinifier.Minify(javaScript);

            Assert.AreEqual(javaScript + "\n", minifiedJavaScript);
        }
예제 #6
0
        public void NullCompressorTest()
        {
            var cssCompressor   = MinifierFactory.Get <CSSBundle, NullMinifier>();
            var uncompressedCss = cssCompressor.Minify(css);

            Assert.AreEqual(css + "\n", uncompressedCss);
        }
예제 #7
0
        public void MsCompressorTest()
        {
            var cssCompressor = MinifierFactory.Get <CSSBundle, MsMinifier>();
            var compressedCss = cssCompressor.Minify(css);

            Assert.AreEqual("li{margin-bottom:.1em;margin-left:0;margin-top:.1em}th{font-weight:normal;vertical-align:bottom}.FloatRight{float:right}.FloatLeft{float:left}", compressedCss);
        }
예제 #8
0
        public void MsMinifierTest()
        {
            var    javaScriptMinifier = MinifierFactory.Get <MsMinifier>();
            string minifiedJavaScript = javaScriptMinifier.Minify(javaScript);

            Assert.AreEqual("function product(a,b){return a*b}function sum(a,b){return a+b}", minifiedJavaScript);
        }
예제 #9
0
        public void NullCompressorTest()
        {
            var cssCompressor   = MinifierFactory.Get <NullCompressor>();
            var uncompressedCss = cssCompressor.Minify(css);

            Assert.AreEqual(css, uncompressedCss);
        }
예제 #10
0
    public void Page_PreRender(object sender, EventArgs e)
    {
        Customer _customer = CustomerSession.CurrentCustomer;

        if (_customer.CustomerRole == Role.Moderator)
        {
            var actions = RoleActionService.GetCustomerRoleActionsByCustomerId(_customer.Id);
            OnLineUsers.Visible = actions.Any(a => a.Key == RoleActionKey.DisplayOrders && a.Enabled);
        }

        OnLineUsers.Visible &= SettingsMain.EnableUserOnline;

        if (!FileHelpers.IsCombineCssJsExsist(true))
        {
            CacheManager.RemoveByPattern("squishit_");
        }

        headStyle.Text = Bundle.Css()
                         .Add("~/admin/css/jquery.tooltip.css")
                         .Add("~/admin/css/AdminStyle.css")
                         .Add("~/admin/css/catalogDataTreeStyles.css")
                         .Add("~/admin/css/exportFeedStyles.css")
                         .Add("~/admin/css/jqueryslidemenu.css")
                         .Add("~/css/jq/jquery.autocomplete.css")
                         .Add("~/css/advcss/modal.css")
                         .Add("~/js/plugins/progress/css/progress.css")
                         .Add("~/js/plugins/jpicker/css/jpicker.css")
                         .WithMinifier(MinifierFactory.Get <CSSBundle, YuiCompressor>())
                         .Render("~/admin/css/combined_#.css");

        // combine java
        headScript.Text = Bundle.JavaScript()
                          .Add("~/js/localization/" + SettingsMain.Language + "/lang.js")
                          .Add("~/js/jq/jquery-1.7.1.min.js")
                          .Add("~/js/jq/jquery.autocomplete.js")
                          .Add("~/js/jq/jquery.metadata.js")
                          .Add("~/js/fix/PIEInit.js")
                          .Add("~/js/advjs/advModal.js")
                          .Add("~/js/advjs/advTabs.js")
                          .Add("~/js/advjs/advUtils.js")
                          .Add("~/admin/js/jquery.cookie.min.js")
                          .Add("~/admin/js/jquery.qtip.min.js")
                          .Add("~/admin/js/jquery.tooltip.min.js")
                          .Add("~/admin/js/slimbox2.js")
                          .Add("~/admin/js/jquery.history.js")
                          .Add("~/admin/js/jquerytimer.js")
                          .Add("~/admin/js/jqueryslidemenu.js")
                          .Add("~/admin/js/admin.js")
                          .Add("~/admin/js/grid.js")
                          .Add("~/js/advantshop.js")
                          .Add("~/js/services/Utilities.js")
                          .Add("~/js/services/scriptsManager.js")
                          .Add("~/js/plugins/progress/progress.js")
                          .Add("~/js/plugins/jpicker/jpicker.js")
                          .WithMinifier(MinifierFactory.Get <JavaScriptBundle, YuiMinifier>())
                          .Render("~/admin/js/combined_#.js");
    }
예제 #11
0
    public void Page_PreRender(object sender, EventArgs e)
    {
        if (!FileHelpers.IsCombineCssJsExsist(false))
        {
            CacheManager.RemoveByPattern("squishit_");
        }

        // combine css

        headStyle.Text = Bundle.Css()
                         .Add("~/admin/css/jquery.tooltip.css")
                         .Add("~/admin/css/AdminStyle.css")
                         .Add("~/admin/css/catalogDataTreeStyles.css")
                         .Add("~/admin/css/exportFeedStyles.css")
                         .Add("~/admin/css/jqueryslidemenu.css")
                         .Add("~/css/jq/jquery.autocomplete.css")
                         .Add("~/css/advcss/modal.css")
                         .Add("~/css/advcss/progress.css")
                         .WithMinifier(MinifierFactory.Get <CSSBundle, YuiCompressor>())
                         .Render("~/admin/css/combined_#.css");

        // combine java
        headScript.Text = Bundle.JavaScript()
                          .Add("~/js/jq/jquery-1.7.1.min.js")
                          .Add("~/js/jq/jquery.autocomplete.js")
                          .Add("~/js/jq/jquery.metadata.js")
                          .Add("~/js/advjs/advModal.js")
                          .Add("~/js/advjs/advTabs.js")
                          .Add("~/js/advjs/advProgress.js")
                          .Add("~/js/advjs/advUtils.js")
                          .Add("~/admin/js/jquery.cookie.min.js")
                          .Add("~/admin/js/jquery.qtip.min.js")
                          .Add("~/admin/js/jquery.tooltip.min.js")
                          .Add("~/admin/js/slimbox2.js")
                          .Add("~/admin/js/jquery.history.js")
                          .Add("~/admin/js/jquerytimer.js")
                          .Add("~/admin/js/jqueryslidemenu.js")
                          .Add("~/admin/js/admin.js")
                          .Add("~/admin/js/grid.js")
                          .WithMinifier(MinifierFactory.Get <JavaScriptBundle, YuiMinifier>())
                          .Render("~/admin/js/combined_#.js");
    }
예제 #12
0
 public T WithMinifier <TMin>() where TMin : IMinifier <T>
 {
     Minifier = MinifierFactory.Get <T, TMin>();
     return((T)this);
 }
예제 #13
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!FileHelpers.IsCombineCssJsExsist(false))
        {
            CacheManager.RemoveByPattern("squishit_");
        }

        headStyle.Text = Bundle.Css()
                         .Add("css/normalize.css")
                         .Add("css/advcss/modal.css")
                         .Add("css/advcss/notify.css")

                         .Add("css/jq/jquery.cloud-zoom.css")
                         .Add("css/jq/jquery-ui-1.8.17.custom.css")
                         .Add("css/jq/jquery.autocomplete.css")
                         .Add("css/jq/jquery.fancybox-1.3.4.css")
                         .Add("css/jq/jquery.flexslider.css")
                         .Add("css/theme.css")
                         .Add("css/constructor.css")
                         .Add("css/carousel.css")
                         .Add("css/forms.css")
                         .Add("css/styles.css")
                         .Add("css/styles-extra.css")
                         .Add("css/validator.css")
                         .Add("js/plugins/jpicker/css/jpicker.css")
                         .Add("js/plugins/upper/css/upper.css")
                         .Add("js/plugins/expander/css/expander.css")
                         .Add("js/plugins/vote/css/vote.css")
                         .Add("js/plugins/progress/css/progress.css")
                         .Add("js/plugins/compare/css/compare.css")
                         .Add("js/plugins/spinbox/css/spinbox.css")
                         .Add("js/plugins/cart/css/cart.css")
                         .Add("js/plugins/scrollbar/css/scrollbar.css")
                         .Add("js/plugins/tabs/css/tabs.css")
                         .WithMinifier(MinifierFactory.Get <CSSBundle, YuiCompressor>())
                         .ForceDebug()
                         .Render("css/combined_#.css");

        headScript.Text = Bundle.JavaScript()
                          .Add("js/jq/jquery-1.7.1.min.js")
                          .Add("js/modernizr.custom.70373.js")
                          .Add("js/ejs_fulljslint.js")
                          .Add("js/ejs.js")
                          .WithMinifier(MinifierFactory.Get <JavaScriptBundle, YuiMinifier>())
                          .Render("js/combined_#.js");

        bottomScript.Text = Bundle.JavaScript()
                            .Add("~/js/fix/PIEInit.js")
                            .Add("~/js/localization/" + SettingsMain.Language + "/lang.js")
                            .Add("~/js/string.format-1.0.js")
                            .Add("~/js/advantshop.js")
                            .Add("~/js/services/Utilities.js")
                            .Add("~/js/services/scriptsManager.js")
                            .Add("~/js/jq/jquery-ui-1.8.17.custom.min.js")
                            .Add("~/js/jq/jquery.cloud-zoom.1.0.2.js")
                            .Add("~/js/jq/jquery.cookie.js")
                            .Add("~/js/jq/jquery.metadata.js")
                            .Add("~/js/jq/jquery.fancybox-1.3.4.js")
                            .Add("~/js/jq/jquery.flexslider.js")
                            .Add("~/js/jq/jquery.jcarousel.min.js")
                            .Add("~/js/jq/jquery.placeholder.js")
                            .Add("~/js/jq/jquery.validate.js")
                            .Add("~/js/jq/jquery.autocomplete.js")
                            .Add("~/js/jq/jquery.raty.js")
                            .Add("~/js/jq/jquery.mousewheel.js")
                            .Add("~/js/advjs/advDetectTouch.js")
                            .Add("~/js/advjs/advFeedback.js")
                            .Add("~/js/advjs/advNotify.js")
                            .Add("~/js/advjs/advModal.js")
                            .Add("~/js/advjs/advMoveCaret.js")
                            .Add("~/js/advjs/advGiftCertificate.js")
                            .Add("~/js/advjs/advMyAccount.js")
                            .Add("~/js/advjs/advOrderConfirmation.js")
                            .Add("~/js/advjs/advReviews.js")
                            .Add("~/js/advjs/advUtils.js")

                            .Add("~/js/plugins/cart/cart.js")
                            .Add("~/js/plugins/compare/compare.js")
                            .Add("~/js/plugins/expander/expander.js")
                            .Add("~/js/plugins/jpicker/jpicker.js")
                            .Add("~/js/plugins/progress/progress.js")
                            .Add("~/js/plugins/reviews/reviews.js")
                            .Add("~/js/plugins/scrollbar/scrollbar.js")
                            .Add("~/js/plugins/spinbox/spinbox.js")
                            .Add("~/js/plugins/tabs/tabs.js")
                            .Add("~/js/plugins/upper/upper.js")
                            .Add("~/js/plugins/vote/vote.js")

                            .Add("~/js/common.js")
                            .Add("~/js/constructor.js")
                            .Add("~/js/dopostback.js")
                            .Add("~/js/validateInit.js")
                            .WithMinifier(MinifierFactory.Get <JavaScriptBundle, YuiMinifier>())
                            .ForceDebug()
                            .Render("js/combined_#.js");
    }
예제 #14
0
    protected void Page_PreRender(object sender, EventArgs e)
    {
        if (!FileHelpers.IsCombineCssJsExsist(false))
        {
            CacheManager.RemoveByPattern("squishit_");
        }

        headStyle.Text = Bundle.Css()
                         .Add("css/normalize.css")
                         .Add("css/advcss/modal.css")
                         .Add("css/advcss/notify.css")

                         .Add("css/jq/jquery.cloud-zoom.css")
                         .Add("css/jq/jquery-ui-1.8.17.custom.css")
                         .Add("css/jq/jquery.autocomplete.css")
                         .Add("css/jq/jquery.fancybox-1.3.4.css")
                         .Add("css/jq/jquery.flexslider.css")
                         .Add("css/theme.css")
                         .Add("css/constructor.css")
                         .Add("css/carousel.css")
                         .Add("css/forms.css")
                         .Add("css/styles.css")
                         .Add("css/styles-extra.css")
                         .Add("css/validator.css")
                         .Add("js/plugins/jpicker/css/jpicker.css")
                         .Add("js/plugins/upper/css/upper.css")
                         .Add("js/plugins/expander/css/expander.css")
                         .Add("js/plugins/vote/css/vote.css")
                         .Add("js/plugins/progress/css/progress.css")
                         .Add("js/plugins/compare/css/compare.css")
                         .Add("js/plugins/spinbox/css/spinbox.css")
                         .Add("js/plugins/cart/css/cart.css")
                         .Add("js/plugins/scrollbar/css/scrollbar.css")
                         .Add("js/plugins/tabs/css/tabs.css")

                         //.Add("images/BoschMain/main.css")//Added by Evgeni
                         // .Add("images/BoschMain/main.css")//Added by Evgeni

                         .WithMinifier(MinifierFactory.Get <CSSBundle, YuiCompressor>())
                         .Render("css/combined_#.css");

        headScript.Text = Bundle.JavaScript()
                          .Add("js/jq/jquery-1.7.1.min.js")
                          .Add("js/modernizr.custom.70373.js")
                          .Add("js/ejs_fulljslint.js")
                          .Add("js/ejs.js")
                          .WithMinifier(MinifierFactory.Get <JavaScriptBundle, YuiMinifier>())
                          .Render("js/combined_#.js");

        bottomScript.Text = Bundle.JavaScript()
                            .Add("js/fix/PIEInit.js")
                            .Add("js/localization/" + SettingsMain.Language + "/lang.js")
                            .Add("js/string.format-1.0.js")
                            .Add("js/advantshop.js")
                            .Add("js/services/Utilities.js")
                            .Add("js/services/scriptsManager.js")

                            .Add("js/jq/jquery-ui-1.8.17.custom.min.js")
                            .Add("js/jq/jquery.cloud-zoom.1.0.2.js")
                            .Add("js/jq/jquery.cookie.js")
                            .Add("js/jq/jquery.metadata.js")
                            .Add("js/jq/jquery.fancybox-1.3.4.js")
                            .Add("js/jq/jquery.flexslider.js")
                            .Add("js/jq/jquery.jcarousel.min.js")
                            .Add("js/jq/jquery.placeholder.js")
                            .Add("js/jq/jquery.validate.js")
                            .Add("js/jq/jquery.autocomplete.js")
                            .Add("js/jq/jquery.raty.js")
                            .Add("js/jq/jquery.mousewheel.js")

                            .Add("js/advjs/advBuyInOneClick.js")
                            .Add("js/advjs/advDetectTouch.js")
                            .Add("js/advjs/advFeedback.js")
                            .Add("js/advjs/advNotify.js")
                            .Add("js/advjs/advModal.js")
                            .Add("js/advjs/advMoveCaret.js")
                            .Add("js/advjs/advGiftCertificate.js")
                            .Add("js/advjs/advMyAccount.js")
                            .Add("js/advjs/advOrderConfirmation.js")
                            .Add("js/advjs/advReviews.js")
                            .Add("js/advjs/advUtils.js")

                            .Add("js/plugins/cart/cart.js")
                            .Add("js/plugins/compare/compare.js")
                            .Add("js/plugins/expander/expander.js")
                            .Add("js/plugins/jpicker/jpicker.js")
                            .Add("js/plugins/progress/progress.js")
                            .Add("js/plugins/reviews/reviews.js")
                            .Add("js/plugins/scrollbar/scrollbar.js")
                            .Add("js/plugins/spinbox/spinbox.js")
                            .Add("js/plugins/tabs/tabs.js")
                            .Add("js/plugins/upper/upper.js")
                            .Add("js/plugins/vote/vote.js")

                            .Add("js/common.js")
                            .Add("js/constructor.js")
                            .Add("js/dopostback.js")
                            .Add("js/validateInit.js")

                            //   .Add("images/BoschMain/jquery.nyroModal.custom.js")//Added by Evgeni
                            //    .Add("images/BoschMain/main.js")//Added by Evgeni
                            //   .Add("images/BoschMain/extends.divisionstartpage.js")//Added by Evgeni

                            .WithMinifier(MinifierFactory.Get <JavaScriptBundle, YuiMinifier>())
                            .Render("js/combined_#.js");

        int wishCount = ShoppingCartService.CurrentWishlist.Count;

        wishlistCount = string.Format("{0} {1}", wishCount == 0 ? "" : wishCount.ToString(CultureInfo.InvariantCulture),
                                      Strings.Numerals(wishCount, Resources.Resource.Client_MasterPage_WishList_Empty,
                                                       Resources.Resource.Client_MasterPage_WishList_1Product,
                                                       Resources.Resource.Client_MasterPage_WishList_2Products,
                                                       Resources.Resource.Client_MasterPage_WishList_5Products));

        headCustomMeta.Text = SettingsSEO.CustomMetaString;
    }