Skip to content

Commit

Permalink
Move floodprotection js out of .tmpl
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthGandalf committed Apr 1, 2012
1 parent 1a8455b commit ce6a9ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
13 changes: 13 additions & 0 deletions modules/data/webadmin/files/webadmin.js
@@ -0,0 +1,13 @@
function floodprotection_change() {
var protection = document.getElementById('floodprotection_checkbox');
var rate = document.getElementById('floodrate');
var burst = document.getElementById('floodburst');
if (protection.checked) {
rate.removeAttribute('disabled');
burst.removeAttribute('disabled');
} else {
rate.disabled = 'disabled';
burst.disabled = 'disabled';
}
}

15 changes: 1 addition & 14 deletions modules/data/webadmin/tmpl/add_edit_network.tmpl
@@ -1,3 +1,4 @@
<? AddRow JSLoop HREF=/modfiles/global/webadmin/webadmin.js ?>
<? INC Header.tmpl ?>

<? IF Edit ?>
Expand Down Expand Up @@ -58,20 +59,6 @@
<br /><span class="info">One server per line, host [[+]port] [password]</span>
</div>

<script type="text/javascript">
function floodprotection_change() {
var protection = document.getElementById('floodprotection_checkbox');
var rate = document.getElementById('floodrate');
var burst = document.getElementById('floodburst');
if (protection.checked) {
rate.removeAttribute('disabled');
burst.removeAttribute('disabled');
} else {
rate.disabled = 'disabled';
burst.disabled = 'disabled';
}
}
</script>
<div class="subsection">
<div class="inputlabel">Flood protection:</div>
<div class="checkbox">
Expand Down

0 comments on commit ce6a9ce

Please sign in to comment.