sonarr-repo-only/NzbDrone.Web/Views/AddSeries/RootDir.cshtml

53 lines
1.6 KiB
Plaintext
Raw Normal View History

2011-07-01 07:23:07 +00:00
@{
Layout = null;
}
2011-07-01 07:23:07 +00:00
<div>
<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>
@(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')"))
2011-07-01 07:23:07 +00:00
@(Html.Telerik().ScriptRegistrar().OnDocumentReady("onRootReady()"))
2011-06-30 06:15:06 +00:00
<script type="text/javascript">
2011-07-01 07:23:07 +00:00
function onRootReady() {
$('#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();
});
});
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-01 07:23:07 +00:00
$.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() {
$.get('@Url.Action("RootList", "AddSeries")', function (data) {
$('#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>