fix only submit on user click
This commit is contained in:
@ -294,6 +294,9 @@ function showCompletion() {
|
|||||||
', Attempts: ' + attempts);
|
', Attempts: ' + attempts);
|
||||||
var bonfireSolution = myCodeMirror.getValue();
|
var bonfireSolution = myCodeMirror.getValue();
|
||||||
var didCompleteWith = $('#completed-with').val() || null;
|
var didCompleteWith = $('#completed-with').val() || null;
|
||||||
|
$('#complete-courseware-dialog').modal('show');
|
||||||
|
$('#submit-challenge').click(function(e) {
|
||||||
|
e.preventDefault();
|
||||||
$.post(
|
$.post(
|
||||||
'/completed-bonfire/', {
|
'/completed-bonfire/', {
|
||||||
challengeInfo: {
|
challengeInfo: {
|
||||||
@ -306,15 +309,11 @@ function showCompletion() {
|
|||||||
},
|
},
|
||||||
function(res) {
|
function(res) {
|
||||||
if (res) {
|
if (res) {
|
||||||
$('#complete-courseware-dialog').modal('show');
|
window.location = '/challenges/next-challenge';
|
||||||
$('#complete-courseware-dialog').keydown(function(e) {
|
|
||||||
if (e.ctrlKey && e.keyCode == 13) {
|
|
||||||
$('#next-courseware-button').click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var resetEditor = function resetEditor() {
|
var resetEditor = function resetEditor() {
|
@ -124,7 +124,7 @@ block content
|
|||||||
form.code
|
form.code
|
||||||
.form-group.codeMirrorView
|
.form-group.codeMirrorView
|
||||||
textarea#codeEditor(autofocus=true, style='display: none;')
|
textarea#codeEditor(autofocus=true, style='display: none;')
|
||||||
script(src='/js/lib/coursewares/commonFrameWork_0.0.5.js')
|
script(src='/js/lib/coursewares/commonFrameWork_0.0.6.js')
|
||||||
script.
|
script.
|
||||||
editor.setOption("mode", "javascript");
|
editor.setOption("mode", "javascript");
|
||||||
|
|
||||||
@ -138,8 +138,7 @@ block content
|
|||||||
.animated.zoomInDown.delay-half
|
.animated.zoomInDown.delay-half
|
||||||
span.completion-icon.ion-checkmark-circled.text-primary
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
if (user)
|
if (user)
|
||||||
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) Go to my next challenge (ctrl + enter)
|
|
||||||
|
|
||||||
if (user.progressTimestamps.length > 2)
|
if (user.progressTimestamps.length > 2)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
||||||
|
@ -72,7 +72,7 @@ block content
|
|||||||
form.code
|
form.code
|
||||||
.codeMirrorView
|
.codeMirrorView
|
||||||
textarea#codeEditor(autofocus=true, style='display: none;')
|
textarea#codeEditor(autofocus=true, style='display: none;')
|
||||||
script(src = '/js/lib/coursewares/commonFrameWork_0.0.5.js')
|
script(src = '/js/lib/coursewares/commonFrameWork_0.0.6.js')
|
||||||
script.
|
script.
|
||||||
editor.setOption("mode", "text/html");
|
editor.setOption("mode", "text/html");
|
||||||
.col-md-4.col-lg-3
|
.col-md-4.col-lg-3
|
||||||
@ -91,7 +91,7 @@ block content
|
|||||||
.animated.zoomInDown.delay-half
|
.animated.zoomInDown.delay-half
|
||||||
span.completion-icon.ion-checkmark-circled.text-primary
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
if(user)
|
if(user)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge') Go to the next challenge
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit
|
||||||
else
|
else
|
||||||
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
|
||||||
include ../partials/challenge-modals
|
include ../partials/challenge-modals
|
||||||
|
@ -72,7 +72,7 @@ block content
|
|||||||
form.code
|
form.code
|
||||||
.codeMirrorView
|
.codeMirrorView
|
||||||
textarea#codeEditor(autofocus=true, style='display: none;')
|
textarea#codeEditor(autofocus=true, style='display: none;')
|
||||||
script(src = '/js/lib/coursewares/commonFrameWork_0.0.5.js')
|
script(src = '/js/lib/coursewares/commonFrameWork_0.0.6.js')
|
||||||
script.
|
script.
|
||||||
editor.setOption("mode", "javascript");
|
editor.setOption("mode", "javascript");
|
||||||
#complete-courseware-dialog.modal(tabindex='-1')
|
#complete-courseware-dialog.modal(tabindex='-1')
|
||||||
@ -85,7 +85,7 @@ block content
|
|||||||
.animated.zoomInDown.delay-half
|
.animated.zoomInDown.delay-half
|
||||||
span.completion-icon.ion-checkmark-circled.text-primary
|
span.completion-icon.ion-checkmark-circled.text-primary
|
||||||
if (user)
|
if (user)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) Go to my next challenge (ctrl + enter)
|
#submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit
|
||||||
if (user.progressTimestamps.length > 2)
|
if (user.progressTimestamps.length > 2)
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
|
||||||
i.fa.fa-twitter  
|
i.fa.fa-twitter  
|
||||||
|
Reference in New Issue
Block a user