You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/NzbDrone.Web/Views/AddSeries/RootDir.cshtml

57 lines
1.7 KiB

@{
Layout = null;
}
<div>
<input id="rootDirInput" type="text" style="width: 400px" />
<button id="saveDir">
Add</button>
</div>
14 years ago
<div id="rootDirs">
@{Html.RenderAction("RootList");}
14 years ago
</div>
@(Html.Telerik().ScriptRegistrar().DefaultGroup(c => c.Add("http://ajax.googleapis.com/ajax/libs/yui/3.3.0/build/yui/yui-min.js")
.Add("AutoComplete.js")
).OnDocumentReady("bindFolderAutoComplete('#rootDirInput')"))
@(Html.Telerik().ScriptRegistrar().OnDocumentReady("onRootReady()"))
14 years ago
<script type="text/javascript">
function onRootReady() {
14 years ago
$.ajaxSetup({
cache: false
});
$('#rootDirInput').watermark('Start typing to add new root folder...');
$('#rootDirs .actionButton img').live('click',
function (image) {
var path = $(image.srcElement).attr('id');
$.post('@Url.Action("DeleteRootDir", "AddSeries")', { Path: path }, function () {
refreshRoot();
});
});
14 years ago
$('#saveDir').click(saveRootDir);
14 years ago
function saveRootDir() {
var path = $("#rootDirInput").val();
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function () {
refreshRoot();
$("#rootDirInput").val('');
});
14 years ago
}
function refreshRoot() {
$.get('@Url.Action("RootList", "AddSeries")', function (data) {
$('#rootDirs').html(data);
14 years ago
});
}
}
14 years ago
</script>