|
1 |
| -<!DOCTYPE html> |
| 1 | +@using System.IO |
| 2 | +@using System.Text.Json |
| 3 | +<!DOCTYPE html> |
2 | 4 | <html lang="en">
|
3 | 5 | <head>
|
4 | 6 | <meta charset="utf-8" />
|
|
9 | 11 | var themeVersion = "11.0.2";
|
10 | 12 | }
|
11 | 13 | <link href="https://kendo.cdn.telerik.com/themes/@themeVersion/default/default-ocean-blue.css" rel="stylesheet" type="text/css" />
|
12 |
| - |
| 14 | + |
13 | 15 | <script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
|
14 | 16 | <script src="https://unpkg.com/jszip/dist/jszip.min.js"></script>
|
15 | 17 | <script src="https://kendo.cdn.telerik.com/@kendoVersion/js/kendo.all.min.js"></script>
|
16 | 18 | <script src="https://kendo.cdn.telerik.com/@kendoVersion/js/kendo.aspnetmvc.min.js"></script>
|
17 | 19 |
|
18 | 20 | <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
19 | 21 | <link rel="stylesheet" href="~/css/site.css" />
|
| 22 | + |
| 23 | + <script> |
| 24 | + function searchExamples() { |
| 25 | + sessionStorage["searchValue"] = $(".k-searchbox input").val(); |
| 26 | +
|
| 27 | + $("#panelbar").data().kendoPanelBar.items().each(function (i, el) { |
| 28 | + var item = $(el); |
| 29 | + var condition = true; |
| 30 | + var literals = $(".k-searchbox input").val().split(' '); |
| 31 | + for (var i = 0; i < literals.length; i++) { |
| 32 | + if (!item.text().replaceAll(' ', '').toLowerCase().includes(literals[i].toLowerCase())) { |
| 33 | + condition = false; |
| 34 | + break; |
| 35 | + } |
| 36 | + } |
| 37 | + if (condition) { |
| 38 | + item.parent().show(); |
| 39 | + } |
| 40 | + else { |
| 41 | + item.parent().hide(); |
| 42 | + } |
| 43 | + }) |
| 44 | + } |
| 45 | + function gridSelect(e) { |
| 46 | + sessionStorage["position"] = e.sender.element.scrollTop(); |
| 47 | + var literalParts=e.item.textContent.split(" "); |
| 48 | + literalParts.shift(); |
| 49 | + var exampleName= literalParts.toString().replaceAll(",", ""); |
| 50 | + window.location ="../"+ exampleName+"/"+exampleName; |
| 51 | + } |
| 52 | + $(document).ready(function () { |
| 53 | + setTimeout(function () { |
| 54 | + if (sessionStorage["searchValue"]) { |
| 55 | + $(".k-searchbox input").val(sessionStorage["searchValue"]); |
| 56 | + $(".k-searchbox input").trigger("onkeyup"); |
| 57 | + } |
| 58 | +
|
| 59 | + var item = $(".k-panelbar-item") |
| 60 | + .filter(function (index) { |
| 61 | + return $(this).find(".k-panelbar-item-text").text().endsWith($(".title-container").text().trim()); |
| 62 | + }) |
| 63 | + var panelBar = $("#panelbar").data().kendoPanelBar; |
| 64 | + panelBar.select(item); |
| 65 | + if (sessionStorage["position"]) { |
| 66 | + panelBar.element.scrollTop(sessionStorage["position"]); |
| 67 | + } |
| 68 | + }, 20) |
| 69 | + }) |
| 70 | + </script> |
20 | 71 | </head>
|
21 | 72 | <body>
|
22 | 73 | <header>
|
|
33 | 84 | <a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Home</a>
|
34 | 85 | </li>
|
35 | 86 | </ul>
|
36 |
| - @if(ViewContext.RouteData.Values.ContainsKey("controller") && ViewContext.RouteData.Values["controller"].ToString() == "SecurityTrimming") |
| 87 | + @if (ViewContext.RouteData.Values.ContainsKey("controller") && ViewContext.RouteData.Values["controller"].ToString() == "SecurityTrimming") |
37 | 88 | {
|
38 |
| - <partial name="_LoginPartial"/> |
| 89 | + <partial name="_LoginPartial" /> |
39 | 90 | }
|
40 | 91 | </div>
|
41 | 92 | </div>
|
42 | 93 | </nav>
|
43 | 94 | </header>
|
| 95 | + <div class="toc"> |
| 96 | + <span class="k-searchbox k-input k-input-md k-rounded-md k-input-solid"> |
| 97 | + <span class="k-icon k-svg-icon k-svg-i-search k-input-icon"> |
| 98 | + <svg viewBox="0 0 512 512" focusable="false" xmlns="http://www.w3.org/2000/svg"> |
| 99 | + <path d="M365.3 320h-22.7l-26.7-26.7C338.5 265.7 352 230.4 352 192c0-88.4-71.6-160-160-160S32 103.6 32 192s71.6 160 160 160c38.4 0 73.7-13.5 101.3-36.1l26.7 26.7v22.7L434.7 480l45.3-45.3zM64 192c0-70.7 57.3-128 128-128s128 57.3 128 128-57.3 128-128 128S64 262.7 64 192"> |
| 100 | + </path> |
| 101 | + </svg> |
| 102 | + </span> |
| 103 | + <input autocomplete="off" placeholder="Search..." title="Search..." aria-label="Search..." class="k-input-inner" onkeyup="searchExamples();"> |
| 104 | + </span> |
| 105 | + @(Html.Kendo().PanelBar() |
| 106 | + .Name("panelbar") |
| 107 | + .Events(e => e.Select("gridSelect")) |
| 108 | + .ExpandMode(PanelBarExpandMode.Single) |
| 109 | + .Items(panelbar => |
| 110 | + { |
| 111 | + foreach (var example in (List<Demo>)JsonSerializer.Deserialize<List<Demo>>(File.ReadAllBytes(Directory.GetCurrentDirectory() + "/wwwroot/files/ExamplesEndpoints.txt"))) |
| 112 | + { |
| 113 | + panelbar.Add().Text(example.ComponentName + " " + System.Text.RegularExpressions.Regex.Replace(example.ActionName, "(\\B[A-Z])", " $1")); |
| 114 | + } |
| 115 | + })) |
| 116 | + </div> |
44 | 117 | <div class="container">
|
45 |
| - <main role="main" class="pb-3"> |
46 |
| - @RenderBody() |
47 |
| - </main> |
| 118 | + <h4 class="title-container">@(System.Text.RegularExpressions.Regex.Replace(ViewContext.HttpContext.Request.Path.Value.Split('/')[1], "(\\B[A-Z])", " $1"))</h4> |
| 119 | + @{ |
| 120 | + RenderBody(); |
| 121 | + var controllerPath = ViewContext.View.Path.Replace("Views","Controllers").Replace(".cshtml", "")+"Controller.cs"; |
| 122 | + } |
| 123 | + @(Html.Kendo().TabStrip() |
| 124 | + .Name("tabstrip-images") |
| 125 | + .Items(tabstrip => |
| 126 | + { |
| 127 | + tabstrip.Add().Text("Sample") |
| 128 | + .Selected(true) |
| 129 | + .Content(@<text> |
| 130 | + <main role="main" class="pb-3"> |
| 131 | + @RenderBody() |
| 132 | + </main> |
| 133 | + </text>); |
| 134 | + if (!ViewContext.View.Path.Contains("/Home/")){ |
| 135 | + tabstrip.Add().Text(ViewContext.View.Path.Split("/")[3]) |
| 136 | + .Content(@<text> |
| 137 | + @{ |
| 138 | + string line; |
| 139 | + System.IO.StreamReader file = new System.IO.StreamReader(Directory.GetCurrentDirectory() + ViewContext.View.Path); |
| 140 | + var fileLines = new List<string>(); |
| 141 | + while ((line = file.ReadLine()) != null) |
| 142 | + { |
| 143 | + <pre>@line</pre> |
| 144 | + } |
| 145 | + } |
| 146 | + </text>); |
| 147 | + } |
| 148 | + |
| 149 | + if (File.Exists(Directory.GetCurrentDirectory()+ViewContext.View.Path.Replace("Views", "Controllers").Replace(".cshtml", "") + "Controller.cs")) |
| 150 | + { |
| 151 | + tabstrip.Add().Text(ViewContext.View.Path.Split("/")[3].Replace(".cshtml","")+"Controller.cs") |
| 152 | + .Content(@<text> |
| 153 | + @{ |
| 154 | + string line; |
| 155 | + System.IO.StreamReader file = new System.IO.StreamReader(Directory.GetCurrentDirectory()+ |
| 156 | + ViewContext.View.Path.Replace("Views","Controllers").Replace(".cshtml", "")+"Controller.cs"); |
| 157 | + var fileLines = new List<string>(); |
| 158 | + while ((line = file.ReadLine()) != null) |
| 159 | + { |
| 160 | + <pre>@line</pre> |
| 161 | + } |
| 162 | + } |
| 163 | + </text>); |
| 164 | + } |
| 165 | + })) |
48 | 166 | </div>
|
49 | 167 |
|
50 | 168 | <footer class="border-top footer text-muted">
|
51 | 169 | <div class="container">
|
52 |
| - © @DateTime.Now.Year Telerik.Examples.Mvc |
| 170 | + <p>Copyright © @DateTime.Now.Year Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.</p> |
53 | 171 | </div>
|
54 | 172 | </footer>
|
55 | 173 | <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
|
0 commit comments