Message ID | 20211127191043.1279-1-hofmann@leo-andres.de |
---|---|
State | Accepted |
Commit | b91a0f297ab27cc5bbbc0c9777a2fe8bc881ae01 |
Headers | show |
Series | ipfire-theme/functions.pl: Load $extrahead after jQuery | expand |
Reviewed-by: Michael Tremer <michael.tremer@ipfire.org> > On 27 Nov 2021, at 19:10, Leo-Andres Hofmann <hofmann@leo-andres.de> wrote: > > This ensures that jQuery is also available for custom javascript > added to the HTML <head> with $extrahead. > > Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> > --- > html/html/themes/ipfire/include/functions.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl > index 18931428e..54f8966d5 100644 > --- a/html/html/themes/ipfire/include/functions.pl > +++ b/html/html/themes/ipfire/include/functions.pl > @@ -120,12 +120,12 @@ print <<END; > <html> > <head> > <title>$headline - $title</title> > - $extrahead > <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 src="/include/rrdimage.js"></script> > > + $extrahead > <script type="text/javascript"> > function swapVisibility(id) { > \$('#' + id).toggle(); > -- > 2.27.0.windows.1 >
diff --git a/html/html/themes/ipfire/include/functions.pl b/html/html/themes/ipfire/include/functions.pl index 18931428e..54f8966d5 100644 --- a/html/html/themes/ipfire/include/functions.pl +++ b/html/html/themes/ipfire/include/functions.pl @@ -120,12 +120,12 @@ print <<END; <html> <head> <title>$headline - $title</title> - $extrahead <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 src="/include/rrdimage.js"></script> + $extrahead <script type="text/javascript"> function swapVisibility(id) { \$('#' + id).toggle();
This ensures that jQuery is also available for custom javascript added to the HTML <head> with $extrahead. Signed-off-by: Leo-Andres Hofmann <hofmann@leo-andres.de> --- html/html/themes/ipfire/include/functions.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)