@*
    Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
    Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
*@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Script</title>
</head>
<body>
    <h2>Script tag helper test</h2>
    <script src="~/styles/site.js" data-foo="foo-data1" title="&lt;the title>">
        // Regular script with comment in body, and extra properties.
    </script>

    <script src="~/blank.js?a=b&c=d" asp-fallback-src="~/styles/site.js?a=b&c=d" asp-fallback-test="false" data-foo="foo-data2" title="&lt;the title>">
        // TagHelper script with comment in body, and extra properties.
    </script>

    <script src="~/blank.js" asp-fallback-src-include="**/site.js" asp-fallback-test="false" title='"the" title'>
        // Fallback to globbed src
    </script>

    <script src="~/blank.js"
            asp-fallback-src-include="**/*.js"
            asp-fallback-src-exclude="**/site3.js"
            asp-fallback-test="false">
        // Fallback to globbed src with exclude
    </script>

    <script src="~/blank.js"
            asp-fallback-src="~/styles/site.js"
            asp-fallback-src-include="**/site2.js"
            asp-fallback-test="false">
        // Fallback to globbed and static src
    </script>

    <script src="~/blank.js"
            asp-fallback-src="~/styles/site.js"
            asp-fallback-src-include="**/site.js"
            asp-fallback-test="false">
        // Fallback to globbed and static src should de-dupe
    </script>

    <script src="~/blank.js" asp-fallback-src-exclude="**/site3.js" asp-fallback-test="false">
        // Fallback to globbed src with missing include
    </script>

    <script src="~/blank.js"
            asp-fallback-src="~/styles/site.js"
            asp-fallback-src-exclude="**/site3.js"
            asp-fallback-test="false">
        // Fallback to static and globbed src with missing include
    </script>

    <script src="~/blank.js" asp-fallback-src-include="**/appRoot.js" asp-fallback-test="false">
        // Fallback to globbed src outside of webroot
    </script>

    <script src="~/blank.js" asp-fallback-src-include="../**/appRoot.js" asp-fallback-test="false">
        // Fallback to globbed src outside of webroot
    </script>

    <script asp-fallback-src="~/styles/site.js" asp-fallback-test="false" data-foo="foo-data3">
        // Valid TagHelper (although no src is provided) script with comment in body, and extra properties.
    </script>

    <script src="~/blank.js" asp-fallback-src="~/styles/site.js">
        // Invalid TagHelper script with comment in body.
    </script>

    <!-- Globbed script tag with existing file -->
    <script asp-src-include="**/site.js">
        // This comment shouldn't be emitted
    </script>

    <!-- Globbed script tag with existing file and exclude -->
    <script asp-src-include="**/*.js" asp-src-exclude="**/site3.js">
        // This comment shouldn't be emitted
    </script>

    <script asp-src-exclude="**/site2.js">
        // Globbed script tag missing include
    </script>

    <script src="~/styles/site.js" asp-src-exclude="**/site2.js">
        // Globbed script tag missing include but with static src
    </script>

    <!-- Globbed script tag with comma separated include pattern -->
    <script asp-src-include="~/styles/*.js, ~/styles/sub/*.js"></script>

    <!-- Globbed script tag with missing file -->
    <script asp-src-include="**/notThere.js"></script>

    <!-- Globbed script tag with file outside of webroot -->
    <script asp-src-include="../**/appRoot.js"></script>

    <!-- Globbed script tag with file outside of webroot -->
    <script asp-src-include="**/appRoot.js"></script>

    <script src="~/styles/site.js" asp-src-include="**/site2.js">
        // Globbed script tag with existing file and static src
    </script>

    <script src="~/styles/site.js" asp-src-include="**/site.js">
        // Globbed script tag with existing file and static src should dedupe
    </script>

    <script src="~/blank.js" asp-fallback-src="~/styles/site.js" asp-fallback-test="false" asp-append-version="true">
        // TagHelper script with comment in body, and file version.
    </script>

    <script src="~/blank.js" asp-fallback-src-include="**/site.js" asp-fallback-test="false" asp-append-version="true">
        // Fallback to globbed src with file version.
    </script>

    <script src="~/styles/site.js" asp-append-version="true">
        // Regular script with comment in body, and file version.
    </script>

    <!-- Globbed script tag with existing files and version -->
    <script asp-src-include="**/*.js" asp-append-version="true">
        // This comment shouldn't be emitted
    </script>

    <!-- Globbed script tag with existing file, exclude and version -->
    <script asp-src-include="**/*.js" asp-src-exclude="**/site3.js" asp-append-version="true">
        // This comment shouldn't be emitted
    </script>
</body>
</html>