Radarr/NzbDrone.Web/Views/AddSeries/RootDir.cshtml

42 lines
1.3 KiB
Plaintext
Raw Normal View History

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