Improved the search UI and made it more consistant.

Finished the Netflix API Part #884
This commit is contained in:
Jamie.Rees 2017-01-16 15:23:04 +00:00
commit 88c0651b1e
9 changed files with 98 additions and 7 deletions

View file

@ -304,6 +304,8 @@ $(function () {
var html = searchTemplate(context);
$("#movieList").append(html);
checkNetflix(context.title, context.id);
});
}
else {
@ -334,6 +336,9 @@ $(function () {
var context = buildTvShowContext(result);
var html = searchTemplate(context);
$("#tvList").append(html);
checkNetflix(context.title, context.id);
});
}
else {
@ -343,6 +348,19 @@ $(function () {
});
};
function checkNetflix(title, id) {
var url = createBaseUrl(base, '/searchextension/netflix/' + title);
$.ajax(url).success(function (results) {
if (results.result) {
// It's on Netflix
$('#' + id + 'netflixTab')
.html("<span class='label label-success'>Avaialble on Netflix</span>");
}
});
}
function resetTvShows() {
$("#tvList").html("");
}