changed times for rfc and break intervention to minimum 15 and 20 minutes. roc modal shows some additional text to the modal for less confusion

This commit is contained in:
Thomas Hille
2017-03-08 14:36:25 +01:00
parent bd0721da2e
commit f1bf313280

View File

@ -323,6 +323,9 @@ configureEditors: function () {
var button = $('#requestComments'); var button = $('#requestComments');
button.prop('disabled', true); button.prop('disabled', true);
button.on('click', function () { button.on('click', function () {
if ($('#editor').data('show-interventions') == true){
$('#rfc_intervention_text').hide()
}
$('#comment-modal').modal('show'); $('#comment-modal').modal('show');
}); });
@ -589,15 +592,16 @@ configureEditors: function () {
var percentile75 = data['working_time_75_percentile']; var percentile75 = data['working_time_75_percentile'];
var accumulatedWorkTimeUser = data['working_time_accumulated']; var accumulatedWorkTimeUser = data['working_time_accumulated'];
var timeUntilBreak = 15 * 60 * 1000; var timeUntilBreak = 20 * 60 * 1000;
var minTimeUntilAskQuestion = 15 * 60 * 1000;
if ((accumulatedWorkTimeUser - percentile75) > 0) { if ((accumulatedWorkTimeUser - percentile75) > 0) {
// working time is already over 75 percentile // working time is already over 75 percentile
var timeUntilAskQuestion = 10 * 60 * 1000; var timeUntilAskQuestion = minTimeUntilAskQuestion;
} else { } else {
// working time is less than 75 percentile // working time is less than 75 percentile
// ensure we give user at least 10 minutes before we bother the user // ensure we give user at least 10 minutes before we bother the user
var timeUntilAskQuestion = (percentile75 - accumulatedWorkTimeUser) > 10 * 60 * 1000 ? (percentile75 - accumulatedWorkTimeUser) : 10 * 60 * 1000; var timeUntilAskQuestion = (percentile75 - accumulatedWorkTimeUser) > minTimeUntilAskQuestion ? (percentile75 - accumulatedWorkTimeUser) : minTimeUntilAskQuestion;
} }
// if notifications are too close to each other, ensure some time differences between them // if notifications are too close to each other, ensure some time differences between them
@ -616,15 +620,20 @@ configureEditors: function () {
url: $('#editor').data('intervention-save-url')}); url: $('#editor').data('intervention-save-url')});
}, timeUntilBreak); }, timeUntilBreak);
setTimeout(function() { setTimeout(function() {
$('#search-intervention-modal').modal('show'); var button = $('#requestComments');
$.ajax({ if (!button.prop('disabled')){
data: { $('#rfc_intervention_text').show();
intervention_type: 'QuestionIntervention' $('#comment-modal').modal('show');
}, $.ajax({
dataType: 'json', data: {
type: 'POST', intervention_type: 'QuestionIntervention'
url: $('#editor').data('intervention-save-url')}); },
dataType: 'json',
type: 'POST',
url: $('#editor').data('intervention-save-url')});
};
}, timeUntilAskQuestion); }, timeUntilAskQuestion);
} }
}); });
@ -636,11 +645,6 @@ configureEditors: function () {
window.open(`https://open.hpi.de/courses/javaeinstieg2017/pinboard?query=${search}`, '_blank'); window.open(`https://open.hpi.de/courses/javaeinstieg2017/pinboard?query=${search}`, '_blank');
}) })
$('#btn-search-modal').button().click(function(){
var search = $('#search-modal').val();
window.open(`https://open.hpi.de/courses/javaeinstieg2017/pinboard?query=${search}`, '_blank');
})
$('#sidebar-search-collapsed').on('click',this.handleSideBarToggle.bind(this)); $('#sidebar-search-collapsed').on('click',this.handleSideBarToggle.bind(this));
}, },