Esempio n. 1
0
 public StyleBundleTagHelper(
     IBundleCollection bundles,
     IBundleCache bundleCache,
     IOptionsMonitor <BundlingOptions> options,
     IWebHostEnvironment env)
     : base(bundles, bundleCache, options, env)
 {
 }
Esempio n. 2
0
 public BundleTagHelper(
     IBundleCollection bundles,
     IBundleCache bundleCache,
     IOptionsMonitor <BundlingOptions> options,
     IWebHostEnvironment env)
 {
     Bundles         = bundles;
     BundleCache     = bundleCache;
     Options         = options.CurrentValue;
     HostEnvironment = env;
 }
Esempio n. 3
0
        public void RegisterBundles(IApplicationContext appContext, IBundleCollection bundles)
        {
            Guard.NotNull(appContext, nameof(appContext));
            Guard.NotNull(bundles, nameof(bundles));

            var bundleProviders = appContext.TypeScanner
                                  .FindTypes <IBundleProvider>(ignoreInactiveModules: true)
                                  .Select(providerType => Activator.CreateInstance(providerType) as IBundleProvider)
                                  .OrderByDescending(provider => provider.Priority)
                                  .ToList();

            foreach (var provider in bundleProviders)
            {
                provider.RegisterBundles(appContext, bundles);
            }
        }
Esempio n. 4
0
 public BundleMiddleware(
     RequestDelegate next,
     IBundleCollection collection,
     IBundleCache bundleCache,
     IBundleBuilder bundleBuilder,
     IOptionsMonitor <BundlingOptions> optionsMonitor,
     IThemeRegistry themeRegistry,
     ILogger <BundleMiddleware> logger)
 {
     _next           = next;
     _collection     = collection;
     _bundleCache    = bundleCache;
     _bundleBuilder  = bundleBuilder;
     _optionsMonitor = optionsMonitor;
     _themeRegistry  = themeRegistry;
     _logger         = logger;
 }
