js-products.html.tmpl 779 Bytes
Newer Older
1 2 3
[%# This Source Code Form is subject to the terms of the Mozilla Public
  # License, v. 2.0. If a copy of the MPL was not distributed with this
  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
  #
5 6
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
7 8 9 10
  #%]

[%# The javascript block gets used in header.html.tmpl. %]
[% javascript = BLOCK %]
11 12
  var first_load = true; // Is this the first time we load the page?
  var last_sel = []; // Caches last selection
13
  var cpts = new Array();
14

15
  [% n = 1 %]
16
  [% FOREACH prod = products %]
17
    cpts['[% n %]'] = [[% FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%]];
18
    [% n = n+1 %]
19 20
  [% END %]
[% END %]