Closed Bug 251469 Opened 19 years ago Closed 19 years ago

Add an interface argument in header template to import <script src files

Categories

(Bugzilla :: Bugzilla-General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: timello, Assigned: timello)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a2) Gecko/20040612 Firefox/0.8.0+
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a2) Gecko/20040612 Firefox/0.8.0+

Currently, javascript just is passing using a string in header template. Maybe
should be possible import a script source.

Reproducible: Always
Steps to Reproduce:
1.
2.
3.



Expected Results:  
diff -u -u -r1.24 header.html.tmpl
--- header.html.tmpl    17 Mar 2004 22:50:20 -0000      1.24
+++ header.html.tmpl    14 Jul 2004 22:49:32 -0000
@@ -30,6 +30,7 @@
   # bodyattrs: any extra attributes for the <body> tag
   # onload: string. JavaScript code to run when the page finishes loading.
   # javascript: string. Javascript to go in the header.
+  # javascript_urls: list. List of URLs to Javascript
   # style: string. CSS style.
   # style_urls: list. List of URLs to CSS style sheets.
   # message: string. A message to display to the user. May contain HTML.
@@ -70,6 +71,12 @@
         [% javascript %]
       </script>
     [% END %]
+    
+    [% IF javascript_urls %]
+      [% FOREACH javascript_url = javascript_urls %]
+        <script src="[% javascript_url %]" type="text/javascript"
language="JavaScript"></script>
+      [% END %]
+    [% END %]

     [%+ INCLUDE "global/help-header.html.tmpl" %]
Err, Tiago, could you package this as a patch and attach it?

Myk, should we also clean up the callsites that import JS files to use this?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 96983
Sorry, here it is!
Reassigning to patch author. Looks simple enough.
Assignee: justdave → tiago
Comment on attachment 153321 [details] [diff] [review]
Patch for header template

>@@ -70,6 +71,12 @@
>+    [% IF javascript_urls %]

i don't think the if is needed (foreach should do the right thing tm), but this
is in the style of, so i'll leave that for someone else to fix.
Attachment #153321 - Flags: review+
Trivial, harmless and works. Why not help customizers out?
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval2.18?
Flags: approval?
Flags: approval2.18?
Flags: approval2.18-
Flags: approval+
Target Milestone: --- → Bugzilla 2.20
Summary: Add an interface element in header template for import script source → Add an interface argument in header template to import <script src files
Attached patch kiko_bustageSplinter Review
Needed some filtering, and fixed style_url while I was at it.
Attachment #153350 - Flags: review+
Checked in both patch and bustage fix. Sorry for bustage, but thanks to Tiago
for his first patch checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.