mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-26 19:00:34 +02:00
ids.cgi: Display oinkcode section after page load when neccessary.
Fixes #12048. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
d51d3c5b93
commit
0d34a479c8
@@ -689,20 +689,26 @@ print"var show = \"$Lang::tr{'ids show'}\"\;\n";
|
||||
print"var hide = \"$Lang::tr{'ids hide'}\"\;\n";
|
||||
|
||||
print <<END
|
||||
// JQuery function to show/hide the text input field for
|
||||
// Java Script function to show/hide the text input field for
|
||||
// Oinkcode/Subscription code.
|
||||
\$(function() {
|
||||
\$('#RULES').change(function(){
|
||||
if(\$('#RULES').val() == 'registered') {
|
||||
\$('#code').show();
|
||||
} else if(\$('#RULES').val() == 'subscripted') {
|
||||
\$('#code').show();
|
||||
} else if(\$('#RULES').val() == 'emerging_pro') {
|
||||
\$('#code').show();
|
||||
} else {
|
||||
\$('#code').hide();
|
||||
}
|
||||
});
|
||||
var update_code = function() {
|
||||
if(\$('#RULES').val() == 'registered') {
|
||||
\$('#code').show();
|
||||
} else if(\$('#RULES').val() == 'subscripted') {
|
||||
\$('#code').show();
|
||||
} else if(\$('#RULES').val() == 'emerging_pro') {
|
||||
\$('#code').show();
|
||||
} else {
|
||||
\$('#code').hide();
|
||||
}
|
||||
};
|
||||
|
||||
// JQuery function to call corresponding function when
|
||||
// the ruleset is changed or the page is loaded for showing/hiding
|
||||
// the code area.
|
||||
\$(document).ready(function() {
|
||||
\$('#RULES').change(update_code);
|
||||
update_code();
|
||||
});
|
||||
|
||||
// Tiny java script function to show/hide the rules
|
||||
|
||||
Reference in New Issue
Block a user