summaryrefslogtreecommitdiffstats
path: root/template/en/default/global/js-products.html.tmpl
blob: e40a3e3aef4bfb15d321e30b129655a7aa31d5bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[%# 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/.
  #
  # This Source Code Form is "Incompatible With Secondary Licenses", as
  # defined by the Mozilla Public License, v. 2.0.
  #%]

[%# The javascript block gets used in header.html.tmpl. %]
[% javascript = BLOCK %]
  var useclassification = false; // No classification level in use
  var first_load = true; // Is this the first time we load the page?
  var last_sel = []; // Caches last selection
  var cpts = new Array();
  [% n = 1 %]
  [% FOREACH prod = products %]
    cpts['[% n %]'] = [
      [%- FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
    [% n = n+1 %]
  [% END %]
[% END %]