ipfire theme: Add missing swapVisibility javascript function
authorAlf Høgemark <alf@i100.no>
Wed, 19 Feb 2014 17:05:55 +0000 (18:05 +0100)
committerAlf Høgemark <alf@i100.no>
Wed, 19 Feb 2014 17:05:55 +0000 (18:05 +0100)
qos.cgi and media.cgi depend on swapVisibility function, this
is defined in each theme, but was missing from the new theme.

Add the function, and implement it using jquery, since jquery
is always present in the new theme.

html/html/themes/ipfire/include/functions.pl

index 44ed9b7..b3b26b9 100644 (file)
@@ -128,6 +128,12 @@ print <<END;
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <link rel="shortcut icon" href="/favicon.ico" />
        <script type="text/javascript" src="/include/jquery.js"></script>
+
+       <script language="javascript" type="text/javascript">
+               function swapVisibility(id) {
+                       \$('#' + id).toggle();
+               }
+       </script>
 END
 
        foreach my $stylesheet (@stylesheets) {