Esempio n. 1
0
        /// <summary>
        /// Appends a version hash querystring parameter to the end
        /// of the file path, e.g. 'myfile.js?v=examplecomputedhash'
        /// </summary>
        /// <param name="applicationRelativePath">
        /// The static resource file path, which must be the full application
        /// relative path.
        /// </param>
        /// <returns>
        /// If the file is found, the path is returned with the version
        /// appended, otherwise the unmodified path is returned.
        /// </returns>
        public string AppendVersion(string applicationRelativePath)
        {
            var appended = _staticFilePathFormatter.AppendVersion(applicationRelativePath);

            return(appended);
        }
Esempio n. 2
0
        /// <summary>
        /// Returns an application relative path to a js file in the conventional
        /// '[modulepath]/Content/js' directory. The path is automatically versioned e.g. 'myfile.js?v=uniquehash.
        /// The renderer first checks for a minified file by appending '_min' to the filename and
        /// will use that file unless DebugSettings.UseUncompressedResources is set to true.
        /// </summary>
        /// <param name="moduleRouteLibrary">Route library for the module to render the script for.</param>
        /// <param name="fileName">The javascript filename without a .js extension.</param>
        public string JsPath(ModuleRouteLibrary moduleRouteLibrary, string fileName)
        {
            string virtualPath = JsPathWithoutVersion(moduleRouteLibrary, fileName);

            return(_staticFilePathFormatter.AppendVersion(virtualPath));
        }