77 lines
2.3 KiB
JavaScript
77 lines
2.3 KiB
JavaScript
function showErrorSections() {
|
|
|
|
if($("#soundcloud-settings .errors").length > 0) {
|
|
$("#soundcloud-settings").show();
|
|
$(window).scrollTop($("#soundcloud-settings .errors").position().top);
|
|
}
|
|
|
|
if($("#email-server-settings .errors").length > 0) {
|
|
$("#email-server-settings").show();
|
|
$(window).scrollTop($("#email-server-settings .errors").position().top);
|
|
}
|
|
|
|
if($("#livestream-settings .errors").length > 0) {
|
|
$("#livestream-settings").show();
|
|
$(window).scrollTop($("#livestream-settings .errors").position().top);
|
|
}
|
|
}
|
|
|
|
function setConfigureMailServerListener() {
|
|
var configMailServer = $("#configureMailServer");
|
|
configMailServer.click(function(event){
|
|
setMailServerInputReadonly();
|
|
})
|
|
}
|
|
|
|
function setEnableSystemEmailsListener() {
|
|
var enableSystemEmails = $("#enableSystemEmail");
|
|
enableSystemEmails.click(function(event){
|
|
setSystemFromEmailReadonly();
|
|
})
|
|
}
|
|
|
|
function setSystemFromEmailReadonly() {
|
|
var enableSystemEmails = $("#enableSystemEmail");
|
|
var systemFromEmail = $("#systemEmail");
|
|
if ($(enableSystemEmails).is(':checked')) {
|
|
systemFromEmail.removeAttr("readonly");
|
|
} else {
|
|
systemFromEmail.attr("readonly", "readonly");
|
|
}
|
|
}
|
|
|
|
function setMailServerInputReadonly() {
|
|
var configMailServer = $("#configureMailServer");
|
|
var mailServer = $("#mailServer");
|
|
var email = $("#email");
|
|
var password = $("#ms_password");
|
|
var port = $("#port");
|
|
if ($(configMailServer).is(':checked')) {
|
|
mailServer.removeAttr("readonly");
|
|
email.removeAttr("readonly");
|
|
password.removeAttr("readonly");
|
|
port.removeAttr("readonly");
|
|
} else {
|
|
mailServer.attr("readonly", "readonly");
|
|
email.attr("readonly", "readonly");
|
|
password.attr("readonly", "readonly");
|
|
port.attr("readonly", "readonly");
|
|
}
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('.collapsible-header').live('click',function() {
|
|
$(this).next().toggle('fast');
|
|
$(this).toggleClass("close");
|
|
return false;
|
|
}).next().hide();
|
|
|
|
showErrorSections();
|
|
|
|
setMailServerInputReadonly();
|
|
setSystemFromEmailReadonly();
|
|
setConfigureMailServerListener();
|
|
setEnableSystemEmailsListener();
|
|
});
|