// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); //bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( // "~/Scripts/jquery.validate*")); var bundleHeadJs = new Bundle("~/bundles/jqueryval"); bundleHeadJs.Include("~/scripts/bootstrap.min.js"); bundleHeadJs.Include("~/Scripts/jquery.validate.min.js"); bundleHeadJs.Include("~/Scripts/jquery.validate.unobtrusive.min.js"); bundleHeadJs.Include("~/Scripts/jquery.unobtrusive-ajax.min.js"); bundleHeadJs.Include("~/Scripts/mvcfoolproof.unobtrusive.min.js"); bundleHeadJs.Transforms.Add(new JsMinify()); BundleTable.Bundles.Add(bundleHeadJs); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.js", "~/Scripts/respond.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/site.css")); }
public static void RegisterBundles(BundleCollection bundles) { BundleTable.EnableOptimizations = false; IBundleTransform[] jsTransforms = new IBundleTransform[0]; IBundleTransform[] cssTransforms = new IBundleTransform[0]; Bundle angularMaterialBundle = new Bundle("~/Areas/M/angular-material", cssTransforms); angularMaterialBundle.Include("~/Areas/M/Content/angular-material/angular-material.css"); angularMaterialBundle.Include("~/Areas/M/Content/angular-material/admins.style.css"); angularMaterialBundle.Include("~/Areas/M/Content/sections.css"); angularMaterialBundle.Include("~/Areas/M/app/MenuBar.StyleSheet.css"); bundles.Add(angularMaterialBundle); Bundle materialLiteBundle = new Bundle("~/Content/mdl", cssTransforms); materialLiteBundle.Include("~/Content/mdl-v1.1.2/material.css"); materialLiteBundle.Include("~/Areas/M/Content/table.style.css"); bundles.Add(materialLiteBundle); Bundle angularBundle = new Bundle("~/Areas/M/angular", jsTransforms); angularBundle.Include("~/Areas/M/Scripts/angular.js"); angularBundle.Include("~/Areas/M/Scripts/angular-aria.js"); angularBundle.Include("~/Areas/M/Scripts/angular-animate.js"); angularBundle.Include("~/Areas/M/Scripts/angular-material.js"); angularBundle.Include("~/Areas/M/Scripts/angular-route.js"); angularBundle.Include("~/Content/mdl-v1.1.2/material.js"); bundles.Add(angularBundle); Bundle appModuleBundle = new Bundle("~/Areas/M/module", jsTransforms); appModuleBundle.Include("~/Areas/M/app/app.module.js"); bundles.Add(appModuleBundle); Bundle controllerBundle = new Bundle("~/Areas/M/AngularControllers", jsTransforms); controllerBundle.Include("~/Areas/M/app/mainbar/mainbar.controller.js"); controllerBundle.Include("~/Areas/M/app/ckeditor/ck-editor.directive.js"); controllerBundle.Include("~/Areas/M/app/tests/tests.controller.js"); controllerBundle.Include("~/Areas/M/app/questions/questions.controller.js"); controllerBundle.Include("~/Areas/M/app/questions/questions-edit.controller.js"); controllerBundle.Include("~/Areas/M/app/questions/questions-add.controller.js"); controllerBundle.Include("~/Areas/M/app/sections/sections.controller.js"); controllerBundle.Include("~/Areas/M/app/sections/section-save.controller.js"); controllerBundle.Include("~/Areas/M/app/admins/admins.controller.js"); controllerBundle.Include("~/Areas/M/app/admins/admin-save.controller.js"); bundles.Add(controllerBundle); Bundle serviceBundle = new Bundle("~/Areas/M/AngularServices", jsTransforms); serviceBundle.Include("~/Areas/M/app/common/services/guids.service.js"); serviceBundle.Include("~/Areas/M/app/common/services/httpService.service.js"); serviceBundle.Include("~/Areas/M/app/tests/tests.service.js"); serviceBundle.Include("~/Areas/M/app/questions/questions.service.js"); serviceBundle.Include("~/Areas/M/app/sections/sections.service.js"); serviceBundle.Include("~/Areas/M/app/admins/admins.service.js"); bundles.Add(serviceBundle); }
protected void Application_Start(object sender, EventArgs e) { // Create frameworks bundle: JQuery and Underscore in our case var coreJs = new Bundle("~/core.js"); coreJs.IncludeDirectory("~/scripts/", "*.js"); BundleTable.Bundles.Add(coreJs); Debugger.Launch(); // Create app bundle: // main.html is underscore template // app.js is our simple application var appJs = new Bundle("~/app.js"); appJs.Include("~/scripts/app/main.html"); appJs.Include("~/scripts/app/example2.html"); appJs.Include("~/scripts/app/app.js"); //appJs.Transforms.Add(new NoTransform("text/javascript; charset=utf-8")); // You can minify bundle if you want //cartJs.Transform = new JsMinify(); appJs.Builder = new CompiledUndrescoreTemplatesBundler(); BundleTable.Bundles.Add(appJs); }
public static void RegisterBundles(BundleCollection bundles) { BundleTable.EnableOptimizations = false; IBundleTransform[] jsTransforms = new IBundleTransform[0]; IBundleTransform[] cssTransforms = new IBundleTransform[0]; Bundle angularMaterialBundle = new Bundle("~/Areas/M/angular-material", cssTransforms); angularMaterialBundle.Include("~/Areas/M/Content/angular-material/angular-material.css"); bundles.Add(angularMaterialBundle); Bundle angularBundle = new Bundle("~/Areas/M/angular", jsTransforms); angularBundle.Include("~/Areas/M/Scripts/angular.js"); angularBundle.Include("~/Areas/M/Scripts/angular-aria.js"); angularBundle.Include("~/Areas/M/Scripts/angular-animate.js"); angularBundle.Include("~/Areas/M/Scripts/angular-material.js"); angularBundle.Include("~/Areas/M/Scripts/angular-route.js"); bundles.Add(angularBundle); Bundle appModuleBundle = new Bundle("~/Areas/M/module", jsTransforms); appModuleBundle.Include("~/Areas/M/App/app.module.js"); bundles.Add(appModuleBundle); Bundle testsBundle = new Bundle("~/Areas/M/tests", jsTransforms); testsBundle.Include("~/Areas/M/App/Tests/Services/tests.service.js"); testsBundle.Include("~/Areas/M/App/Tests/tests.controller.js"); bundles.Add(testsBundle); }
/// <summary> /// Registers the styles. /// </summary> /// <param name="bundles">The bundles.</param> public static void RegisterStyles(BundleCollection bundles) { var attendeeLessBundle = new Bundle("~/AttendeeStyles/"); attendeeLessBundle.Include("~/Styles/Attendee/Variables.less"); attendeeLessBundle.IncludeDirectory("~/Styles/", "*.less", false); attendeeLessBundle.Include("~/Styles/Attendee/Global.less"); attendeeLessBundle.IncludeDirectory("~/Styles/Attendee/Pages", "*.less", false); attendeeLessBundle.Transforms.Add(new LessTransform()); attendeeLessBundle.Transforms.Add(new CssMinify()); bundles.Add(attendeeLessBundle); var organizerLessBundle = new Bundle("~/OrganizerStyles/"); organizerLessBundle.Include("~/Styles/Organizer/Variables.less"); organizerLessBundle.IncludeDirectory("~/Styles/", "*.less", false); organizerLessBundle.Include("~/Styles/Organizer/Global.less"); organizerLessBundle.IncludeDirectory("~/Styles/Organizer/Pages", "*.less", false); organizerLessBundle.Transforms.Add(new LessTransform()); organizerLessBundle.Transforms.Add(new CssMinify()); bundles.Add(organizerLessBundle); var mobileCssBundle = new Bundle("~/MobileStyles/"); mobileCssBundle.Include("~/Styles/Mobile/myevent.mobile.css"); mobileCssBundle.IncludeDirectory("~/Styles/Mobile/", "*.css", false); mobileCssBundle.Transforms.Add(new CssMinify()); bundles.Add(mobileCssBundle); }
public static void EnableRaphaelBundles(this BundleCollection bundles) { var raphaelJs = new Bundle("~/raphael/js"); raphaelJs.Include("~/Scripts/raphael-min.js"); raphaelJs.Include("~/Scripts/g.raphael-min.js"); raphaelJs.Include("~/Scripts/g.line-min.js"); bundles.Add(raphaelJs); }
public static void RegisterBundles_GetAPet(BundleCollection bundles) { BundleTable.EnableOptimizations = false; IBundleTransform[] jsTransforms = new IBundleTransform[0]; IBundleTransform[] cssTransforms = new IBundleTransform[0]; Bundle angularMaterialBundle = new Bundle("~/angular-material", cssTransforms); angularMaterialBundle.Include("~/Content/angular-material/angular-material.css"); angularMaterialBundle.Include("~/Content/angular-material/bootstrap.css"); bundles.Add(angularMaterialBundle); Bundle materialLiteBundle = new Bundle("~/Content/mdl", cssTransforms); materialLiteBundle.Include("~/Content/mdl-v1.1.2/material.css"); bundles.Add(materialLiteBundle); Bundle angularBundle = new Bundle("~/angular", jsTransforms); angularBundle.Include("~/Scripts/angular/angular.js"); angularBundle.Include("~/Scripts/angular/angular-aria.js"); angularBundle.Include("~/Scripts/angular/angular-animate.js"); angularBundle.Include("~/Scripts/angular/angular-material.js"); angularBundle.Include("~/Scripts/angular/angular-route.js"); angularBundle.Include("~/Content/mdl-v1.1.2/material.js"); bundles.Add(angularBundle); Bundle appModuleBundle = new Bundle("~/module", jsTransforms); appModuleBundle.Include("~/app/app.module.js"); bundles.Add(appModuleBundle); Bundle controllerBundle = new Bundle("~/AngularControllers", jsTransforms); controllerBundle.Include("~/app/home/home.controller.js"); controllerBundle.Include("~/app/home/home.service.js"); controllerBundle.Include("~/app/user/user.service.js"); controllerBundle.Include("~/app/user/userdetails.controller.js"); controllerBundle.Include("~/app/myPets/mypets.controller.js"); controllerBundle.Include("~/app/myPets/mypets.service.js"); controllerBundle.Include("~/app/myPets/pet-save.controller.js"); controllerBundle.Include("~/app/myPets/pet-edit.controller.js"); controllerBundle.Include("~/app/conversations/conversations.controller.js"); controllerBundle.Include("~/app/conversations/conversation.controller.js"); controllerBundle.Include("~/app/conversations/conversations.service.js"); controllerBundle.Include("~/app/conversations/messages.service.js"); controllerBundle.Include("~/app/myPets/pet.view.controller.js"); controllerBundle.Include("~/app/uploads/uploads.controller.js"); controllerBundle.Include("~/app/uploads/uploads.service.js"); controllerBundle.Include("~/app/uploads/loading-spinner.js"); bundles.Add(controllerBundle); }
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 public static void RegisterBundles(BundleCollection bundles) { //bundles.Add(new ScriptBundle("~/bundles/jquery").Include( // "~/Scripts/jquery-{version}.js")); //bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include( // "~/Scripts/jquery-ui-{version}.js")); //bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( // "~/Scripts/jquery.unobtrusive*", // "~/Scripts/jquery.validate*")); //// Use the development version of Modernizr to develop with and learn from. Then, when you're //// ready for production, use the build tool at http://modernizr.com to pick only the tests you need. //bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( // "~/Scripts/modernizr-*")); //bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); //bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( // "~/Content/themes/base/jquery.ui.core.css", // "~/Content/themes/base/jquery.ui.resizable.css", // "~/Content/themes/base/jquery.ui.selectable.css", // "~/Content/themes/base/jquery.ui.accordion.css", // "~/Content/themes/base/jquery.ui.autocomplete.css", // "~/Content/themes/base/jquery.ui.button.css", // "~/Content/themes/base/jquery.ui.dialog.css", // "~/Content/themes/base/jquery.ui.slider.css", // "~/Content/themes/base/jquery.ui.tabs.css", // "~/Content/themes/base/jquery.ui.datepicker.css", // "~/Content/themes/base/jquery.ui.progressbar.css", // "~/Content/themes/base/jquery.ui.theme.css")); var cssbundle = new Bundle("~/FrontContent/allstyles"); cssbundle.Include("~/FrontContent/css/bootstrap.min.css"); cssbundle.Include("~/FrontContent/css/animate.min.css"); cssbundle.Include("~/FrontContent/css/responsive.css"); bundles.Add(cssbundle); var bundle = new Bundle("~/FrontContent/javascript"); bundle.Include("~/FrontContent/js/jquery.js"); bundle.Include("~/FrontContent/js/bootstrap.min.js"); bundle.Include("~/FrontContent/js/lightbox.min.js"); bundle.Include("~/FrontContent/js/wow.min.js"); bundle.Include("~/FrontContent/js/main.js"); bundles.Add(bundle); BundleTable.EnableOptimizations = true; }
public static void RegisterBundles(BundleCollection bundles) { var cssBundle = new Bundle("~/content/css", new CssMinify()); cssBundle.Include("~/content/bootstrap.min.css"); cssBundle.Include("~/content/bootstrap-custom.css"); cssBundle.Include("~/content/bootstrap-responsive.min.css"); bundles.Add(cssBundle); var javascriptBundle = new Bundle("~/scripts/javascript", new JsMinify()); javascriptBundle.Include("~/scripts/bootstrap.min.js"); bundles.Add(javascriptBundle); BundleTable.EnableOptimizations = true; }
public static void Initialize(BundleManfest manifest) { IBundleTransform jstransformer; IBundleTransform csstransformer; #if DEBUG jstransformer = new PassThroughTransform("text/javascript"); csstransformer = new PassThroughTransform("text/css"); #else jstransformer = new JsMinify(); csstransformer = new CssMinify(); #endif foreach (var bs in manifest.JsBundles) { Bundle jsBundle = new Bundle(bs.SpecKey, jstransformer); jsBundle.Include(bs.FilePaths.ToArray()); BundleTable.Bundles.Add(jsBundle); } foreach (var bs in manifest.CssBundles) { Bundle cssBundle = new Bundle(bs.SpecKey, csstransformer); cssBundle.Include(bs.FilePaths.ToArray()); BundleTable.Bundles.Add(cssBundle); } }
private static Bundle GetBundle(string name, string[] paths, string namePrefix, string pathPrefix) { var bundle = new Bundle(string.Format("{0}/{1}", namePrefix, name)); foreach (var path in paths) bundle.Include(string.Format("{0}/{1}", pathPrefix, path)); return bundle; }
public static Bundle CreateBootstrapperXp(string msi) { var bootstrapper = new Bundle("TestInstaller", new ExePackage(@"..\documents\dotnetfx35setup.exe") { Name = "Microsoft .NET Framework 3.5", InstallCommand = "/passive /norestart", Permanent = true, Vital = true, DetectCondition = "NETFRAMEWORK35", Compressed = true }, new MsiPackage(msi)) { Version = Version, UpgradeCode = new Guid("4FD2A66C-1EDD-4812-9AB2-A4A3A13768B8"), Application = { AttributesDefinition = "ShowVersion=yes; ShowFilesInUse=yes; SuppressRepair=yes; SuppressOptionsUI=yes" }, }; bootstrapper.Include(WixExtension.NetFx); return(bootstrapper); }
// Called from Application_Start in Global.asax.cs public static void RegisterBundles() { var bundle = new Bundle("~/default", new TypeScriptTransformer()); bundle.Include("~/content/test.ts"); BundleTable.Bundles.Add(bundle); }
public static void RegisterBundles(BundleCollection bundles) { var cssTransformer = new CssTransformer(); var jsTransformer = new JsTransformer(); var commonStylesBundle = new Bundle("~/css"); commonStylesBundle.Include( "~/Content/less/bootstrap.less"); commonStylesBundle.Transforms.Add(cssTransformer); bundles.Add(commonStylesBundle); var modernizrBundle = new Bundle("~/modernizr"); modernizrBundle.Include("~/Scripts/modernizr-2.*"); modernizrBundle.Transforms.Add(jsTransformer); bundles.Add(modernizrBundle); var commonScriptsBundle = new Bundle("~/jquery"); commonScriptsBundle.Include( "~/Scripts/jquery-{version}.js", "~/Scripts/jquery-migrate-{version}.js" ); commonScriptsBundle.Transforms.Add(jsTransformer); bundles.Add(commonScriptsBundle); var jqueryDependentScriptsBundle = new Bundle("~/js"); jqueryDependentScriptsBundle.Include( "~/Scripts/bootstrap.js", "~/Scripts/jquery.validate.js", "~/Scripts/jquery.validate.unobtrusive.js" , "~/Scripts/jquery.unobtrusive-ajax.js"); jqueryDependentScriptsBundle.Transforms.Add(jsTransformer); bundles.Add(jqueryDependentScriptsBundle); }
private static bool HandleBundle(Bundle bundle, XmlNode node) { if (node == null || node.ChildNodes == null || node.ChildNodes.Count <= 0) { return(false); } bool hasEntry = false; foreach (XmlNode nodeFile in node.ChildNodes) { if (nodeFile.Name == "file") { if (string.IsNullOrWhiteSpace(nodeFile.InnerText) == false) { bundle.Include(nodeFile.InnerText.Trim()); hasEntry = true; } } else if (nodeFile.Name == "folder") { if (string.IsNullOrWhiteSpace(nodeFile.InnerText) == false) { string pattern = GetAttributeValue(nodeFile, "pattern"); if (string.IsNullOrWhiteSpace(pattern)) { throw new ApplicationException("Bundle的配置有误,folder节点必须配置pattern属性,请检查文件‘" + BundleConfigPath + "’"); } string includeSubfolderStr = GetAttributeValue(nodeFile, "includeSubfolder"); bool includeSubfolder = !string.Equals(includeSubfolderStr, "false", StringComparison.InvariantCultureIgnoreCase); hasEntry = true; } } } return(hasEntry); }
public static void RegisterBundles(BundleCollection bundles) { var cssTransformer = new CssTransformer(); var jsTransformer = new JsTransformer(); var nullOrderer = new NullOrderer(); var commonStylesBundle = new Bundle("~/Bundles/CommonStyles"); commonStylesBundle.Include( "~/Content/less/bootstrap.less", "~/Content/less/responsive.less"); commonStylesBundle.Transforms.Add(cssTransformer); commonStylesBundle.Orderer = nullOrderer; bundles.Add(commonStylesBundle); var commonScriptsBundle = new Bundle("~/Bundles/CommonScripts"); commonScriptsBundle.Include( "~/Scripts/jquery-{version}.js", "~/Scripts/less.min.js", "~/Scripts/bootstrap.js", "~/Scripts/angular.js", "~/Scripts/linq.js"); commonScriptsBundle.Transforms.Add(jsTransformer); commonScriptsBundle.Orderer = nullOrderer; bundles.Add(commonScriptsBundle); }
/// <summary> /// IncludeCoreJs_1 /// </summary> /// <param name="appJs">appjs</param> private static void IncludeCoreJs_5(Bundle appJs) { appJs.Include("~/scripts/Shared/Common/Praksys.UI.Logger.js", "~/scripts/controllers/DocumentViewerController.js", "~/scripts/services/DictionaryService.js", "~/scripts/controllers/AuthorityAdminController.js", "~/scripts/controllers/RolleSansvarController.js", "~/scripts/controllers/UploadUserController.js", "~/scripts/controllers/TeamBrugerController.js", "~/scripts/controllers/UpdatePasswordController.js", "~/scripts/controllers/TemplateController.js", "~/scripts/controllers/MessageController.js", "~/scripts/controllers/RolleController.js", "~/scripts/controllers/AssignTeamToBrugerController.js", "~/scripts/controllers/SagsrelevanteOplysningerController.js", "~/scripts/directives/pkview.js", "~/scripts/directives/Spinner.js", "~/scripts/directives/numericField.js", "~/scripts/directives/kendotooltip.js", "~/scripts/Shared/draggable.js", "~/scripts/directives/pksysTruncateLabel.js", "~/scripts/directives/SetZeroValueDirective.js", "~/scripts/directives/Hangfire.js", "~/scripts/directives/moveNext.js", "~/scripts/directives/addRow.js", "~/scripts/directives/moveNextGrid.js", "~/scripts/directives/noDirty.js"); }
/// <summary> /// IncludeCoreJs_1 /// </summary> /// <param name="appjs">appjs</param> private static void IncludeCoreJs_6(Bundle appjs) { appjs.Include( "~/scripts/Shared/ValidateOnHover.js", "~/scripts/directives/CheckBoxList.js", "~/scripts/Shared/SetFocus.js", "~/scripts/Shared/loader.js", "~/scripts/Shared/ngEnter.js", "~/scripts/directives/dynamicfield.js", "~/scripts/Shared/focusOnSelStart.js", "~/scripts/directives/ydelseNummer.js", "~/scripts/JSLinq/linq-vsdoc.js", "~/scripts/JSLinq/linq.js", "~/scripts/JSLinq/linq.min.js", "~/scripts/controllers/OrderReValidationController.js", "~/scripts/services/InputFormatService.js", "~/scripts/services/LAEnumerator.js", "~/scripts/services/UAEnumerator.js", "~/scripts/controllers/CoveringAreaMyndighedController.js", "~/scripts/controllers/DekningsomradeController.js", "~/scripts/Shared/ContextMenuHide.js", "~/scripts/cognos/CognosLauncher.js", "~/scripts/controllers/SogPaSagController.js", "~/scripts/controllers/TransferSagToUserController.js", "~/scripts/Shared/HangfireStatusPollingFactory.js", "~/scripts/controllers/TeamAddressController.js", "~/Scripts/services/CoreHelpers.js", "~/Scripts/services/Notification.js", "~/Scripts/services/CoreService.js", "~/Scripts/services/CoreUI.js", "~/Scripts/services/PageHelpers.js", "~/scripts/controllers/BeskederController.js"); }
public static Bundle Include(this Bundle bundle, IEnumerable <BundleItem> items) { foreach (var item in items) { var file = item.Item as ManifestBundleFile; var directory = item.Item as ManifestBundleDirectory; try { if (file != null) { bundle.Include(file.VirtualPath); } if (directory != null) { bundle.IncludeDirectory( directory.VirtualPath, directory.SearchPattern, directory.SearchSubdirectories); } } catch (Exception) { var notFoundPath = file?.VirtualPath ?? directory?.VirtualPath; ((ManifestModuleInfo)item.Module).Errors.Add($"Path not found ({notFoundPath})."); } } return(bundle); }
public static void RegisterBundles(BundleCollection bundles) { // javascript var jsBundle = new Bundle("~/bundles/js"); jsBundle.Orderer = new AsIsBundleOrdered(); jsBundle .Include("~/Scripts/jquery.js") .Include("~/Scripts/bootstrap.js") .Include("~/Scripts/highcharts.js") .Include("~/Scripts/highlight.js"); bundles.Add(jsBundle); // css var cssBundle = new Bundle("~/bundles/css"); cssBundle.Orderer = new AsIsBundleOrdered(); cssBundle .Include("~/Content/bootstrap.css") .Include("~/Content/bootstrap-theme.css") .Include("~/Content/spinner.css") .Include("~/Content/highlight.css") .Include("~/Content/site.css"); bundles.Add(cssBundle); // set optimization on BundleTable.EnableOptimizations = true; }
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/js/jquery") .Include("~/public/js/lib/jquery-{version}.js") .Include("~/public/js/lib/jquery.tmpl.js")); bundles.Add(new ScriptBundle("~/bundles/js/jqueryval").Include( "~/public/js/lib/jquery.unobtrusive*", "~/public/js/lib/jquery.validate*")); bundles.Add(new ScriptBundle("~/bundles/js/bootstrap") .Include("~/public/js/lib/bootstrap.js") .Include("~/public/js/lib/bootstrap-mvc.js")); bundles.Add(new ScriptBundle("~/bundles/js/game") .Include("~/public/js/Game.js")); var css = new Bundle("~/bundles/css/site"); css.Include("~/public/css/bootstrap.css") .Include("~/public/css/bootstrap-responsive.css") .Include("~/public/css/site.less"); css.Transforms.Add(new CssTransformer()); css.Orderer = new NullOrderer(); bundles.Add(css); }
public static Bundle IncludeFromSprocketFile(this Bundle bundle, string relativePath, string root) { if (string.IsNullOrWhiteSpace(relativePath)) { throw new ArgumentNullException("relativePath"); } if (string.IsNullOrWhiteSpace(root)) { throw new ArgumentNullException("root"); } if (!relativePath.StartsWith("~/")) { throw new ArgumentException("relativePath must start with ~/", relativePath); } relativePath = relativePath.Substring(2); var sprockets = new Sprockets(); var rootNode = sprockets.Scan(Path.Combine(root, relativePath)); var resolved = rootNode.ResolveDependencies(); return(bundle.Include(resolved.Select(node => ToAbsolutePath(node, root)).ToArray())); }
/// <summary> /// Registers the style bundles. /// </summary> /// <param name="bundles">The bundles.</param> private static void RegisterStyleBundles(BundleCollection bundles) { try { Bundle styleBundle = new Bundle("~/Styles/CommonStyle", new CustomCssMinify(), new CssMinify()); styleBundle.Include("~/Styles/jquery.mobile-1.4.2.min.css", "~/Styles/style.css"); BundleTable.Bundles.Add(styleBundle); styleBundle = new Bundle("~/Areas/Admin/Styles/CommonAdminStyle", new CustomCssMinify(), new CssMinify()); styleBundle.Include("~/Areas/Admin/Styles/bootstrap.css", "~/Areas/Admin/Styles/dataTables.bootstrap.css", "~/Areas/Admin/Styles/dataTables.responsive.css", "~/Areas/Admin/Styles/sb-admin-2.css", "~/Areas/Admin/Styles/metisMenu.min.css", "~/Areas/Admin/Styles/font-awesome.css"); BundleTable.Bundles.Add(styleBundle); styleBundle = new Bundle("~/Styles/MapStyle", new CustomCssMinify(), new CssMinify()); styleBundle.Include("~/Styles/litetooltip.min.css"); BundleTable.Bundles.Add(styleBundle); styleBundle = new Bundle("~/Styles/MapStyleForApps", new CustomCssMinify(), new CssMinify()); styleBundle.Include("~/Styles/DirectionStyle.css"); BundleTable.Bundles.Add(styleBundle); } catch (Exception ex) { ex.ExceptionValueTracker(bundles); } }
private static void AddDirectory([NotNull] Bundle bundle, [NotNull] string extension, [NotNull] string directory) { // Read the include.rules file in this directory, and add each included directory var includes = HostingEnvironment.VirtualPathProvider.GetFile( HostingEnvironment.VirtualPathProvider.CombineVirtualPaths(directory, "include.rules")); if (HostingEnvironment.VirtualPathProvider.FileExists(includes.VirtualPath)) { using (var reader = new StreamReader(includes.Open(), Encoding.UTF8)) { string include; while ((include = reader.ReadLine()) != null) { if (include.StartsWith("~/")) { AddDirectory(bundle, extension, include); } } } } bundle.Include($"{directory}*.{extension}"); foreach (var virtualDirectory in HostingEnvironment.VirtualPathProvider.GetDirectory(directory) .Directories.Cast <VirtualDirectory>()) { AddDirectory(bundle, extension, $"~{virtualDirectory.VirtualPath}/"); } }
/// <summary> /// IncludeCoreJs_1 /// </summary> /// <param name="appjs">appjs</param> private static void IncludeCoreJs_1(Bundle appjs) { appjs.Include("~/scripts/app/App.js", "~/Scripts/angular/toaster.js", "~/scripts/app/localize.js", "~/scripts/app/route.js", "~/scripts/Shared/Common/shortcutKeys-lib.js", "~/scripts/app/shortcutKeys.js", "~/scripts/app/spaGlobals.js", "~/scripts/app/ResourceDictionary.js", "~/Scripts/services/ExceptionHandler.js", "~/Scripts/angular/toaster.js", "~/scripts/controllers/LocaleController.js", "~/scripts/services/AuditLogService.js", "~/scripts/controllers/tabController.js", "~/scripts/controllers/HeaderController.js", "~/scripts/controllers/FooterController.js", "~/scripts/controllers/MenuController.js", "~/scripts/controllers/AddressGenericController.js", "~/Scripts/services/ValidationService.js", "~/scripts/controllers/ConfirmationController.js", "~/scripts/services/Praksys.UserInfo.js", "~/scripts/services/HotLinkAccessService.js", "~/scripts/services/Praksys.UI.GridExporter.js", "~/scripts/controllers/RabbitMQFejledeBeskederController.js"); }
public static Bundle IncludeT4MVC(this Bundle bundle, params string[] virtualPaths) { Arg.IsNotNull(() => bundle); bundle.Include(virtualPaths.Select(path => VirtualPathUtility.ToAppRelative(path)).ToArray()); return(bundle); }
public static void RegisterBundles(BundleCollection bundles) { bundles.UseCdn = true; var nullBuilder = new NullBuilder(); var cssTransformer = new CssTransformer(); var jsTransformer = new JsTransformer(); var nullOrderer = new NullOrderer(); /*Common Styles */ var commonStylesBundle = new Bundle("~/Bundles/CommonStyles"); commonStylesBundle.Include("~/Content/bootstrap.css"); commonStylesBundle.Builder = nullBuilder; commonStylesBundle.Transforms.Add(cssTransformer); commonStylesBundle.Orderer = nullOrderer; bundles.Add(commonStylesBundle); /*App Css */ var appStylesBundle = new Bundle("~/Bundles/AppStyles"); appStylesBundle.Include( "~/App/css/base.css", "~/App/css/custom.css"); appStylesBundle.Builder = nullBuilder; appStylesBundle.Transforms.Add(cssTransformer); appStylesBundle.Orderer = nullOrderer; bundles.Add(appStylesBundle); }
public static Bundle IncludeSubDir(this Bundle bundle, string path, string searchPattern) { var isStyleBundle = bundle is StyleBundle; if (isStyleBundle) { var rootPath = HttpContext.Current.Server.MapPath("~/"); var absolutePath = HttpContext.Current.Server.MapPath(path); var directoryInfo = new DirectoryInfo(absolutePath); var files = directoryInfo.GetFiles(searchPattern, SearchOption.AllDirectories); foreach (var file in files) { bundle.Include(file.FullName.Replace(rootPath, "~/").Replace('\\', '/'), new CssRewriteUrlTransformFixed()); } } else { bundle.IncludeDirectory(path, searchPattern, true); } return(bundle); }
public static Bundle IncludeCss(this Bundle bundle, IEnumerable <string> virtualPaths) { foreach (var item in virtualPaths) { bundle = bundle.Include(item, new CssRewriteUrlTransform()); } return(bundle); }
public static Bundle Add(this Bundle bundle, params string[] virtualPaths) { foreach (string virtualPath in virtualPaths) { EnumerateFiles(bundle, virtualPath); } return(bundle.Include(virtualPaths)); }
public static Bundle IncludeExisting(this Bundle bundle, params string[] virtualPaths) { foreach (string virtualPath in virtualPaths) { CheckExistence(virtualPath); } return(bundle.Include(virtualPaths)); }
protected void Include(IBundledFile bundledFile) { if (!PartOfBundle(bundledFile.OrignalUri)) { Bundle.Include(bundledFile.RelativeUri); _includedFiles[bundledFile.OrignalUri] = true; } }
public static Bundle Include(this Bundle bundle, IItemTransform transform, params string[] virtualPaths) { foreach (string virtualPath in virtualPaths) { bundle.Include(virtualPath, transform); } return(bundle); }
/// <summary> /// Required to use registry searches and many other non-default operations. /// </summary> /// <param name="bundle"></param> /// <returns>Same instance for chaining.</returns> public static Bundle IncludeWixUtilExtension(this Bundle bundle) { if (bundle is null) throw new ArgumentNullException(nameof(bundle)); bundle.Include(WixExtension.Util); return bundle; }
public static void RegisterBundles() { BundleTable.Bundles.Clear(); BundleTable.Bundles.ResetAll(); BundleTable.Bundles.Add(new StyleBundle("~/bundles/css") .Include("~/Content/bootstrap.css") .Include("~/Content/bootstrap-responsive.css") .Include("~/Content/css/fd.css")); var applicationRoot = HttpContext.Current.Server.MapPath("~"); var files = Directory.EnumerateFiles( applicationRoot + "/Scripts/Views/", "*.js", SearchOption.AllDirectories); var fileInfos = files.Where(file => true).Select(file => new FileInfo(file.ToLowerInvariant())).ToArray(); foreach (var source in fileInfos) { var script = File.ReadAllText(source.FullName); var match = DependencyRegex.Match(script); var bundlePath = "~/bundles/" + source.Name.Split('.')[0]; var bundle = new Bundle(bundlePath); while (match.Success) { var path = match.Groups["path"].Value; bundle.Include(path); match = match.NextMatch(); } bundle.Include("~/Scripts/Views/" + source.Directory.Name + "/" + source.Name); #if !DEBUG bundle.Transforms.Add(new JsMinify()); #endif BundleTable.Bundles.Add(bundle); } BundleTable.EnableOptimizations = true; }
public static void EnableBootstrapBundles(this BundleCollection bundles) { var bootstrapCss = new Bundle("~/bootstrap/css", new CssMinify()); bootstrapCss.Include("~/Content/bootstrap.css"); bootstrapCss.Include("~/Content/bootstrap-responsive.css"); bootstrapCss.Include("~/Content/application.css"); bundles.Add(bootstrapCss); var bootstrapJs = new Bundle("~/bootstrap/js", new JsMinify()); bootstrapJs.Include("~/Scripts/jquery-1.7.1.js"); bootstrapJs.Include("~/Scripts/bootstrap.js"); bootstrapJs.Include("~/Scripts/jquery.unobtrusive-ajax.js"); bootstrapJs.Include("~/Scripts/jquery.validate.js"); bootstrapJs.Include("~/Scripts/jquery.validate.unobtrusive.js"); bootstrapJs.Include("~/Scripts/knockout.js"); bootstrapJs.Include("~/Scripts/modernizr-2.5.3.js"); bootstrapJs.Include("~/Scripts/site.js"); bundles.Add(bootstrapJs); }
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254726 public static void RegisterBundles(BundleCollection bundles) { //This setting is used when if you have specfied the path Using System.web.Optimization.bundle.Cdnpath then it will try to fetch data from there first bundles.UseCdn = true; //NullBuilder class is responsible for prevention of early applying of the item transformations and combining of code. var nullBuilder = new NullBuilder(); //StyleTransformer and ScriptTransformer classes produce processing of stylesheets and scripts. var styleTransformer = new StyleTransformer(); var scriptTransformer = new ScriptTransformer(); //NullOrderer class disables the built-in sorting mechanism and save assets sorted in the order they are declared. var nullOrderer = new NullOrderer(); //create your own scriptbundle var scriptbundleToObfuscate = new Bundle("~/bundles/WebFormsJs"); scriptbundleToObfuscate.Include("~/Scripts/WebForms/WebForms.js", "~/Scripts/WebForms/WebUIValidation.js", "~/Scripts/WebForms/MenuStandards.js", "~/Scripts/WebForms/Focus.js", "~/Scripts/WebForms/GridView.js", "~/Scripts/WebForms/DetailsView.js", "~/Scripts/WebForms/TreeView.js", "~/Scripts/WebForms/WebParts.js"); scriptbundleToObfuscate.Builder = nullBuilder; scriptbundleToObfuscate.Transforms.Add(scriptTransformer); scriptbundleToObfuscate.Orderer = nullOrderer; bundles.Add(scriptbundleToObfuscate); //bundles.Add(new ScriptBundle("~/bundles/WebFormsJs").Include( // "~/Scripts/WebForms/WebForms.js", // "~/Scripts/WebForms/WebUIValidation.js", // "~/Scripts/WebForms/MenuStandards.js", // "~/Scripts/WebForms/Focus.js", // "~/Scripts/WebForms/GridView.js", // "~/Scripts/WebForms/DetailsView.js", // "~/Scripts/WebForms/TreeView.js", // "~/Scripts/WebForms/WebParts.js")); bundles.Add(new ScriptBundle("~/bundles/MsAjaxJs").Include( "~/Scripts/WebForms/MsAjax/MicrosoftAjax.js", "~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js", "~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js", "~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js")); // Use the Development version of Modernizr to develop with and learn from. Then, when you’re // ready for production, use the build tool at http://modernizr.com to pick only the tests you need bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); BundleTable.EnableOptimizations = true; }
public static void RegisterBundles(BundleCollection bundles) { var combined = new Bundle( "~/scripts/combined", new CombinedCoffeeScriptTransform(), new JsMinify()); combined.Include( "~/Scripts/jquery-{version}.js", "~/Scripts/coffeescript/app.coffee"); bundles.Add(combined); }
private static Bundle createBundle(string name, string[] paths, string type) { var bundle = new Bundle(name); foreach (string s in paths) { bundle.Include(s); } bundle.Builder = nullBuilder; if (type.Equals("style")) bundle.Transforms.Add(styleTransformer); else if (type.Equals("script")) bundle.Transforms.Add(scriptTransformer); bundle.Orderer = nullOrderer; return bundle; }
public static void RegisterBundles(BundleCollection bundles) { var stylesBundle = new Bundle("~/Static/Styles"); stylesBundle.Include("~/Static/css/site.css"); bundles.Add(stylesBundle); var scriptsBundle = new ScriptBundle("~/Static/Scripts"); scriptsBundle.Include( "~/Static/lib/jquery-1.10.2.js", "~/Static/lib/bootstrap3/js/bootstrap.js", "~/Static/lib/knockout-3.2.0.js", "~/Static/lib/sprintf.js"); bundles.Add(scriptsBundle); }
public static void RegisterBundles() { BundleCollection bundles = BundleTable.Bundles; bundles.UseCdn = true; var cssBundle = new Bundle("~/bundles/css"); cssBundle.Include("~/Content/bootstrap/bootstrap.less"); cssBundle.Include("~/Content/main.less"); cssBundle.Include("~/Content/bootstrap/theme.less"); cssBundle.Transforms.Add(new LessTransform()); cssBundle.Transforms.Add(new CssInlineImagesTransform()); var modernizrBundle = new Bundle("~/bundles/modernizr"); modernizrBundle.Include("~/Scripts/modernizr-2.8.3.js"); var scriptBundle = new Bundle("~/bundles/js"); scriptBundle.Include("~/Scripts/jquery-2.1.1.js"); scriptBundle.Include("~/Scripts/bootstrap.js"); scriptBundle.Include("~/Scripts/holder.js"); #if !DEBUG var cssMin = new YuiCssMinify(); var scriptMin = new YuiJsMinify(); cssBundle.Transforms.Add(cssMin); modernizrBundle.Transforms.Add(scriptMin); scriptBundle.Transforms.Add(scriptMin); BundleTable.EnableOptimizations = true; #endif bundles.Add(cssBundle); bundles.Add(modernizrBundle); bundles.Add(scriptBundle); RouteTable.Routes.AddBundleRoutes(); }
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 public static void RegisterBundles(BundleCollection bundles) { SetupIgnorePatterns(bundles.IgnoreList); bundles.Add(new StyleBundle("~/Content/kendoui/css") .Include("~/Content/KendoUI/kendo.common.min.css","~/Content/KendoUI/kendo.default.min.css")); Bundle bootstrapBundle = new StyleBundle("~/Content/bootstrap/css/styles"); bootstrapBundle.Include("~/Content/bootstrap/css/bootstrap.css", "~/Content/bootstrap/css/bootstrap-responsive.css"); bundles.Add(bootstrapBundle); Bundle flattyBundle = new StyleBundle("~/Content/flatty/stylesheets/styles"); flattyBundle.Include("~/Content/flatty/stylesheets/dark-theme.css", "~/Content/flatty/stylesheets/theme-colors.css", "~/Content/flatty/stylesheets/plugins/tabdrop/tabdrop.css"); bundles.Add(flattyBundle); Bundle cssBundle = new StyleBundle("~/Content/css/styles"); cssBundle.IncludeDirectory("~/Content/css", "*.css"); cssBundle.IncludeDirectory("~/Content", "*.css"); bundles.Add(cssBundle); Bundle lessBundle = new Bundle("~/Content/less", new LessMinify()); lessBundle.Include("~/Content/Site.less"); bundles.Add(lessBundle); Bundle scriptBundle = new ScriptBundle("~/bundles/scripts"); scriptBundle.Include("~/Scripts/jquery-{version}.js"); scriptBundle.Include("~/Scripts/knockout-{version}.js"); scriptBundle.Include("~/Scripts/knockout.mapping-latest.js"); scriptBundle.Include("~/Scripts/knockout.validation.js"); scriptBundle.Include("~/Scripts/kendo.web.min.js"); scriptBundle.Include("~/Scripts/knockout-kendo.min.js"); scriptBundle.Include("~/Scripts/jquery.history.js"); scriptBundle.Include("~/Scripts/moment.js"); scriptBundle.Include("~/Scripts/signals.min.js"); scriptBundle.Include("~/Scripts/crossroads.min.js"); scriptBundle.Include("~/Content/bootstrap/js/bootstrap.js"); scriptBundle.Include("~/Scripts/select2.js"); scriptBundle.Include("~/Content/flatty/javascripts/plugins/mobile_events/jquery.mobile-events.min.js"); scriptBundle.Include("~/Content/flatty/javascripts/jquery/jquery-migrate.min.js"); scriptBundle.Include("~/Content/flatty/javascripts/nav.js"); scriptBundle.Include("~/Content/flatty/javascripts/plugins/tabdrop/bootstrap-tabdrop.js"); scriptBundle.Include("~/Scripts/toastr.js"); scriptBundle.IncludeDirectory("~/App/Global", "*.js", true); scriptBundle.IncludeDirectory("~/App", "*.js", true); bundles.Add(scriptBundle); // Uncomment to see release configuration bundling. //BundleTable.EnableOptimizations = true; }
public static void RegisterBundles(BundleCollection bundles) { var cssTransformer = new CssTransformer(); var jsTransformer = new JsTransformer(); var nullOrderer = new NullOrderer(); var commonStylesBundle = new Bundle("~/Bundles/Styles"); commonStylesBundle.Include( "~/stylesheets/screen.css"); commonStylesBundle.Transforms.Add(cssTransformer); commonStylesBundle.Orderer = nullOrderer; bundles.Add(commonStylesBundle); //var modernizrBundle = new Bundle("~/Bundles/Modernizr"); //modernizrBundle.Include("~/Scripts/modernizr-2.*"); //modernizrBundle.Transforms.Add(jsTransformer); //modernizrBundle.Orderer = nullOrderer; //bundles.Add(modernizrBundle); var commonScriptsBundle = new Bundle("~/Bundles/ProjectAether"); commonScriptsBundle.Include(//"~/ProjectAether/libs/knockout.debug.js", "~/libs/underscore.js", "~/libs/underscore-ko-1.1.0.js", "~/libs/hash/jshashset.js", "~/libs/hash/jshashtable.js", "~/app/helper.js") .IncludeDirectory("~/app", "*.js", true); commonScriptsBundle.Transforms.Add(jsTransformer); commonScriptsBundle.Orderer = nullOrderer; bundles.Add(commonScriptsBundle); var testScriptsBundle = new Bundle("~/Bundles/Tests"); testScriptsBundle.Include(//"~/ProjectAether/libs/knockout.debug.js", "~/libs/underscore.js", "~/libs/underscore-ko-1.1.0.js", "~/libs/hash/jshashset.js", "~/libs/hash/jshashtable.js", "~/app/helper.js") .IncludeDirectory("~/tests/app", "*.js", true); testScriptsBundle.Transforms.Add(jsTransformer); testScriptsBundle.Orderer = nullOrderer; bundles.Add(testScriptsBundle); }
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { var nullBuilder = new NullBuilder(); var styleTransformer = new StyleTransformer(); var scriptTransformer = new ScriptTransformer(); var nullOrderer = new NullOrderer(); BundleResolver.Current = new CustomBundleResolver(); var cssBundle = new Bundle("~/Content/css"); cssBundle.Include( "~/Content/bootstrap.css", "~/Content/Site.css", "~/Content/Bootstrap/kendo.common-bootstrap.min.css", "~/Content/Bootstrap/kendo.bootstrap.min.css", "~/Scripts/Toastr/toastr.min.css" ); cssBundle.Builder = nullBuilder; cssBundle.Transforms.Add(styleTransformer); cssBundle.Orderer = nullOrderer; bundles.Add(cssBundle); var jsMainBundle = new Bundle("~/bundles/js"); jsMainBundle.Include( "~/Scripts/jquery-1.11.1.min.js", "~/Scripts/bootstrap.min.js", "~/Scripts/jquery.unobtrusive-ajax.min.js", "~/Scripts/Toastr/ToastrWrapper.js", "~/Scripts/Toastr/toastr.min.js", "~/Scripts/Kendo/kendo.web.min.js", "~/Scripts/Kendo/kendo.culture.ru-RU.min.js", "~/Scripts/Angular/angular.min.js", "~/Scripts/Kendo/kendo.angular.min.js" ); jsMainBundle.Builder = nullBuilder; jsMainBundle.Transforms.Add(scriptTransformer); jsMainBundle.Orderer = nullOrderer; bundles.Add(jsMainBundle); var jsVendorAppBulk = new Bundle("~/bundles/jsVendorApp"); jsVendorAppBulk.Include( "~/Scripts/Angular/vendorApp.js" ); jsVendorAppBulk.Builder = nullBuilder; jsVendorAppBulk.Transforms.Add(scriptTransformer); jsVendorAppBulk.Orderer = nullOrderer; bundles.Add(jsVendorAppBulk); }
public static void RegisterBundles(BundleCollection bundles) { Bundle jsBundle = new Bundle("~/bundles/WebFormsJs", new JsMinify()); jsBundle.Include("~/Scripts/WebForms/WebForms.js"); jsBundle.Include("~/Scripts/WebForms/MenuStandards.js"); jsBundle.Include("~/Scripts/WebForms/Focus.js"); jsBundle.Include("~/Scripts/WebForms/GridView.js"); jsBundle.Include("~/Scripts/WebForms/DetailsView.js"); jsBundle.Include("~/Scripts/WebForms/TreeView.js"); jsBundle.Include("~/Scripts/WebForms/WebParts.js"); bundles.Add(jsBundle); // Order is very important for these files to work, they have explicit dependencies Bundle ajaxBundle = new Bundle("~/bundles/MsAjaxJs", new JsMinify()); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjax.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxCore.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxSerialization.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxNetwork.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebServices.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxApplicationServices.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxComponentModel.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxGlobalization.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxTimer.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxHistory.js"); ajaxBundle.Include("~/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js"); bundles.Add(ajaxBundle); Bundle cssBundle = new Bundle("~/Content/css", new CssMinify()); cssBundle.Include("~/Content/site.css"); bundles.Add(cssBundle); Bundle jqueryUiCssBundle = new Bundle("~/Content/themes/base/css", new CssMinify()); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.core.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.resizable.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.selectable.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.accordion.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.autocomplete.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.button.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.dialog.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.slider.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.tabs.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.datepicker.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.progressbar.css"); jqueryUiCssBundle.Include("~/Content/themes/base/jquery.ui.theme.css"); bundles.Add(jqueryUiCssBundle); }
public static void RegisterBundles(BundleCollection bundles) { var css = new Bundle("~/public/static/css", new CssMinify()); css.Include("~/Public/css/bootstrap.css") .Include("~/Public/css/bootstrap-responsive.css") .Include("~/Public/css/fonts.css"); bundles.Add(css); var less = new Bundle("~/public/static/less", new LessTransform(), new CssMinify()); less.Include("~/Public/css/styles.less"); bundles.Add(less); var js = new Bundle("~/public/static/js", new JsMinify()); js.Include("~/Public/js/lib/jquery-1*") .Include("~/Public/js/lib/bootstrap.js") .Include("~/Public/js/lib/spin.js") .Include("~/Public/js/lib/jquery.spin.js") .Include("~/Public/js/scripts.js"); bundles.Add(js); }
/// <summary> /// See http://www.codeproject.com/Articles/863295/Hack-proof-your-Javascript-using-javascript-Obfusc /// </summary> /// <param name="bundles"></param> private static void _RegisterObfuscatedScriptsBundle(BundleCollection bundles) { // This setting is used when if you have specfied the path Using System.web.Optimization.bundle.Cdnpath then // it will try to fetch data from there first bundles.UseCdn = true; // NullBuilder class is responsible for prevention of early applying of the item transformations and combining of code. var nullBuilder = new NullBuilder(); /* // Replace a default bundle resolver in order to the debugging HTTP-handler // can use transformations of the corresponding bundle BundleResolver.Current = new CustomBundleResolver(); */ // StyleTransformer and ScriptTransformer classes produce processing of stylesheets and scripts. var styleTransformer = new StyleTransformer(); var scriptTransformer = new ScriptTransformer(); // NullOrderer class disables the built-in sorting mechanism and save assets sorted in the order they are declared. var nullOrderer = new NullOrderer(); // create your own scriptbundle var obfuscatedScriptBundle = new Bundle("~/Bundles/Gallery") { Builder = nullBuilder, Orderer = nullOrderer }; obfuscatedScriptBundle.Include( "~/Scripts/jquery-{version}.js", "~/Scripts/knockout-{version}.js", "~/Scripts/date.format.js", "~/Scripts/jquery.extensions.js", "~/Scripts/root.extensions.js", "~/Scripts/root.gallery.js", "~/Scripts/root.photo-box.js", "~/Scripts/root.slider.js"); obfuscatedScriptBundle.Transforms.Add(scriptTransformer); bundles.Add(obfuscatedScriptBundle); }
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 public static void RegisterBundles(BundleCollection bundles) { bundles.Add( new ScriptBundle("~/bundles/jquery") .Include("~/Scripts/jquery-{version}.js") .Include("~/Scripts/jquery.numeric.js") .Include("~/Scripts/autoEmpty.js") ); //bundles.Add( // new ScriptBundle("~/bundles/jwplayer") // .Include("~/Scripts/jwplayer/jwplayer.js") //); Bundle tagBundle = new Bundle("~/bundles/tags", new JsMinify()); tagBundle.Include("~/Scripts/Tagging.js"); bundles.Add(tagBundle); Bundle cssBundle = new Bundle("~/Content/cssbundle/"); cssBundle.Include("~/Content/css/styles.css"); bundles.Add(cssBundle); }
public static void RegisterBundles(BundleCollection bundles) { var less = new Bundle("~/css"); less.Transforms.Add(new CssTransformer()); less.Include("~/Content/Mat.less"); BundleTable.Bundles.Add(less); bundles.Add(new ScriptBundle("~/bundles/js") .Include("~/Scripts/jquery*", "~/Scripts/knockout-*", "~/Scripts/prefixfree.*", "~/Scripts/mat.js")); bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-1.*")); bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include( "~/Scripts/jquery-ui*")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*")); bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( "~/Content/themes/base/jquery.ui.core.css", "~/Content/themes/base/jquery.ui.resizable.css", "~/Content/themes/base/jquery.ui.selectable.css", "~/Content/themes/base/jquery.ui.accordion.css", "~/Content/themes/base/jquery.ui.autocomplete.css", "~/Content/themes/base/jquery.ui.button.css", "~/Content/themes/base/jquery.ui.dialog.css", "~/Content/themes/base/jquery.ui.slider.css", "~/Content/themes/base/jquery.ui.tabs.css", "~/Content/themes/base/jquery.ui.datepicker.css", "~/Content/themes/base/jquery.ui.progressbar.css", "~/Content/themes/base/jquery.ui.theme.css")); }
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( "~/Scripts/bootstrap.js", "~/Scripts/respond.js")); bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/site.css")); var appBundle = new Bundle("~/bundles/app", new TypeScriptTransformer()); appBundle.Include("~/scripts/app/*.ts"); BundleTable.Bundles.Add(appBundle); }
private MvcHtmlString InsertCss_Bundled(transformType ttype) { var files = new HashSet<string>(); var bundles = BundleTable.Bundles; // BundleTable.Bundles.Clear(); IBundleTransform transform = ttype == transformType.Compress ? new CssMinify() : null as IBundleTransform; var vpath = CombineUrlPath(LocalCssPath, BundleFile); var bundle = new Bundle(vpath, transform); foreach (var lib in Segments.stdFiles) { string name = lib.Css ?? lib.Name; if (!files.Contains(name)) { files.Add(name); if (name[0] == '/') { bundle.Include(name); } else { var sheet = CssDetails.FirstOrDefault(css => css.Name == name); if (sheet != null) bundle.Include(CombineUrlPath(LocalCssPath, sheet.PathName)); } } } bundles.Add(bundle); // var resp = bundle.GenerateBundleResponse(new BundleContext(this.httpcontext, bundles, this.LocalCssPath)); return new MvcHtmlString( String.Format(@"<link href=""{0}"" rel=""stylesheet"" type=""text/css"" />", bundles.ResolveBundleUrl(vpath))); }
internal static IHtmlString BaseBundle(MinifyType bundleType, string bundleName, params string[] filePaths) { var newFiles = CheckFiles(filePaths); if (newFiles == null) { return new HtmlString(string.Empty); } var bundles = BundleTable.Bundles; BundleTable.EnableOptimizations = EnableBundle; string name = ""; if (string.IsNullOrWhiteSpace(bundleName)) { name = BundleName; } IHtmlString htmlString = null; switch (bundleType) { case MinifyType.Javascript: //var bundle = new ScriptBundle(name); //bundle.Transforms.Add(new MyBundlePlatform("BEGIN TEST INTERFACE", "END TEST INTERFACE")); //bundle.Include(newFiles); var bundle = new Bundle(name, new MyBundlePlatform("// BEGIN TEST INTERFACE", "// END TEST INTERFACE")); bundle.Include(newFiles); bundles.Add(bundle); return Scripts.Render(name); case MinifyType.Css: bundles.Add(new StyleBundle(name).Include(newFiles)); return Styles.Render(name); } return new HtmlString(string.Empty); }
public static void addToBundleTable (string name, params string[][] jss) { Bundle res = new Bundle("~/" + name); foreach (var fn in jss.SelectMany(s => s)) res.Include("~/" + fn); BundleTable.Bundles.Add(res); }
public static void RegisterBundles(BundleCollection bundles) { try { var ignoreCompilationDebug = Settings.GetSetting("ignoreCompilationDebug") == "True" || string.IsNullOrEmpty(Settings.GetSetting("ignoreCompilationDebug")); if (ignoreCompilationDebug) { BundleTable.EnableOptimizations = true; } var cssTransformer = new StyleTransformer(); var jsTransformer = new ScriptTransformer(); var nullOrderer = new NullOrderer(); var doc = XDocument.Load(HttpContext.Current.Server.MapPath(Config.BundlesConfigPath)); foreach (string bundleType in "script,style".Split(',')) { foreach (var bundleElement in doc.Descendants(bundleType + "Bundle")) { var bundle = new Bundle(bundleElement.Attribute("virtualPath").Value); var bundleHasFiles = false; var dontMinify = bundleElement.Attribute("disableMinification") != null ? bundleElement.Attribute("disableMinification").Value == true.ToString() : false; foreach (var includeElement in bundleElement.Elements()) { var filePath = includeElement.Attribute("virtualPath").Value; string fullPath = null; try { fullPath = HttpContext.Current.Server.MapPath(filePath); } catch (Exception ex) { LogHelper.Warn<Exception>("Optmius skipped '" + filePath + "' in Bundle '" + bundle.Path + "' as the file path was invalid. Only application relative URLs (~/url) are allowed."); } if (fullPath != null) { bundle.Include(filePath); bundleHasFiles = true; } } if (bundleHasFiles) { if (bundleType == "script") { bundle.Transforms.Add(jsTransformer); if(!dontMinify) bundle.Transforms.Add(new JsMinify()); } else { bundle.Transforms.Add(cssTransformer); if(!dontMinify) bundle.Transforms.Add(new CssMinify()); } bundle.Orderer = nullOrderer; bundles.Add(bundle); } } } } catch (Exception e) { LogHelper.Error(typeof(BundleCollection), "Error adding bundles: " + e.ToString(),e); } }
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 public static void RegisterBundles(BundleCollection bundles) { var nullBuilder = new NullBuilder(); var styleTransformer = new StyleTransformer(); var scriptTransformer = new ScriptTransformer(); // Replace a default bundle resolver in order to the debugging HTTP-handler // can use transformations of the corresponding bundle BundleResolver.Current = new CustomBundleResolver(); var commonStylesBundle = new Bundle("~/bundles/CommonStyles"); commonStylesBundle.Include( "~/Content/css/tablednd.css", "~/Content/site.less", "~/Content/css/themes/base/jquery-ui.css"); commonStylesBundle.Builder = nullBuilder; commonStylesBundle.Orderer = new NullOrderer(); commonStylesBundle.Transforms.Add(styleTransformer); bundles.Add(commonStylesBundle); var jQueryBundle = new Bundle("~/bundles/Jquery"); jQueryBundle.Include( "~/Scripts/Common/jquery-{version}.js", "~/Scripts/Common/jquery.unobtrusive*", "~/Scripts/Common/jquery.validate*"); jQueryBundle.Builder = nullBuilder; jQueryBundle.Transforms.Add(scriptTransformer); bundles.Add(jQueryBundle); var jQueryUiBundle = new Bundle("~/bundles/JqueryUI"); jQueryUiBundle.Include( "~/Scripts/Common/jquery.ui.core.js", "~/Scripts/Common/jquery-ui.js", "~/Scripts/Common/jquery.ui.dialog.js", "~/Scripts/Common/jquery.ui.touch-punch.min.js"); jQueryUiBundle.Builder = nullBuilder; jQueryUiBundle.Transforms.Add(scriptTransformer); bundles.Add(jQueryUiBundle); var commonScriptsBundle = new Bundle("~/bundles/CommonScripts"); commonScriptsBundle.Include( "~/Scripts/Common/jquery.DataTables.min.js", "~/Scripts/Common/jquery.jeditable.js", "~/Scripts/Common/jquery.DataTables.editable.js", "~/Scripts/Common/jquery.jeditable.checkbox.js", "~/Scripts/Common/jquery.tablednd.js", "~/Scripts/Common/jquery.blockUI.js", "~/Scripts/Common/knockout-{version}.js"); commonScriptsBundle.Builder = nullBuilder; commonScriptsBundle.Transforms.Add(scriptTransformer); bundles.Add(commonScriptsBundle); var customScriptsBundle = new Bundle("~/bundles/CustomScripts"); customScriptsBundle.Include( "~/Scripts/Site/Site.js", "~/Scripts/Site/Session.js", "~/Scripts/Dialog/Dialog.js", "~/Scripts/Shared/Layout.js", "~/Scripts/Home/Index.js", "~/Scripts/Preferences/Index.js"); customScriptsBundle.Builder = nullBuilder; customScriptsBundle.Transforms.Add(scriptTransformer); bundles.Add(customScriptsBundle); // uncomment to see optimizations locally //BundleTable.EnableOptimizations = true; }