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

48 lines
1.3 KiB
Plaintext
Raw Normal View History

<div>
2011-07-01 07:23:07 +00:00
<input id="rootDirInput" type="text" style="width: 400px" />
<button id="saveDir">
Add</button>
</div>
2011-06-30 06:15:06 +00:00
<div id="rootDirs">
2011-07-01 07:23:07 +00:00
@{Html.RenderAction("RootList");}
2011-06-30 06:15:06 +00:00
</div>
<script type="text/javascript">
jQuery(document).ready(function() {
2011-07-01 07:52:44 +00:00
$.ajaxSetup({
cache: false
});
bindFolderAutoComplete('#rootDirInput');
2011-07-01 07:52:44 +00:00
2011-07-01 07:23:07 +00:00
$('#rootDirInput').watermark('Start typing to add new root folder...');
$('#rootDirs .actionButton img').live('click',
function(image) {
2011-07-01 07:23:07 +00:00
var path = $(image.srcElement).attr('id');
$.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();
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function() {
2011-07-01 07:23:07 +00:00
refreshRoot();
$("#rootDirInput").val('');
});
2011-06-30 06:15:06 +00:00
}
2011-07-01 07:23:07 +00:00
function refreshRoot() {
$.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-01 07:23:07 +00:00
}
});
2011-06-30 06:15:06 +00:00
</script>