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

57 lines
1.7 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() {
2011-07-01 07:52:44 +00:00
$.ajaxSetup({
cache: false
});
2011-07-01 07:23:07 +00: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 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>