” + d + ” +
‘
‘; } $.every(s, operate (i, v) { $(‘.schedule-tabs’).append(template(_this.days[new Date(i).getDay()], runonce)); runonce = true; }); }, populate: operate (s) { var _this = this, runonce = false, depend=0; operate template(o, j) { var cl = (j % 2) ? ” : ‘striped’; cl += (j >= _this.restrict) ? ‘ conceal’ : ”; return ” + ‘
‘ + second(o.datetime).format(‘LT’) + ‘
‘ + ‘
‘ + o.title + ‘
‘ + ‘
‘ + o.subtitle + ‘
‘ + ‘
‘ + o.description + ‘
‘ + ”; } operate loadMoreTemplate() { return ‘
‘ +
‘‘+
‘
‘; } operate showLessTemplate() { return ‘
‘ +
‘‘+
‘
‘;
}
$.every(s, operate (i, v) {
var d = _this.days[new Date(i).getDay()].toLowerCase();
$.every(v, operate (j, o) {
var nmSubtitle = “”;
if (o.Episode == o.Program) {
nmSubtitle = “”;
} else {
nmSubtitle = o.Episode;
}
var program = { datetime: o.ShowDateTime, title: o.Program, description: o.Description, subtitle: nmSubtitle };
$(‘#sched-‘ + d).append(template(program, j));
(_this.restrict == j+1) ? $(‘#sched-‘ + d).append(loadMoreTemplate) : [];
(v.length-1 == j && j>_this.restrict) ? $(‘#sched-‘ + d).append(showLessTemplate) : [];
if (!runonce) {
$(‘#sched-‘ + d).addClass(‘in lively’);
$(doc).set off(‘programEvent’, program);
}
runonce = true;
});
});
},
scrollUp: operate () {
var goal = $(‘#schedule-section’);
$(‘html, physique’).animate({
scrollTop: goal.offset().high – 100
}, 1000);
},
init: operate (ms) {
var _this = this;
var hash = (ms) ? “?h=” + ms : “”;
$.getJSON(_this.endpoint + hash, operate (information) {
$.every(information, operate (i, v) { _this.parse(v); });
_this.createSchedule();
_this.createTabs(_this.information);
_this.populate(_this.information);
});
}
};
// Initialize
schedule.init();
// Intervals
var everyInterval = 1860000; // 31 Minutes
var nextInterval = Math.abs(second().endOf(‘hour’).toDate() – second().toDate());
window.setTimeout(operate() {
schedule.init(Date.now());
window.setInterval(operate() {
schedule.init(Date.now());
}, everyInterval);
}, nextInterval);
$(d).prepared(operate () {
operate showmore(btn) {
$(btn).addClass(‘conceal’);
$(btn).father or mother().siblings().removeClass(‘conceal’);
$(btn).father or mother().siblings().discover(‘.sched-less’).removeClass(‘conceal’);
}
operate showless(btn) {
$(btn).addClass(‘conceal’);
schedule.scrollUp();
$(btn).father or mother().siblings().discover(‘.sched-more’).removeClass(‘conceal’);
$(btn).father or mother().siblings().discover(‘.sched-more’).father or mother().nextAll().addClass(‘conceal’);
}
$(‘physique’).on(‘click on’, ‘.sched-more’, operate (e) {
showmore(e.goal);
});
$(‘physique’).on(‘click on’, ‘.sched-less’, operate (e) {
showless(e.goal);
});
});
})(window.jQuery, this);
“, ““] }); })(window.jQuery); ]]>
Get Newsmax in your cable, name us at: 844-500-6397
Get free Newsmax TV alerts for breaking information, newest reveals, and visitors
Privateness: We by no means share your e-mail.
Average Rating