AddSeries javascript fixes.

Add new series now has a drop box for rootdir.
Moved add series javascript to addSeries.js.
This commit is contained in:
Mark McDowall
2011-08-23 13:31:28 -07:00
parent fb9c2b6d9e
commit 88525a0b7c
7 changed files with 152 additions and 127 deletions
+2 -33
View File
@@ -5,41 +5,10 @@
<div>
<input id="newSeriesLookup" class="seriesLookup" type="text" style="width: 400px" />
</div>
<input id="newSeriesPath" class="folderLookup" type="text" style="width: 400px" />
@*<input id="newSeriesPath" class="folderLookup" type="text" style="width: 400px" />*@
@Html.DropDownList("newSeriesPath", new SelectList((IList)ViewData["RootDirs"]), new { style = "width: 406px; margin-left: 0px;" })
@Html.DropDownList("qualityList", new SelectList((IList)ViewData["QualityList"], "QualityProfileId", "Name"), new { @class = "qualitySelector" })
<button id="saveNewSeries">
Add</button>
</div>
<br />
<script type="text/javascript" language="javascript">
jQuery(document).ready(function () {
$('#newSeriesPath').watermark('Path for the new series...');
$('#newSeriesLookup').watermark('Title of the series you want to add...');
$('#saveNewSeries').click(function () {
var addSeriesUrl = '@Url.Action("AddNewSeries", "AddSeries")';
var seriesTitle = $("#newSeriesLookup").val();
var qualityId = $("#qualityList").val();
var path = $('#newSeriesPath').val();
$.ajax({
type: "POST",
url: addSeriesUrl,
data: jQuery.param({ path: path, seriesName: seriesTitle, qualityProfileId: qualityId }),
error: function (req, status, error) {
alert("Sorry! We could not add " + path + " at this time. " + error);
},
success: function () {
$("#newSeriesLookup").val("");
$('#newSeriesPath').val("");
}
});
});
});
</script>