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

57 lines
1.7 KiB
Plaintext
Raw Normal View History

2011-07-01 10:23:07 +03:00
@{
Layout = null;
}
2011-07-01 10:23:07 +03:00
<div>
<input id="rootDirInput" type="text" style="width: 400px" />
<button id="saveDir">
Add</button>
</div>
2011-06-30 09:15:06 +03:00
<div id="rootDirs">
2011-07-01 10:23:07 +03:00
@{Html.RenderAction("RootList");}
2011-06-30 09:15:06 +03: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 10:23:07 +03:00
@(Html.Telerik().ScriptRegistrar().OnDocumentReady("onRootReady()"))
2011-06-30 09:15:06 +03:00
<script type="text/javascript">
2011-07-01 10:23:07 +03:00
function onRootReady() {
2011-07-01 10:52:44 +03:00
$.ajaxSetup({
cache: false
});
2011-07-01 10:23:07 +03:00
$('#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 09:15:06 +03:00
$('#saveDir').click(saveRootDir);
2011-06-30 09:15:06 +03:00
function saveRootDir() {
var path = $("#rootDirInput").val();
2011-07-01 10:23:07 +03:00
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function () {
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) {
$('#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>