Sorcerer's IsleCode QueryParam Scanner / files

 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	highlightClientScopeFiles();
11
12	renderDisplayOptions();
13}
14
15
16
17function toggleFileInfo()
18{
19	$j(this).find('+dd.file_info').toggle();
20}
21
22
23function toggleAllFileInfo()
24{
25	// Ideally, we should fire each toggleFileInfo call:
26	// $j('dt.file').click();
27	// But it's simpler just to toggle all queries...
28
29	$j('dd.file_info').toggle();
30}
31
32
33function toggleQueryCode()
34{
35	$j(this).find('+dd.query_code').toggle();
36}
37
38function toggleAllQueryCode()
39{
40	$j('dd.query_code').toggle();
41}
42
43
44
45function highlightClientScopeFiles()
46{
47	$j('dt.file:has(+dd * .ContainsClientScope)').addClass('ContainsClientScope');
48}
49
50
51
52function renderDisplayOptions()
53{
54	$j('#DisplayOptions')
55		.html('')
56		.append('<button type="button">toggle all files</button>')
57		.append('<button type="button">toggle all queries</button>')
58		;
59
60	$j('#DisplayOptions button:contains(toggle all files)').click( toggleAllFileInfo );
61	$j('#DisplayOptions button:contains(toggle all queries)').click( toggleAllQueryCode );
62}