caruby-tissue 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. data/History.txt +4 -0
  2. data/LEGAL +5 -0
  3. data/LICENSE +22 -0
  4. data/README.md +44 -0
  5. data/bin/crtdump +31 -0
  6. data/bin/crtexample +18 -0
  7. data/bin/crtextract +47 -0
  8. data/bin/crtmigrate +17 -0
  9. data/bin/crtsmoke +27 -0
  10. data/examples/galena/README.md +53 -0
  11. data/examples/galena/bin/migrate.rb +42 -0
  12. data/examples/galena/bin/seed.rb +43 -0
  13. data/examples/galena/conf/extract/simple_fields.yaml +4 -0
  14. data/examples/galena/conf/migration/filter_fields.yaml +7 -0
  15. data/examples/galena/conf/migration/filter_migration.yaml +9 -0
  16. data/examples/galena/conf/migration/frozen_fields.yaml +11 -0
  17. data/examples/galena/conf/migration/frozen_migration.yaml +9 -0
  18. data/examples/galena/conf/migration/general_fields.yaml +42 -0
  19. data/examples/galena/conf/migration/general_migration.yaml +9 -0
  20. data/examples/galena/conf/migration/simple_fields.yaml +30 -0
  21. data/examples/galena/conf/migration/simple_migration.yaml +7 -0
  22. data/examples/galena/conf/migration/small_fields.yaml +24 -0
  23. data/examples/galena/conf/migration/small_migration.yaml +9 -0
  24. data/examples/galena/data/filter.csv +1 -0
  25. data/examples/galena/data/frozen.csv +1 -0
  26. data/examples/galena/data/general.csv +1 -0
  27. data/examples/galena/data/minimal.csv +1 -0
  28. data/examples/galena/data/simple.csv +1 -0
  29. data/examples/galena/data/small.csv +1 -0
  30. data/examples/galena/doc/CaTissue.html +93 -0
  31. data/examples/galena/doc/CaTissue/CollectionProtocolRegistration.html +181 -0
  32. data/examples/galena/doc/CaTissue/Participant.html +241 -0
  33. data/examples/galena/doc/CaTissue/SpecimenCollectionGroup.html +190 -0
  34. data/examples/galena/doc/CaTissue/StorageContainer.html +179 -0
  35. data/examples/galena/doc/CaTissue/TissueSpecimen.html +320 -0
  36. data/examples/galena/doc/Galena.html +290 -0
  37. data/examples/galena/doc/Galena/Seed.html +203 -0
  38. data/examples/galena/doc/Galena/Seed/Defaults.html +646 -0
  39. data/examples/galena/doc/_index.html +188 -0
  40. data/examples/galena/doc/class_list.html +36 -0
  41. data/examples/galena/doc/css/common.css +1 -0
  42. data/examples/galena/doc/css/full_list.css +53 -0
  43. data/examples/galena/doc/css/style.css +307 -0
  44. data/examples/galena/doc/file.README.html +108 -0
  45. data/examples/galena/doc/file_list.html +38 -0
  46. data/examples/galena/doc/frames.html +13 -0
  47. data/examples/galena/doc/index.html +108 -0
  48. data/examples/galena/doc/js/app.js +202 -0
  49. data/examples/galena/doc/js/full_list.js +149 -0
  50. data/examples/galena/doc/js/jquery.js +154 -0
  51. data/examples/galena/doc/method_list.html +179 -0
  52. data/examples/galena/doc/top-level-namespace.html +112 -0
  53. data/examples/galena/lib/README.html +33 -0
  54. data/examples/galena/lib/galena.rb +8 -0
  55. data/examples/galena/lib/galena/cli/seed.rb +43 -0
  56. data/examples/galena/lib/galena/migration/filter_shims.rb +43 -0
  57. data/examples/galena/lib/galena/migration/frozen_shims.rb +54 -0
  58. data/examples/galena/lib/galena/seed/defaults.rb +97 -0
  59. data/lib/catissue.rb +26 -0
  60. data/lib/catissue/cli/command.rb +51 -0
  61. data/lib/catissue/cli/example.rb +31 -0
  62. data/lib/catissue/cli/migrate.rb +60 -0
  63. data/lib/catissue/cli/smoke.rb +45 -0
  64. data/lib/catissue/database.rb +451 -0
  65. data/lib/catissue/database/annotation/annotatable_service.rb +25 -0
  66. data/lib/catissue/database/annotation/annotation_service.rb +79 -0
  67. data/lib/catissue/database/annotation/annotator.rb +84 -0
  68. data/lib/catissue/database/annotation/entity_manager.rb +10 -0
  69. data/lib/catissue/database/annotation/integration_service.rb +87 -0
  70. data/lib/catissue/database/controlled_value_finder.rb +43 -0
  71. data/lib/catissue/database/controlled_values.rb +162 -0
  72. data/lib/catissue/domain/abstract_domain_object.rb +8 -0
  73. data/lib/catissue/domain/abstract_position.rb +22 -0
  74. data/lib/catissue/domain/abstract_specimen.rb +288 -0
  75. data/lib/catissue/domain/abstract_specimen_collection_group.rb +25 -0
  76. data/lib/catissue/domain/address.rb +13 -0
  77. data/lib/catissue/domain/cancer_research_group.rb +11 -0
  78. data/lib/catissue/domain/capacity.rb +34 -0
  79. data/lib/catissue/domain/check_in_check_out_event_parameter.rb +19 -0
  80. data/lib/catissue/domain/collection_event_parameters.rb +13 -0
  81. data/lib/catissue/domain/collection_protocol.rb +177 -0
  82. data/lib/catissue/domain/collection_protocol_event.rb +108 -0
  83. data/lib/catissue/domain/collection_protocol_registration.rb +108 -0
  84. data/lib/catissue/domain/consent_tier_response.rb +13 -0
  85. data/lib/catissue/domain/consent_tier_status.rb +29 -0
  86. data/lib/catissue/domain/container.rb +234 -0
  87. data/lib/catissue/domain/container_position.rb +21 -0
  88. data/lib/catissue/domain/container_type.rb +131 -0
  89. data/lib/catissue/domain/department.rb +13 -0
  90. data/lib/catissue/domain/disposal_event_parameters.rb +13 -0
  91. data/lib/catissue/domain/embedded_event_parameters.rb +10 -0
  92. data/lib/catissue/domain/external_identifier.rb +22 -0
  93. data/lib/catissue/domain/frozen_event_parameters.rb +10 -0
  94. data/lib/catissue/domain/institution.rb +13 -0
  95. data/lib/catissue/domain/new_specimen_array_order_item.rb +35 -0
  96. data/lib/catissue/domain/order_details.rb +25 -0
  97. data/lib/catissue/domain/participant.rb +138 -0
  98. data/lib/catissue/domain/participant_medical_identifier.rb +38 -0
  99. data/lib/catissue/domain/password.rb +11 -0
  100. data/lib/catissue/domain/race.rb +11 -0
  101. data/lib/catissue/domain/received_event_parameters.rb +25 -0
  102. data/lib/catissue/domain/scg_event_parameters.rb +11 -0
  103. data/lib/catissue/domain/site.rb +30 -0
  104. data/lib/catissue/domain/specimen.rb +456 -0
  105. data/lib/catissue/domain/specimen_array.rb +47 -0
  106. data/lib/catissue/domain/specimen_array_content.rb +19 -0
  107. data/lib/catissue/domain/specimen_array_type.rb +20 -0
  108. data/lib/catissue/domain/specimen_characteristics.rb +20 -0
  109. data/lib/catissue/domain/specimen_collection_group.rb +412 -0
  110. data/lib/catissue/domain/specimen_event_parameters.rb +111 -0
  111. data/lib/catissue/domain/specimen_position.rb +38 -0
  112. data/lib/catissue/domain/specimen_protocol.rb +34 -0
  113. data/lib/catissue/domain/specimen_requirement.rb +143 -0
  114. data/lib/catissue/domain/storage_container.rb +204 -0
  115. data/lib/catissue/domain/storage_type.rb +82 -0
  116. data/lib/catissue/domain/transfer_event_parameters.rb +53 -0
  117. data/lib/catissue/domain/user.rb +100 -0
  118. data/lib/catissue/extract/command.rb +31 -0
  119. data/lib/catissue/extract/delta.rb +62 -0
  120. data/lib/catissue/extract/extractor.rb +99 -0
  121. data/lib/catissue/migration/migrator.rb +101 -0
  122. data/lib/catissue/migration/shims.rb +108 -0
  123. data/lib/catissue/migration/uniquify.rb +111 -0
  124. data/lib/catissue/resource.rb +84 -0
  125. data/lib/catissue/util/controlled_value.rb +29 -0
  126. data/lib/catissue/util/location.rb +116 -0
  127. data/lib/catissue/util/log.rb +30 -0
  128. data/lib/catissue/util/person.rb +31 -0
  129. data/lib/catissue/util/position.rb +54 -0
  130. data/lib/catissue/util/storable.rb +34 -0
  131. data/lib/catissue/util/storage_type_holder.rb +30 -0
  132. data/lib/catissue/version.rb +7 -0
  133. metadata +212 -0
