From 894e37e30fff2998ad406a619443c00dce320195 Mon Sep 17 00:00:00 2001 From: FlixtorMe Date: Wed, 27 Aug 2014 22:30:14 +0200 Subject: [PATCH] Update background transition --- frames/movies.html | 17 +++-------------- frames/series.html | 41 ++++++++++++++++++++++++++--------------- js/callwcf.js | 2 +- js/translations.js | 2 +- locales/en.json | 3 ++- 5 files changed, 33 insertions(+), 32 deletions(-) diff --git a/frames/movies.html b/frames/movies.html index 51db9c1..aec05de 100644 --- a/frames/movies.html +++ b/frames/movies.html @@ -40,12 +40,6 @@ //By default we filter by most downloaded changeFilterCategory("Most downloaded"); - //Persistence - if(sessionStorage.movie) { - var movie = $.parseJSON(sessionStorage.movie); - //showDetails(movie.MovieId); - } - $("#txtMovieSearch").bind('keyup paste', function() { clearTimeout($(this).data('timeout')); $(this).data('timeout', setTimeout(function(){ @@ -62,19 +56,13 @@ }); $.fn.inView = function(){ - //Window Object var win = $(window); - //Object to Check obj = $(this); - //the top Scroll Position in the page var scrollPosition = win.scrollTop(); - //the end of the visible area in the page, starting from the scroll position var visibleArea = win.scrollTop() + win.height(); - //the end of the object to check var objEndPos = (obj.offset().top + obj.outerHeight()); return(visibleArea >= objEndPos && scrollPosition <= objEndPos ? true : false) - }; $('#movieContainer').scroll(function() { @@ -293,7 +281,6 @@ $('#date').empty(); $('#date').append('  '); - console.log(movie); //Insert backdrop path $( "" ).appendTo("#customCSS"); @@ -380,7 +367,7 @@ $("#side-bar-full").hide(); $("#content").css("opacity", "0"); $('#side-bar-small').attr("style", "display: none !important"); - $('#customCSS').animate({opacity: 0}, 0).animate({opacity: 1}, 2000); + $('#customCSS').animate({opacity: 0}, 0).animate({opacity: 1}, 3500); } function changeSearchText() { @@ -490,6 +477,8 @@ console.log(e); } + $("#customCSS").stop(); + $("#customCSS").removeAttr('style'); $("#customCSS").empty(); $("#content-overlay").hide(); $("#movie").hide(); diff --git a/frames/series.html b/frames/series.html index 5f3d273..e4c1952 100644 --- a/frames/series.html +++ b/frames/series.html @@ -40,26 +40,29 @@ //By default we filter by most downloaded. changeFilterCategory("Most downloaded"); - //Persistence - if(sessionStorage.serie){ - var serie = $.parseJSON(sessionStorage.serie); - //showDetails(serie.SerieId , true); - } + $("#txtSerieSearch").bind('keyup paste', function() { + clearTimeout($(this).data('timeout')); + $(this).data('timeout', setTimeout(function(){ + var serieSearchValue = $('#txtSerieSearch').val(); + + if(serieSearchValue.indexOf('magnet:?xt=urn:btih:') == 0) { + $("#btnSearchSerie").text('Play'); + } + else { + $( "#btnSearchSerie" ).empty(); + $("#btnSearchSerie").append(''); + } + }, 200)); + }); $.fn.inView = function(){ - //Window Object var win = $(window); - //Object to Check obj = $(this); - //the top Scroll Position in the page var scrollPosition = win.scrollTop(); - //the end of the visible area in the page, starting from the scroll position var visibleArea = win.scrollTop() + win.height(); - //the end of the object to check var objEndPos = (obj.offset().top + obj.outerHeight()); return(visibleArea >= objEndPos && scrollPosition <= objEndPos ? true : false) - }; $('#serieContainer').scroll(function() { @@ -248,7 +251,14 @@ queue: false } }); - serieApplySearch(); + + if(serieFilter.searchValue.indexOf('magnet:?xt=urn:btih:') == 0) { + var infoHash = serieFilter.searchValue.split('magnet:?xt=urn:btih:'); + main.go("players/player.html?torrentId=" + infoHash[1]); + } + else { + serieApplySearch(); + } } function startTorrent(infoHash) { @@ -275,7 +285,6 @@ callwcf.searchSerieDetail( serie, function(results) { if( results !== 'error' ) { - console.log(results); serie = results; //Insert backdrop path @@ -356,7 +365,7 @@ $("#content").css("opacity", "0"); $('#side-bar-small').attr("style", "display: none !important"); $("#head-bar").hide(); - $('#customCSS').animate({opacity: 0}, 0).animate({opacity: 1}, 2000); + $('#customCSS').animate({opacity: 0}, 0).animate({opacity: 1}, 3500); } else { console.log("Service not available"); @@ -442,6 +451,8 @@ console.log(e); } + $("#customCSS").stop(); + $("#customCSS").removeAttr('style'); $("#customCSS").empty(); $("#content-overlay").hide(); $("#serie").hide(); @@ -463,7 +474,7 @@ - diff --git a/js/callwcf.js b/js/callwcf.js index 89551cf..0d1beeb 100644 --- a/js/callwcf.js +++ b/js/callwcf.js @@ -209,7 +209,7 @@ var searchMovies = function (sort, keywords, genre, limit, page, order, callback callback("error"); } }).error(function () { - utilities.showPrompt("An uncaughtException was found", "An uncaughtException was found.", "ok", function(answer) { + utilities.showPrompt("An uncaughtException was found", "Yts is unavailable. Please try it again later.", "ok", function(answer) { }); callback("error"); }); diff --git a/js/translations.js b/js/translations.js index 4bb4e5f..786f732 100644 --- a/js/translations.js +++ b/js/translations.js @@ -52,7 +52,7 @@ var Translations = function () { var moviesSearchPlaceholder = i18n.__('Movie title or magnet link...'); $('#txtMovieSearch').attr('placeholder', moviesSearchPlaceholder); - var seriesSearchPlaceholder = i18n.__('Serie title...'); + var seriesSearchPlaceholder = i18n.__('Serie title or magnet link...'); $('#txtSerieSearch').attr('placeholder', seriesSearchPlaceholder); var seriesTorrentPlaceholder = i18n.__('Torrent name...'); diff --git a/locales/en.json b/locales/en.json index 8e811e3..78b0f03 100644 --- a/locales/en.json +++ b/locales/en.json @@ -115,5 +115,6 @@ "Cut": "Cut", "Copy": "Copy", "Paste": "Paste", - "3D": "3D" + "3D": "3D", + "Serie title or magnet link...": "Serie title or magnet link..." } \ No newline at end of file