Files
freeCodeCamp/public/js/main.js

31 lines
1.0 KiB
JavaScript
Raw Normal View History

2014-10-17 19:23:53 -07:00
$(document).ready(function() {
$('.start-challenge').on("click", function() {
2014-11-02 12:24:37 -08:00
$(this).parent().remove();
$('.challenge-content').removeClass('hidden-element').addClass('animated fadeInDown');
});
$('.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)
});
});