2011-04-01 23:55:20 +00:00
|
|
|
@model SelectList
|
|
|
|
<div style="position: relative; padding: 10px" id="div_ @ViewData["guid"]">
|
2011-04-01 06:36:34 +00:00
|
|
|
<div style="position: relative; left: 0; width: 50%;">
|
2011-04-01 23:55:20 +00:00
|
|
|
@ViewData["path"].ToString()
|
2011-04-01 06:36:34 +00:00
|
|
|
</div>
|
|
|
|
<div style="position: relative; right: 0; width: 50%;">
|
2011-04-01 23:55:20 +00:00
|
|
|
@(Html.Telerik().ComboBox()
|
|
|
|
.Name(ViewData["guid"].ToString())
|
2011-04-01 06:36:34 +00:00
|
|
|
// .AutoFill(true)
|
|
|
|
.BindTo(Model)
|
|
|
|
// .DataBinding(b => b.Ajax().Select("TvDbLookup", "AddSeries"))
|
2011-04-01 23:11:09 +00:00
|
|
|
.DataBinding(binding => binding.Ajax().Select("_textLookUp", "AddSeries").Delay(400).Cache(false))
|
|
|
|
|
2011-04-01 06:36:34 +00:00
|
|
|
.Filterable(f => f.FilterMode(AutoCompleteFilterMode.Contains))
|
|
|
|
.HighlightFirstMatch(true)
|
|
|
|
.HtmlAttributes(new { style = "width:70%; align:right" })
|
2011-04-01 23:55:20 +00:00
|
|
|
.SelectedIndex(0))
|
|
|
|
<button class="listButton" onclick="addSeries('@ViewData["guid"]','@ViewData["javaPath"].ToString()' )">
|
2011-04-01 06:36:34 +00:00
|
|
|
Add</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
|
|
|
|
2011-04-01 23:55:20 +00:00
|
|
|
var addSeriesUrl = '@Url.Action("AddSeries", "AddSeries")';
|
2011-04-01 06:36:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
function addSeries(guid, path) {
|
|
|
|
var qualityProfileId = $("#qualityProfileId").val();
|
2011-04-01 23:11:09 +00:00
|
|
|
var comboBox = $("#" + guid).data("tComboBox");
|
|
|
|
sendToServer(comboBox.value(), path, qualityProfileId);
|
2011-04-01 06:36:34 +00:00
|
|
|
$("#div_" + guid).hide();
|
|
|
|
}
|
|
|
|
|
|
|
|
function sendToServer(id, path, quality) {
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: addSeriesUrl,
|
|
|
|
data: jQuery.param({ path: path, seriesId: id, qualityProfileId: quality }),
|
|
|
|
error: function (req, status, error) {
|
|
|
|
alert("Sorry! We could not add " + this.name + "at this time. " + error);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|