Commit afe68535 authored by SergeevaAA's avatar SergeevaAA

Перенесла стили и скрипты в отдельные файлы

parent fae1084d
......@@ -42,45 +42,4 @@
else
{
<h4>С файлами еще не производилось никаких действий.</h4>
}
<script>
function downloadFile(id) {
$.get('@Url.Action("GetDownloadUrl", "File")', { id: id })
.done(function (url) {
location.href = url;
})
.fail(function (xhr) {
searchFiles();
alert(xhr.responseText);
})
}
function deleteFile(id) {
$.get('@Url.Action("Delete", "File")', { id: id })
.done(function (message) {
searchFiles();
alert(message);
})
.fail(function (xhr) {
searchFiles();
alert(xhr.responseText);
})
}
</script>
<style>
.download {
height: 30px;
width: 30px;
background-image: url(/images/Download.png);
background-size: cover;
}
.delete {
height: 30px;
width: 30px;
background-image: url(/images/Delete.png);
background-size: cover;
}
</style>
\ No newline at end of file
}
\ No newline at end of file
......@@ -16,16 +16,4 @@
<br />
<div id="search-results">
@Html.Action("Search", "File")
</div>
<script>
function searchFiles() {
$.get('@Url.Action("Search", "File")', { searchString: $('#searchString').val(), isCaseSensitive: $('#isCaseSensitive')[0].checked })
.done(function (data) {
$('#search-results').html(data);
})
.fail(function (xhr) {
$('#search-results').html(xhr.responseText);
})
}
</script>
\ No newline at end of file
</div>
\ No newline at end of file
......@@ -67,19 +67,17 @@
<footer class="border-top footer text-muted">
<div class="container">
&copy; 2020 - FileDesk - <a asp-area="" asp-controller="Home" asp-action="About">О сайте</a>
&copy; 2020 - FileDesk - @Html.ActionLink("О сайте", "About", "Home")
</div>
</footer>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<script src="~/js/site.js" asp-append-version="true"></script>
<script>
var searchUrl = '@Url.Action("Search", "File")';
var downloadUrl = '@Url.Action("GetDownloadUrl", "File")';
var deleteUrl = '@Url.Action("Delete", "File")';
</script>
@RenderSection("Scripts", required: false)
</body>
</html>
<style>
img {
height: 30px;
width: 30px;
}
</style>
\ No newline at end of file
</html>
\ No newline at end of file
......@@ -41,50 +41,4 @@
{
<h4>Файлы не найдены.</h4>
}
</div>
<script>
function downloadFile(id) {
$.get('@Url.Action("GetDownloadUrl", "File")', { id: id })
.done(function (url) {
location.href = url;
})
.fail(function (xhr) {
searchFiles();
alert(xhr.responseText);
})
}
function deleteFile(id) {
$.get('@Url.Action("Delete", "File")', { id: id })
.done(function (message) {
searchFiles();
alert(message);
})
.fail(function (xhr) {
searchFiles();
alert(xhr.responseText);
})
}
</script>
<style>
img {
height: 30px;
width: 30px;
}
.download {
height: 30px;
width: 30px;
background-image: url(/images/Download.png);
background-size: cover;
}
.delete {
height: 30px;
width: 30px;
background-image: url(/images/Delete.png);
background-size: cover;
}
</style>
\ No newline at end of file
</div>
\ No newline at end of file
......@@ -70,3 +70,24 @@ body {
white-space: nowrap;
line-height: 60px; /* Vertically center the text there */
}
/*My own css
-------------------------------------------------------*/
img {
height: 30px;
width: 30px;
}
.download {
height: 30px;
width: 30px;
background-image: url(/images/Download.png);
background-size: cover;
}
.delete {
height: 30px;
width: 30px;
background-image: url(/images/Delete.png);
background-size: cover;
}
\ No newline at end of file
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
function searchFiles() {
$.get(searchUrl, { searchString: $('#searchString').val(), isCaseSensitive: $('#isCaseSensitive')[0].checked })
.done(function (data) {
$('#search-results').html(data);
})
.fail(function (xhr) {
$('#search-results').html(xhr.responseText);
})
}
// Write your JavaScript code.
function downloadFile(id) {
$.get(downloadUrl, { id: id })
.done(function (url) {
location.href = url;
})
.fail(function (xhr) {
searchFiles();
alert(xhr.responseText);
})
}
function deleteFile(id) {
$.get(deleteUrl, { id: id })
.done(function (message) {
searchFiles();
alert(message);
})
.fail(function (xhr) {
searchFiles();
alert(xhr.responseText);
})
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment