diff --git a/public/js/lib/coursewares/coursewaresFramework.js b/public/js/lib/coursewares/coursewaresFramework.js index df1b92a4821..18e4e9f53ed 100644 --- a/public/js/lib/coursewares/coursewaresFramework.js +++ b/public/js/lib/coursewares/coursewaresFramework.js @@ -31,6 +31,8 @@ var libraryIncludes = "" + "" + "" + + "" + + "" + "" + "" + ""; @@ -55,6 +57,15 @@ editor.on("change", function () { 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 */ @@ -69,16 +80,6 @@ eventer(messageEvent,function(e) { } },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"), { @@ -256,7 +257,7 @@ var runTests = function(err, data) { }; function showCompletion() { - $('#complete-bonfire-dialog').modal('show'); + $('#complete-courseware-dialog').modal('show'); } document.domain = 'localhost'; \ No newline at end of file diff --git a/views/coursewares/show.jade b/views/coursewares/show.jade index 789d9b63161..e5c674eafb3 100644 --- a/views/coursewares/show.jade +++ b/views/coursewares/show.jade @@ -66,29 +66,17 @@ block content iframe.iphone#preview - #complete-bonfire-dialog.modal(tabindex='-1') + #complete-courseware-dialog.modal(tabindex='-1') .modal-dialog.animated.zoomIn.fast-animation .modal-content .modal-header.challenge-list-header= compliment - a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × - .modal-body(ng-controller="pairedWithController") - + a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × + .model-body .text-center .animated.zoomInDown.delay-half span.completion-icon.ion-checkmark-circled.text-primary - if (cc) - form.form-horizontal(novalidate='novalidate', name='completedWithForm') - .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 + 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 - if (points && points > 2)