|
|
@ -1,26 +1,69 @@
|
|
|
|
var searchSource = $("#search-template").html();
|
|
|
|
Handlebars.registerHelper('if_eq', function (a, b, opts) {
|
|
|
|
|
|
|
|
if (a == b)
|
|
|
|
|
|
|
|
return opts.fn(this);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return opts.inverse(this);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var searchSource = $("#search-template").html();
|
|
|
|
var searchTemplate = Handlebars.compile(searchSource);
|
|
|
|
var searchTemplate = Handlebars.compile(searchSource);
|
|
|
|
var movieTimer = 0;
|
|
|
|
var movieTimer = 0;
|
|
|
|
var tvimer = 0;
|
|
|
|
var tvimer = 0;
|
|
|
|
|
|
|
|
|
|
|
|
$("#movieSearchContent").on("keyup", function (e) {
|
|
|
|
$("#movieSearchContent").keypress(function (e) {
|
|
|
|
if (movieTimer) {
|
|
|
|
if (movieTimer) {
|
|
|
|
clearTimeout(movieTimer);
|
|
|
|
clearTimeout(movieTimer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
movieTimer = setTimeout(movieSearch, 400);
|
|
|
|
movieTimer = setTimeout(movieSearch, 400);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("#tvSearchContent").on("keyup", function (e) {
|
|
|
|
$("#tvSearchContent").keypress(function (e) {
|
|
|
|
if (tvimer) {
|
|
|
|
if (tvimer) {
|
|
|
|
clearTimeout(tvimer);
|
|
|
|
clearTimeout(tvimer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
tvimer = setTimeout(tvSearch(), 400);
|
|
|
|
tvimer = setTimeout(tvSearch(), 400);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$("#test").click(function (e) {
|
|
|
|
$(document).on("click", ".dropdownTv", function (e) {
|
|
|
|
|
|
|
|
var formData = [];
|
|
|
|
e.preventDefault();
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
console.log(e.target.id);
|
|
|
|
var $form = $('#form'+e.target.id);
|
|
|
|
var $form = $('#form'+e.target.id);
|
|
|
|
|
|
|
|
var data = $form.serialize();
|
|
|
|
|
|
|
|
var seasons = $(this).attr("season-select");
|
|
|
|
|
|
|
|
console.log(data);
|
|
|
|
|
|
|
|
formData.push(data);
|
|
|
|
|
|
|
|
if (seasons === "1") {
|
|
|
|
|
|
|
|
formData.push("latest=true");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
data.latest = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
|
|
type: $form.prop('method'),
|
|
|
|
|
|
|
|
url: $form.prop('action'),
|
|
|
|
|
|
|
|
data: data,
|
|
|
|
|
|
|
|
dataType: "json",
|
|
|
|
|
|
|
|
success: function (response) {
|
|
|
|
|
|
|
|
console.log(response);
|
|
|
|
|
|
|
|
if (response.result === true) {
|
|
|
|
|
|
|
|
generateNotify("Success!", "success");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
generateNotify(response.message, "warning");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
error: function (e) {
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
generateNotify("Something went wrong!", "danger");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on("click", ".requesttv", function (e) {
|
|
|
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
console.log(e.target.id);
|
|
|
|
|
|
|
|
var $form = $('#form' + e.target.id);
|
|
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
$.ajax({
|
|
|
|
type: $form.prop('method'),
|
|
|
|
type: $form.prop('method'),
|
|
|
@ -29,10 +72,10 @@ $("#test").click(function (e) {
|
|
|
|
dataType: "json",
|
|
|
|
dataType: "json",
|
|
|
|
success: function (response) {
|
|
|
|
success: function (response) {
|
|
|
|
console.log(response);
|
|
|
|
console.log(response);
|
|
|
|
if (response.Result === true) {
|
|
|
|
if (response.result === true) {
|
|
|
|
generateNotify("Success!", "success");
|
|
|
|
generateNotify("Success!", "success");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
generateNotify(response.Message, "warning");
|
|
|
|
generateNotify(response.message, "warning");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
error: function (e) {
|
|
|
|
error: function (e) {
|
|
|
|