diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/ImageTagHelper.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/ImageTagHelper.cs index cdd1496453..1e3e19e574 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/ImageTagHelper.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/ImageTagHelper.cs @@ -15,12 +15,12 @@ namespace Microsoft.AspNet.Mvc.TagHelpers /// /// The tag helper won't process for cases with just the 'src' attribute. /// - [TargetElement("img", Attributes = FileVersionAttributeName + "," + SrcAttributeName)] + [TargetElement("img", Attributes = AppendVersionAttributeName + "," + SrcAttributeName)] public class ImageTagHelper : TagHelper { private static readonly string Namespace = typeof(ImageTagHelper).Namespace; - private const string FileVersionAttributeName = "asp-file-version"; + private const string AppendVersionAttributeName = "asp-append-version"; private const string SrcAttributeName = "src"; private FileVersionProvider _fileVersionProvider; @@ -51,8 +51,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers /// /// If true then a query string "v" with the encoded content of the file is added. /// - [HtmlAttributeName(FileVersionAttributeName)] - public bool FileVersion { get; set; } + [HtmlAttributeName(AppendVersionAttributeName)] + public bool AppendVersion { get; set; } protected IHostingEnvironment HostingEnvironment { get; } @@ -64,7 +64,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers /// public override void Process(TagHelperContext context, TagHelperOutput output) { - if (FileVersion) + if (AppendVersion) { EnsureFileVersionProvider(); output.Attributes[SrcAttributeName] = _fileVersionProvider.AddFileVersionToPath(Src); diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/LinkTagHelper.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/LinkTagHelper.cs index 6619deaaa1..f4342c0411 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/LinkTagHelper.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/LinkTagHelper.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers [TargetElement("link", Attributes = FallbackTestClassAttributeName)] [TargetElement("link", Attributes = FallbackTestPropertyAttributeName)] [TargetElement("link", Attributes = FallbackTestValueAttributeName)] - [TargetElement("link", Attributes = FileVersionAttributeName)] + [TargetElement("link", Attributes = AppendVersionAttributeName)] public class LinkTagHelper : TagHelper { private static readonly string Namespace = typeof(LinkTagHelper).Namespace; @@ -43,14 +43,14 @@ namespace Microsoft.AspNet.Mvc.TagHelpers private const string FallbackTestPropertyAttributeName = "asp-fallback-test-property"; private const string FallbackTestValueAttributeName = "asp-fallback-test-value"; private readonly string FallbackJavaScriptResourceName = Namespace + ".compiler.resources.LinkTagHelper_FallbackJavaScript.js"; - private const string FileVersionAttributeName = "asp-file-version"; + private const string AppendVersionAttributeName = "asp-append-version"; private const string HrefAttributeName = "href"; private FileVersionProvider _fileVersionProvider; private static readonly ModeAttributes[] ModeDetails = new[] { // Regular src with file version alone - ModeAttributes.Create(Mode.FileVersion, new[] { FileVersionAttributeName }), + ModeAttributes.Create(Mode.AppendVersion, new[] { AppendVersionAttributeName }), // Globbed Href (include only) no static href ModeAttributes.Create(Mode.GlobbedHref, new [] { HrefIncludeAttributeName }), // Globbed Href (include & exclude), no static href @@ -141,8 +141,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers /// /// If true then a query string "v" with the encoded content of the file is added. /// - [HtmlAttributeName(FileVersionAttributeName)] - public bool? FileVersion { get; set; } + [HtmlAttributeName(AppendVersionAttributeName)] + public bool? AppendVersion { get; set; } /// /// A comma separated list of globbed file patterns of CSS stylesheets to fallback to in the case the primary @@ -229,7 +229,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers var builder = new DefaultTagHelperContent(); - if (mode == Mode.Fallback && string.IsNullOrEmpty(HrefInclude) || mode == Mode.FileVersion) + if (mode == Mode.Fallback && string.IsNullOrEmpty(HrefInclude) || mode == Mode.AppendVersion) { // No globbing to do, just build a tag to match the original one in the source file. // Or just add file version to the link tag. @@ -274,7 +274,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers if (fallbackHrefs.Length > 0) { - if (FileVersion == true) + if (AppendVersion == true) { for (var i=0; i < fallbackHrefs.Length; i++) { @@ -338,7 +338,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers foreach (var attribute in attributes) { var attributeValue = attribute.Value; - if (FileVersion == true && + if (AppendVersion == true && string.Equals(attribute.Name, HrefAttributeName, StringComparison.OrdinalIgnoreCase)) { // "href" values come from bound attributes and globbing. So anything but a non-null string is @@ -366,7 +366,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers /// /// Just adding a file version for the generated urls. /// - FileVersion = 0, + AppendVersion = 0, /// /// Just performing file globbing search for the href, rendering a separate <link> for each match. diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/ScriptTagHelper.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/ScriptTagHelper.cs index 8b278a1e59..115dfb6813 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/ScriptTagHelper.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/ScriptTagHelper.cs @@ -27,7 +27,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers [TargetElement("script", Attributes = FallbackSrcIncludeAttributeName)] [TargetElement("script", Attributes = FallbackSrcExcludeAttributeName)] [TargetElement("script", Attributes = FallbackTestExpressionAttributeName)] - [TargetElement("script", Attributes = FileVersionAttributeName)] + [TargetElement("script", Attributes = AppendVersionAttributeName)] public class ScriptTagHelper : TagHelper { private const string SrcIncludeAttributeName = "asp-src-include"; @@ -37,13 +37,13 @@ namespace Microsoft.AspNet.Mvc.TagHelpers private const string FallbackSrcExcludeAttributeName = "asp-fallback-src-exclude"; private const string FallbackTestExpressionAttributeName = "asp-fallback-test"; private const string SrcAttributeName = "src"; - private const string FileVersionAttributeName = "asp-file-version"; + private const string AppendVersionAttributeName = "asp-append-version"; private FileVersionProvider _fileVersionProvider; private static readonly ModeAttributes[] ModeDetails = new[] { // Regular src with file version alone - ModeAttributes.Create(Mode.FileVersion, new[] { FileVersionAttributeName }), + ModeAttributes.Create(Mode.AppendVersion, new[] { AppendVersionAttributeName }), // Globbed src (include only) ModeAttributes.Create(Mode.GlobbedSrc, new [] { SrcIncludeAttributeName }), // Globbed src (include & exclude) @@ -128,8 +128,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers /// /// A query string "v" with the encoded content of the file is added. /// - [HtmlAttributeName(FileVersionAttributeName)] - public bool? FileVersion { get; set; } + [HtmlAttributeName(AppendVersionAttributeName)] + public bool? AppendVersion { get; set; } /// /// A comma separated list of globbed file patterns of JavaScript scripts to fallback to in the case the @@ -199,7 +199,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers var builder = new DefaultTagHelperContent(); var originalContent = await context.GetChildContentAsync(); - if (mode == Mode.Fallback && string.IsNullOrEmpty(SrcInclude) || mode == Mode.FileVersion) + if (mode == Mode.Fallback && string.IsNullOrEmpty(SrcInclude) || mode == Mode.AppendVersion) { // No globbing to do, just build a - - - - -