Esempio n. 5
0
        public void RegisterBundles(IApplicationContext appContext, IBundleCollection bundles)
        {
            var lib = "/lib/";
            var js  = "/js/";

            /* Modernizr + jQuery --> /bundle/js/jquery.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/jquery.js").Include(
                            lib + "modernizr/modernizr.js",
                            lib + "jquery/jquery-3.4.1.js"));

            if (!appContext.IsInstalled)
            {
                return;
            }

            /* Vue --> /bundle/js/vue.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/vue.js").Include(
                            lib + "vue/vue.js"));


            /* File uploader --> /bundle/js/fileuploader.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/fileuploader.js").Include(
                            lib + "dropzone/dropzone.js",
                            js + "smartstore.dropzoneWrapper.js"));


            /* Image Gallery --> /bundle/js/smart-gallery.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/smart-gallery.js").Include(
                            lib + "drift/Drift.js",
                            lib + "photoswipe/photoswipe.js",
                            lib + "photoswipe/photoswipe-ui-default.js",
                            js + "smartstore.gallery.js"));
        }
Esempio n. 6
0
        public void RegisterBundles(IApplicationContext appContext, IBundleCollection bundles)
        {
            if (!appContext.IsInstalled)
            {
                return;
            }

            var lib        = "/lib/";
            var js         = "/js/";
            var adminJs    = "/admin/js/";
            var components = "/components/";

            /* Admin Common CSS --> /bundle/css/admin-common.css
             * -----------------------------------------------------*/
            bundles.Add(new StyleBundle("/bundle/css/admin-common.css").Include(
                            lib + "fontastic/fontastic.css",
                            lib + "fa5/css/all.css",
                            lib + "pnotify/css/pnotify.css",
                            lib + "pnotify/css/pnotify.mobile.css",
                            lib + "pnotify/css/pnotify.buttons.css"));


            /* Admin Main Sass theme --> /admin/theme[-rtl].scss
             * -----------------------------------------------------*/
            bundles.Add(new StyleBundle("/bundle/css/admin-theme.css").Include("/admin/theme.scss"));
            bundles.Add(new StyleBundle("/bundle/css/admin-theme-rtl.css").Include("/admin/theme-rtl.scss"));


            /* Admin Main scripts --> /bundle/js/admin.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/admin.js").Include(
                            adminJs + "jquery-shims.js",
                            // Lib
                            lib + "underscore/underscore.js",
                            lib + "underscore/underscore.string.js",
                            lib + "jquery/jquery.addeasing.js",
                            lib + "jquery-ui/effect.js",
                            lib + "jquery-ui/effect-transfer.js",
                            lib + "jquery-ui/position.js",
                            lib + "jquery/jquery.unobtrusive-ajax.js",
                            lib + "jquery/jquery.validate.js",
                            lib + "jquery/jquery.validate.unobtrusive.js",
                            lib + "jquery/jquery.scrollTo.js",
                            lib + "jquery/jquery.serializeToJSON.min.js",
                            lib + "sortable/sortable.js",
                            lib + "sortable/jquery-sortable.js",
                            lib + "moment/moment.js",
                            lib + "datetimepicker/js/tempusdominus-bootstrap-4.js",
                            lib + "colorpicker/js/bootstrap-colorpicker.js",
                            lib + "colorpicker/js/bootstrap-colorpicker-globalinit.js",
                            lib + "select2/js/select2.js",
                            lib + "pnotify/js/pnotify.js",
                            lib + "pnotify/js/pnotify.mobile.js",
                            lib + "pnotify/js/pnotify.buttons.js",
                            lib + "pnotify/js/pnotify.animate.js",
                            lib + "bs4/js/bootstrap.bundle.js",
                            // Common
                            js + "underscore.mixins.js",
                            js + "smartstore.system.js",
                            js + "smartstore.touchevents.js",
                            js + "smartstore.jquery.utils.js",
                            js + "smartstore.globalization.js",
                            js + "jquery.validate.unobtrusive.custom.js",
                            js + "smartstore.viewport.js",
                            js + "smartstore.doajax.js",
                            js + "smartstore.eventbroker.js",
                            js + "smartstore.common.js",
                            js + "smartstore.dialogs.js",
                            js + "smartstore.selectwrapper.js",
                            js + "smartstore.throbber.js",
                            js + "smartstore.thumbzoomer.js",
                            js + "smartstore.entitypicker.js",
                            js + "smartstore.rangeslider.js",
                            js + "smartstore.tree.js",
                            js + "smartstore.media.js",
                            js + "smartstore.editortemplates.js",
                            // Admin
                            adminJs + "admin.common.js",
                            adminJs + "admin.media.js",
                            adminJs + "admin.globalinit.js"));


            /* Chart.js --> /bundle/js/chart.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/chart.js").Include(
                            lib + "Chart.js/Chart.js"));


            /* DataGrid --> /bundle/js/datagrid.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/datagrid.js").Include(
                            components + "datagrid/datagrid.js",
                            components + "datagrid/datagrid-pager.js",
                            components + "datagrid/datagrid-tools.js"));


            /* Summernote--> /bundle/js/summernote.js
             * -----------------------------------------------------*/
            var summernote = "/lib/editors/summernote/";

            bundles.Add(new ScriptBundle("/bundle/js/summernote.js").Include(
                            summernote + "summernote-bs4.min.js",
                            summernote + "plugins/smartstore.image.js",
                            summernote + "plugins/smartstore.link.js",
                            summernote + "plugins/smartstore.tablestyles.js",
                            summernote + "plugins/smartstore.cssclass.js",
                            lib + "beautify/beautify.min.js",
                            lib + "beautify/beautify-css.min.js",
                            lib + "beautify/beautify-html.min.js",
                            summernote + "globalinit.js"));


            /* CodeMirror (V 5.3.3) --> /bundle/js/codemirror.js
             * -----------------------------------------------------*/
            var cm = "/lib/editors/CodeMirror/";

            // Script
            bundles.Add(new ScriptBundle("/bundle/js/codemirror.js").Include(
                            cm + "codemirror.min.js",
                            cm + "addon/fold/xml-fold.min.js",
                            cm + "addon/hint/show-hint.min.js",
                            cm + "addon/hint/xml-hint.min.js",
                            cm + "addon/hint/html-hint.min.js",
                            cm + "addon/hint/css-hint.min.js",
                            cm + "addon/hint/javascript-hint.min.js",
                            cm + "addon/edit/closetag.min.js",
                            cm + "addon/edit/closebrackets.min.js",
                            cm + "addon/edit/matchtags.min.js",
                            cm + "addon/edit/matchbrackets.min.js",
                            cm + "addon/mode/multiplex.min.js",
                            cm + "addon/mode/overlay.min.js",
                            cm + "addon/display/fullscreen.min.js",
                            cm + "addon/selection/active-line.min.js",
                            cm + "mode/xml/xml.min.js",
                            cm + "mode/javascript/javascript.min.js",
                            cm + "mode/css/css.min.js",
                            cm + "mode/htmlmixed/htmlmixed.min.js",
                            cm + "mode/liquid/liquid.js"));
            // CSS
            bundles.Add(new StyleBundle("/bundle/css/codemirror.css").Include(
                            cm + "codemirror.min.css",
                            cm + "codemirror.custom.css",
                            cm + "addon/hint/show-hint.min.css",
                            cm + "addon/display/fullscreen.css",
                            cm + "theme/eclipse.min.css",
                            cm + "mode/liquid/liquid.css"));


            /* Roxy File Manager--> /bundle/js/filemanager.js
             *          ------------------------------------------------------*/
            var roxy = "/lib/roxyfm/js/";

            bundles.Add(new StyleBundle("/bundle/js/roxyfm.js").Include(
                            roxy + "jquery-2.1.1.min.js",
                            roxy + "jquery-ui-1.10.4.custom.min.js",
                            roxy + "filetypes.js",
                            roxy + "custom.js",
                            roxy + "main.js",
                            roxy + "utils.js",
                            roxy + "file.js",
                            roxy + "directory.js",
                            roxy + "jquery-dateFormat.min.js"));
        }
Esempio n. 7
0
        public void RegisterBundles(IApplicationContext appContext, IBundleCollection bundles)
        {
            if (!appContext.IsInstalled)
            {
                return;
            }

            var lib = "/lib/";
            var js  = "/js/";


            /* Dynamic Sass themes --> /themes/[theme]/theme[-rtl].css
             * -----------------------------------------------------*/
            bundles.Add(new DynamicStyleBundle("/themes/{theme}/theme.css")
                        .WithConstraint(IsValidTheme)
                        .Include(ResolveThemeSourceFiles));
            bundles.Add(new DynamicStyleBundle("/themes/{theme}/theme-rtl.css")
                        .WithConstraint(IsValidTheme)
                        .Include(ResolveRtlThemeSourceFiles));


            /* Public Common CSS --> /bundle/css/site-common.css
             * -----------------------------------------------------*/
            bundles.Add(new StyleBundle("/bundle/css/site-common.css").Include(
                            lib + "fa5/css/all.css", // TODO: (core) Consider "fa-use-pro" theme variable somehow
                            lib + "fontastic/fontastic.css",
                            lib + "pnotify/css/pnotify.css",
                            lib + "pnotify/css/pnotify.mobile.css",
                            lib + "pnotify/css/pnotify.buttons.css"));


            /* Public Main --> /bundle/js/site.js
             * -----------------------------------------------------*/
            bundles.Add(new ScriptBundle("/bundle/js/site.js").Include(
                            // Vendors
                            lib + "underscore/underscore.js",
                            lib + "underscore/underscore.string.js",
                            lib + "jquery/jquery.addeasing.js",
                            lib + "jquery-ui/effect.js",
                            lib + "jquery-ui/effect-shake.js",
                            lib + "jquery/jquery.unobtrusive-ajax.js",
                            lib + "jquery/jquery.validate.js",
                            lib + "jquery/jquery.validate.unobtrusive.js",
                            lib + "jquery/jquery.ba-outside-events.js",
                            lib + "jquery/jquery.scrollTo.js",
                            lib + "moment/moment.js",
                            lib + "datetimepicker/js/tempusdominus-bootstrap-4.js",
                            lib + "select2/js/select2.js",
                            lib + "pnotify/js/pnotify.js",
                            lib + "pnotify/js/pnotify.mobile.js",
                            lib + "pnotify/js/pnotify.buttons.js",
                            lib + "pnotify/js/pnotify.animate.js",
                            lib + "slick/slick.js",
                            lib + "touchspin/jquery.bootstrap-touchspin.js",
                            lib + "aos/js/aos.js",
                            lib + "bs4/js/bootstrap.bundle.js",
                            // Common
                            js + "underscore.mixins.js",
                            js + "smartstore.system.js",
                            js + "smartstore.touchevents.js",
                            js + "smartstore.jquery.utils.js",
                            js + "smartstore.globalization.js",
                            js + "jquery.validate.unobtrusive.custom.js",
                            js + "smartstore.viewport.js",
                            js + "smartstore.doajax.js",
                            js + "smartstore.eventbroker.js",
                            js + "smartstore.common.js",
                            js + "smartstore.dialogs.js",
                            js + "smartstore.selectwrapper.js",
                            js + "smartstore.throbber.js",
                            js + "smartstore.thumbzoomer.js",
                            js + "smartstore.responsiveNav.js",
                            js + "smartstore.keynav.js",
                            js + "smartstore.articlelist.js",
                            js + "smartstore.megamenu.js",
                            js + "smartstore.offcanvas.js",
                            js + "smartstore.parallax.js",
                            js + "smartstore.media.js",
                            // Shop
                            js + "public.common.js",
                            js + "public.search.js",
                            // INFO: (mh) (core) Offcanvas cart is rendered by widget & not available on document loaded.
                            //                   So it must either be rewritten so it can be initialized on request or widgets must be rendered before scripts are injected.
                            //                   The second solution might be preferable as I don't know how many other places are affected by this.
                            // TODO: (mh) (core) Uncomment when this problem is solved.
                            //js + "public.offcanvas-cart.js",
                            js + "public.offcanvas-menu.js",
                            js + "public.product.js"));
        }