parent
c65b0a68b0
commit
9deea44c87
File diff suppressed because it is too large
Load Diff
@ -1,44 +1,52 @@
|
|||||||
@using NzbDrone.Web.Models
|
@{
|
||||||
@model IEnumerable<String>
|
|
||||||
@{
|
|
||||||
Layout = null;
|
Layout = null;
|
||||||
}
|
}
|
||||||
|
<div>
|
||||||
|
<input id="rootDirInput" type="text" style="width: 400px" />
|
||||||
|
<button id="saveDir">
|
||||||
|
Add</button>
|
||||||
|
</div>
|
||||||
<div id="rootDirs">
|
<div id="rootDirs">
|
||||||
@foreach (var root in Model)
|
@{Html.RenderAction("RootList");}
|
||||||
{
|
|
||||||
<div class="actionButton delete">
|
|
||||||
<img src="/Content/Images/x_16.png" alt="delete" id='@root'/>
|
|
||||||
<span>@root</span>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<br />
|
|
||||||
<label for="ac-input">
|
|
||||||
Enter a GitHub username:</label>
|
|
||||||
<input id="rootDirInput" type="text" style="width: 100px" />
|
|
||||||
<button id="saveDir">
|
|
||||||
Save</button>
|
|
||||||
@(Html.Telerik().ScriptRegistrar().DefaultGroup(c => c.Add("http://ajax.googleapis.com/ajax/libs/yui/3.3.0/build/yui/yui-min.js")
|
@(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")
|
.Add("AutoComplete.js")
|
||||||
).OnDocumentReady("bindFolderAutoComplete('#rootDirInput')"))
|
).OnDocumentReady("bindFolderAutoComplete('#rootDirInput')"))
|
||||||
|
|
||||||
|
@(Html.Telerik().ScriptRegistrar().OnDocumentReady("onRootReady()"))
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$('#saveDir').click(saveRootDir);
|
|
||||||
|
|
||||||
function saveRootDir() {
|
function onRootReady() {
|
||||||
var path = $("#rootDirInput").val();
|
|
||||||
$.post("/AddSeries/SaveRootDir", { Path: path });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
$('#rootDirInput').watermark('Start typing to add new root folder...');
|
||||||
|
|
||||||
$(document).ready(function () {
|
|
||||||
$('#rootDirs .actionButton img').live('click',
|
$('#rootDirs .actionButton img').live('click',
|
||||||
function (image) {
|
function (image) {
|
||||||
var path = $(image.srcElement).attr('id');
|
var path = $(image.srcElement).attr('id');
|
||||||
$.post("/AddSeries/DeleteRootDir", { Path: path });
|
$.post('@Url.Action("DeleteRootDir", "AddSeries")', { Path: path }, function () {
|
||||||
|
refreshRoot();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#saveDir').click(saveRootDir);
|
||||||
|
|
||||||
|
function saveRootDir() {
|
||||||
|
var path = $("#rootDirInput").val();
|
||||||
|
$.post('@Url.Action("SaveRootDir", "AddSeries")', { Path: path }, function () {
|
||||||
|
refreshRoot();
|
||||||
|
$("#rootDirInput").val('');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function refreshRoot() {
|
||||||
|
$.get('@Url.Action("RootList", "AddSeries")', function (data) {
|
||||||
|
$('#rootDirs').html(data);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
@model IEnumerable<String>
|
||||||
|
@if (Model.Count() == 0)
|
||||||
|
{
|
||||||
|
<div class="actionButton delete">
|
||||||
|
<span>You have no root folders added.</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@foreach (var root in Model)
|
||||||
|
{
|
||||||
|
<div class="actionButton delete">
|
||||||
|
<img src="/Content/Images/x_16.png" alt="delete" id='@root'/>
|
||||||
|
<span>@root</span>
|
||||||
|
</div>
|
||||||
|
}
|
Loading…
Reference in new issue