static ResourceManagementOptionsConfiguration() { _manifest = new ResourceManifest(); // See https://github.com/marella/material-icons for usage _manifest .DefineStyle("material-icons") .SetCdn("https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined|Material+Icons+Two+Tone|Material+Icons+Round|Material+Icons+Sharp") .SetUrl("~/TheAdmin/fonts/material-icons/material-icons.min.css", "~/TheAdmin/fonts/material-icons/material-icons.css") .SetVersion("1.10.11"); _manifest .DefineScript("admin") .SetDependencies("jQuery") .SetUrl("~/TheAdmin/js/TheAdmin.min.js", "~/TheAdmin/js/TheAdmin.js") .SetVersion("1.0.0"); _manifest .DefineScript("admin-head") .SetUrl("~/TheAdmin/js/TheAdmin-header.min.js", "~/TheAdmin/js/TheAdmin-header.js") .SetVersion("1.0.0"); _manifest .DefineStyle("admin") .SetUrl("~/TheAdmin/css/TheAdmin.min.css", "~/TheAdmin/css/TheAdmin.css") .SetVersion("1.0.0"); }
public void BuildManifests(ResourceManifestBuilder builder) { ResourceManifest manifest = builder.Add(); //easyui全部控件样式 manifest.DefineStyle("Easyui").SetUrl("default/easyui.css"); //自定义的主样式 manifest.DefineStyle("MainSty").SetUrl("Styles.css").SetDependencies("Easyui"); //凭证样式 manifest.DefineStyle("voucher").SetUrl("voucher.css").SetDependencies("MainSty"); //easyui库 manifest.DefineScript("Easyui").SetUrl("jquery.easyui.min.js").SetDependencies("jQuery"); //easyui中文化 manifest.DefineScript("Easyui.cn").SetUrl("easyui-lang-zh_CN.js").SetDependencies("Easyui"); //easyui验证方法扩展 manifest.DefineScript("Easyui.Extend").SetUrl("easyui.extend.js").SetDependencies("Easyui"); //企业信息相关脚本 manifest.DefineScript("Company.App").SetUrl("App/Company.App.js").SetDependencies("Easyui.cn", "Easyui.Extend"); //科目设置 manifest.DefineScript("Subject.App").SetUrl("App/Subject.App.js").SetDependencies("Easyui.cn", "Easyui.Extend"); //凭证录入、查询 manifest.DefineScript("Voucher.App").SetUrl("App/Voucher.App.js").SetDependencies("Easyui.cn", "Easyui.Extend"); }
public async Task RenderStylesheet() { var options = new ResourceManagementOptions(); var manifest = new ResourceManifest(); manifest.DefineStyle("required").SetUrl("required.css") .SetDependencies("dependency"); manifest.DefineStyle("dependency").SetUrl("dependency.css"); manifest.DefineStyle("not-required").SetUrl("not-required.css"); options.ResourceManifests.Add(manifest); var resourceManager = new ResourceManager( new OptionsWrapper <ResourceManagementOptions>(options), StubFileVersionProvider.Instance ); resourceManager.RegisterLink(new LinkEntry { Rel = "icon", Href = "/favicon.ico" }); // Should not be rendered // Require resource resourceManager.RegisterResource("stylesheet", "required"); // Register custom style var customStyle = ".my-class { prop: value; }"; resourceManager.RegisterStyle(new HtmlString($"<style>{customStyle}</style>")); using var sw = new StringWriter(); resourceManager.RenderStylesheet(sw); var htmlBuilder = new HtmlContentBuilder(); htmlBuilder.AppendHtml(sw.ToString()); var document = await ParseHtmlAsync(htmlBuilder); var links = document .QuerySelectorAll <IHtmlLinkElement>("link"); var styles = document .QuerySelectorAll <IHtmlStyleElement>("style"); Assert.Equal(2, links.Count()); Assert.Contains(links, link => link.Href == $"{basePath}/dependency.css"); Assert.Contains(links, link => link.Href == $"{basePath}/required.css"); Assert.Single(styles); Assert.Contains(styles, style => style.InnerHtml == customStyle); // Required stylesheet after its dependency Assert.Equal(DocumentPositions.Following, links.First(link => link.Href == $"{basePath}/dependency.css") .CompareDocumentPosition( links.First(link => link.Href == $"{basePath}/required.css") ) ); // Custom style after resources Assert.Equal(DocumentPositions.Following, links.First(link => link.Href == $"{basePath}/required.css") .CompareDocumentPosition( styles.First(style => style.InnerHtml == customStyle) ) ); }
static ResourceManagementOptionsConfiguration() { manifest = new ResourceManifest(); manifest .DefineScript("ZachsBlogTheme-vendor-jQuery") .SetUrl("~/ZachsBlogTheme/vendor/jquery/jquery.min.js", "~/ZachsBlogTheme/vendor/jquery/jquery.js") .SetCdn("https://code.jquery.com/jquery-3.4.1.min.js", "https://code.jquery.com/jquery-3.4.1.js") .SetCdnIntegrity("sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh", "sha384-mlceH9HlqLp7GMKHrj5Ara1+LvdTZVMx4S1U43/NxCvAkzIo8WJ0FE7duLel3wVo") .SetVersion("3.4.1"); manifest .DefineScript("ZachsBlogTheme-vendor-jQuery.slim") .SetUrl("~/ZachsBlogTheme/vendor/jquery/jquery.slim.min.js", "~/ZachsBlogTheme/vendor/jquery/jquery.slim.js") .SetCdn("https://code.jquery.com/jquery-3.4.1.slim.min.js", "https://code.jquery.com/jquery-3.4.1.slim.js") .SetCdnIntegrity("sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n", "sha384-teRaFq/YbXOM/9FZ1qTavgUgTagWUPsk6xapwcjkrkBHoWvKdZZuAeV8hhaykl+G") .SetVersion("3.4.1"); manifest .DefineScript("ZachsBlogTheme-vendor-bootstrap") .SetDependencies("ZachsBlogTheme-vendor-jQuery") .SetUrl("~/ZachsBlogTheme/vendor/bootstrap/js/bootstrap.min.js", "~/ZachsBlogTheme/vendor/bootstrap/js/bootstrap.js") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js", "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.js") .SetCdnIntegrity("sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM", "sha384-rkSGcquOAzh5YMplX4tcXMuXXwmdF/9eRLkw/gNZG+1zYutPej7fxyVLiOgfoDgi") .SetVersion("4.3.1"); manifest .DefineScript("ZachsBlogTheme-vendor-bootstrap-bundle") .SetDependencies("ZachsBlogTheme-vendor-jQuery") .SetUrl("~/ZachsBlogTheme/vendor/bootstrap/js/bootstrap.bundle.min.js", "~/ZachsBlogTheme/vendor/bootstrap/js/bootstrap.bundle.js") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js", "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.js") .SetCdnIntegrity("sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o", "sha384-szbKYgPl66wivXHlSpJF+CKDAVckMVnlGrP25Sndhe+PwOBcXV9LlFh4MUpRhjIB") .SetVersion("4.3.1"); manifest .DefineStyle("ZachsBlogTheme-vendor-bootstrap") .SetUrl("~/ZachsBlogTheme/vendor/bootstrap/css/bootstrap.min.css", "~/ZachsBlogTheme/vendor/bootstrap/css/bootstrap.css") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css", "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.css") .SetCdnIntegrity("sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T", "sha384-t4IGnnWtvYimgcRMiXD2ZD04g28Is9vYsVaHo5LcWWJkoQGmMwGg+QS0mYlhbVv3") .SetVersion("4.3.1"); manifest .DefineStyle("ZachsBlogTheme-bootstrap-oc") .SetUrl("~/ZachsBlogTheme/css/bootstrap-oc.min.css", "~/ZachsBlogTheme/css/bootstrap-oc.css") .SetVersion("1.0.0"); manifest .DefineStyle("ZachsBlogTheme-vendor-font-awesome") .SetUrl("~/ZachsBlogTheme/vendor/fontawesome-free/css/all.min.css", "~/ZachsBlogTheme/vendor/fontawesome-free/css/all.css") .SetCdn("https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css", "https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.css") .SetCdnIntegrity("sha384-rtJEYb85SiYWgfpCr0jn174XgJTn4rptSOQsMroFBPQSGLdOC5IbubP6lJ35qoM9", "sha384-Ex0vLvgbKZTFlqEetkjk2iUgM+H5udpQKFKjBoGFwPaHRGhiWyVI6jLz/3fBm5ht") .SetVersion("5.10.2"); manifest .DefineScript("ZachsBlogTheme-vendor-font-awesome") .SetCdn("https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/js/all.min.js", "https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/js/all.js") .SetCdnIntegrity("sha384-QMu+Y+eu45Nfr9fmFOlw8EqjiUreChmoQ7k7C1pFNO8hEbGv9yzsszTmz+RzwyCh", "sha384-7/I8Wc+TVwiZpEjE4qTV6M27LYR5Dus6yPGzQZowRtgh+0gDW9BNR9GmII1/YwmG") .SetVersion("5.10.2"); }
static ResourceManagerBenchmark() { var manifest1 = new ResourceManifest(); manifest1.DefineStyle("some1").SetDependencies("dependency1").SetUrl("file://some1.txt").SetVersion("1.0.0"); var manifest2 = new ResourceManifest(); manifest2.DefineStyle("some2").SetDependencies("dependency2").SetUrl("file://some2.txt").SetVersion("1.0.0"); var dependency1 = new ResourceManifest(); dependency1.DefineStyle("dependency1").SetUrl("file://dependency1.txt").SetVersion("1.0.0"); var dependency2 = new ResourceManifest(); dependency2.DefineStyle("dependency2").SetUrl("file://dependency2.txt").SetVersion("1.0.0"); _resourceManifestState = new ResourceManifestState { ResourceManifests = new List <ResourceManifest> { manifest1, manifest2, dependency1, dependency2 } }; }
static ResourceManagerBenchmark() { var options = new ResourceManagementOptions(); var manifest1 = new ResourceManifest(); manifest1.DefineStyle("some1").SetDependencies("dependency1").SetUrl("file://some1.txt").SetVersion("1.0.0"); options.ResourceManifests.Add(manifest1); var manifest2 = new ResourceManifest(); manifest2.DefineStyle("some2").SetDependencies("dependency2").SetUrl("file://some2.txt").SetVersion("1.0.0"); options.ResourceManifests.Add(manifest2); var dependency1 = new ResourceManifest(); dependency1.DefineStyle("dependency1").SetUrl("file://dependency1.txt").SetVersion("1.0.0"); options.ResourceManifests.Add(dependency1); var dependency2 = new ResourceManifest(); dependency2.DefineStyle("dependency2").SetUrl("file://dependency2.txt").SetVersion("1.0.0"); options.ResourceManifests.Add(dependency2); _options = new OptionsWrapper <ResourceManagementOptions>(options); }
static ResourceManagementOptionsConfiguration() { _manifest = new ResourceManifest(); _manifest .DefineStyle("SamwiseTheme-bootstrap-oc") .SetUrl("~/SamwiseTheme/css/bootstrap-oc.min.css", "~/SamwiseTheme/css/bootstrap-oc.css") .SetVersion("1.0.0"); }
public async Task RenderLocalStyle() { var options = new ResourceManagementOptions(); var manifest = new ResourceManifest(); manifest.DefineStyle("required").SetUrl("required.css") .SetDependencies("dependency"); manifest.DefineStyle("dependency").SetUrl("dependency.css"); manifest.DefineStyle("not-required").SetUrl("not-required.css"); options.ResourceManifests.Add(manifest); var resourceManager = new ResourceManager( new OptionsWrapper <ResourceManagementOptions>(options), StubFileVersionProvider.Instance ); var requireSetting = resourceManager.RegisterResource("stylesheet", "required").AtLocation(ResourceLocation.Inline); using var sw = new StringWriter(); resourceManager.RenderLocalStyle(requireSetting, sw); var htmlBuilder = new HtmlContentBuilder(); htmlBuilder.AppendHtml(sw.ToString()); var document = await ParseHtmlAsync(htmlBuilder); var scripts = document .QuerySelectorAll <IHtmlLinkElement>("link"); Assert.Equal(2, scripts.Count()); Assert.Contains(scripts, script => script.Href.EndsWith("dependency.css")); Assert.Contains(scripts, script => script.Href.EndsWith("required.css")); Assert.Equal(DocumentPositions.Following, scripts.First(script => script.Href.EndsWith("dependency.css")) .CompareDocumentPosition( scripts.First(script => script.Href.EndsWith("required.css")) ) ); }
static ResourceManagementOptionsConfiguration() { _manifest = new ResourceManifest(); _manifest .DefineScript("leaflet") .SetUrl("/OrchardCore.Spatial/Scripts/leaflet/leaflet.js", "/OrchardCore.Spatial/Scripts/leaflet/leaflet-src.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.min.js", "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet-src.js") .SetCdnIntegrity("sha384-vdvDM6Rl/coCrMsKwhal4uc9MUUFNrYa+cxp+nJQHy3TvozEpVKVexz/NTbE5VSO", "sha384-mc6rNK5V0bzWGJ1EUEAR2o+a/oH6qaVl+NCF63Et+mVpGnlSnyVSBhSP/wp4ir+O") .SetVersion("1.7.1"); _manifest .DefineStyle("leaflet") .SetUrl("/OrchardCore.Spatial/Styles/leaflet.min.css", "/OrchardCore.Spatial/Styles/leaflet.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.min.css", "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.css") .SetCdnIntegrity("sha384-d7pQbIswLsqVbYoAoHHlzPt+fmjkMwiXW/fvtIgK2r1u1bZXvGzL9HICUg4DKSgO", "sha384-VzLXTJGPSyTLX6d96AxgkKvE/LRb7ECGyTxuwtpjHnVWVZs2gp5RDjeM/tgBnVdM") .SetVersion("1.7.1"); }
static ResourceManagementOptionsConfiguration() { _manifest = new ResourceManifest(); _manifest .DefineScript("jsplumb") .SetDependencies("jQuery") .SetUrl("~/OrchardCore.Workflows/Scripts/jsplumb.min.js", "~/OrchardCore.Workflows/Scripts/jsplumb.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/jsPlumb/2.15.5/js/jsplumb.min.js", "https://cdnjs.cloudflare.com/ajax/libs/jsPlumb/2.15.5/js/jsplumb.js") .SetCdnIntegrity("sha384-vJ4MOlEjImsRl4La5sTXZ1UBtJ8uOOqxl2+0gdjRB7oVF6AvTVZ3woqYbTJb7vaf", "sha384-6qcVETlKUuSEc/QpsceL6BNiyEMBFSPE/uyfdRUvEfao8/K9lynY+r8nd/mwLGGh") .SetVersion("2.15.5"); _manifest .DefineStyle("jsplumbtoolkit-defaults") .SetUrl("~/OrchardCore.Workflows/Styles/jsplumbtoolkit-defaults.min.css", "~/OrchardCore.Workflows/Styles/jsplumbtoolkit-defaults.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/jsPlumb/2.15.5/css/jsplumbtoolkit-defaults.min.css", "https://cdnjs.cloudflare.com/ajax/libs/jsPlumb/2.15.5/css/jsplumbtoolkit-defaults.css") .SetCdnIntegrity("sha384-4TTNOHwtAFYbq+UTSu/7Fj0xnqOabg7FYr9DkNtEKnmIx/YaACNiwhd2XZfO0A/u", "sha384-Q0wOomiqdBpz2z6/yYA8b3gc8A9t7z7QjD14d1WABvXVHbRYBu/IGOv3SOR57anB") .SetVersion("2.15.5"); }
static ResourceManagementOptionsConfiguration() { _manifest = new ResourceManifest(); _manifest .DefineScript("vuejs") .SetUrl("~/VuetifyTheme/Scripts/vue.min.js", "~/VuetifyTheme/Scripts/vue.js") .SetCdn("https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.min.js", "https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js") .SetCdnIntegrity("sha384-ULpZhk1pvhc/UK5ktA9kwb2guy9ovNSTyxPNHANnA35YjBQgdwI+AhLkixDvdlw4", "sha384-t1tHLsbM7bYMJCXlhr0//00jSs7ZhsAhxgm191xFsyzvieTMCbUWKMhFg9I6ci8q") .SetVersion("2.6.14"); _manifest .DefineStyle("vuetify-theme") .SetDependencies("vuejs") .SetUrl("~/VuetifyTheme/dist/vuetify-theme.css", "~/VuetifyTheme/dist/vuetify-theme.css") .SetVersion("1.0.0"); _manifest .DefineScript("vuetify-theme") .SetDependencies("vuejs") .SetUrl("~/VuetifyTheme/dist/vuetify-theme.umd.min.js", "~/VuetifyTheme/dist/vuetify-theme.umd.js") .SetVersion("1.0.0"); }
static ResourceManagementOptionsConfiguration() { var root = "~/FlyingRat.Braksn"; _manifest = new ResourceManifest(); _manifest.DefineScript("Braksn-bootstrap") .SetUrl($"{root}/js/bootstrap.min.js") .SetVersion("4.0.0"); #region js _manifest.DefineScript("Braksn-animsition") .SetUrl($"{root}/js/animsition.min.js") .SetVersion("4.0.2"); _manifest.DefineScript("Braksn-custom_jquery") .SetUrl($"{root}/js/custom_jquery.js") .SetVersion("1.0.0"); _manifest.DefineScript("Braksn-jquery") .SetUrl($"{root}/js/jquery-3.2.1.min.js") .SetVersion("3.2.1"); _manifest.DefineScript("Braksn-popper") .SetUrl($"{root}/js/popper.js") .SetVersion("1.12.5"); #endregion #region css _manifest.DefineStyle("Braksn-stylesheet") .SetUrl($"{root}/css/stylesheet.css") .SetVersion("1.0.0"); _manifest.DefineStyle("Braksn-util") .SetUrl($"{root}/css/util.min.css") .SetVersion("1.0.0"); _manifest.DefineStyle("Braksn-animate") .SetUrl($"{root}/css/animate.css") .SetVersion("1.0.0"); _manifest.DefineStyle("Braksn-animstion") .SetUrl($"{root}/css/animsition.min.css") .SetVersion("1.0.0"); _manifest.DefineStyle("Braksn-bootstrap") .SetUrl($"{root}/css/bootstrap.min.css") .SetVersion("4.0.0"); _manifest.DefineStyle("Braksn-hamburgers") .SetUrl($"{root}/css/hamburgers.min.css") .SetVersion("1.0.0"); #endregion #region font _manifest.DefineStyle("Braksn-font-awesome") .SetUrl($"{root}/fonts/fontawesome-5.0.8/css/fontawesome-all.min.css") .SetVersion("5.0.8"); _manifest.DefineStyle("Braksn-font-iconic") .SetUrl($"{root}/fonts/iconic/css/material-design-iconic-font.min.css") .SetVersion("1.0.0"); #endregion #region bundle assts _manifest.DefineScript("website-bundle") .SetUrl($"{root}/bundle/website.min.js") .SetVersion("1.0"); _manifest.DefineScript("braksn-validate") .SetUrl($"{root}/bundle/validate.min.js") .SetVersion("1.0"); _manifest.DefineScript("braksn-bundle") .SetUrl($"{root}/bundle/bundle.min.js") .SetVersion("1.0"); _manifest.DefineStyle("braksn-bundle") .SetUrl($"{root}/bundle/bundle.min.css") .SetVersion("1.0"); #region page _manifest.DefineScript("braksn-atlas") .SetUrl($"{root}/bundle/atlas.min.js") .SetVersion("1.0"); #endregion #endregion }
/// <summary> /// Adds a stylesheet to the resourceManifest. /// The style sheets name will be converted to a minified and a normal resource url. /// </summary> public static ResourceDefinition DefineStyleWithAllUrls(this ResourceManifest manifest, string name) { return(manifest.DefineStyle(name).SetUrl(string.Format("{0}.min.css", name), string.Format("{0}.css", name))); }
static ResourceManagementOptionsConfiguration() { _manifest = new ResourceManifest(); _manifest.DefineStyle("theprocardtheme-vendor-bootstrapcss") .SetUrl("~/ProCardTheme/css/bootstrap.min.css", "~/ProCardTheme/css/bootstrap.css") .SetCdn("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css", "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css") .SetCdnIntegrity("sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u", "sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u") .SetVersion("3.3.7"); _manifest.DefineStyle("TheProCardTheme-vendor-normalize") .SetUrl("~/ProCardTheme/css/normalize.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css", "https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css") .SetCdnIntegrity("sha512-NhSC1YmyruXifcj/KFRWoC561YpHpc5Jtzgvbuzx5VozKpWvQ+4nXhPdFgmx8xqexRcpAglTj9sIBWINXa8x5w==", "sha512-oHDEc8Xed4hiW6CxD7qjbnI+B07vDdX7hEPTvn9pSZO1bcRqHp8mj9pyr+8RVC2GmtEfI2Bi9Ke9Ass0as+zpg==") .SetVersion("8.0.1"); _manifest.DefineStyle("TheProCardTheme-vendor-animate") .SetUrl("~/ProCardTheme/css/animate.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.min.css", "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.css") .SetCdnIntegrity("sha512-4e743y/yh7ffjixFn2DBKvAA0j02JNn0iQ/bIq6usesbp6TRPcZFW0XHnwfSnpTtsTmMGh0UmvbXY26aJfIb0Q==", "sha512-K2J6Yt6ElUYEMPcTr0wm555AAyiqkgYiUgPIW18FT88/aYSNDk0EvGjsln/TEu3ee/jaHf0xoXzFppSbBtUXbQ==") .SetVersion("3.5.1"); _manifest.DefineStyle("TheProCardTheme-vendor-transitionanimations") .SetUrl("~/ProCardTheme/css/transition-animations.css") .SetVersion("1.0.0"); _manifest.DefineStyle("TheProCardTheme-vendor-owlcarousel") .SetUrl("~/ProCardTheme/css/owl.carousel.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.0/assets/owl.carousel.min.css", "https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.0/assets/owl.carousel.css") .SetCdnIntegrity("sha512-wOFbhKjhJWoAjlnxMK+uNACGNi2xrcTarIBCLpktzzajCOfxCR4AnJcT9mBEiVTFWmthRvQHY23v4OhyY981Lg==", "sha512-nQBtu5ETxTSzk2JroACVYGz3hR7lz1wli8+RSeEhX0KERJOpLbl+j7OtGwvrqE6DGdm4xyVpt7tAfFZGBDq+ug==") .SetVersion("2.2.0"); _manifest.DefineStyle("TheProCardTheme-vendor-magnificpopup") .SetUrl("~/ProCardTheme/css/magnific-popup.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css", "https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css") .SetCdnIntegrity("sha512-+EoPw+Fiwh6eSeRK7zwIKG2MA8i3rV/DGa3tdttQGgWyatG/SkncT53KHQaS5Jh9MNOT3dmFL0FjTY08And/Cw==", "sha512-WEQNv9d3+sqyHjrqUZobDhFARZDko2wpWdfcpv44lsypsSuMO0kHGd3MQ8rrsBn/Qa39VojphdU6CMkpJUmDVw==") .SetVersion("2.2.0"); _manifest.DefineStyle("TheProCardTheme-main") .SetUrl("~/ProCardTheme/css/main.css"); _manifest.DefineScript("TheProCardTheme-vendor-jquery") .SetUrl("~/ProCardTheme/js/jquery-2.1.3.min.js", "~/ProCardTheme/js/jquery-2.1.3.min.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js", "https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js") .SetCdnIntegrity("sha512-egJ/Y+22P9NQ9aIyVCh0VCOsfydyn8eNmqBy+y2CnJG+fpRIxXMS6jbWP8tVKp0jp+NO5n8WtMUAnNnGoJKi4w==", "sha512-uOsadAxj/qq4rCTYfzn0z+JjaUyXL0l4ufDjCS+RKnIllv0JTdY30i8DgWYX4TIQvxH62aVF27BCPcghyCcIHg==") .SetVersion("2.1.3"); _manifest.DefineScript("TheProCardTheme-vendor-modernizr") .SetUrl("~/ProCardTheme/js/modernizr.custom.js", "~/ProCardTheme/js/modernizr.custom.js"); _manifest.DefineScript("TheProCardTheme-vendor-bootstrap") .SetUrl("~/ProCardTheme/js/bootstrap.min.js", "~/ProCardTheme/js/bootstrap.min.js"); _manifest.DefineScript("TheProCardTheme-vendor-pages-switcher") .SetUrl("~/ProCardTheme/js/pages-switcher.js", "~/ProCardTheme/js/pages-switcher.js"); _manifest.DefineScript("TheProCardTheme-vendor-imagesloaded") .SetUrl("~/ProCardTheme/js/imagesloaded.pkgd.min.js", "~/ProCardTheme/js/imagesloaded.pkgd.min.js"); _manifest.DefineScript("TheProCardTheme-vendor-validator") .SetUrl("~/ProCardTheme/js/validator.js", "~/ProCardTheme/js/validator.js"); _manifest.DefineScript("TheProCardTheme-vendor-jqueryshuffle") .SetUrl("~/ProCardTheme/js/jquery.shuffle.min.js", "~/ProCardTheme/js/jquery.shuffle.min.js"); _manifest.DefineScript("TheProCardTheme-vendor-masonry") .SetUrl("~/ProCardTheme/js/masonry.pkgd.min.js", "~/ProCardTheme/js/masonry.pkgd.min.js"); _manifest.DefineScript("TheProCardTheme-vendor-owlcarousel") .SetUrl("~/ProCardTheme/js/owl.carousel.min.js", "~/ProCardTheme/js/owl.carousel.min.js"); _manifest.DefineScript("TheProCardTheme-vendor-magnificpopup") .SetUrl("~/ProCardTheme/js/jquery.magnific-popup.min.js", "~/ProCardTheme/js/jquery.magnific-popup.min.js"); _manifest.DefineScript("TheProCardTheme-vendor-hoverdir") .SetUrl("~/ProCardTheme/js/jquery.hoverdir.js", "~/ProCardTheme/js/jquery.hoverdir.js"); _manifest.DefineScript("TheProCardTheme-vendor-jquerygooglemaps") .SetUrl("~/ProCardTheme/js/jquery.googlemap.js"); _manifest.DefineScript("TheProCardTheme-main") .SetUrl("~/ProCardTheme/js/main.js"); }
/// <summary> /// Adds a stylesheet to the resourceManifest. /// The style sheets name will be converted to a minified and a normal resource url. /// </summary> public static ResourceDefinition DefineStyleWithAllUrls(this ResourceManifest manifest, string name, params string[] subfolders) { var subfolderPath = string.Join("/", subfolders); return(manifest.DefineStyle(name).SetUrl(string.Format("{0}/{1}.min.css", subfolderPath, name), string.Format("{0}/{1}.css", subfolderPath, name))); }
static ResourceManifestOptionsConfiguration() { _manifest = new ResourceManifest(); _manifest.DefineScript("TheRonaldoTheme-vendor-jQuery") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/jquery-3.2.1.min.js", "~/TheRonaldoTheme.OrchardCore/js/jquery.min.js") .SetCdn("https://code.jquery.com/jquery-3.2.1.min.js", "https://code.jquery.com/jquery-3.2.1.js") .SetCdnIntegrity("sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=", "sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE=") .SetVersion("3.2.1"); _manifest.DefineScript("TheRonaldoTheme-vendor-jQuery-migrate") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/jquery-migrate-3.0.1.min.js") .SetCdn("https://code.jquery.com/jquery-migrate-3.0.1.min.js", "https://code.jquery.com/jquery-migrate-3.0.1.js") .SetCdnIntegrity("sha256-F0O1TmEa4I8N24nY0bya59eP6svWcshqX1uzwaWC4F4=", "sha256-VvnF+Zgpd00LL73P2XULYXEn6ROvoFaa/vbfoiFlZZ4=") .SetVersion("3.0.1"); _manifest.DefineScript("TheRonaldoTheme-vendor-popper") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/popper.min.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js") .SetCdnIntegrity("sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"); _manifest.DefineScript("TheRonaldoTheme-vendor-bootstrap") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/bootstrap.min.js") .SetCdn("https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js") .SetCdnIntegrity("sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM") .SetVersion("4.3.1"); _manifest.DefineScript("TheRonaldoTheme-vendor-jqueryeasing") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/jquery.easing.1.3.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js", "https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.js") .SetCdnIntegrity("sha512-ahmSZKApTDNd3gVuqL5TQ3MBTj8tL5p2tYV05Xxzcfu6/ecvt1A0j6tfudSGBVuteSoTRMqMljbfdU0g2eDNUA==", "sha512-brrjTp9G6MkKX5QjXwwAQkscfFpKi3okjyZ/M3vGwwg9qI1msoz7z+EbQBLXsTnVK3POjYBGHcQvX34GFKr/7A==") .SetVersion("1.3"); _manifest.DefineScript("TheRonaldoTheme-vendor-waypoints") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/jquery.waypoints.min.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.0/jquery.waypoints.min.js", "https://cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.0/jquery.waypoints.js") .SetCdnIntegrity("sha512-oy0NXKQt2trzxMo6JXDYvDcqNJRQPnL56ABDoPdC+vsIOJnU+OLuc3QP3TJAnsNKXUXVpit5xRYKTiij3ov9Qg==", "sha512-BnrjiUrz5UU3mBQD4awG5ekDBgTPUzpcNJtMQbNj4kfqStjn48180rUTEQjU5+Gf2BBfAtZETnMP4Khv0vcPug==") .SetVersion("4.0"); _manifest.DefineScript("TheRonaldoTheme-vendor-animateNumber") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/jquery.animateNumber.min.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/jquery-animateNumber/0.0.14/jquery.animateNumber.min.js", "https://cdnjs.cloudflare.com/ajax/libs/jquery-animateNumber/0.0.14/jquery.animateNumber.js") .SetCdnIntegrity("sha512-WY7Piz2TwYjkLlgxw9DONwf5ixUOBnL3Go+FSdqRxhKlOqx9F+ee/JsablX84YBPLQzUPJsZvV88s8YOJ4S/UA==", "sha512-1QMfUOxKmBVh0AakHIAh5tQfEW2r0atqXu4lHbAxgKZZnMY06M5MuTUrB6F/nQ6vjImMrWirGcLM1W6yslREpg=="); _manifest.DefineScript("TheRonaldoTheme-vendor-magnificpopup") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/jquery.mangnific-popup.min.js") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.min.js", "https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/jquery.magnific-popup.js") .SetCdnIntegrity("sha512-IsNh5E3eYy3tr/JiX2Yx4vsCujtkhwl7SLqgnwLNgf04Hrt9BT9SXlLlZlWx+OK4ndzAoALhsMNcCmkggjZB1w==", "sha512-C1zvdb9R55RAkl6xCLTPt+Wmcz6s+ccOvcr6G57lbm8M2fbgn2SUjUJbQ13fEyjuLViwe97uJvwa1EUf4F1Akw==") .SetVersion("1.1"); _manifest.DefineScript("TheRonaldoTheme-vendor-stellar") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/jquery.stellar.min.js"); _manifest.DefineScript("TheRonaldoTheme-vendor-carousel") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/owl.carousel.min.js"); _manifest.DefineScript("TheRonaldoTheme-vendor-scrollax") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/scrollax.min.js"); _manifest.DefineScript("TheRonaldoTheme-vendor-aos") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/aos.js"); _manifest.DefineScript("TheRonaldoTheme-vendor-main") .SetUrl("~/TheRonaldoTheme.OrchardCore/js/main.js") .SetDependencies("TheRonaldoTheme-vendor-jQuery", "TheRonaldoTheme-vendor-jQuery-migrate", "theronaldotheme-vendor-popper", "theronaldotheme-vendor-bootstrap", "theronaldotheme-vendor-jqueryeasing", "theronaldotheme-vendor-waypoints", "theronaldotheme-vendor-animatenumber", "theronaldotheme-vendor-carousel", "theronaldotheme-vendor-magnificpopup", "theronaldotheme-vendor-aos", "theronaldotheme-vendor-animatenumber", "theronaldotheme-vendor-scrollax", "theronaldotheme-vendor-stellar" ); _manifest.DefineStyle("TheRonaldoTheme-vendor-openiconic") .SetUrl("~/TheRonaldoTheme.OrchardCore/css/open-iconic-bootstrap.min.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/open-iconic/1.1.1/font/css/open-iconic.min.css") .SetCdnIntegrity("sha512-LeCmts7kEi09nKc+DwGJqDV+dNQi/W8/qb0oUSsBLzTYiBwxj0KBlAow2//jV7jwEHwSCPShRN2+IWwWcn1x7Q=="); _manifest.DefineStyle("TheRonaldoTheme-vendor-magnificpopup") .SetUrl("~/TheRonaldoTheme.OrchardCore/css/magnific-popup.css") .SetCdn("https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css", "https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.css") .SetCdnIntegrity("sha512-+EoPw+Fiwh6eSeRK7zwIKG2MA8i3rV/DGa3tdttQGgWyatG/SkncT53KHQaS5Jh9MNOT3dmFL0FjTY08And/Cw==", "sha512-WEQNv9d3+sqyHjrqUZobDhFARZDko2wpWdfcpv44lsypsSuMO0kHGd3MQ8rrsBn/Qa39VojphdU6CMkpJUmDVw==") .SetVersion("1.1"); }
/// <summary> /// Defines the styles. /// </summary> /// <param name="manifest">The manifest.</param> /// <param name="key">The key.</param> /// <param name="currentVersion">The current version.</param> /// <param name="previousVersions">The previous versions.</param> public void DefineStyles(ResourceManifest manifest, string key, string currentVersion, params string[] previousVersions) { var versions = new List <string>(previousVersions) { currentVersion }; Func <string, string, string> format = (a, b) => { return(string.Format(KeyFormat, a, b)); }; string commonDependency = format(key, "common"); string siteTheme = kendoThemeService.SiteTheme(); string siteThemePath = string.Format("kendo.{0}.min.css", string.IsNullOrWhiteSpace(siteTheme) ? "default" : siteTheme); foreach (var version in versions) { manifest.DefineStyle("jQueryTimeEntry").SetUrl("jquery.timeentry.css").SetVersion("2.0.1"); manifest .DefineStyle(format(key, "commonmaterial")) .SetUrl(VersionPath(version, "kendo.common-material.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "material")) .SetUrl(VersionPath(version, "kendo.material.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "commonbootstrap")) .SetUrl(VersionPath(version, "kendo.common-bootstrap.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "common")) .SetUrl(VersionPath(version, "kendo.common.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "default")) .SetUrl(VersionPath(version, "kendo.default.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "defaultmobile")) .SetUrl(VersionPath(version, "kendo.default.mobile.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "web")) .SetUrl(VersionPath(version, "kendo.web.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "mobileall")) .SetUrl(VersionPath(version, "kendo.mobile.all.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "dataviz")) .SetUrl(VersionPath(version, "kendo.dataviz.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "bootstrap")) .SetUrl(VersionPath(version, "kendo.bootstrap.min.css")) .SetVersion(version); manifest .DefineStyle(format(key, "datavizbootstrap")) .SetUrl(VersionPath(version, "kendo.dataviz.bootstrap.min.css")) .SetVersion(version); foreach (var themeName in Definitions.Themes) { manifest .DefineStyle(format(key, themeName)) .SetDependencies(commonDependency) .SetUrl(VersionPath(version, string.Format("kendo.{0}.min.css", themeName))) .SetVersion(version); } manifest .DefineStyle(format(key, "site")) .SetDependencies(commonDependency) .SetUrl(VersionPath(version, siteThemePath)) .SetVersion(version); //.SetDependencies(kendoThemeService.SiteTheme()) } }