[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mistakes in javascript code for virtual packages in packages.debian.org



* Frédéric Bothamy <frederic.bothamy@free.fr> [2008-01-11 17:59] :
> Hello,
> 
> I have just noticed that in the page
> http://packages.debian.org/lenny/xscreensaver, the code for wordlist (a
> virtual package) ends with:
> 
>  <script type="text/javascript">init_toggle_elem("wordlist",32 providing packages</script>
> 
> which is incorrect because the second argument should be quoted and it lacks
> the final parenthesis for init_toggle_elem.

I've had a quick look at the code and the following small patch should
be enough to fix this problem:

diff --git a/templates/html/search.tmpl b/templates/html/search.tmpl
index f90586a..2cf2aeb 100644
--- a/templates/html/search.tmpl
+++ b/templates/html/search.tmpl
@@ -112,7 +112,7 @@
       [%- IF real_archive %] [<strong class="pmarker">[% real_archive %]</strong>][% END %]
     <br>[% g('Binary packages:') %] <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]" class="binaries">
        [% IF binaries.size > 10 %]
-       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('%u binary packages', binaries.size) %])</script>
+       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('%u binary packages', binaries.size) %]")</script>
        [% END %]
     </li>
   [% END %]
diff --git a/templates/html/show.tmpl b/templates/html/show.tmpl
index bfd3c78..9ab8f48 100644
--- a/templates/html/show.tmpl
+++ b/templates/html/show.tmpl
@@ -256,7 +256,7 @@
          [% js_id = name %]
            <span id="js_[% js_id %]" class="p_js_elem"></span> <span id="html_[% js_id %]">[% FOREACH provider IN providers.pkgs.sort
        [% IF providers.pkgs.size > 10 %]
-       <script type="text/javascript">init_toggle_elem("[% js_id %]",[% g('%u providing packages', providers.pkgs.size) %]</script>
+       <script type="text/javascript">init_toggle_elem("[% js_id %]","[% g('%u providing packages', providers.pkgs.size) %]")</script
        [% END %]
         [% END %]
         </dd>

Greetings,


Fred


Reply to: