Free cookie consent management tool by TermsFeed Policy Generator

source: branches/WebJobManager/HeuristicLab.Services.WebApp/3.3/Configs/BundleConfig.cs @ 13782

Last change on this file since 13782 was 12878, checked in by ascheibe, 9 years ago

#2388 merged hive statistics branch into trunk

File size: 4.8 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System.Collections.Generic;
23using System.IO;
24using System.Web.Optimization;
25
26namespace HeuristicLab.Services.WebApp.Configs {
27  public class BundleConfig {
28
29    public static void RegisterBundles(BundleCollection bundles) {
30      bundles.IgnoreList.Clear();
31
32      // IESupport
33      bundles.Add(new ScriptBundle("~/Bundles/IESupport").Include(
34        "~/WebApp/libs/misc/html5shiv.min.js",
35        "~/WebApp/libs/misc/respond.min.js"
36      ));
37
38      // Vendors
39      bundles.Add(new StyleBundle("~/Bundles/Vendors/css").Include(
40        "~/WebApp/libs/bootstrap/css/bootstrap.min.css",
41        "~/WebApp/libs/bootstrap/css/bootstrap-theme.min.css",
42        "~/WebApp/libs/font-aweseome/font-aweseome.min.css",
43        "~/WebApp/libs/angularjs/loading-bar/loading-bar.css",
44        "~/WebApp/libs/angularjs/angular-tablesort/tablesort.css"
45      ));
46
47      bundles.Add(new ScriptBundle("~/Bundles/Vendors/js").Include(
48        // jquery
49        "~/WebApp/libs/jquery/jquery-2.1.4.min.js",
50        "~/WebApp/libs/jquery/jquery-ui/jquery-ui-1.11.4.min.js",
51        "~/WebApp/libs/jquery/jquery-knob/jquery.knob.min.js",
52        "~/WebApp/libs/jquery/jquery-flot/excanvas.min.js",
53        "~/WebApp/libs/jquery/jquery-flot/jquery.flot.min.js",
54        "~/WebApp/libs/jquery/jquery-flot/jquery.flot.time.min.js",
55        "~/WebApp/libs/jquery/jquery-flot/jquery.flot.selection.min.js",
56        "~/WebApp/libs/jquery/jquery-flot/jquery.flot.navigate.min.js",
57        "~/WebApp/libs/jquery/jquery-flot/jquery.flot.resize.min.js",
58        "~/WebApp/libs/jquery/jquery-flot/jquery.flot.stack.min.js",
59        // bootstrap
60        "~/WebApp/libs/bootstrap/js/bootstrap.min.js",
61        // cryptojs
62        "~/WebApp/libs/cryptojs/aes.js",
63        // angular js
64        "~/WebApp/libs/angularjs/angular.min.js",
65        "~/WebApp/libs/angularjs/angular-route.min.js",
66        "~/WebApp/libs/angularjs/angular-aria.min.js",
67        "~/WebApp/libs/angularjs/angular-cookies.min.js",
68        "~/WebApp/libs/angularjs/angular-loader.min.js",
69        "~/WebApp/libs/angularjs/angular-messages.min.js",
70        "~/WebApp/libs/angularjs/angular-resource.min.js",
71        "~/WebApp/libs/angularjs/angular-sanitize.min.js",
72        "~/WebApp/libs/angularjs/angular-touch.min.js",
73        "~/WebApp/libs/angularjs/angular-ui-router.min.js",
74        "~/WebApp/libs/angularjs/angular-knob/angular-knob.js",
75        "~/WebApp/libs/angularjs/angular-tablesort/angular-tablesort.js",
76        "~/WebApp/libs/angularjs/angular-ui/ui-bootstrap-tpls-0.13.0.min.js",
77        "~/WebApp/libs/angularjs/loading-bar/loading-bar.js",
78        "~/WebApp/libs/angularjs/ocLazyLoad/ocLazyLoad.min.js",
79        "~/WebApp/libs/angularjs/fittext/ng-FitText.js",
80        // smoothScroll
81        "~/WebApp/libs/smoothScroll/smoothScroll.js"
82      ));
83
84      // Application
85      bundles.Add(new StyleBundle("~/Bundles/WebApp/css").Include(
86        "~/WebApp/app.css"
87      ));
88
89      bundles.Add(new ScriptBundle("~/Bundles/WebApp/Main").Include(
90        "~/WebApp/main.js"
91      ));
92
93      bundles.Add(new ScriptBundle("~/Bundles/WebApp/Shared")
94        .IncludeDirectory("~/WebApp/shared/services", "*.js", true)
95        .IncludeDirectory("~/WebApp/shared/directives", "*.js", true)
96        .IncludeDirectory("~/WebApp/shared/filter", "*.js", true)
97        .IncludeDirectory("~/WebApp/shared/menu", "*.js", true)
98      );
99    }
100
101    public static IEnumerable<string> GetWebAppScripts() {
102      var jsFiles = new List<string> {
103        "WebApp/helper.js",
104        "WebApp/app.js"
105      };
106      PluginManager pluginManager = PluginManager.Instance;
107      foreach (var plugin in pluginManager.Plugins) {
108        var path = Path.Combine(PluginManager.PluginsDirectory, plugin.Name, string.Concat(plugin.Name, ".js"));
109        if (File.Exists(path)) {
110          jsFiles.Add(string.Format("WebApp/plugins/{0}/{0}.js", plugin.Name));
111        }
112      }
113      jsFiles.Add("WebApp/main.js");
114      return jsFiles;
115    }
116  }
117}
Note: See TracBrowser for help on using the repository browser.