Commit 003d71db authored by gerv%gerv.net's avatar gerv%gerv.net

Bug 140993 - Pass javascript correctly into header; templatise the rest of the…

Bug 140993 - Pass javascript correctly into header; templatise the rest of the header-related parameters. Patch by gerv; r=bbaetz, caillon.
parent 6428fbf3
...@@ -332,8 +332,8 @@ sub value_quote { ...@@ -332,8 +332,8 @@ sub value_quote {
} }
# Adds <link> elements for bug lists. These can be inserted into the header by # Adds <link> elements for bug lists. These can be inserted into the header by
# (ab)using the "jscript" parameter to PutHeader, which inserts an arbitrary # using the "header_html" parameter to PutHeader, which inserts an arbitrary
# string into the header. This is currently used only in # string into the header. This function is currently used only in
# template/en/default/bug/edit.html.tmpl. # template/en/default/bug/edit.html.tmpl.
sub navigation_links($) { sub navigation_links($) {
my ($buglist) = @_; my ($buglist) = @_;
...@@ -849,8 +849,7 @@ Content-type: text/html ...@@ -849,8 +849,7 @@ Content-type: text/html
} }
sub PutHeader { sub PutHeader {
($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}, ($vars->{'title'}, $vars->{'h1'}, $vars->{'h2'}) = (@_);
$vars->{'extra'}, $vars->{'jscript'}) = (@_);
$::template->process("global/header.html.tmpl", $::vars) $::template->process("global/header.html.tmpl", $::vars)
|| ThrowTemplateError($::template->error()); || ThrowTemplateError($::template->error());
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
th { text-align: right; vertical-align: baseline; white-space: nowrap; } th { text-align: right; vertical-align: baseline; white-space: nowrap; }
td { text-align: left; vertical-align: baseline; padding-bottom: 5px; } td { text-align: left; vertical-align: baseline; padding-bottom: 5px; }
" "
extra = "onload=\"setContentTypeDisabledState();\"" body_attributes = "onload=\"setContentTypeDisabledState();\""
%] %]
<form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data"> <form name="entryform" method="post" action="attachment.cgi" enctype="multipart/form-data">
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
title = "Bug $bug.bug_id - $bug.short_desc" title = "Bug $bug.bug_id - $bug.short_desc"
h1 = "Bugzilla Bug $bug.bug_id" h1 = "Bugzilla Bug $bug.bug_id"
h2 = filtered_desc h2 = filtered_desc
extra = navigation_links() header_html = navigation_links()
%] %]
[% END %] [% END %]
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# Copyright (C) 1998 Netscape Communications Corporation. All # Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved. # Rights Reserved.
# #
# Contributor(s): # Contributor(s): Gervase Markham <gerv@gerv.net>
#%] #%]
[%# INTERFACE: [%# INTERFACE:
...@@ -31,22 +31,23 @@ ...@@ -31,22 +31,23 @@
#%] #%]
[% DEFAULT [% DEFAULT
title = ""
h1 = title h1 = title
h2 = "" h2 = ""
extra = ""
jscript = ""
style = ""
message = ""
%] %]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<title>[% title FILTER html %]</title> <title>[% title FILTER html %]</title>
[% Param('headerhtml') %] [%# Migration note: contents of the old Param 'headerhtml' would go here %]
[% header_html %]
[% jscript %] [% IF javascript %]
<script type="text/javascript" language="JavaScript">
[% javascript %]
</script>
[% END %]
[% IF style %] [% IF style %]
<style type="text/css"> <style type="text/css">
...@@ -60,9 +61,29 @@ ...@@ -60,9 +61,29 @@
</head> </head>
<body [% Param('bodyhtml') %][% " " %][% extra %]> [%# Migration note: contents of the old Param 'bodyhtml' go in the body tag %]
<body [% body_attributes %]>
[%# Migration note: this section corresponds to the old Param 'bannerhtml' %]
<table bgcolor="#000000" width="100%" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td>
<a href="http://www.mozilla.org/">
<img src="http://www.mozilla.org/images/mozilla-banner.gif" alt=""
border="0" width="600" height="58">
</a>
</td>
</tr>
</table>
<center>
<small>Bugzilla version [% Param("version") %]</small>
</center>
[% PerformSubsts(Param('bannerhtml')) %] [%# End section %]
[% IF h1 || h2 %] [% IF h1 || h2 %]
<table border="0" cellspacing="0"> <table border="0" cellspacing="0">
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Search for bugs" title = "Search for bugs"
extra = " onLoad=\"selectProduct(document.forms['queryform']);\"" body_attributes = "onload=\"selectProduct(document.forms['queryform']);\""
%] %]
[% button_name = "Search" %] [% button_name = "Search" %]
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
[% PROCESS global/header.html.tmpl [% PROCESS global/header.html.tmpl
title = "Search for bugs" title = "Search for bugs"
extra = " onLoad=\"selectProduct(document.forms['queryform']);\"" body_attributes = "onload=\"selectProduct(document.forms['queryform']);\""
%] %]
[% button_name = "Search" %] [% button_name = "Search" %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment