- qpscanner/resources/scripts/scan-results.js
- develop
- 1 KB
- 63
1$j().ready( init );
2
3
4function init()
5{
6 // INFO: Setup interface events
7 $j('dt.file').click( toggleFileInfo );
8 $j('dt.query').click( toggleQueryCode );
9
10 $j('dt.file .id,dt.query .id').click( function(){return false;} );
11
12 highlightClientScopeFiles();
13
14 renderDisplayOptions();
15}
16
17
18
19function toggleFileInfo()
20{
21 $j(this).find('+dd.file_info').toggle();
22}
23
24
25function toggleAllFileInfo()
26{
27 // Ideally, we should fire each toggleFileInfo call:
28 // $j('dt.file').click();
29 // But it's simpler just to toggle all queries...
30
31 $j('dd.file_info').toggle();
32}
33
34
35function toggleQueryCode()
36{
37 $j(this).find('+dd.query_code').toggle();
38}
39
40function toggleAllQueryCode()
41{
42 $j('dd.query_code').toggle();
43}
44
45
46
47function highlightClientScopeFiles()
48{
49 $j('dt.file:has(+dd * .ContainsClientScope)').addClass('ContainsClientScope');
50}
51
52
53
54function renderDisplayOptions()
55{
56 $j('#DisplayOptions')
57 .html('')
58 .append('<input type="checkbox" checked id="toggle_files" /><label class="indiv" for="toggle_files">toggle file contents</label>')
59 .append('<input type="checkbox" checked id="toggle_queries" /><label class="indiv" for="toggle_queries">toggle query contents</label>')
60 ;
61
62 $j('#DisplayOptions #toggle_files').click( toggleAllFileInfo );
63 $j('#DisplayOptions #toggle_queries').click( toggleAllQueryCode );
64}