From b1d8814aed5c4888767289586f6af810351fb126 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Tue, 6 Oct 2015 16:43:46 -0700 Subject: [PATCH] remove angular from views --- client/main.js | 1 + server/boot/challenge.js | 2 +- server/views/coursewares/showBonfire.jade | 8 ++------ .../coursewares/showZiplineOrBasejump.jade | 17 ++++++----------- server/views/partials/navbar.jade | 16 ++++++++++++++++ 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/client/main.js b/client/main.js index 9c3ce8b11e..9ba4e834b5 100644 --- a/client/main.js +++ b/client/main.js @@ -221,6 +221,7 @@ $(document).ready(function() { case challengeTypes.ZIPLINE: var didCompleteWith = $('#completed-with').val() || null; var publicURL = $('#public-url').val() || null; + console.log("debug", didCompleteWith, publicURL); $.post( '/completed-zipline-or-basejump/', { diff --git a/server/boot/challenge.js b/server/boot/challenge.js index 745f8be876..6cde532636 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -266,7 +266,7 @@ module.exports = function(app) { origChallengeName + '` Please double check the name.' }); - return Observable.just('/challenges'); + return Observable.just('/map'); } if (dasherize(challenge.name) !== origChallengeName) { diff --git a/server/views/coursewares/showBonfire.jade b/server/views/coursewares/showBonfire.jade index 42c7d8d20d..9e791eee90 100644 --- a/server/views/coursewares/showBonfire.jade +++ b/server/views/coursewares/showBonfire.jade @@ -38,12 +38,8 @@ block content .form-group.text-center.negative-10 .col-xs-12 // 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="Your pair's username if pairing", existing-username='', ng-model="existingUser") - .col-xs-12(ng-cloak, ng-show="completedWithForm.$error.exists && !completedWithForm.existingUser.$pristine && existingUser.length > 0") - alert(type='danger') - span.ion-close-circled - | Username not found + input.form-control.hidden + input.form-control#completed-with(name="existingUser", placeholder="Your pair's username if pairing") label.negative-10.btn.btn-primary.btn-block.btn-lg#submitButton i.fa.fa-play |   Run tests (ctrl + enter) diff --git a/server/views/coursewares/showZiplineOrBasejump.jade b/server/views/coursewares/showZiplineOrBasejump.jade index 1d7fd835a1..12c72c6f16 100644 --- a/server/views/coursewares/showZiplineOrBasejump.jade +++ b/server/views/coursewares/showZiplineOrBasejump.jade @@ -73,21 +73,16 @@ block content .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 // extra field to distract password tools like lastpass from injecting css into our username field - input.form-control(ng-show="false") + input.form-control.hidden if (challengeType === "3") - input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://codepen.io/your-pen-here", autofocus, required, ng-minlength="10", ng-model="deploymentUrl") + input.form-control#public-url(type="url", name="solutionUrl", placeholder="http://codepen.io/your-pen-here", autofocus, required) else - input.form-control#public-url(type='url', name="solutionUrl", placeholder="http://yourapp.com", autofocus, required, ng-minlength="10", ng-model="deploymentUrl") - input.form-control#github-url(name="githubUrl", placeholder="http://github.com/camper/project", ng-model="githubUrl") - - input.form-control#completed-with(name="existingUser", ng-minlength placeholder="If you paired, enter your pair's username here", existing-username='', ng-model="existingUser") - .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 + input.form-control#public-url(type="url", name="solutionUrl", placeholder="http://yourapp.com", autofocus, required) + input.form-control#github-url(name="githubUrl", placeholder="http://github.com/camper/project") + input.form-control#completed-with(name="existingUser", placeholder="If you paired, enter your pair's username here") if (user) - a.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid') Go to my next challenge + a.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) Go to my next challenge .button-spacer script. $('#complete-zipline-or-basejump-dialog').on('keypress', modalControlEnterHandler); diff --git a/server/views/partials/navbar.jade b/server/views/partials/navbar.jade index 6a51f98145..7108bd05b4 100644 --- a/server/views/partials/navbar.jade +++ b/server/views/partials/navbar.jade @@ -27,3 +27,19 @@ nav.navbar.navbar-default.navbar-fixed-top.nav-height .hidden-xs.hidden-sm a(href='/' + user.username) img.profile-picture.float-right(src='#{user.picture}') +script. + $(document).ready(function() { + $('.learn-btn').click(function(e) { + var challengeDashedName = null; + e.preventDefault(); + if (typeof dashedName === "string") { + return location.reload(); + } + if (typeof localStorage !== 'undefined') { + challengeDashedName = localStorage.getItem('currentDashedName'); + } + window.location = challengeDashedName ? + '/challenges/' + challengeDashedName : + '/map'; + }); + });