1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-22 17:31:47 +02:00
Radarr/NzbDrone.Web/Views/AddSeries/RootDir.cshtml

42 lines
1.3 KiB
Plaintext
Raw Normal View History

2011-07-01 22:59:25 +02:00
<span>
2011-07-28 00:59:48 +02:00
<input id="rootDirInput" class="folderLookup" type="text" style="width: 400px" />
2011-07-01 09:23:07 +02:00
<button id="saveDir">
Add</button>
2011-07-28 00:59:48 +02:00
</span><span id="rootDirs">
2011-07-01 09:23:07 +02:00
@{Html.RenderAction("RootList");}
2011-07-01 22:59:25 +02:00
</span>
2011-06-30 08:15:06 +02:00
<script type="text/javascript">
2011-07-28 00:59:48 +02:00
jQuery(document).ready(function () {
2011-07-01 09:23:07 +02:00
$('#rootDirInput').watermark('Start typing to add new root folder...');
$('#rootDirs .actionButton img').live('click',
2011-07-28 00:59:48 +02:00
function (image) {
2011-07-01 23:19:52 +02:00
var path = $(image.target).attr('id');
2011-07-28 00:59:48 +02:00
$.post('@Url.Action("DeleteRootDir", "AddSeries")', { Path: path }, function () {
2011-07-01 09:23:07 +02:00
refreshRoot();
});
});
2011-06-30 08:15:06 +02:00
$('#saveDir').click(saveRootDir);
2011-06-30 08:15:06 +02:00
function saveRootDir() {
var path = $("#rootDirInput").val();
2011-07-28 00:59:48 +02:00
if (path) {
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function () {
refreshRoot();
$("#rootDirInput").val('');
});
}
2011-06-30 08:15:06 +02:00
}
2011-07-01 09:23:07 +02:00
function refreshRoot() {
2011-07-28 00:59:48 +02:00
$.get('@Url.Action("RootList", "AddSeries")', function (data) {
2011-07-01 09:23:07 +02:00
$('#rootDirs').html(data);
2011-06-30 08:15:06 +02:00
});
2011-07-28 00:59:48 +02:00
reloadExistingSeries();
2011-07-01 09:23:07 +02:00
}
});
2011-06-30 08:15:06 +02:00
</script>