mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-28 11:43:25 +02:00
ids.cgi: Show/Hide subscription code area dynamically.
Dynamically (Java Script) show/hide the area for entering the subscription code / oinkcode based on the choosen ruleset. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
@@ -612,6 +612,22 @@ $selected{'AUTOUPDATE_INTERVAL'}{$rulessettings{'AUTOUPDATE_INTERVAL'}} = "selec
|
|||||||
### Java Script ###
|
### Java Script ###
|
||||||
print <<END
|
print <<END
|
||||||
<script>
|
<script>
|
||||||
|
// JQuery 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();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Tiny java script function to show/hide the rules
|
// Tiny java script function to show/hide the rules
|
||||||
// of a given category.
|
// of a given category.
|
||||||
function showhide(tblname) {
|
function showhide(tblname) {
|
||||||
@@ -780,7 +796,7 @@ print <<END
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><select name='RULES'>
|
<td><select name='RULES' id='RULES'>
|
||||||
<option value='emerging' $selected{'RULES'}{'emerging'} >$Lang::tr{'emerging rules'}</option>
|
<option value='emerging' $selected{'RULES'}{'emerging'} >$Lang::tr{'emerging rules'}</option>
|
||||||
<option value='community' $selected{'RULES'}{'community'} >$Lang::tr{'community rules'}</option>
|
<option value='community' $selected{'RULES'}{'community'} >$Lang::tr{'community rules'}</option>
|
||||||
<option value='registered' $selected{'RULES'}{'registered'} >$Lang::tr{'registered user rules'}</option>
|
<option value='registered' $selected{'RULES'}{'registered'} >$Lang::tr{'registered user rules'}</option>
|
||||||
@@ -801,8 +817,8 @@ print <<END
|
|||||||
<td colspan='2'><br><br></td>
|
<td colspan='2'><br><br></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr style='display:none' id='code'>
|
||||||
<td colspan='2' nowrap='nowrap'>Oinkcode: <input type='text' size='40' name='OINKCODE' value='$rulessettings{'OINKCODE'}'></td>
|
<td colspan='2'>Oinkcode: <input type='text' size='40' name='OINKCODE' value='$rulessettings{'OINKCODE'}'></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user