This repository has been archived by the owner on Nov 12, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
515785d
commit 1352c58
Showing
36 changed files
with
264 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
// ReSharper disable FieldCanBeMadeReadOnly.Global | |||
// ReSharper disable ConvertToConstant.Global | |||
|
|||
using System.Web; | |||
|
|||
namespace CacheTag.Core.Configuration | |||
{ | |||
public static class CacheTagSettings | |||
{ | |||
public const string AssemblyVersion = "1.0.*"; | |||
|
|||
public static string HashAlgorithm = "System.Security.Cryptography.MD5"; | |||
public static RuntimeMode RuntimeMode = RuntimeMode.Dynamic; | |||
public static bool HashFilesInDebugMode = false; | |||
public static bool HideFileExtensions = false; | |||
|
|||
public static string ImageTagFormat = @"<img src=""{0}"" width=""{1}"" height=""{2}"" alt=""{3}"" />"; | |||
public static string ScriptTagFormat = @"<script src=""{0}"" type=""text/javascript""></script>"; | |||
public static string StyleTagFormat = @"<link rel=""stylesheet"" type=""text/css"" href=""{0}"" />"; | |||
public static string InlineScriptTagFormat = @"<script type=""text/javascript"">{0}</script>"; | |||
public static string InlineStyleTagFormat = @"<style type=""text/css"">{0}</style>"; | |||
|
|||
public static bool IsReleaseMode | |||
{ | |||
get | |||
{ | |||
return RuntimeMode == RuntimeMode.ForceRelease || HttpContext.Current.IsDebuggingEnabled == false; | |||
} | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,59 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
|
|||
namespace CacheTag.Core.Configuration | |||
{ | |||
public static class FileExtensions | |||
{ | |||
public static string GetMimeType(string extension) | |||
{ | |||
switch (extension.ToLowerInvariant()) | |||
{ | |||
case ".jpg": | |||
case ".jpeg": | |||
return "image/jpeg"; | |||
|
|||
case ".gif": | |||
return "image/gif"; | |||
|
|||
case ".png": | |||
return "image/png"; | |||
|
|||
default: | |||
throw new ArgumentException("Unknown file extension"); | |||
} | |||
} | |||
} | |||
|
|||
public static class MimeTypes | |||
{ | |||
public static string GetFileExtension(string mimeType) | |||
{ | |||
switch (mimeType.ToLowerInvariant()) | |||
{ | |||
case "application/x-javascript": | |||
case "application/javascript": | |||
case "application/ecmascript": | |||
case "text/javascript": | |||
case "text/ecmascript": | |||
return ".js"; | |||
|
|||
case "text/css": | |||
return ".css"; | |||
|
|||
case "image/jpeg": | |||
return ".jpg"; | |||
|
|||
case "image/gif": | |||
return ".gif"; | |||
|
|||
case "image/png": | |||
return ".png"; | |||
|
|||
default: | |||
throw new ArgumentException("Unknown mime type"); | |||
} | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.