Merge pull request #96 from JackDandy/feature/FixDisplayShowNextPrev

Fix Display Show next/previous when show list is split.
This commit is contained in:
JackDandy 2014-12-12 19:11:56 +00:00
commit 9d2d3cee45
6 changed files with 20 additions and 9 deletions

View file

@ -23,6 +23,7 @@
* Fix missing navbar gradients for all browsers
* Update qTip2 to v2.2.1
* Overhaul all Add Show pages
* Fix Display Show next/previous when show list is split
[develop changelog]
* Add TVRage network name standardization

View file

@ -2256,11 +2256,13 @@ pre {
/* =======================================================================
input sizing (for config pages)
========================================================================== */
#pickShow optgroup,
#editAProvider optgroup {
color: #eee;
background-color: rgb(51, 51, 51);
}
#pickShow optgroup option,
#editAProvider optgroup option {
color: #222;
background-color: #fff;

View file

@ -2236,11 +2236,13 @@ pre {
/* =======================================================================
input sizing (for config pages)
========================================================================== */
#pickShow optgroup,
#editAProvider optgroup {
color: #eee;
background-color: #888;
}
#pickShow optgroup option,
#editAProvider optgroup option {
color: #222;
background-color: #fff;

View file

@ -52,7 +52,7 @@
};
\$('.imdbstars').generateStars();
TVShowList = [${tvshow_id_csv}]
});
//-->
</script>

View file

@ -13,14 +13,14 @@ $(document).ready(function () {
$(this).val('jump');
});
$("#prevShow").click(function () {
$('#pickShow option:selected').prev('option').attr('selected', 'selected');
$("#pickShow").change();
});
$("#nextShow").click(function () {
$('#pickShow option:selected').next('option').attr('selected', 'selected');
$("#pickShow").change();
$('#prevShow, #nextShow').click(function () {
var select$ = $('#pickShow'),
index = $.inArray(select$.find('option:selected').val()*1, TVShowList);
select$.find('option[value="' + TVShowList[('nextShow' === $(this).attr('id')
? (index < TVShowList.length - 1 ? index + 1 : 0)
: (0 < index ? index - 1 : TVShowList.length - 1))] + '"]').attr('selected', 'selected');
select$.change();
return false;
});
$('#changeStatus').click(function () {

View file

@ -3729,6 +3729,12 @@ class Home(MainHandler):
shows.append(show)
t.sortedShowLists = [["Shows", sorted(shows, lambda x, y: cmp(titler(x.name), titler(y.name)))],
["Anime", sorted(anime, lambda x, y: cmp(titler(x.name), titler(y.name)))]]
tvshows = []
for tvshow_types in t.sortedShowLists:
for tvshow in tvshow_types[1]:
tvshows.append(tvshow.indexerid)
t.tvshow_id_csv = ','.join(str(x) for x in tvshows)
else:
t.sortedShowLists = [
["Shows", sorted(sickbeard.showList, lambda x, y: cmp(titler(x.name), titler(y.name)))]]