|
|
@ -4,23 +4,32 @@
|
|
|
|
<div id="searchResults">
|
|
|
|
<div id="searchResults">
|
|
|
|
<fieldset>
|
|
|
|
<fieldset>
|
|
|
|
<legend>Search Results</legend>
|
|
|
|
<legend>Search Results</legend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% int r = 0; %>
|
|
|
|
<% foreach (var result in Model)
|
|
|
|
<% foreach (var result in Model)
|
|
|
|
{ %>
|
|
|
|
{ %>
|
|
|
|
<%: Html.RadioButton("selectedSeries", result.TvDbId, new { @class="searchRadio examplePart", name = result.TvDbName }) %>
|
|
|
|
<%: Html.RadioButton("selectedSeries", result.TvDbId, new { @class="searchRadio examplePart", id="searchRadio_" + r }) %>
|
|
|
|
<%: Html.Label(result.TvDbName) %> (<%: Html.Label(result.FirstAired.ToString()) %>)
|
|
|
|
<b><%: Html.Label(result.TvDbName) %></b> (<%: Html.Label(result.FirstAired.ToString("MM/dd/yyyy"))%>)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<%: Html.TextBox(result.TvDbName + "_text", result.TvDbName, new { id = result.TvDbId + "_text", style="display:none" }) %>
|
|
|
|
|
|
|
|
<% r++;%>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<% } %>
|
|
|
|
<%
|
|
|
|
|
|
|
|
} %>
|
|
|
|
</fieldset>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="RootDirectories" style="display:none">
|
|
|
|
<div id="RootDirectories" style="display:none">
|
|
|
|
<fieldset>
|
|
|
|
<fieldset>
|
|
|
|
<legend>Root TV Folders</legend>
|
|
|
|
<legend>Root TV Folders</legend>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<% int d = 0; %>
|
|
|
|
<% foreach (var dir in (List<RootDir>)ViewData["RootDirs"])
|
|
|
|
<% foreach (var dir in (List<RootDir>)ViewData["RootDirs"])
|
|
|
|
{ %>
|
|
|
|
{ %>
|
|
|
|
<%: Html.RadioButton("selectedRootDir", dir.RootDirId, dir.Default, new { @class="dirList examplePart", name = dir.Path }) %>
|
|
|
|
<%: Html.RadioButton("selectedRootDir", dir.Path, dir.Default, new { @class="dirList examplePart", id="dirRadio_" + d }) %>
|
|
|
|
<%: Html.Label(dir.Path) %>
|
|
|
|
<%: Html.Label(dir.Path) %>
|
|
|
|
<% if (dir.Default) { %> * <% } %>
|
|
|
|
<% if (dir.Default) { %> * <% } %>
|
|
|
|
|
|
|
|
<% d++;%>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<% } %>
|
|
|
|
<% } %>
|
|
|
|
</fieldset>
|
|
|
|
</fieldset>
|
|
|
@ -30,14 +39,13 @@
|
|
|
|
<button class="t.button" onclick="addSeries ()">Add New Series</button>
|
|
|
|
<button class="t.button" onclick="addSeries ()">Add New Series</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="tester"></div>
|
|
|
|
<div id="addResult"></div>
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(".searchRadio").live("change", function () {
|
|
|
|
$(".searchRadio").live("change", function () {
|
|
|
|
var checked = $(this).attr('checked');
|
|
|
|
var checked = $(this).attr('checked');
|
|
|
|
|
|
|
|
|
|
|
|
if (checked) {
|
|
|
|
if (checked) {
|
|
|
|
$('#tester').text(this.value);
|
|
|
|
|
|
|
|
document.getElementById('RootDirectories').style.display = 'inline';
|
|
|
|
document.getElementById('RootDirectories').style.display = 'inline';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -46,23 +54,38 @@
|
|
|
|
//Get the selected tvdbid + selected root folder
|
|
|
|
//Get the selected tvdbid + selected root folder
|
|
|
|
//jquery bit below doesn't want to work...
|
|
|
|
//jquery bit below doesn't want to work...
|
|
|
|
|
|
|
|
|
|
|
|
var checkedSeries = $('input:radio[name=selectedSeries]:checked').val();
|
|
|
|
var checkedSeries = $("input[name='selectedSeries']:checked").val();
|
|
|
|
//$('input:radio[name=selectedSeries]:checked').val();
|
|
|
|
//var checkedSeries = $('input.searchRadio:checked').val();
|
|
|
|
|
|
|
|
//var checkedSeries = $('input:radio[name=selectedSeries]:checked').val();
|
|
|
|
|
|
|
|
//var checkedSeries = $('input:radio[class=searchRadio]:checked').val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var checkedDir = $("input[name='selectedRootDir']:checked").val();
|
|
|
|
|
|
|
|
|
|
|
|
$('#tester').text(checkedSeries.value);
|
|
|
|
var id = "#" + checkedSeries + "_text";
|
|
|
|
|
|
|
|
var seriesName = $(id).val();
|
|
|
|
|
|
|
|
|
|
|
|
//$('#tester').text("Hello_jhasdajsd");
|
|
|
|
$("#addResult").load('<%=Url.Action("AddNewSeries", "Series") %>', {
|
|
|
|
|
|
|
|
dir: checkedDir,
|
|
|
|
|
|
|
|
seriesId: checkedSeries,
|
|
|
|
|
|
|
|
seriesName: seriesName
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// $(".examplePart").live("change", function() {
|
|
|
|
|
|
|
|
// var dir = $('.selectedRootDir:checked');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var show = $('.selectedSeries:checked');
|
|
|
|
//Need to figure out how to use 'ViewData["DirSep"]' instead of hardcoding '\'
|
|
|
|
// var sep = "\\";
|
|
|
|
$(".examplePart").live("change", function () {
|
|
|
|
// var str = "Example: " + dir.name + sep + show.name;
|
|
|
|
var dir = $("input[name='selectedRootDir']:checked").val();
|
|
|
|
|
|
|
|
var series = $("input[name='selectedSeries']:checked").val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var id = "#" + series + "_text";
|
|
|
|
|
|
|
|
var seriesName = $(id).val();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//var sep = '<%= ViewData["DirSep"] %>';
|
|
|
|
|
|
|
|
var sep = "\\";
|
|
|
|
|
|
|
|
|
|
|
|
// $('#example').text(str);
|
|
|
|
var str = "Example: " + dir + sep + seriesName;
|
|
|
|
//
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#example').text(str);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|