96 lines
2.5 KiB
JavaScript
96 lines
2.5 KiB
JavaScript
$(document).ready(function() {
|
|
|
|
if (typeof movies_list !== 'undefined') {
|
|
ShowMovies(movies_list);
|
|
}
|
|
|
|
else if (typeof movie_detail !== 'undefined') {
|
|
MovieDetails(movie_detail);
|
|
}
|
|
|
|
else if (typeof saga_list !== 'undefined') {
|
|
$('#back').hide();
|
|
ShowSagas(saga_list);
|
|
}
|
|
|
|
if (typeof file_info !== 'undefined') {
|
|
FileInfo(file_info);
|
|
Horloge();
|
|
setInterval(Horloge, 1000);
|
|
}
|
|
|
|
if (document.referrer.split('/')[2] !== location.host)
|
|
$('#back').hide();
|
|
|
|
$("#search").on('keyup', function (e) {
|
|
if (e.keyCode === 13) {
|
|
|
|
var sc_saga = [];
|
|
var sc_movie = [];
|
|
var search = $("#search").val();
|
|
console.log(search);
|
|
$.each(saga_list, function(index, value) {
|
|
if (value.name.toLowerCase().includes(search.toLowerCase())) {
|
|
if(! sc_saga.includes(value)){ sc_saga.push(value);}
|
|
}
|
|
});
|
|
$.each(movies_full_list, function(index, value) {
|
|
if (value.title.toLowerCase().includes(search.toLowerCase())) {
|
|
if(! sc_movie.includes(value)){ sc_movie.push(value);}
|
|
}
|
|
if (value.original_title.toLowerCase().includes(search.toLowerCase())) {
|
|
if(! sc_movie.includes(value)){ sc_movie.push(value);}
|
|
}
|
|
});
|
|
ShowSearch(sc_saga, sc_movie);
|
|
}
|
|
});
|
|
|
|
$('.fa-list').click(function() {
|
|
var lien = $('.saga, .movie');
|
|
var title = $('.saga > .title, .movie > .title');
|
|
var original_title = $('.movie > .original_title');
|
|
lien.removeClass('button container');
|
|
lien.addClass('line');
|
|
title.removeClass('centered');
|
|
original_title.show();
|
|
|
|
});
|
|
|
|
$('.fa-th').click(function() {
|
|
var lien = $('.saga, .movie');
|
|
var title = $('.saga > .title, .movie > .title');
|
|
var original_title = $('.movie > .original_title');
|
|
lien.removeClass('line');
|
|
lien.addClass('button container');
|
|
title.addClass('centered');
|
|
original_title.hide();
|
|
});
|
|
|
|
$('.fa-clipboard-list').click(function() {
|
|
//var copyText = $('#dl > a').attr('href');
|
|
var copyText = $(this).prev().attr('href');
|
|
|
|
var temp = $("<input>");
|
|
$("body").append(temp);
|
|
temp.val(location.origin + location.pathname + copyText).select();
|
|
//temp.setSelectionRange(0, 99999);
|
|
document.execCommand("copy");
|
|
temp.remove();
|
|
});
|
|
|
|
$('#convert').click(function() {
|
|
var stream = [];
|
|
$('#AV > input[type=checkbox]').each(function() {
|
|
var id = $(this).attr('id');
|
|
var state = $(this).prop('checked');
|
|
if (state)
|
|
stream.push(id);
|
|
});
|
|
if (stream.length > 0)
|
|
alert(stream);
|
|
});
|
|
|
|
});
|
|
|