finish fixing modals
This commit is contained in:
		@@ -37,7 +37,7 @@ $(document).ready(function() {
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  $('#i-want-help-editorless').on('click', function() {
 | 
			
		||||
    $('#help-modal-editorless').modal('hide');
 | 
			
		||||
    $('#help-editorless-modal').modal('hide');
 | 
			
		||||
    var currentLocation = window.location.href;
 | 
			
		||||
    $.post(
 | 
			
		||||
      '/get-help',
 | 
			
		||||
@@ -134,6 +134,14 @@ $(document).ready(function() {
 | 
			
		||||
    $(this).unbind("error").attr("src", "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png");
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  $('#completed-courseware').on('click', function() {
 | 
			
		||||
    $('#complete-courseware-dialog').modal('show');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  $('#completed-courseware-editorless').on('click', function() {
 | 
			
		||||
    $('#complete-courseware-editorless-dialog').modal('show');
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  $('#trigger-pair-modal').on('click', function() {
 | 
			
		||||
    $('#pair-modal').modal('show');
 | 
			
		||||
  });
 | 
			
		||||
@@ -157,6 +165,11 @@ $(document).ready(function() {
 | 
			
		||||
  $('#complete-courseware-dialog').on('hidden.bs.modal', function() {
 | 
			
		||||
    editor.focus();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  $('#complete-challenge-dialog').on('hidden.bs.modal', function() {
 | 
			
		||||
    editor.focus();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  var challengeTypes = {
 | 
			
		||||
    'HTML_CSS_JQ': 0,
 | 
			
		||||
    'JAVASCRIPT': 1,
 | 
			
		||||
@@ -172,7 +185,6 @@ $(document).ready(function() {
 | 
			
		||||
        case challengeTypes.HTML_CSS_JQ:
 | 
			
		||||
        case challengeTypes.JAVASCRIPT:
 | 
			
		||||
        case challengeTypes.VIDEO:
 | 
			
		||||
          console.log(challenge_Id);
 | 
			
		||||
          $.post(
 | 
			
		||||
            '/completed-challenge/',
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -80,7 +80,7 @@ block content
 | 
			
		||||
                    - if (user)
 | 
			
		||||
                        a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid && existingUser.length > 0') Go to my next challenge (ctrl + enter)
 | 
			
		||||
                        - if (points && points > 2)
 | 
			
		||||
                            a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/bonfires/#{dashedName}&hashtags=LearnToCode, JavaScript" target="_blank")
 | 
			
		||||
                            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")
 | 
			
		||||
                                i.fa.fa-twitter  
 | 
			
		||||
                                    = phrase
 | 
			
		||||
                    - else
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ block content
 | 
			
		||||
                iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
 | 
			
		||||
            br
 | 
			
		||||
            if (user)
 | 
			
		||||
                a.btn.btn-primary.btn-big.btn-block#completed-courseware I've completed this challenge  (ctrl + enter)
 | 
			
		||||
                a.btn.btn-primary.btn-big.btn-block#completed-courseware-editorless I've completed this challenge  (ctrl + enter)
 | 
			
		||||
                script.
 | 
			
		||||
                    var userLoggedIn = true;
 | 
			
		||||
                .button-spacer
 | 
			
		||||
@@ -41,22 +41,21 @@ block content
 | 
			
		||||
                var controlEnterHandler = function(e) {
 | 
			
		||||
                    $('body').unbind('keypress');
 | 
			
		||||
                    if (e.ctrlKey && e.keyCode == 13) {
 | 
			
		||||
                      $('#complete-courseware-dialog').modal('show');
 | 
			
		||||
                      $('#complete-courseware-editorless-dialog').modal('show');
 | 
			
		||||
                    } else {
 | 
			
		||||
                      $('body').bind('keypress', controlEnterHandler);
 | 
			
		||||
                    }
 | 
			
		||||
                };
 | 
			
		||||
                var modalControlEnterHandler = function(e) {
 | 
			
		||||
                  $('#complete-courseware-dialog').unbind('keypress');
 | 
			
		||||
                  $('#complete-courseware-editorless-dialog').unbind('keypress');
 | 
			
		||||
                  if (e.ctrlKey && e.keyCode == 13) {
 | 
			
		||||
                    $('#next-courseware-button').click();
 | 
			
		||||
                  } else {
 | 
			
		||||
                    $('#complete-courseware-dialog').bind('keypress', modalControlEnterHandler);
 | 
			
		||||
                    $('#complete-courseware-editorless-dialog').bind('keypress', modalControlEnterHandler);
 | 
			
		||||
                  }
 | 
			
		||||
                };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    #complete-courseware-dialog.modal(tabindex='-1')
 | 
			
		||||
    #complete-courseware-editorless-dialog.modal(tabindex='-1')
 | 
			
		||||
        .modal-dialog.animated.zoomIn.fast-animation
 | 
			
		||||
            .modal-content
 | 
			
		||||
                .modal-header.challenge-list-header= compliment
 | 
			
		||||
@@ -65,17 +64,17 @@ block content
 | 
			
		||||
                    .text-center
 | 
			
		||||
                        .animated.zoomInDown.delay-half
 | 
			
		||||
                            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) On to my next challenge (ctrl + enter)
 | 
			
		||||
                            script.
 | 
			
		||||
                              $('#complete-courseware-dialog').bind('keypress', modalControlEnterHandler);
 | 
			
		||||
                              $('#complete-courseware-editorless-dialog').bind('keypress', modalControlEnterHandler);
 | 
			
		||||
 | 
			
		||||
                            - if (user.progressTimestamps.length > 2)
 | 
			
		||||
                            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%20Challenge:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript" target="_blank")
 | 
			
		||||
                                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")
 | 
			
		||||
                                    i.fa.fa-twitter  
 | 
			
		||||
                                    = phrase
 | 
			
		||||
                        - else
 | 
			
		||||
                        else
 | 
			
		||||
                            a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
 | 
			
		||||
                                h1 #{name}
 | 
			
		||||
        script.
 | 
			
		||||
 
 | 
			
		||||
@@ -91,12 +91,6 @@ block content
 | 
			
		||||
                        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 (ctrl + enter)
 | 
			
		||||
                        script.
 | 
			
		||||
                          $('#complete-zipline-or-basejump-dialog').on('keypress', modalControlEnterHandler);
 | 
			
		||||
 | 
			
		||||
                        if (user.progressTimestamps.length > 2)
 | 
			
		||||
                            .button-spacer
 | 
			
		||||
                            a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank")
 | 
			
		||||
                                i.fa.fa-twitter  
 | 
			
		||||
                                    = phrase
 | 
			
		||||
                    else
 | 
			
		||||
                        a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
 | 
			
		||||
        script.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user