public static void RegisterBundles() { BundleManager.CreateCssBundle("Bootstrap", new CssFile("~/Content/css/site.css") ); BundleManager.CreateJsBundle("jquery", 1, new JavascriptFile("~/Scripts/lib/jquery/jquery-1.10.2.js"), new JavascriptFile("~/Scripts/lib/jquery/jquery.validate.js"), new JavascriptFile("~/Scripts/lib/jquery/jquery.validate.unobtrusive.bootstrap.js"), new JavascriptFile("~/Scripts/lib/jquery/jquery.hotkeys.js") ); BundleManager.CreateJsBundle("bootstrap", 3, new JavascriptFile("~/Scripts/lib/bootstrap/modernizr-2.6.2.js"), new JavascriptFile("~/Scripts/lib/bootstrap/bootstrap.min.js"), new JavascriptFile("~/Scripts/lib/bootstrap/respond.min.js"), new JavascriptFile("~/Scripts/lib/moment/moment-with-locales.min.js") ); BundleManager.CreateJsBundle("angular", 2, new JavascriptFile("~/Scripts/lib/anuglar/angular.js"), new JavascriptFile("~/Scripts/lib/anuglar/angular-animate.js"), new JavascriptFile("~/Scripts/lib/anuglar/angular-sanitize.js") ); BundleManager.CreateJsBundle("core", 4, new JavascriptFile("~/Scripts/lib/angular-ui/ui-bootstrap.js"), new JavascriptFile("~/Scripts/application.js") ); }
public void Ensure_Order_Correct() { var a1 = new List <CssFile> { new CssFile("/css/test1.css"), new CssFile("/css/test3.css"), new CssFile("/css/test2.css"), new CssFile("/css/test4.css") { Priority = 1 }, new CssFile("/css/test5.css") }; BundleManager.CreateCssBundle("Css1", a1.ToArray()); var bundle = BundleManager.GetCssBundles().First(); Assert.AreEqual(a1[3], (CssFile)bundle.Value.First()); var currentIndex = -1; //iterate except for the one with the priority foreach (CssFile b in bundle.Value.Except(new[] { (CssFile)a1[3] })) { var newIndex = a1.IndexOf(b); Assert.Greater(newIndex, currentIndex); currentIndex = newIndex; } }
public static void CreateBundles() { BundleManager.CreateCssBundle("CssBundle", new CssFile("~/Css/BundleTest/css1.css"), new CssFile("~/Css/BundleTest/css2.css"), new CssFile("~/Css/BundleTest/css3.css")); }
public static void CreateBundles() { #region Javascript Bundles BundleManager.CreateJsBundle(@"jQuery", new JavascriptFile(@"~/Scripts/jquery-3.1.1.js"), new JavascriptFile(@"~/Scripts/jquery-migrate-3.0.0.js"), new JavascriptFile(@"~/Scripts/jquery.easing.1.3.js")); BundleManager.CreateJsBundle(@"jQueryValidation", new JavascriptFile(@"~/Scripts/jquery.validate.js"), new JavascriptFile(@"https://ajax.aspnetcdn.com/ajax/mvc/5.1/jquery.validate.unobtrusive.min.js"), new JavascriptFile(@"~/Scripts/jquery.unobtrusive-ajax.js")); BundleManager.CreateJsBundle(@"bootstrap", new JavascriptFile(@"~/Scripts/bootstrap.js")); BundleManager.CreateJsBundle(@"globalScripts", new JavascriptFile(@"~/Scripts/scrolling-nav.js"), new JavascriptFile(@"~/Scripts/respond.js")); BundleManager.CreateJsBundle(@"kendo", new JavascriptFile(@"https://kendo.cdn.telerik.com/2017.2.504/js/jszip.min.js"), new JavascriptFile(@"https://kendo.cdn.telerik.com/2017.2.504/js/kendo.all.min.js"), new JavascriptFile(@"https://kendo.cdn.telerik.com/2017.2.504/js/kendo.aspnetmvc.min.js"), new JavascriptFile(@"~/Scripts/kendo.modernizr.custom.js")); #endregion #region Css Bundles BundleManager.CreateCssBundle(@"bootstrap", new CssFile(@"~/Content/bootstrap.css"), new CssFile(@"~/Content/bootstrap-theme.css")); BundleManager.CreateCssBundle(@"site", new CssFile(@"~/css/Site.css"), new CssFile(@"~/Content/font-awesome.css")); BundleManager.CreateCssBundle(@"kendo", new CssFile("https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.common.min.css"), new CssFile("https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.mobile.all.min.css"), new CssFile("https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.dataviz.min.css"), new CssFile("https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.metro.min.css"), new CssFile("https://kendo.cdn.telerik.com/2017.2.504/styles/kendo.dataviz.metro.min.css")); #endregion }
public void Can_Add_And_Retreive_Css_Bundle() { var a1 = new[] { new CssFile("/css/test1.css"), new CssFile("/css/test2.css"), new CssFile("/css/test3.css") }; var a2 = new[] { new CssFile("/css/test4.css"), new CssFile("/css/test5.css"), new CssFile("/css/test6.css") }; BundleManager.CreateCssBundle("Css1", a1); BundleManager.CreateCssBundle("Css2", a2); Assert.AreEqual(BundleManager.GetCssBundles().Count, 2); }
public void Can_Update_Css_Bundle() { var a1 = new[] { new CssFile("/css/test1.css"), new CssFile("/css/test2.css"), new CssFile("/css/test3.css") }; var a2 = new[] { new CssFile("/css/test4.css"), new CssFile("/css/test5.css"), new CssFile("/css/test6.css") }; BundleManager.CreateCssBundle("Css1", a1); //this will replace the previous one BundleManager.CreateCssBundle("Css1", a2); Assert.AreEqual(BundleManager.GetCssBundles().Count, 1); }
private void CreateBundles() { BundleManager.CreateCssBundle( "MasterCss", 1, new CssFile("~/css/bootstrap.css"), new CssFile("~/css/site.css")); BundleManager.CreateJsBundle( "MasterScripts", 1, new JavascriptFile("~/scripts/jquery-3.3.1.js"), new JavascriptFile("~/scripts/popper.js"), new JavascriptFile("~/scripts/bootstrap.js"), new JavascriptFile("~/scripts/site.js")); BundleManager.CreateJsBundle( "ValidationScripts", new JavascriptFile("~/scripts/jquery.validate.js"), new JavascriptFile("~/scripts/jquery.validate.unobtrusive.options.js"), new JavascriptFile("~/scripts/jquery.validate.unobtrusive.js")); }
private static void CreateBundles() { BundleManager.CreateCssBundle("Bootstrap", new CssFile("~/Content/bootstrap.css"), new CssFile("~/Content/bootstrap-theme.css"), new CssFile("~/Content/css/font-awesome.css"), new CssFile("~/Content/index-style.css"), new CssFile("~/Content/site.css"), new CssFile("~/Content/estilo.css")); BundleManager.CreateJsBundle("BaseJavascript", new JavascriptFile("~/Scripts/jquery.validate.js"), new JavascriptFile("~/Scripts/jquery.validate.unobtrusive.js"), new JavascriptFile("~/Scripts/bootstrap.js"), new JavascriptFile("~/Scripts/jquery.matchHeight.js"), new JavascriptFile("~/Scripts/raty/jquery.raty.js"), new JavascriptFile("~/Scripts/jquery.inputmask/jquery.inputmask-2.4.30.js"), new JavascriptFile("~/Scripts/jquery.inputmask/jquery.inputmask.numeric.extensions-2.4.30.js"), new JavascriptFile("~/Scripts/jquery.blockUI.js"), new JavascriptFile("~/scripts/bootbox.js"), new JavascriptFile("~/scripts/jquery.google-analytics.js") ); }