parent
6c7fa1674e
commit
463881843e
@ -0,0 +1,65 @@
|
||||
@model IEnumerable<String>
|
||||
|
||||
<script type="text/javascript" src="../../Scripts/2011.1.315/telerik.window.min.js"></script>
|
||||
|
||||
@section TitleContent{
|
||||
Add Existing Series
|
||||
}
|
||||
|
||||
@section MainContent{
|
||||
|
||||
@{ Html.Telerik().Window()
|
||||
.Name("Window")
|
||||
.Title("Add New Series")
|
||||
.Modal(true)
|
||||
.Buttons(b => b.Close())
|
||||
.Width(500)
|
||||
.Height(200)
|
||||
.Visible(false)
|
||||
.Draggable(true)
|
||||
.Resizable(resizing => resizing.Enabled(false))
|
||||
.LoadContentFrom("AddNew", "AddSeries")
|
||||
.Render();
|
||||
}
|
||||
|
||||
@if (Model.Count() == 0)
|
||||
{
|
||||
@Html.DisplayText("No Series to Add");
|
||||
}
|
||||
|
||||
@Html.DropDownList("masterDropbox", (SelectList) ViewData["qualities"],
|
||||
new {style = "width: 100px;", id = "masterDropboxId"})
|
||||
|
||||
@Html.Telerik().DropDownList().Name("tester").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes(
|
||||
new {style = "width: 100px", @class = "qualityDropbox"})
|
||||
|
||||
<button onclick="openAddNewSeries(); return false;" class="listButton">Add New</button>
|
||||
|
||||
@foreach (var path in Model)
|
||||
{
|
||||
Html.RenderAction("RenderPartial", "AddSeries", new {path});
|
||||
}
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
function openAddNewSeries() {
|
||||
var windowElement = $('#Window');
|
||||
|
||||
windowElement.data('tWindow').center().open();
|
||||
};
|
||||
|
||||
function closeAddNewSeries() {
|
||||
var window = $('#Window').data("tWindow");
|
||||
window.close();
|
||||
}
|
||||
|
||||
$("#masterDropboxId").change(function () {
|
||||
var selectedQuality = $('#masterDropboxId').get(0).selectedIndex;
|
||||
//$(".qualityDropbox").data("tComboBox").value(selectedQuality);
|
||||
//$(".qualityDropbox").data("tDropDownList").val(selectedQuality);
|
||||
|
||||
var comboBox = $(".qualityDropbox").data("tDropDownList");
|
||||
comboBox.select(selectedQuality);
|
||||
});
|
||||
</script>
|
@ -1,35 +0,0 @@
|
||||
@model IEnumerable<String>
|
||||
|
||||
@section TitleContent{
|
||||
Add Existing Series
|
||||
}
|
||||
|
||||
@section MainContent{
|
||||
|
||||
@if (Model.Count() == 0)
|
||||
{
|
||||
@Html.DisplayText("No Series to Add");
|
||||
}
|
||||
|
||||
@Html.DropDownList("masterDropbox", (SelectList) ViewData["qualities"],
|
||||
new {style = "width: 100px;", id = "masterDropboxId"})
|
||||
|
||||
@Html.Telerik().DropDownList().Name("tester").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes(
|
||||
new {style = "width: 100px", @class = "qualityDropbox"})
|
||||
|
||||
@foreach (var path in Model)
|
||||
{
|
||||
Html.RenderAction("RenderPartial", "AddSeries", new {path});
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#masterDropboxId").change(function () {
|
||||
var selectedQuality = $('#masterDropboxId').get(0).selectedIndex;
|
||||
//$(".qualityDropbox").data("tComboBox").value(selectedQuality);
|
||||
//$(".qualityDropbox").data("tDropDownList").val(selectedQuality);
|
||||
|
||||
var comboBox = $(".qualityDropbox").data("tDropDownList");
|
||||
comboBox.select(selectedQuality);
|
||||
});
|
||||
</script>
|
||||
}
|
@ -1,98 +1,67 @@
|
||||
@model NzbDrone.Web.Models.AddNewSeriesModel
|
||||
@using NzbDrone.Web.Models
|
||||
@model NzbDrone.Web.Models.AddNewSeriesModel
|
||||
|
||||
@section TitleContent{
|
||||
Add New Series
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function () {
|
||||
$('#searchButton').attr('disabled', '');
|
||||
});
|
||||
</script>
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
@section MainContent{
|
||||
<div style="width: 60%">
|
||||
<div style="display: inline">
|
||||
@Html.Label("Enter a Series Name")
|
||||
@Html.TextBox("new_series_name", String.Empty, new {id = "new_series_id"})
|
||||
<button class="t.button" id="searchButton" disabled="disabled" onclick="searchSeries ()">
|
||||
Search</button>
|
||||
</div>
|
||||
<div style="display: inline; float: right;">
|
||||
@Html.LabelFor(m => m.QualityProfileId)
|
||||
@Html.DropDownListFor(m => m.QualityProfileId, Model.QualitySelectList)
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="result"></div>
|
||||
<div>
|
||||
<fieldset>
|
||||
<legend>Root Directory</legend>
|
||||
|
||||
<div id="RootDirectories" class="rootDirectories" style="display: none">
|
||||
<fieldset>
|
||||
<legend>Root TV Folders</legend>
|
||||
@{int d = 0;}
|
||||
@{int d = 0;
|
||||
|
||||
@foreach (var dir in Model.RootDirectories)
|
||||
{
|
||||
@Html.RadioButton("selectedRootDir", dir.Path, d == 0, new {@class = "dirList examplePart", id = "dirRadio_" + d});
|
||||
@Html.Label(dir.Path)
|
||||
foreach (var dir in ViewData["RootDirs"] as List<RootDirModel>)
|
||||
{
|
||||
<div>
|
||||
@Html.RadioButton("selectedRootDir", dir.CleanPath, d == 0, new { @class = "dirList examplePart", id = "dirRadio_" + d })
|
||||
@Html.Label(dir.Path)
|
||||
@{ d++; }
|
||||
</div>
|
||||
}
|
||||
</fieldset>
|
||||
<div id="example">
|
||||
</div>
|
||||
<button class="t.button" onclick="addSeries ()">
|
||||
Add New Series</button>
|
||||
</div>
|
||||
|
||||
<div id="addResult"></div>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
$('#new_series_id').bind('keydown', function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
$('#searchButton').click();
|
||||
}
|
||||
});
|
||||
|
||||
function searchSeries() {
|
||||
var seriesSearch = $('#new_series_id');
|
||||
|
||||
$("#result").text("Searching...");
|
||||
$("#result").load('@Url.Action("SearchForSeries", "Series")', {
|
||||
seriesName: seriesSearch.val()
|
||||
});
|
||||
|
||||
document.getElementById('RootDirectories').style.display = 'inline';
|
||||
}
|
||||
|
||||
function addSeries() {
|
||||
var checkedSeries = $("input[name='selectedSeries']:checked").val();
|
||||
var checkedDir = $("input[name='selectedRootDir']:checked").val();
|
||||
var id = "#" + checkedSeries + "_text";
|
||||
var seriesName = $(id).val();
|
||||
var qualityProfileId = $("#QualityProfileId").val();
|
||||
|
||||
$("#addResult").load('@Url.Action("AddSeries", "AddSeries")', {
|
||||
dir: checkedDir,
|
||||
seriesId: checkedSeries,
|
||||
seriesName: seriesName,
|
||||
qualityProfileId: qualityProfileId
|
||||
});
|
||||
}
|
||||
|
||||
//Need to figure out how to use 'ViewData["DirSep"]' instead of hardcoding '\'
|
||||
$(".examplePart").live("change", function () {
|
||||
var dir = $("input[name='selectedRootDir']:checked").val();
|
||||
var series = $("input[name='selectedSeries']:checked").val();
|
||||
|
||||
var id = "#" + series + "_text";
|
||||
var seriesName = $(id).val();
|
||||
|
||||
var sep = "\\";
|
||||
|
||||
var str = "Target: " + dir + sep + seriesName;
|
||||
|
||||
$('#example').text(str);
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
<br/>
|
||||
<div>
|
||||
@{Html.Telerik().ComboBox()
|
||||
.Name("seriesList_new")
|
||||
.DataBinding(binding => binding.Ajax().Select("_textLookUp", "AddSeries").Delay(400))
|
||||
.Filterable(f => f.FilterMode(AutoCompleteFilterMode.Contains))
|
||||
.HighlightFirstMatch(true)
|
||||
.HtmlAttributes(new { style = "width: 300px;" })
|
||||
.Render();}
|
||||
@Html.Telerik().DropDownList().Name("qualityList_new").BindTo((SelectList)ViewData["quality"]).HtmlAttributes(new { style = "width: 100px", @class = "qualityDropbox" })
|
||||
<button class="listButton" onclick="addNewSeries()">
|
||||
Add</button>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
var addNewSeriesUrl = '@Url.Action("AddNewSeries", "AddSeries")';
|
||||
|
||||
function addNewSeries() {
|
||||
var seriesComboBox = $("#seriesList_new").data("tComboBox");
|
||||
var qualityComboBox = $("#qualityList_new").data("tDropDownList");
|
||||
var path = $("input[name='selectedRootDir']:checked").val();
|
||||
|
||||
sendToServerNew(seriesComboBox.value(), path, seriesComboBox.text(), qualityComboBox.value());
|
||||
}
|
||||
|
||||
function sendToServerNew(id, rootPath, seriesName, quality) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: addNewSeriesUrl,
|
||||
data: jQuery.param({ rootPath: rootPath, seriesName: seriesName, seriesId: id, qualityProfileId: quality }),
|
||||
error: function (req, status, error) {
|
||||
alert("Sorry! We could not add " + path + " at this time. " + error);
|
||||
},
|
||||
success: function (){
|
||||
//Clear the search box
|
||||
$("#seriesList_new").data("tComboBox").text('');
|
||||
|
||||
//Close the Window!
|
||||
closeAddNewSeries();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,58 +1 @@
|
||||
<style>
|
||||
|
||||
#container {
|
||||
width: 850px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.back
|
||||
{
|
||||
position:absolute;
|
||||
top:0;left:0;
|
||||
}
|
||||
.wrap
|
||||
{
|
||||
width:550px;
|
||||
height:390px;
|
||||
position:relative;
|
||||
margin:auto;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.comment
|
||||
{
|
||||
position: absolute;
|
||||
width: 550px;
|
||||
height: auto;
|
||||
top: 400px;
|
||||
left: 0px;
|
||||
letter-spacing: -1px;
|
||||
color: white; font: 24px/45px Berlin Sans FB, Sans-Serif;
|
||||
background: #4A4D4A;
|
||||
padding: 10px;
|
||||
filter:alpha(opacity=60);
|
||||
-moz-opacity:0.6;
|
||||
-khtml-opacity: 0.6;
|
||||
opacity: 0.6;
|
||||
line-height: 90%
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<button onclick="overlay()">Click Me!</button>
|
||||
|
||||
<div class="wrap">
|
||||
<img class="backer" src="../../Content/leopard.jpg" alt="image"/>
|
||||
|
||||
<span class="comment">
|
||||
Loading...
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function overlay() {
|
||||
$('.wrap').children('.comment').stop().css("top", "0px");
|
||||
}
|
||||
</script>
|
||||
Hello World
|
Loading…
Reference in new issue