<commit_before></div>
</div>
<div id="currentSurveyModal"></div>
<script>
$(".openSurvey").click(function(){
    openSurveyModal()
})
function openSurveyModal(){
  $.ajax({
        url:'ajaxQuery/AJAX_getTrainingSurvey.php',
        data:{<?php echo $userHasUnansweredOnLoginSurveys?"onLogin:true":"" ?>},
        type: 'get',
        success : function(resp){
            $("#currentSurveyModal").html(resp);
        },
        error : function(resp){console.error(resp)},
        complete: function(resp){
            $("#currentSurveyModal .survey-modal").modal({
                backdrop: 'static',
                keyboard: false
            });
        }
   });
}
<?php if($userHasUnansweredOnLoginSurveys){echo "setTimeout(function(){ openSurveyModal() },500)";} ?>
</script>
<?php // endif; ?>

<button type='button' class='btn btn-primary feedback-button'>Feedback</button> 
<script>
$("#feedback_form").submit(function(event){
    event.preventDefault();
    var img = window.feedbackCanvasObject.toDataURL()
    var postData =  {
        location:window.location.href,
        message: $("#feedback_message").val(),
        type:$('input[name=feedback_type]:checked').val()
    };
    if(document.getElementById("feedback_includeScreenshot").checked){
        postData.screenshot = img;
    }
    $.post("ajaxQuery/AJAX_sendFeedback.php",
    postData,
    function (response){
        alert(response)
        //clear form
        $("#feedback_message").val("")
        $('#feedbackModal').modal('hide');
    }
);
});
$(".feedback-button").on("click",function(){
    html2canvas(document.body).then(function(canvas) {
        canvas.toBlob(function(blob) {
            var newImg = document.createElement('img'), url = URL.createObjectURL(blob);
            newImg.onload = function() {
                URL.revokeObjectURL(url);
            };
            newImg.src = url;
            $("#screenshot").html(newImg);
        });
        window.feedbackCanvasObject = canvas
        $('#feedbackModal').modal('show');
    });
})
<commit_msg>stop feedback from appearing behind other modals<commit_after></div>
</div>
<div id="currentSurveyModal"></div>
<script>
$(".openSurvey").click(function(){
    openSurveyModal()
})
function openSurveyModal(){
  $.ajax({
        url:'ajaxQuery/AJAX_getTrainingSurvey.php',
        data:{<?php echo $userHasUnansweredOnLoginSurveys?"onLogin:true":"" ?>},
        type: 'get',
        success : function(resp){
            $("#currentSurveyModal").html(resp);
        },
        error : function(resp){console.error(resp)},
        complete: function(resp){
            $("#currentSurveyModal .survey-modal").modal({
                backdrop: 'static',
                keyboard: false
            });
        }
   });
}
<?php if($userHasUnansweredOnLoginSurveys){echo "setTimeout(function(){ openSurveyModal() },500)";} ?>
</script>
<?php // endif; ?>

<button type='button' class='btn btn-primary feedback-button'>Feedback</button> 
<script>
$("#feedback_form").submit(function(event){
    event.preventDefault();
    var img = window.feedbackCanvasObject.toDataURL()
    var postData =  {
        location:window.location.href,
        message: $("#feedback_message").val(),
        type:$('input[name=feedback_type]:checked').val()
    };
    if(document.getElementById("feedback_includeScreenshot").checked){
        postData.screenshot = img;
    }
    $.post("ajaxQuery/AJAX_sendFeedback.php",
    postData,
    function (response){
        alert(response)
        //clear form
        $("#feedback_message").val("")
        $('#feedbackModal').modal('hide');
    }
);
});
$(".feedback-button").on("click",function(){
    html2canvas(document.body).then(function(canvas) {
        canvas.toBlob(function(blob) {
            var newImg = document.createElement('img'), url = URL.createObjectURL(blob);
            newImg.onload = function() {
                URL.revokeObjectURL(url);
            };
            newImg.src = url;
            $("#screenshot").html(newImg);
        });
        window.feedbackCanvasObject = canvas
        $('#feedbackModal').appendTo("body").modal('show');
    });
})

{'fraction_non_alphanumeric': 0.17549350024073182, 'fraction_numerical': 0.0019258545979778526, 'mean_word_length': 2.883177570093458, 'pattern_counts': {'":': 2, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '863280', 'n_tokens_mistral': 1233, 'n_tokens_neox': 1200, 'n_words': 172}