Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #9819: Not possible to add languages to the list of avail…
…able languages in global settings
- Loading branch information
Showing
2 changed files
with
58 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,59 @@ | ||
$(document).on('click',"[data-copy] :submit",function(){ | ||
$("form :input[value='"+$(this).val()+"']").click(); | ||
}); | ||
$(document).on('submit',"#frmglobalsettings",function(){ | ||
$('#frmglobalsettings').attr('action',$('#frmglobalsettings').attr('action')+location.hash);// Maybe validate before ? | ||
}); | ||
// $Id: globalsettings.js 8964 2010-07-20 20:46:47Z anishseth $ | ||
|
||
$(document).ready(function(){ | ||
$("[data-copy]").each(function(){ | ||
$(this).html($("#"+$(this).data('copy')).html()); | ||
}); | ||
$('[type=password]').attr('autocomplete', 'off'); | ||
$("#emailmethod").change(Emailchange); | ||
Emailchange(); | ||
|
||
$("#bounceaccounttype").change(Emailchanges); | ||
Emailchanges(); | ||
$('#btnRemove').click(removeLanguages); | ||
$('#btnAdd').click(addLanguages); | ||
$("#frmglobalsettings").submit(UpdateRestrictedLanguages); | ||
}); | ||
|
||
|
||
function removeLanguages(ui,evt) | ||
{ | ||
$('#includedLanguages').copyOptions('#excludedLanguages'); | ||
$("#excludedLanguages").sortOptions(); | ||
$("#includedLanguages").removeOption(/./,true); | ||
} | ||
|
||
function addLanguages(ui,evt) | ||
{ | ||
$('#excludedLanguages').copyOptions('#includedLanguages'); | ||
$("#includedLanguages").sortOptions(); | ||
$("#excludedLanguages").removeOption(/./,true); | ||
} | ||
|
||
function UpdateRestrictedLanguages(){ | ||
aString=''; | ||
$("#includedLanguages option").each(function(){ | ||
aString=aString+' '+$(this).val(); | ||
}); | ||
$('#restrictToLanguages').val($.trim(aString)); | ||
} | ||
|
||
function Emailchange(ui,evt) | ||
{ | ||
smtp_enabled=($("#emailmethod").val()=='smtp'); | ||
if (smtp_enabled==true) {smtp_enabled='';} | ||
else {smtp_enabled='disabled';} | ||
$("#emailsmtphost").prop('disabled',smtp_enabled); | ||
$("#emailsmtpuser").prop('disabled',smtp_enabled); | ||
$("#emailsmtppassword").prop('disabled',smtp_enabled); | ||
$("#emailsmtpssl").prop('disabled',smtp_enabled); | ||
$("#emailsmtpdebug").prop('disabled',smtp_enabled); | ||
} | ||
|
||
function Emailchanges(ui,evt) | ||
{ | ||
bounce_disabled=($("#bounceaccounttype").val()=='off'); | ||
if (bounce_disabled==true) {bounce_disabled='disabled';} | ||
else {bounce_disabled='';} | ||
$("#bounceaccounthost").prop('disabled',bounce_disabled); | ||
$("#bounceaccountuser").prop('disabled',bounce_disabled); | ||
$("#bounceaccountpass").prop('disabled',bounce_disabled); | ||
$("#bounceencryption").prop('disabled',bounce_disabled); | ||
$("#bounceaccountmailbox").prop('disabled',bounce_disabled); | ||
} |