@@ -0,0 +1,108 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Documentation by YARD 0.6.1</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html" title="Index">Index</a> &raquo;
27
+ <span class="title">File: README</span>
28
+
29
+
30
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
+ </div>
32
+
33
+ <div id="search">
34
+ <a id="class_list_link" href="#">Class List</a>
35
+ <a id="method_list_link" href="#">Method List</a>
36
+ <a id ="file_list_link" href="#">File List</a>
37
+ </div>
38
+
39
+ <div class="clear"></div>
40
+ </div>
41
+
42
+ <iframe id="search_frame"></iframe>
43
+
44
+ <div id="content"><div id='filecontents'><h1>Galena caRuby Tissue example</h1>
45
+
46
+ <h2>Synopsis</h2>
47
+
48
+ <p>This directory contains the caRuby Tissue example for the hypothetical Galena Cancer Center.
49
+ The example files are a useful template for building your own migrator.</p>
50
+
51
+ <p>The Galena example demonstrates how to load the content of a custom tissue bank into caTissue.
52
+ The use cases illustrate several common migration impediments:</p>
53
+
54
+ <ul>
55
+ <li>Different terminology than caTissue</li>
56
+ <li>Different associations than caTissue</li>
57
+ <li>Incomplete input for caTissue</li>
58
+ <li>Denormalized input</li>
59
+ <li>Inconsistent input</li>
60
+ <li>Input data scrubbing</li>
61
+ <li>Aliquot inference</li>
62
+ <li>Pre-defined caTissue protocol</li>
63
+ </ul>
64
+
65
+
66
+ <h2>Setup</h2>
67
+
68
+ <ol>
69
+ <li><p>Run the <code>crtexample --list</code> command to display the Galena example location.</p></li>
70
+ <li><p>Copy the example into a location of your choosing.</p></li>
71
+ <li><p>Configure a caTissue client to connect to a test caTissue instance, as described in the
72
+ caTissue Technical Guide.</p></li>
73
+ <li><p>Define the caRuby Tissue access property file as described in
74
+ <a href="FAQ">http://caruby.tenderapp.com/faqs/getting-started/tissue_config</a>.</p></li>
75
+ </ol>
76
+
77
+
78
+ <h2>Migration</h2>
79
+
80
+ <p>The example migration input data resides in the <code>data</code> directory.
81
+ Each CSV input file holds one row for each specimen.</p>
82
+
83
+ <p>Each example has a field mapping configuration in the <code>conf/migration</code> directory.
84
+ For example, the <code>simple.csv</code> input file is migrated into caTissue using the
85
+ <code>simple_migration.yaml</code> configuration file.</p>
86
+
87
+ <p>Migrate the Galena <code>simple</code> example as follows:</p>
88
+
89
+ <ol>
90
+ <li><p>Open a console in the copied Galena example location.</p></li>
91
+ <li><p>Run the following:</p>
92
+
93
+ <p> crtmigrate --file conf/migration/simple.yaml data/simple.yaml</p></li>
94
+ <li><p>Check the test database and verify that a there is a collection protocol
95
+ named `Galena CP.</p></li>
96
+ </ol>
97
+
98
+
99
+ <p>The other examples are run in a similar manner.</p></div></div>
100
+
101
+ <div id="footer">
102
+ Generated on Tue Nov 23 11:38:42 2010 by
103
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
104
+ 0.6.1 (ruby-1.8.6).
105
+ </div>
106
+
107
+ </body>
108
+ </html>
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
7
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
8
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
9
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
10
+ <base id="base_target" target="_parent" />
11
+ </head>
12
+ <body>
13
+ <script type="text/javascript" charset="utf-8">
14
+ if (window.top.frames.main) {
15
+ document.getElementById('base_target').target = 'main';
16
+ document.body.className = 'frames';
17
+ }
18
+ </script>
19
+ <div id="content">
20
+ <h1 id="full_list_header">File List</h1>
21
+ <div id="nav">
22
+ <a target="_self" href="class_list.html">Classes</a> |
23
+ <a target="_self" href="method_list.html">Methods</a> |
24
+ <a target="_self" href="file_list.html">Files</a>
25
+ </div>
26
+ <div id="search">Search: <input type="text" /></div>
27
+
28
+ <ul id="full_list" class="files">
29
+
30
+
31
+ <li class="r1"><a href="index.html" title="README">README</a></li>
32
+
33
+
34
+ </ul>
35
+ </div>
36
+ </body>
37
+ </html>
38
+
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7
+ <title>Documentation by YARD 0.6.1</title>
8
+ </head>
9
+ <frameset cols="20%,*">
10
+ <frame name="list" src="class_list.html" />
11
+ <frame name="main" src="index.html" />
12
+ </frameset>
13
+ </html>
@@ -0,0 +1,108 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Documentation by YARD 0.6.1</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html" title="Index">Index</a> &raquo;
27
+ <span class="title">File: README</span>
28
+
29
+
30
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
31
+ </div>
32
+
33
+ <div id="search">
34
+ <a id="class_list_link" href="#">Class List</a>
35
+ <a id="method_list_link" href="#">Method List</a>
36
+ <a id ="file_list_link" href="#">File List</a>
37
+ </div>
38
+
39
+ <div class="clear"></div>
40
+ </div>
41
+
42
+ <iframe id="search_frame"></iframe>
43
+
44
+ <div id="content"><div id='filecontents'><h1>Galena caRuby Tissue example</h1>
45
+
46
+ <h2>Synopsis</h2>
47
+
48
+ <p>This directory contains the caRuby Tissue example for the hypothetical Galena Cancer Center.
49
+ The example files are a useful template for building your own migrator.</p>
50
+
51
+ <p>The Galena example demonstrates how to load the content of a custom tissue bank into caTissue.
52
+ The use cases illustrate several common migration impediments:</p>
53
+
54
+ <ul>
55
+ <li>Different terminology than caTissue</li>
56
+ <li>Different associations than caTissue</li>
57
+ <li>Incomplete input for caTissue</li>
58
+ <li>Denormalized input</li>
59
+ <li>Inconsistent input</li>
60
+ <li>Input data scrubbing</li>
61
+ <li>Aliquot inference</li>
62
+ <li>Pre-defined caTissue protocol</li>
63
+ </ul>
64
+
65
+
66
+ <h2>Setup</h2>
67
+
68
+ <ol>
69
+ <li><p>Run the <code>crtexample --list</code> command to display the Galena example location.</p></li>
70
+ <li><p>Copy the example into a location of your choosing.</p></li>
71
+ <li><p>Configure a caTissue client to connect to a test caTissue instance, as described in the
72
+ caTissue Technical Guide.</p></li>
73
+ <li><p>Define the caRuby Tissue access property file as described in
74
+ <a href="FAQ">http://caruby.tenderapp.com/faqs/getting-started/tissue_config</a>.</p></li>
75
+ </ol>
76
+
77
+
78
+ <h2>Migration</h2>
79
+
80
+ <p>The example migration input data resides in the <code>data</code> directory.
81
+ Each CSV input file holds one row for each specimen.</p>
82
+
83
+ <p>Each example has a field mapping configuration in the <code>conf/migration</code> directory.
84
+ For example, the <code>simple.csv</code> input file is migrated into caTissue using the
85
+ <code>simple_migration.yaml</code> configuration file.</p>
86
+
87
+ <p>Migrate the Galena <code>simple</code> example as follows:</p>
88
+
89
+ <ol>
90
+ <li><p>Open a console in the copied Galena example location.</p></li>
91
+ <li><p>Run the following:</p>
92
+
93
+ <p> crtmigrate --file conf/migration/simple.yaml data/simple.yaml</p></li>
94
+ <li><p>Check the test database and verify that a there is a collection protocol
95
+ named `Galena CP.</p></li>
96
+ </ol>
97
+
98
+
99
+ <p>The other examples are run in a similar manner.</p></div></div>
100
+
101
+ <div id="footer">
102
+ Generated on Tue Nov 23 11:38:42 2010 by
103
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
104
+ 0.6.1 (ruby-1.8.6).
105
+ </div>
106
+
107
+ </body>
108
+ </html>
@@ -0,0 +1,202 @@
1
+ function createSourceLinks() {
2
+ $('.method_details_list .source_code').
3
+ before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
4
+ $('.toggleSource').toggle(function() {
5
+ $(this).parent().next().slideDown(100);
6
+ $(this).text("Hide source");
7
+ },
8
+ function() {
9
+ $(this).parent().next().slideUp(100);
10
+ $(this).text("View source");
11
+ });
12
+ }
13
+
14
+ function createDefineLinks() {
15
+ var tHeight = 0;
16
+ $('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
17
+ $('.toggleDefines').toggle(function() {
18
+ tHeight = $(this).parent().prev().height();
19
+ $(this).prev().show();
20
+ $(this).parent().prev().height($(this).parent().height());
21
+ $(this).text("(less)");
22
+ },
23
+ function() {
24
+ $(this).prev().hide();
25
+ $(this).parent().prev().height(tHeight);
26
+ $(this).text("more...")
27
+ });
28
+ }
29
+
30
+ function createFullTreeLinks() {
31
+ var tHeight = 0;
32
+ $('.inheritanceTree').toggle(function() {
33
+ tHeight = $(this).parent().prev().height();
34
+ $(this).parent().toggleClass('showAll');
35
+ $(this).text("(hide)");
36
+ $(this).parent().prev().height($(this).parent().height());
37
+ },
38
+ function() {
39
+ $(this).parent().toggleClass('showAll');
40
+ $(this).parent().prev().height(tHeight);
41
+ $(this).text("show all")
42
+ });
43
+ }
44
+
45
+ function fixBoxInfoHeights() {
46
+ $('dl.box dd.r1, dl.box dd.r2').each(function() {
47
+ $(this).prev().height($(this).height());
48
+ });
49
+ }
50
+
51
+ function searchFrameLinks() {
52
+ $('#method_list_link').click(function() {
53
+ toggleSearchFrame(this, relpath + 'method_list.html');
54
+ });
55
+
56
+ $('#class_list_link').click(function() {
57
+ toggleSearchFrame(this, relpath + 'class_list.html');
58
+ });
59
+
60
+ $('#file_list_link').click(function() {
61
+ toggleSearchFrame(this, relpath + 'file_list.html');
62
+ });
63
+ }
64
+
65
+ function toggleSearchFrame(id, link) {
66
+ var frame = $('#search_frame');
67
+ $('#search a').removeClass('active').addClass('inactive');
68
+ if (frame.attr('src') == link && frame.css('display') != "none") {
69
+ frame.slideUp(100);
70
+ $('#search a').removeClass('active inactive');
71
+ }
72
+ else {
73
+ $(id).addClass('active').removeClass('inactive');
74
+ frame.attr('src', link).slideDown(100);
75
+ }
76
+ }
77
+
78
+ function linkSummaries() {
79
+ $('.summary_signature').click(function() {
80
+ document.location = $(this).find('a').attr('href');
81
+ });
82
+ }
83
+
84
+ function framesInit() {
85
+ if (window.top.frames.main) {
86
+ document.body.className = 'frames';
87
+ $('#menu .noframes a').attr('href', document.location);
88
+ $('html head title', window.parent.document).text($('html head title').text());
89
+ }
90
+ }
91
+
92
+ function keyboardShortcuts() {
93
+ if (window.top.frames.main) return;
94
+ $(document).keypress(function(evt) {
95
+ if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
96
+ if (evt.originalTarget.nodeName == "INPUT" ||
97
+ evt.originalTarget.nodeName == "TEXTAREA") return;
98
+ switch (evt.charCode) {
99
+ case 67: case 99: $('#class_list_link').click(); break; // 'c'
100
+ case 77: case 109: $('#method_list_link').click(); break; // 'm'
101
+ case 70: case 102: $('#file_list_link').click(); break; // 'f'
102
+ }
103
+ });
104
+ }
105
+
106
+ function summaryToggle() {
107
+ $('.summary_toggle').click(function() {
108
+ localStorage.summaryCollapsed = $(this).text();
109
+ $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
110
+ var next = $(this).parent().parent().next();
111
+ if (next.hasClass('compact')) {
112
+ next.toggle();
113
+ next.next().toggle();
114
+ }
115
+ else if (next.hasClass('summary')) {
116
+ var list = $('<ul class="summary compact" />');
117
+ list.html(next.html());
118
+ list.find('.summary_desc, .note').remove();
119
+ list.find('a').each(function() {
120
+ $(this).html($(this).find('strong').html());
121
+ $(this).parent().html($(this)[0].outerHTML);
122
+ });
123
+ next.before(list);
124
+ next.toggle();
125
+ }
126
+ return false;
127
+ });
128
+ if (localStorage) {
129
+ if (localStorage.summaryCollapsed == "collapse") $('.summary_toggle').click();
130
+ else localStorage.summaryCollapsed = "expand";
131
+ }
132
+ }
133
+
134
+ function fixOutsideWorldLinks() {
135
+ $('a').each(function() {
136
+ if (window.location.host != this.host) this.target = '_parent';
137
+ });
138
+ }
139
+
140
+ function generateTOC() {
141
+ if ($('#filecontents').length == 0) return;
142
+ var _toc = $('<ol class="top"></ol>');
143
+ var show = false;
144
+ var toc = _toc;
145
+ var counter = 0;
146
+ var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
147
+ if ($('#filecontents h1').length > 1) tags.unshift('h1');
148
+ for (i in tags) { tags[i] = '#filecontents ' + tags[i] }
149
+ var lastTag = parseInt(tags[0][1]);
150
+ $(tags.join(', ')).each(function() {
151
+ if (this.id == "filecontents") return;
152
+ show = true;
153
+ var thisTag = parseInt(this.tagName[1]);
154
+ if (this.id.length == 0) {
155
+ var proposedId = $(this).text().replace(/[^a-z0-9:'"\.()=-]/ig, '_');
156
+ if ($('#' + proposedId).length > 0) proposedId += counter++;
157
+ this.id = proposedId;
158
+ }
159
+ if (thisTag > lastTag) {
160
+ for (var i = 0; i < thisTag - lastTag; i++) {
161
+ var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
162
+ }
163
+ }
164
+ if (thisTag < lastTag) {
165
+ for (var i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
166
+ }
167
+ toc.append('<li><a href="#' + this.id + '">' + $(this).text() + '</a></li>');
168
+ lastTag = thisTag;
169
+ });
170
+ if (!show) return;
171
+ html = '<div id="toc"><p class="title"><a class="hide_toc" href="#"><strong>Table of Contents</strong></a> <small>(<a href="#" class="float_toc">left</a>)</small></p></div>';
172
+ $('#content').prepend(html);
173
+ $('#toc').append(_toc);
174
+ $('#toc .hide_toc').toggle(function() {
175
+ $('#toc .top').slideUp('fast');
176
+ $('#toc').toggleClass('hidden');
177
+ $('#toc .title small').toggle();
178
+ }, function() {
179
+ $('#toc .top').slideDown('fast');
180
+ $('#toc').toggleClass('hidden');
181
+ $('#toc .title small').toggle();
182
+ });
183
+ $('#toc .float_toc').toggle(function() {
184
+ $(this).text('float');
185
+ $('#toc').toggleClass('nofloat');
186
+ }, function() {
187
+ $(this).text('left')
188
+ $('#toc').toggleClass('nofloat');
189
+ });
190
+ }
191
+
192
+ $(framesInit);
193
+ $(createSourceLinks);
194
+ $(createDefineLinks);
195
+ $(createFullTreeLinks);
196
+ $(fixBoxInfoHeights);
197
+ $(searchFrameLinks);
198
+ $(linkSummaries);
199
+ $(keyboardShortcuts);
200
+ $(summaryToggle);
201
+ $(fixOutsideWorldLinks);
202
+ $(generateTOC);