2014-10-17 19:23:53 -07:00
|
|
|
$(document).ready(function() {
|
2014-11-01 18:07:59 -07:00
|
|
|
$('.start-challenge').on("click", function() {
|
2014-11-02 12:24:37 -08:00
|
|
|
$(this).parent().remove();
|
|
|
|
$('.challenge-content').removeClass('hidden-element').addClass('animated fadeInDown');
|
2014-11-01 18:07:59 -07:00
|
|
|
});
|
|
|
|
$('.completed-challenge').on("click", function() {
|
|
|
|
$('#complete-dialog').modal('show');
|
|
|
|
});
|
|
|
|
$('.skip-challenge').on("click", function() {
|
|
|
|
$('#skip-dialog').modal('show');
|
|
|
|
});
|
2014-11-06 17:38:47 -08:00
|
|
|
$('.complete-button').on("click", function() {
|
|
|
|
l = location.pathname.split('/');
|
|
|
|
$.ajax({
|
|
|
|
type: 'POST',
|
|
|
|
data: l,
|
|
|
|
url: '/completed_challenge',
|
|
|
|
success: function(data) {
|
|
|
|
console.log('success');
|
|
|
|
console.log(JSON.stringify(data));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
window.location = "/challenge?=" + (parseInt(l[l.length-1]) + 1)
|
|
|
|
});
|
|
|
|
$('.skip-button').on("click", function() {
|
|
|
|
l = location.pathname.split;
|
|
|
|
window.location = "/challenges/" + (parseInt(l[l.length-1]) + 1)
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|