1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Web/Views/AddSeries/RootDir.cshtml

48 lines
1.3 KiB
Plaintext
Raw Normal View History

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