Correctly display modal on challenge completion
This commit is contained in:
@ -31,6 +31,8 @@ var libraryIncludes = "<script src='//ajax.googleapis.com/ajax/libs/jquery/2.1.3
|
|||||||
"<script src='/js/lib/chai/chai-jquery.js'></script>" +
|
"<script src='/js/lib/chai/chai-jquery.js'></script>" +
|
||||||
"<script src='//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js'></script>" +
|
"<script src='//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js'></script>" +
|
||||||
"<script src='//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js'></script>" +
|
"<script src='//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js'></script>" +
|
||||||
|
"<script src='//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js'></script>" +
|
||||||
|
"<link rel='stylesheet' href='//cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.min.css'/>" +
|
||||||
"<link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css'/>" +
|
"<link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css'/>" +
|
||||||
"<link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css'/>" +
|
"<link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css'/>" +
|
||||||
"<style>body { padding: 0px 3px 0px 3px; }</style>";
|
"<style>body { padding: 0px 3px 0px 3px; }</style>";
|
||||||
@ -55,6 +57,15 @@ editor.on("change", function () {
|
|||||||
delay = setTimeout(updatePreview, 300);
|
delay = setTimeout(updatePreview, 300);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function updatePreview() {
|
||||||
|
var previewFrame = document.getElementById('preview');
|
||||||
|
var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
|
||||||
|
preview.open();
|
||||||
|
preview.write(libraryIncludes + editor.getValue() + coursewareTests);
|
||||||
|
preview.close();
|
||||||
|
}
|
||||||
|
setTimeout(updatePreview, 300);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Window postMessage receiving funtionality
|
* Window postMessage receiving funtionality
|
||||||
*/
|
*/
|
||||||
@ -69,16 +80,6 @@ eventer(messageEvent,function(e) {
|
|||||||
}
|
}
|
||||||
},false);
|
},false);
|
||||||
|
|
||||||
function updatePreview() {
|
|
||||||
var previewFrame = document.getElementById('preview');
|
|
||||||
var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
|
|
||||||
preview.open();
|
|
||||||
preview.write(libraryIncludes + editor.getValue() + coursewareTests);
|
|
||||||
preview.close();
|
|
||||||
var passing = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
setTimeout(updatePreview, 300);
|
|
||||||
|
|
||||||
|
|
||||||
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
|
var codeOutput = CodeMirror.fromTextArea(document.getElementById("codeOutput"), {
|
||||||
@ -256,7 +257,7 @@ var runTests = function(err, data) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function showCompletion() {
|
function showCompletion() {
|
||||||
$('#complete-bonfire-dialog').modal('show');
|
$('#complete-courseware-dialog').modal('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
document.domain = 'localhost';
|
document.domain = 'localhost';
|
@ -66,29 +66,17 @@ block content
|
|||||||
iframe.iphone#preview
|
iframe.iphone#preview
|
||||||
|
|
||||||
|
|
||||||
#complete-bonfire-dialog.modal(tabindex='-1')
|
#complete-courseware-dialog.modal(tabindex='-1')
|
||||||
.modal-dialog.animated.zoomIn.fast-animation
|
.modal-dialog.animated.zoomIn.fast-animation
|
||||||
.modal-content
|
.modal-content
|
||||||
.modal-header.challenge-list-header= compliment
|
.modal-header.challenge-list-header= compliment
|
||||||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||||||
.modal-body(ng-controller="pairedWithController")
|
.model-body
|
||||||
|
|
||||||
.text-center
|
.text-center
|
||||||
.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 (cc)
|
- if (cc)
|
||||||
form.form-horizontal(novalidate='novalidate', name='completedWithForm')
|
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block.next-bonfire-button(name='_csrf', value=_csrf, aria-hidden='true') Take me to my next challenge
|
||||||
.form-group.text-center
|
|
||||||
.col-xs-10.col-xs-offset-1.col-sm-8.col-sm-offset-2.col-md-8.col-md-offset-2.animated.fadeIn
|
|
||||||
// extra field to distract password tools like lastpass from injecting css into our username field
|
|
||||||
input.form-control(ng-show="false")
|
|
||||||
input.form-control#completed-with(name="existingUser", placeholder="If you paired, enter your pair's username here", existing-username='', ng-model="existingUser", autofocus)
|
|
||||||
.col-xs-10.col-xs-offset-1.col-sm-8.col-sm-offset-2.col-md-8.col-md-offset-2(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0")
|
|
||||||
alert(type='danger')
|
|
||||||
span.ion-close-circled
|
|
||||||
| Username not found
|
|
||||||
|
|
||||||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block.next-bonfire-button(name='_csrf', value=_csrf, aria-hidden='true', ng-disabled='completedWithForm.$invalid && existingUser.length > 0') Take me to my next challenge
|
|
||||||
|
|
||||||
|
|
||||||
- if (points && points > 2)
|
- if (points && points > 2)
|
||||||
|
Reference in New Issue
Block a user