diff --git a/client/commonFramework.js b/client/commonFramework.js index 439904aaed..2c615d4f96 100644 --- a/client/commonFramework.js +++ b/client/commonFramework.js @@ -420,6 +420,13 @@ var testSuccess = function() { isInitRun = false; }; +function ctrlEnterClickHandler(e) { + // ctrl + enter + if (e.ctrlKey && e.keyCode === 13) { + $('#submit-challenge').click(); + } +} + function showCompletion() { if (isInitRun) { isInitRun = false; @@ -435,6 +442,8 @@ function showCompletion() { ); var bonfireSolution = myCodeMirror.getValue(); var didCompleteWith = $('#completed-with').val() || null; + + $('#complete-courseware-dialog').modal('show'); $('#complete-courseware-dialog .modal-header').click(); @@ -774,6 +783,17 @@ $('#submitButton').on('click', function() { }); $(document).ready(function() { + + // init modal keybindings on open + $('#complete-courseware-dialog').on('shown.bs.modal', function() { + $('#complete-courseware-dialog').keyup(ctrlEnterClickHandler); + }); + + // remove modal keybinds on close + $('#complete-courseware-dialog').on('hidden.bs.modal', function() { + $('#complete-courseware-dialog').unbind('keyup', ctrlEnterClickHandler); + }); + var $preview = $('#preview'); isInitRun = true; diff --git a/server/views/coursewares/showBonfire.jade b/server/views/coursewares/showBonfire.jade index 11572b0a82..4272e65876 100644 --- a/server/views/coursewares/showBonfire.jade +++ b/server/views/coursewares/showBonfire.jade @@ -129,7 +129,7 @@ block content editor.setOption("mode", "javascript"); #complete-courseware-dialog.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header= compliment a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × @@ -142,13 +142,12 @@ block content .row if (user) #submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter) - 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.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   = phrase else - a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge + a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge #reset-modal.modal(tabindex='-1') .modal-dialog.animated.fadeInUp.fast-animation .modal-content diff --git a/server/views/coursewares/showHTML.jade b/server/views/coursewares/showHTML.jade index b0b82acb21..9dfc27690f 100644 --- a/server/views/coursewares/showHTML.jade +++ b/server/views/coursewares/showHTML.jade @@ -80,7 +80,7 @@ block content iframe.iphone.iframe-scroll#preview .spacer #complete-courseware-dialog.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header = compliment @@ -94,5 +94,5 @@ block content if(user) #submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter) else - a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge + a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge include ../partials/challenge-modals diff --git a/server/views/coursewares/showJS.jade b/server/views/coursewares/showJS.jade index 07cae9c9da..c2e2e5723e 100644 --- a/server/views/coursewares/showJS.jade +++ b/server/views/coursewares/showJS.jade @@ -76,7 +76,7 @@ block content script. editor.setOption("mode", "javascript"); #complete-courseware-dialog.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header= compliment a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × @@ -88,9 +88,9 @@ block content .spacer .row if (user) - #submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to next challenge (Ctrl + enter) + #submit-challenge.animated.fadeIn.btn.btn-lg.btn-primary.btn-block Submit and go to my next challenge (ctrl + enter) 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.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   = phrase else diff --git a/server/views/coursewares/showVideo.jade b/server/views/coursewares/showVideo.jade index 8b4393f453..a26c158109 100644 --- a/server/views/coursewares/showVideo.jade +++ b/server/views/coursewares/showVideo.jade @@ -57,7 +57,7 @@ block content }; #complete-courseware-editorless-dialog.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header= compliment a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × @@ -66,13 +66,13 @@ block content .animated.zoomInDown.delay-half span.completion-icon.ion-checkmark-circled.text-primary if (user) - a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) 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 script. $('#complete-courseware-editorless-dialog').bind('keypress', modalControlEnterHandler); if (user.progressTimestamps.length > 2) .button-spacer - a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(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" target="_blank") + a.btn.btn-lg.btn-block.btn-twitter(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" target="_blank") i.fa.fa-twitter   = phrase else diff --git a/server/views/coursewares/showZiplineOrBasejump.jade b/server/views/coursewares/showZiplineOrBasejump.jade index e1e1e37a8f..056ba51f6b 100644 --- a/server/views/coursewares/showZiplineOrBasejump.jade +++ b/server/views/coursewares/showZiplineOrBasejump.jade @@ -33,7 +33,7 @@ block content script. var userLoggedIn = true; else - a.animated.fadeIn.btn.btn-big.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge (ctrl + enter) + a.btn.btn-big.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge (ctrl + enter) a.btn.btn-big.signup-btn.btn-block(href='/login') Sign in so you can save your progress script. var userLoggedIn = false; @@ -62,7 +62,7 @@ block content }; #complete-zipline-or-basejump-dialog.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header= compliment a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × @@ -73,7 +73,7 @@ block content if (user) 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 + .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") if (challengeType === "3") @@ -89,12 +89,12 @@ block content | Username not found if (user) - a.animated.fadeIn.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, ng-disabled='completedWithForm.$invalid') Go to my next challenge .button-spacer script. $('#complete-zipline-or-basejump-dialog').on('keypress', modalControlEnterHandler); else - a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge + a.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + challengeId) Go to my next challenge script. $('body').on('keypress', controlEnterHandler); include ../partials/challenge-modals diff --git a/server/views/partials/challenge-modals.jade b/server/views/partials/challenge-modals.jade index b5e223cb5e..4503e2ac17 100644 --- a/server/views/partials/challenge-modals.jade +++ b/server/views/partials/challenge-modals.jade @@ -1,5 +1,5 @@ #pair-modal.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header Ready to pair program? a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × @@ -13,7 +13,7 @@ a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel #issue-modal.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header Did you find a bug? a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × @@ -25,7 +25,7 @@ a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel #help-modal.modal(tabindex='-1') - .modal-dialog.animated.zoomIn.fast-animation + .modal-dialog.animated.fadeIn.fast-animation .modal-content .modal-header.challenge-list-header Need some help? a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × diff --git a/server/views/stories/hot-stories.jade b/server/views/stories/hot-stories.jade index 1670569867..0905fbd79b 100644 --- a/server/views/stories/hot-stories.jade +++ b/server/views/stories/hot-stories.jade @@ -48,7 +48,7 @@ (typeof username !== 'undefined' ? "" : "upvote") + - "more info..." + + "more info" + "" + "" + "" + "
" + "
" + - "more info..." + + "more info" + "
" + "" + "" + @@ -103,7 +103,7 @@ script. "" + "" + "
" + - "more info... · " + + "more info · " + rank + (rank > 1 ? " points" : " point") + " · posted " + moment(data[i].timePosted).fromNow() + " by @" + data[i].author.username +