create infrastructure for advancing through wiki

This commit is contained in:
Michael Q Larson
2015-04-05 16:44:07 -07:00
parent c8b72499ab
commit 60fee94574
6 changed files with 94 additions and 31 deletions

View File

@@ -52,6 +52,23 @@ $(document).ready(function() {
}
}
function completedWiki(wikiId) {
if ($('.signup-btn-nav').length < 1) {
$.post(
'/completed-wiki',
{
wikiInfo: {
wikiId: wikiId
}
},
function(res) {
if (res) {
window.location.href = '/wiki'
}
});
}
}
$('.next-bonfire-button').on('click', function() {
var bonfireSolution = myCodeMirror.getValue();
var thisBonfireHash = passedBonfireHash || null;
@@ -61,6 +78,11 @@ $(document).ready(function() {
});
$('.next-wiki-button').on('click', function() {
var wikiId = $('#wikiId').text();
completedWiki(wikiId);
});
$("img").error(function () {
$(this).unbind("error").attr("src", "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png");
});