Debian Codegraph @

rhino/testsrc/tests/importList.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var include = document.location.href.indexOf('?include') != -1;
7 document.write( '<title>Import ' + (include ? 'Include' : 'Exclude') + ' Test List<\/title>')
8
9 function doImport()
10 {
11 var lines =
12 document.forms["foo"].elements["testList"].value.split(/\r?\n/);
13 var suites = window.opener.suites;
14 var elems = window.opener.document.forms["testCases"].elements;
15
16 if (include && document.forms["foo"].elements["clear_all"].checked)
17 window.opener._selectNone();
18
19 for (var l in lines)
20 {
21 if (!lines[l])
22 {
23 continue;
24 }
25
26 if (lines[l].search(/^\s$|\s*\#/) == -1)
27 {
28 var ary = lines[l].match (/(.*)\/(.*)\/(.*)/);
29
30 if (!ary)
31 {
32 if (!confirm ("Line " + l + " '" +
33 lines[l] + "' is confusing, " +
34 "continue with import?"))
35 {
36 return;
37 }
38 }
39
40 if (suites[ary[1]] &&
41 suites[ary[1]].testDirs[ary[2]] &&
42 suites[ary[1]].testDirs[ary[2]].tests[ary[3]])
43 {
44 var radioname = suites[ary[1]].testDirs[ary[2]].tests[ary[3]].id;
45 var radio = elems[radioname];
46 if (include && !radio.checked)
47 {
48 radio.checked = true;
49 window.opener.onRadioClick(radio);
50 }
51 else if (!include && radio.checked)
52 {
53 radio.checked = false;
54 window.opener.onRadioClick(radio);
55 }
56 }
57 }
58 }
59
60 setTimeout('window.close();', 200);
61
62 }