mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
Place page specific js after jquery so that jquery can be used
This commit is contained in:
parent
e49aa3df43
commit
288e4bb6ca
@ -88,19 +88,19 @@ class wan(FormPlugin, PagePlugin):
|
|||||||
url = ["/router/setup"]
|
url = ["/router/setup"]
|
||||||
order = 10
|
order = 10
|
||||||
|
|
||||||
js = """<script type="text/javascript">
|
js = """
|
||||||
<!--
|
<script type="text/javascript">
|
||||||
|
(function($) {
|
||||||
function hideshow_static() {
|
function hideshow_static() {
|
||||||
var d = document.getElementById('connect_type');
|
var show_or_hide = ($('#connect_type').val() == 'Static IP')
|
||||||
connect_type = d.value;
|
$('#static_ip_form').toggle(show_or_hide);
|
||||||
if (connect_type != 'Static IP') {
|
|
||||||
hide("static_ip_form");
|
|
||||||
} else {
|
|
||||||
show("static_ip_form");
|
|
||||||
}
|
}
|
||||||
}
|
$(document).ready(function() {
|
||||||
// -->
|
$('#connect_type').change(hideshow_static);
|
||||||
</script>"""
|
hideshow_static();
|
||||||
|
});
|
||||||
|
})(jQuery);
|
||||||
|
</script>"""
|
||||||
|
|
||||||
def sidebar_right(self, *args, **kwargs):
|
def sidebar_right(self, *args, **kwargs):
|
||||||
side=''
|
side=''
|
||||||
@ -141,7 +141,7 @@ class wan(FormPlugin, PagePlugin):
|
|||||||
action=cfg.server_dir + "/router/setup/wan/index",
|
action=cfg.server_dir + "/router/setup/wan/index",
|
||||||
name="wan_connection_form",
|
name="wan_connection_form",
|
||||||
message=message)
|
message=message)
|
||||||
form.dropdown('Connection Type', vals=["DHCP", "Static IP"], id="connect_type", onchange="hideshow_static()")
|
form.dropdown('Connection Type', vals=["DHCP", "Static IP"], id="connect_type")
|
||||||
form.html('<div id="static_ip_form">')
|
form.html('<div id="static_ip_form">')
|
||||||
form.dotted_quad("WAN IP Address", name="wan_ip", quad=[wan_ip0, wan_ip1, wan_ip2, wan_ip3])
|
form.dotted_quad("WAN IP Address", name="wan_ip", quad=[wan_ip0, wan_ip1, wan_ip2, wan_ip3])
|
||||||
form.dotted_quad("Subnet Mask", name="subnet", quad=[subnet0, subnet1, subnet2, subnet3])
|
form.dotted_quad("Subnet Mask", name="subnet", quad=[subnet0, subnet1, subnet2, subnet3])
|
||||||
@ -150,11 +150,6 @@ class wan(FormPlugin, PagePlugin):
|
|||||||
form.dotted_quad("Static DNS 2", name="dns2", quad=[dns20, dns21, dns22, dns23])
|
form.dotted_quad("Static DNS 2", name="dns2", quad=[dns20, dns21, dns22, dns23])
|
||||||
form.dotted_quad("Static DNS 3", name="dns3", quad=[dns30, dns31, dns32, dns33])
|
form.dotted_quad("Static DNS 3", name="dns3", quad=[dns30, dns31, dns32, dns33])
|
||||||
form.html('</div>')
|
form.html('</div>')
|
||||||
form.html(""" <script type="text/javascript">
|
|
||||||
<!--
|
|
||||||
hideshow_static();
|
|
||||||
// -->
|
|
||||||
</script>""")
|
|
||||||
form.submit("Set Wan")
|
form.submit("Set Wan")
|
||||||
return form.render()
|
return form.render()
|
||||||
|
|
||||||
|
|||||||
@ -96,7 +96,6 @@
|
|||||||
<!-- JS from previous Plinth template, not sure what to keep yet -->
|
<!-- JS from previous Plinth template, not sure what to keep yet -->
|
||||||
<script type="text/javascript" src="$basehref/static/theme/js/menu.js"></script>
|
<script type="text/javascript" src="$basehref/static/theme/js/menu.js"></script>
|
||||||
<script type="text/javascript" src="$basehref/static/theme/js/plinth.js"></script>
|
<script type="text/javascript" src="$basehref/static/theme/js/plinth.js"></script>
|
||||||
$js
|
|
||||||
$main_menu_js
|
$main_menu_js
|
||||||
$sub_menu_js
|
$sub_menu_js
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -199,5 +198,6 @@
|
|||||||
<!--<script type="text/javascript" src="$basehref/static/theme/js/libs/bootstrap/typeahead.js"></script>-->
|
<!--<script type="text/javascript" src="$basehref/static/theme/js/libs/bootstrap/typeahead.js"></script>-->
|
||||||
<!-- JS plugins -->
|
<!-- JS plugins -->
|
||||||
<script type="text/javascript" src="$basehref/static/theme/js/plugins.js"></script>
|
<script type="text/javascript" src="$basehref/static/theme/js/plugins.js"></script>
|
||||||
|
$js
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user