예제 #1
0
        private string Resolve(string virtualPath, string version)
        {
            string extension = virtualPathProvider.GetExtension(virtualPath);

            if (extension.IsCaseInsensitiveEqual(".js"))
            {
                return(ProbePath(virtualPath, version, extensions.JavaScript));
            }

            if (extension.IsCaseInsensitiveEqual(".css"))
            {
                return(ProbePath(virtualPath, version, extensions.Css));
            }

            return(virtualPath);
        }
예제 #2
0
        /// <summary>
        /// Locate the jQuery style sheets and scripts.
        /// </summary>
        /// <param name="virtualPath">The virtual path.</param>
        /// <param name="version">The version.</param>
        /// <returns>The virtual path</returns>
        private string InternalLocate(string virtualPath, string version)
        {
            string result = virtualPath;

            string extension = _virtualPathProvider.GetExtension(virtualPath);

            if (extension.IsCaseInsensitiveEqual(".js"))
            {
                result = _isInDebugMode ? ProbePath(virtualPath,
                                                    version, new[] { ".debug.js", ".js", ".min.js" }) : ProbePath(virtualPath, version, new[] { ".min.js", ".js", ".debug.js" });
            }
            else if (extension.IsCaseInsensitiveEqual(".css"))
            {
                result = _isInDebugMode ? ProbePath(virtualPath,
                                                    version, new[] { ".css", ".min.css" }) : ProbePath(virtualPath, version, new[] { ".min.css", ".css" });
            }

            return(result);
        }