[Web] Do not try to init spam slider as domain admin

master
andryyy 2021-08-04 12:41:01 +02:00
parent b54ec15850
commit fc8ac2de1f
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 25 additions and 23 deletions

View File

@ -3,30 +3,32 @@ var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456
$(document).ready(function() { $(document).ready(function() {
// Spam score slider // Spam score slider
var spam_slider = $('#spam_score')[0]; var spam_slider = $('#spam_score')[0];
noUiSlider.create(spam_slider, { if (typeof spam_slider !== 'undefined') {
start: user_spam_score, noUiSlider.create(spam_slider, {
connect: [true, true, true], start: user_spam_score,
range: { connect: [true, true, true],
'min': [0], //stepsize is 50.000 range: {
'50%': [10], 'min': [0], //stepsize is 50.000
'70%': [20, 5], '50%': [10],
'80%': [50, 10], '70%': [20, 5],
'90%': [100, 100], '80%': [50, 10],
'95%': [1000, 1000], '90%': [100, 100],
'max': [5000] '95%': [1000, 1000],
}, 'max': [5000]
}); },
var connect = spam_slider.querySelectorAll('.noUi-connect'); });
var classes = ['c-1-color', 'c-2-color', 'c-3-color']; var connect = spam_slider.querySelectorAll('.noUi-connect');
for (var i = 0; i < connect.length; i++) { var classes = ['c-1-color', 'c-2-color', 'c-3-color'];
connect[i].classList.add(classes[i]); for (var i = 0; i < connect.length; i++) {
connect[i].classList.add(classes[i]);
}
spam_slider.noUiSlider.on('update', function (values, handle) {
$('.spam-ham-score').text('< ' + Math.round(values[0] * 10) / 10);
$('.spam-spam-score').text(Math.round(values[0] * 10) / 10 + ' - ' + Math.round(values[1] * 10) / 10);
$('.spam-reject-score').text('> ' + Math.round(values[1] * 10) / 10);
$('#spam_score_value').val((Math.round(values[0] * 10) / 10) + ',' + (Math.round(values[1] * 10) / 10));
});
} }
spam_slider.noUiSlider.on('update', function (values, handle) {
$('.spam-ham-score').text('< ' + Math.round(values[0] * 10) / 10);
$('.spam-spam-score').text(Math.round(values[0] * 10) / 10 + ' - ' + Math.round(values[1] * 10) / 10);
$('.spam-reject-score').text('> ' + Math.round(values[1] * 10) / 10);
$('#spam_score_value').val((Math.round(values[0] * 10) / 10) + ',' + (Math.round(values[1] * 10) / 10));
});
// syncjobLogModal // syncjobLogModal
$('#syncjobLogModal').on('show.bs.modal', function(e) { $('#syncjobLogModal').on('show.bs.modal', function(e) {
var syncjob_id = $(e.relatedTarget).data('syncjob-id'); var syncjob_id = $(e.relatedTarget).data('syncjob-id');