bixbite 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. data/LICENSE +20 -0
  2. data/README.markdown +49 -0
  3. data/VERSION +1 -0
  4. data/bin/bixbite +73 -0
  5. data/lib/bixbite.rb +13 -0
  6. data/lib/bixbite/command.rb +14 -0
  7. data/lib/bixbite/create.rb +76 -0
  8. data/template/Rakefile +25 -0
  9. data/template/assets/bixbite/Rakefile.rb +297 -0
  10. data/template/assets/naturaldocs/NaturalDocs/Config/Languages.txt +286 -0
  11. data/template/assets/naturaldocs/NaturalDocs/Config/Topics.txt +382 -0
  12. data/template/assets/naturaldocs/NaturalDocs/Help/customizinglanguages.html +52 -0
  13. data/template/assets/naturaldocs/NaturalDocs/Help/customizingtopics.html +74 -0
  14. data/template/assets/naturaldocs/NaturalDocs/Help/documenting.html +58 -0
  15. data/template/assets/naturaldocs/NaturalDocs/Help/documenting/reference.html +146 -0
  16. data/template/assets/naturaldocs/NaturalDocs/Help/documenting/walkthrough.html +180 -0
  17. data/template/assets/naturaldocs/NaturalDocs/Help/example/Default.css +528 -0
  18. data/template/assets/naturaldocs/NaturalDocs/Help/example/NaturalDocs.js +204 -0
  19. data/template/assets/naturaldocs/NaturalDocs/Help/examples.css +90 -0
  20. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/background.png +0 -0
  21. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/leftside.png +0 -0
  22. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/logo.png +0 -0
  23. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overbody.png +0 -0
  24. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overbodybg.png +0 -0
  25. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overleftmargin.png +0 -0
  26. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overmenu.png +0 -0
  27. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/overmenubg.png +0 -0
  28. data/template/assets/naturaldocs/NaturalDocs/Help/images/header/rightside.png +0 -0
  29. data/template/assets/naturaldocs/NaturalDocs/Help/images/logo.gif +0 -0
  30. data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/about.png +0 -0
  31. data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/background.png +0 -0
  32. data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/bottomleft.png +0 -0
  33. data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/bottomright.png +0 -0
  34. data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/community.png +0 -0
  35. data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/customizing.png +0 -0
  36. data/template/assets/naturaldocs/NaturalDocs/Help/images/menu/using.png +0 -0
  37. data/template/assets/naturaldocs/NaturalDocs/Help/index.html +9 -0
  38. data/template/assets/naturaldocs/NaturalDocs/Help/javascript/BrowserStyles.js +77 -0
  39. data/template/assets/naturaldocs/NaturalDocs/Help/javascript/PNGHandling.js +72 -0
  40. data/template/assets/naturaldocs/NaturalDocs/Help/keywords.html +38 -0
  41. data/template/assets/naturaldocs/NaturalDocs/Help/languages.html +32 -0
  42. data/template/assets/naturaldocs/NaturalDocs/Help/menu.html +79 -0
  43. data/template/assets/naturaldocs/NaturalDocs/Help/output.html +84 -0
  44. data/template/assets/naturaldocs/NaturalDocs/Help/running.html +40 -0
  45. data/template/assets/naturaldocs/NaturalDocs/Help/styles.css +290 -0
  46. data/template/assets/naturaldocs/NaturalDocs/Help/styles.html +52 -0
  47. data/template/assets/naturaldocs/NaturalDocs/Help/troubleshooting.html +18 -0
  48. data/template/assets/naturaldocs/NaturalDocs/Info/CSSGuide.txt +947 -0
  49. data/template/assets/naturaldocs/NaturalDocs/Info/File Parsing.txt +83 -0
  50. data/template/assets/naturaldocs/NaturalDocs/Info/HTMLTestCases.pm +269 -0
  51. data/template/assets/naturaldocs/NaturalDocs/Info/Languages.txt +107 -0
  52. data/template/assets/naturaldocs/NaturalDocs/Info/NDMarkup.txt +91 -0
  53. data/template/assets/naturaldocs/NaturalDocs/Info/Symbol Management.txt +59 -0
  54. data/template/assets/naturaldocs/NaturalDocs/Info/images/Logo.png +0 -0
  55. data/template/assets/naturaldocs/NaturalDocs/JavaScript/NaturalDocs.js +836 -0
  56. data/template/assets/naturaldocs/NaturalDocs/License-GPL.txt +341 -0
  57. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/BinaryFile.pm +294 -0
  58. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder.pm +280 -0
  59. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/Base.pm +348 -0
  60. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/FramedHTML.pm +345 -0
  61. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/HTML.pm +398 -0
  62. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Builder/HTMLBase.pm +3693 -0
  63. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy.pm +860 -0
  64. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy/Class.pm +412 -0
  65. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ClassHierarchy/File.pm +157 -0
  66. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ConfigFile.pm +497 -0
  67. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Constants.pm +165 -0
  68. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/DefineMembers.pm +100 -0
  69. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Error.pm +305 -0
  70. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/File.pm +540 -0
  71. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable.pm +383 -0
  72. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable/Reference.pm +44 -0
  73. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ImageReferenceTable/String.pm +110 -0
  74. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages.pm +1475 -0
  75. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/ActionScript.pm +1473 -0
  76. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Ada.pm +38 -0
  77. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced.pm +828 -0
  78. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced/Scope.pm +95 -0
  79. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Advanced/ScopeChange.pm +70 -0
  80. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Base.pm +832 -0
  81. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/CSharp.pm +1484 -0
  82. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/PLSQL.pm +319 -0
  83. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Pascal.pm +143 -0
  84. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Perl.pm +1370 -0
  85. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Prototype.pm +92 -0
  86. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Prototype/Parameter.pm +87 -0
  87. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Simple.pm +503 -0
  88. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Languages/Tcl.pm +219 -0
  89. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Menu.pm +3406 -0
  90. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Menu/Entry.pm +201 -0
  91. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/NDMarkup.pm +76 -0
  92. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser.pm +1331 -0
  93. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/JavaDoc.pm +464 -0
  94. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/Native.pm +1060 -0
  95. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Parser/ParsedTopic.pm +253 -0
  96. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project.pm +1402 -0
  97. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project/ImageFile.pm +160 -0
  98. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Project/SourceFile.pm +113 -0
  99. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/ReferenceString.pm +334 -0
  100. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Settings.pm +1418 -0
  101. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Settings/BuildTarget.pm +66 -0
  102. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB.pm +678 -0
  103. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/Extension.pm +84 -0
  104. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/File.pm +129 -0
  105. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/Item.pm +201 -0
  106. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/ItemDefinition.pm +45 -0
  107. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SourceDB/WatchedFileDefinitions.pm +159 -0
  108. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/StatusMessage.pm +102 -0
  109. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolString.pm +212 -0
  110. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable.pm +1984 -0
  111. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/File.pm +186 -0
  112. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/IndexElement.pm +522 -0
  113. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/Reference.pm +273 -0
  114. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/ReferenceTarget.pm +97 -0
  115. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/Symbol.pm +428 -0
  116. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/SymbolTable/SymbolDefinition.pm +96 -0
  117. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Topics.pm +1319 -0
  118. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Topics/Type.pm +151 -0
  119. data/template/assets/naturaldocs/NaturalDocs/Modules/NaturalDocs/Version.pm +384 -0
  120. data/template/assets/naturaldocs/NaturalDocs/NaturalDocs +400 -0
  121. data/template/assets/naturaldocs/NaturalDocs/NaturalDocs.bat +17 -0
  122. data/template/assets/naturaldocs/NaturalDocs/Styles/Default.css +767 -0
  123. data/template/assets/naturaldocs/NaturalDocs/Styles/Roman.css +765 -0
  124. data/template/assets/naturaldocs/NaturalDocs/Styles/Small.css +763 -0
  125. data/template/assets/utilities/pngout +0 -0
  126. data/template/deploy/public_html/.htaccess +0 -0
  127. data/template/documentation/js/.htaccess +0 -0
  128. data/template/src/html/.htaccess +76 -0
  129. data/template/src/html/css/cmn/global.css +96 -0
  130. data/template/src/html/css/cmn/ie.css +15 -0
  131. data/template/src/html/css/cmn/ie6.css +15 -0
  132. data/template/src/html/images/cmn/.htaccess +0 -0
  133. data/template/src/html/images/tmp/.htaccess +0 -0
  134. data/template/src/html/includes/debug.inc +5 -0
  135. data/template/src/html/includes/footer.inc +52 -0
  136. data/template/src/html/includes/header.inc +61 -0
  137. data/template/src/html/includes/html.inc +3 -0
  138. data/template/src/html/includes/namespace.inc +19 -0
  139. data/template/src/html/includes/page.inc +151 -0
  140. data/template/src/html/index.html +35 -0
  141. data/template/src/html/js/cmn/bootstrap.js +74 -0
  142. data/template/src/html/js/cmn/global.js +142 -0
  143. data/template/src/html/js/cmn/lib/LAB.js +348 -0
  144. data/template/src/html/min/.htaccess +4 -0
  145. data/template/src/html/min/MinifyCLI.php +19 -0
  146. data/template/src/html/min/README.txt +132 -0
  147. data/template/src/html/min/builder/_index.js +242 -0
  148. data/template/src/html/min/builder/bm.js +36 -0
  149. data/template/src/html/min/builder/index.php +182 -0
  150. data/template/src/html/min/builder/ocCheck.php +36 -0
  151. data/template/src/html/min/builder/rewriteTest.js +1 -0
  152. data/template/src/html/min/config.php +187 -0
  153. data/template/src/html/min/groupsConfig.php +34 -0
  154. data/template/src/html/min/index.php +66 -0
  155. data/template/src/html/min/lib/FirePHP.php +1370 -0
  156. data/template/src/html/min/lib/HTTP/ConditionalGet.php +348 -0
  157. data/template/src/html/min/lib/HTTP/Encoder.php +326 -0
  158. data/template/src/html/min/lib/JSMin.php +314 -0
  159. data/template/src/html/min/lib/JSMinPlus.php +1872 -0
  160. data/template/src/html/min/lib/Minify.php +532 -0
  161. data/template/src/html/min/lib/Minify/Build.php +103 -0
  162. data/template/src/html/min/lib/Minify/CSS.php +83 -0
  163. data/template/src/html/min/lib/Minify/CSS/Compressor.php +250 -0
  164. data/template/src/html/min/lib/Minify/CSS/UriRewriter.php +270 -0
  165. data/template/src/html/min/lib/Minify/Cache/APC.php +130 -0
  166. data/template/src/html/min/lib/Minify/Cache/File.php +125 -0
  167. data/template/src/html/min/lib/Minify/Cache/Memcache.php +137 -0
  168. data/template/src/html/min/lib/Minify/ClosureCompiler.php +85 -0
  169. data/template/src/html/min/lib/Minify/CommentPreserver.php +90 -0
  170. data/template/src/html/min/lib/Minify/Controller/Base.php +202 -0
  171. data/template/src/html/min/lib/Minify/Controller/Files.php +78 -0
  172. data/template/src/html/min/lib/Minify/Controller/Groups.php +94 -0
  173. data/template/src/html/min/lib/Minify/Controller/MinApp.php +132 -0
  174. data/template/src/html/min/lib/Minify/Controller/Page.php +82 -0
  175. data/template/src/html/min/lib/Minify/Controller/Version1.php +118 -0
  176. data/template/src/html/min/lib/Minify/HTML.php +245 -0
  177. data/template/src/html/min/lib/Minify/ImportProcessor.php +157 -0
  178. data/template/src/html/min/lib/Minify/Lines.php +131 -0
  179. data/template/src/html/min/lib/Minify/Logger.php +45 -0
  180. data/template/src/html/min/lib/Minify/Packer.php +37 -0
  181. data/template/src/html/min/lib/Minify/Source.php +187 -0
  182. data/template/src/html/min/lib/Minify/YUICompressor.php +139 -0
  183. data/template/src/html/min/lib/Solar/Dir.php +199 -0
  184. data/template/src/html/min/lib/closure-compiler.jar +0 -0
  185. data/template/src/html/min/lib/yuicompressor-2.4.2.jar +0 -0
  186. data/template/src/html/min/utils.php +90 -0
  187. data/template/src/templates/css/template.css +7 -0
  188. data/template/src/templates/js/template.js +72 -0
  189. data/template/src/templates/template.html +18 -0
  190. data/template/src/yaml/config.yml +46 -0
  191. data/template/src/yaml/deploy.yml +35 -0
  192. data/test/bixbite_test.rb +7 -0
  193. data/test/test_helper.rb +10 -0
  194. metadata +278 -0
@@ -0,0 +1,91 @@
1
+
2
+ Architecture: NDMarkup
3
+ _______________________________________________________________________________
4
+
5
+ A markup format used by the parser, both internally and in <NaturalDocs::Parser::ParsedTopic> objects. Text formatted in
6
+ NDMarkup will only have the tags documented below.
7
+
8
+
9
+ About: Top-Level Tags
10
+
11
+ All content will be surrounded by one of the top-level tags. These tags will not appear within each other.
12
+
13
+ <p></p> - Surrounds a paragraph. Paragraph breaks will replace double line breaks, and single line breaks will
14
+ be removed completely.
15
+
16
+ <code></code> - Surrounds code or text diagrams that should appear literally in the output.
17
+
18
+ <h></h> - Surrounds a heading.
19
+
20
+ <ul></ul> - Surrounds a bulleted (unordered) list.
21
+ <dl></dl> - Surrounds a description list, which is what you are reading.
22
+
23
+ <img mode="inline" target="" original=""> - An inline image. Target contains the image target, and original contains the
24
+ original text in case it doesn't resolve.
25
+
26
+
27
+ About: List Item Tags
28
+
29
+ These tags will only appear within their respective lists.
30
+
31
+ <li></li> - Surrounds a bulleted list item.
32
+ <de></de> - Surrounds a description list entry, which is the left side. It will always be followed by a description list
33
+ description.
34
+ <ds></ds> - Surrounds a description list symbol. This is the same as a description list entry, except that the content
35
+ is also a referenceable symbol. This occurs when inside a list topic. This tag will always
36
+ be followed by a description list description.
37
+ <dd></dd> - Surrounds a description list description, which is the right side. It will always be preceded by a description
38
+ list entry or symbol.
39
+
40
+ About: Text Tags
41
+
42
+ These tags will only appear in paragraphs, headings, or description list descriptions.
43
+
44
+ <b></b> - Bold
45
+ <i></i> - Italics
46
+ <u></u> - Underline
47
+
48
+ <link target="" name="" original=""> - Surrounds a potential link to a symbol; potential because the target is not guaranteed to
49
+ exist. This tag merely designates an attempted link. Target is what is attempting to be
50
+ linked to, name is the text that should appear for a successful link, and original is the
51
+ original text in case the link doesn't resolve.
52
+
53
+ <url target="" name=""> - An external link. There's no need for an original attribute because it will always be
54
+ turned into an actual link.
55
+ <email target="" name=""> - A link to an e-mail address.
56
+
57
+ <img mode="link" target="" original=""> - An image link. Target contains the image target, and original contains the original
58
+ text in case it doesn't resolve.
59
+
60
+
61
+ About: Amp Chars
62
+
63
+ These are the only amp chars supported, and will appear everywhere. Every other character will appear as is.
64
+
65
+ &amp; - The ampersand &.
66
+ &quot; - The double quote ".
67
+ &lt; - The less than sign <.
68
+ &gt; - The greater than sign >.
69
+
70
+ About: Tabs
71
+
72
+ NDMarkup will not contain tab characters, only spaces. Any tab characters appearing in the source files will be
73
+ expanded/replaced as necessary.
74
+
75
+
76
+ About: General Tag Properties
77
+
78
+ Since the tags are generated, they will always have the following properties, which will make pattern matching much
79
+ easier.
80
+
81
+ - Tags and amp chars will always be in all lowercase.
82
+ - Properties will appear exactly as documented here. They will be in all lowercase, in the documented order, and will have no
83
+ extraneous whitespace. Anything appearing in the properties will have amp chars.
84
+ - All code is valid, meaning tags will always be closed, <li>s will only appear within <ul>s, etc.
85
+
86
+ So, for example, you can match description list entries with /<de>(.+?)<\/de>/ and $1 will be the text. No surprises or
87
+ gotchas. No need for sophisticated parsing routines.
88
+
89
+ Remember that for symbol definitions, the text should appear as is, but internally (such as for the anchor) they need to
90
+ be passed through <NaturalDocs::SymbolTable->Defines()> so that the output file is just as tolerant as
91
+ <NaturalDocs::SymbolTable>.
@@ -0,0 +1,59 @@
1
+
2
+ Architecture: Symbol Management
3
+
4
+ ####################################################################################
5
+
6
+ This is the architecture and code path for symbol management. This is almost exclusively managed by <NaturalDocs::SymbolTable>, but it's complicated enough that I want a plain-English walk through of the code paths anyway.
7
+
8
+ An important thing to remember is that each section below is simplified initially and then expanded upon in later sections as more facets of the code are introduced. You will not get the whole story of what a function does by reading just one section.
9
+
10
+
11
+
12
+ Topic: Symbol Storage
13
+ _______________________________________________________________________________________________________
14
+
15
+ Symbols are indexed primarily by their <SymbolString>, which is the normalized, pre-parsed series of identifiers that make it up. A symbol can have any number of definitions, including none, but can only have one definition per file. If a symbol is defined more than once in a file, only the first definition is counted. Stored for each definition is the <TopicType>, summary, and prototype.
16
+
17
+ Each symbol that has a definition has one designated as the global definition. This is the one linked to by other files, unless that file happens to have its own definition which then takes precedence. Which definition is chosen is rather arbitrary at this point; probably the first one that got defined. Similarly, if the global definition is deleted, which one is chosen to replace it is completely arbitrary.
18
+
19
+ Each symbol also stores a list of references to it. Note that references can be interpreted as multiple symbols, and each of those symbols will store a link back to the reference. In other words, every reference a symbol stores is one that _can_ be interpreted as that symbol, but that is not necessarily the interpretation the reference actually uses. A reference could have a better interpretation it uses instead.
20
+
21
+ For example, suppose there are two functions, MyFunction() and MyClass.MyFunction(). The reference text "MyFunction()" appearing in MyClass can be interpreted as either MyClass.MyFunction(), or if that doesn't exist, the global MyFunction(). Both the symbols for MyFunction() and MyClass.MyFunction() will store that it's referenced by the link, even though the class scoped one serves as the actual definition.
22
+
23
+ This is also the reason a symbol can exist that has no definitions: it has references. We want symbols to be created in the table for each reference interpretation, even if it doesn't exist. These are called potential symbols. The reason is so we know whether a new symbol definition fulfills an existing reference, since it may be a better interpretation for the reference than what is currently used.
24
+
25
+
26
+
27
+ Topic: Reference Storage
28
+ _______________________________________________________________________________________________________
29
+
30
+ References are indexed primarily by their <ReferenceString>, which is actually an elaborate data structure packed into a string. It includes a <SymbolString> of the text that appears in the link and a bunch of other data that determines the rules by which the link can be resolved. For example, it includes the scope it appears in and any "using" statements in effect, which are alternate possible scopes. It includes the type of link it is (text links, the ones you explicitly put in comments, aren't the only kind) and resolving flags which encode the language-specific rules of non-text links. But the bottom line is the <ReferenceString> encodes everything that influences how it may be resolved, so if two links come up with the same rules, they're considered two definitions of the same reference. This is the understanding of the word "reference" that will used in this document.
31
+
32
+ Like symbols, each reference stores a list of definitions. However, it only stores the name as all the other relevant information is encoded in the <ReferenceString> itself. Unlike a symbol, which can be linked to the same no matter what kind of definitions it has, references that are in any way different might be interpreted differently and so need their own distinct entries in the symbol table.
33
+
34
+ References also store a list of interpretations. Every possible interpretation of the reference is stored and given a numeric score. The higher the score, the better it suits the reference. In the MyFunction() example from before, MyClass.MyFunction() would have a higher score than just MyFunction() because the local scope should win. Each interpretation has a unique score, there are no duplicates.
35
+
36
+ So the symbol and reference data structures are complimentary. Each symbol has a list of every reference that might be interpreted as it, and every reference has a list of each symbol that it could be interpreted as. Again, objects are created for potential symbols (those with references but no definitions) so that this structure always remains intact.
37
+
38
+ The interpretation with the highest score which actually exists is deemed the current interpretation of the reference. Unlike symbols where the next global definition is arbitrary, the succession of reference interpretations is very controlled and predictable.
39
+
40
+
41
+ Topic: Change Detection
42
+ _______________________________________________________________________________________________________
43
+
44
+ Change management is handled a couple of ways. First, there is a secondary file index in <NaturalDocs::SymbolTable> that stores which symbols and references are stored in each file. It doesn't have any information other than a list of <SymbolStrings> and <ReferenceStrings> since they can be used in the main structures to look up the details. If a file is deleted, the symbol table can then prune any definitions that should no longer be in the table.
45
+
46
+ Another way deals with how the information parsing stage works. Files parsed for information just have their symbols and references added to the table regardless of whether this was the first time it was ever parsed or if it had been parsed before. If it had been parsed before, all the information from the previous parse should be in the symbol table and file indexes already. If a new symbol or reference is defined, that's fine, it's added to the table normally. However, if a symbol is redefined it's ignored because only the first definition matters. Also, this won't detect things that disappear.
47
+
48
+ Enter watched files. <NaturalDocs::Parser> tells <NaturalDocs::SymbolTable> to designate a file as watched before it starts parsing it, and then says to analyze the changes when it's done. The watched file is a second index of all the symbols and references that were defined since the watch started, including the specific details on the symbol definitions. When the analysis is done, it compares the list of symbols and references to the one in the main file index. Any that appear in the main file index but not the watched one are deleted because they didn't show up the second time around. Any symbol definitions that are different in the watched file than the main file are changed to the former, since the first definition that appeared the second time around was different than the original.
49
+
50
+
51
+ Topic: Change Management
52
+ _______________________________________________________________________________________________________
53
+
54
+ When a symbol's global definition changes, either because it switches to another file or because the details of the current file's definition changed (prototype, summary, etc.) it goes through all the references that can be interpreted as that symbol, finds the ones that use it as their current definition, and marks all the files that define them for rebuilding. The links in their output files have to be changed to the new definition or at least have their tooltips updated.
55
+
56
+ When a symbol's last definition is deleted, it goes through all the references that can be interpreted as that symbol, finds the ones that use it as their current definition, and has them reinterpreted to the definition with the next highest score. The files that define them are also marked for rebuilding.
57
+
58
+ When a potential symbol's first definition is found, it goes through all the references that can be interpreted as it and sees if it can serve as a higher scored interpretation than the current one. If so, the interpretations are changed and all the files that define them are marked for rebuilding.
59
+
@@ -0,0 +1,836 @@
1
+ // This file is part of Natural Docs, which is Copyright (C) 2003-2008 Greg Valure
2
+ // Natural Docs is licensed under the GPL
3
+
4
+
5
+ //
6
+ // Browser Styles
7
+ // ____________________________________________________________________________
8
+
9
+ var agt=navigator.userAgent.toLowerCase();
10
+ var browserType;
11
+ var browserVer;
12
+
13
+ if (agt.indexOf("opera") != -1)
14
+ {
15
+ browserType = "Opera";
16
+
17
+ if (agt.indexOf("opera 7") != -1 || agt.indexOf("opera/7") != -1)
18
+ { browserVer = "Opera7"; }
19
+ else if (agt.indexOf("opera 8") != -1 || agt.indexOf("opera/8") != -1)
20
+ { browserVer = "Opera8"; }
21
+ else if (agt.indexOf("opera 9") != -1 || agt.indexOf("opera/9") != -1)
22
+ { browserVer = "Opera9"; }
23
+ }
24
+
25
+ else if (agt.indexOf("applewebkit") != -1)
26
+ {
27
+ browserType = "Safari";
28
+
29
+ if (agt.indexOf("version/3") != -1)
30
+ { browserVer = "Safari3"; }
31
+ else if (agt.indexOf("safari/4") != -1)
32
+ { browserVer = "Safari2"; }
33
+ }
34
+
35
+ else if (agt.indexOf("khtml") != -1)
36
+ {
37
+ browserType = "Konqueror";
38
+ }
39
+
40
+ else if (agt.indexOf("msie") != -1)
41
+ {
42
+ browserType = "IE";
43
+
44
+ if (agt.indexOf("msie 6") != -1)
45
+ { browserVer = "IE6"; }
46
+ else if (agt.indexOf("msie 7") != -1)
47
+ { browserVer = "IE7"; }
48
+ }
49
+
50
+ else if (agt.indexOf("gecko") != -1)
51
+ {
52
+ browserType = "Firefox";
53
+
54
+ if (agt.indexOf("rv:1.7") != -1)
55
+ { browserVer = "Firefox1"; }
56
+ else if (agt.indexOf("rv:1.8)") != -1 || agt.indexOf("rv:1.8.0") != -1)
57
+ { browserVer = "Firefox15"; }
58
+ else if (agt.indexOf("rv:1.8.1") != -1)
59
+ { browserVer = "Firefox2"; }
60
+ }
61
+
62
+
63
+ //
64
+ // Support Functions
65
+ // ____________________________________________________________________________
66
+
67
+
68
+ function GetXPosition(item)
69
+ {
70
+ var position = 0;
71
+
72
+ if (item.offsetWidth != null)
73
+ {
74
+ while (item != document.body && item != null)
75
+ {
76
+ position += item.offsetLeft;
77
+ item = item.offsetParent;
78
+ };
79
+ };
80
+
81
+ return position;
82
+ };
83
+
84
+
85
+ function GetYPosition(item)
86
+ {
87
+ var position = 0;
88
+
89
+ if (item.offsetWidth != null)
90
+ {
91
+ while (item != document.body && item != null)
92
+ {
93
+ position += item.offsetTop;
94
+ item = item.offsetParent;
95
+ };
96
+ };
97
+
98
+ return position;
99
+ };
100
+
101
+
102
+ function MoveToPosition(item, x, y)
103
+ {
104
+ // Opera 5 chokes on the px extension, so it can use the Microsoft one instead.
105
+
106
+ if (item.style.left != null)
107
+ {
108
+ item.style.left = x + "px";
109
+ item.style.top = y + "px";
110
+ }
111
+ else if (item.style.pixelLeft != null)
112
+ {
113
+ item.style.pixelLeft = x;
114
+ item.style.pixelTop = y;
115
+ };
116
+ };
117
+
118
+
119
+ //
120
+ // Menu
121
+ // ____________________________________________________________________________
122
+
123
+
124
+ function ToggleMenu(id)
125
+ {
126
+ if (!window.document.getElementById)
127
+ { return; };
128
+
129
+ var display = window.document.getElementById(id).style.display;
130
+
131
+ if (display == "none")
132
+ { display = "block"; }
133
+ else
134
+ { display = "none"; }
135
+
136
+ window.document.getElementById(id).style.display = display;
137
+ }
138
+
139
+ function HideAllBut(ids, max)
140
+ {
141
+ if (document.getElementById)
142
+ {
143
+ ids.sort( function(a,b) { return a - b; } );
144
+ var number = 1;
145
+
146
+ while (number < max)
147
+ {
148
+ if (ids.length > 0 && number == ids[0])
149
+ { ids.shift(); }
150
+ else
151
+ {
152
+ document.getElementById("MGroupContent" + number).style.display = "none";
153
+ };
154
+
155
+ number++;
156
+ };
157
+ };
158
+ }
159
+
160
+
161
+ //
162
+ // Tooltips
163
+ // ____________________________________________________________________________
164
+
165
+
166
+ var tooltipTimer = 0;
167
+
168
+ function ShowTip(event, tooltipID, linkID)
169
+ {
170
+ if (tooltipTimer)
171
+ { clearTimeout(tooltipTimer); };
172
+
173
+ var docX = event.clientX + window.pageXOffset;
174
+ var docY = event.clientY + window.pageYOffset;
175
+
176
+ var showCommand = "ReallyShowTip('" + tooltipID + "', '" + linkID + "', " + docX + ", " + docY + ")";
177
+
178
+ tooltipTimer = setTimeout(showCommand, 1000);
179
+ }
180
+
181
+ function ReallyShowTip(tooltipID, linkID, docX, docY)
182
+ {
183
+ tooltipTimer = 0;
184
+
185
+ var tooltip;
186
+ var link;
187
+
188
+ if (document.getElementById)
189
+ {
190
+ tooltip = document.getElementById(tooltipID);
191
+ link = document.getElementById(linkID);
192
+ }
193
+ /* else if (document.all)
194
+ {
195
+ tooltip = eval("document.all['" + tooltipID + "']");
196
+ link = eval("document.all['" + linkID + "']");
197
+ }
198
+ */
199
+ if (tooltip)
200
+ {
201
+ var left = GetXPosition(link);
202
+ var top = GetYPosition(link);
203
+ top += link.offsetHeight;
204
+
205
+
206
+ // The fallback method is to use the mouse X and Y relative to the document. We use a separate if and test if its a number
207
+ // in case some browser snuck through the above if statement but didn't support everything.
208
+
209
+ if (!isFinite(top) || top == 0)
210
+ {
211
+ left = docX;
212
+ top = docY;
213
+ }
214
+
215
+ // Some spacing to get it out from under the cursor.
216
+
217
+ top += 10;
218
+
219
+ // Make sure the tooltip doesnt get smushed by being too close to the edge, or in some browsers, go off the edge of the
220
+ // page. We do it here because Konqueror does get offsetWidth right even if it doesnt get the positioning right.
221
+
222
+ if (tooltip.offsetWidth != null)
223
+ {
224
+ var width = tooltip.offsetWidth;
225
+ var docWidth = document.body.clientWidth;
226
+
227
+ if (left + width > docWidth)
228
+ { left = docWidth - width - 1; }
229
+
230
+ // If there's a horizontal scroll bar we could go past zero because it's using the page width, not the window width.
231
+ if (left < 0)
232
+ { left = 0; };
233
+ }
234
+
235
+ MoveToPosition(tooltip, left, top);
236
+ tooltip.style.visibility = "visible";
237
+ }
238
+ }
239
+
240
+ function HideTip(tooltipID)
241
+ {
242
+ if (tooltipTimer)
243
+ {
244
+ clearTimeout(tooltipTimer);
245
+ tooltipTimer = 0;
246
+ }
247
+
248
+ var tooltip;
249
+
250
+ if (document.getElementById)
251
+ { tooltip = document.getElementById(tooltipID); }
252
+ else if (document.all)
253
+ { tooltip = eval("document.all['" + tooltipID + "']"); }
254
+
255
+ if (tooltip)
256
+ { tooltip.style.visibility = "hidden"; }
257
+ }
258
+
259
+
260
+ //
261
+ // Blockquote fix for IE
262
+ // ____________________________________________________________________________
263
+
264
+
265
+ function NDOnLoad()
266
+ {
267
+ if (browserVer == "IE6")
268
+ {
269
+ var scrollboxes = document.getElementsByTagName('blockquote');
270
+
271
+ if (scrollboxes.item(0))
272
+ {
273
+ NDDoResize();
274
+ window.onresize=NDOnResize;
275
+ };
276
+ };
277
+ };
278
+
279
+
280
+ var resizeTimer = 0;
281
+
282
+ function NDOnResize()
283
+ {
284
+ if (resizeTimer != 0)
285
+ { clearTimeout(resizeTimer); };
286
+
287
+ resizeTimer = setTimeout(NDDoResize, 250);
288
+ };
289
+
290
+
291
+ function NDDoResize()
292
+ {
293
+ var scrollboxes = document.getElementsByTagName('blockquote');
294
+
295
+ var i;
296
+ var item;
297
+
298
+ i = 0;
299
+ while (item = scrollboxes.item(i))
300
+ {
301
+ item.style.width = 100;
302
+ i++;
303
+ };
304
+
305
+ i = 0;
306
+ while (item = scrollboxes.item(i))
307
+ {
308
+ item.style.width = item.parentNode.offsetWidth;
309
+ i++;
310
+ };
311
+
312
+ clearTimeout(resizeTimer);
313
+ resizeTimer = 0;
314
+ }
315
+
316
+
317
+
318
+ /* ________________________________________________________________________________________________________
319
+
320
+ Class: SearchPanel
321
+ ________________________________________________________________________________________________________
322
+
323
+ A class handling everything associated with the search panel.
324
+
325
+ Parameters:
326
+
327
+ name - The name of the global variable that will be storing this instance. Is needed to be able to set timeouts.
328
+ mode - The mode the search is going to work in. Pass <NaturalDocs::Builder::Base->CommandLineOption()>, so the
329
+ value will be something like "HTML" or "FramedHTML".
330
+
331
+ ________________________________________________________________________________________________________
332
+ */
333
+
334
+
335
+ function SearchPanel(name, mode, resultsPath)
336
+ {
337
+ if (!name || !mode || !resultsPath)
338
+ { alert("Incorrect parameters to SearchPanel."); };
339
+
340
+
341
+ // Group: Variables
342
+ // ________________________________________________________________________
343
+
344
+ /*
345
+ var: name
346
+ The name of the global variable that will be storing this instance of the class.
347
+ */
348
+ this.name = name;
349
+
350
+ /*
351
+ var: mode
352
+ The mode the search is going to work in, such as "HTML" or "FramedHTML".
353
+ */
354
+ this.mode = mode;
355
+
356
+ /*
357
+ var: resultsPath
358
+ The relative path from the current HTML page to the results page directory.
359
+ */
360
+ this.resultsPath = resultsPath;
361
+
362
+ /*
363
+ var: keyTimeout
364
+ The timeout used between a keystroke and when a search is performed.
365
+ */
366
+ this.keyTimeout = 0;
367
+
368
+ /*
369
+ var: keyTimeoutLength
370
+ The length of <keyTimeout> in thousandths of a second.
371
+ */
372
+ this.keyTimeoutLength = 500;
373
+
374
+ /*
375
+ var: lastSearchValue
376
+ The last search string executed, or an empty string if none.
377
+ */
378
+ this.lastSearchValue = "";
379
+
380
+ /*
381
+ var: lastResultsPage
382
+ The last results page. The value is only relevant if <lastSearchValue> is set.
383
+ */
384
+ this.lastResultsPage = "";
385
+
386
+ /*
387
+ var: deactivateTimeout
388
+
389
+ The timeout used between when a control is deactivated and when the entire panel is deactivated. Is necessary
390
+ because a control may be deactivated in favor of another control in the same panel, in which case it should stay
391
+ active.
392
+ */
393
+ this.deactivateTimout = 0;
394
+
395
+ /*
396
+ var: deactivateTimeoutLength
397
+ The length of <deactivateTimeout> in thousandths of a second.
398
+ */
399
+ this.deactivateTimeoutLength = 200;
400
+
401
+
402
+
403
+
404
+ // Group: DOM Elements
405
+ // ________________________________________________________________________
406
+
407
+
408
+ // Function: DOMSearchField
409
+ this.DOMSearchField = function()
410
+ { return document.getElementById("MSearchField"); };
411
+
412
+ // Function: DOMSearchType
413
+ this.DOMSearchType = function()
414
+ { return document.getElementById("MSearchType"); };
415
+
416
+ // Function: DOMPopupSearchResults
417
+ this.DOMPopupSearchResults = function()
418
+ { return document.getElementById("MSearchResults"); };
419
+
420
+ // Function: DOMPopupSearchResultsWindow
421
+ this.DOMPopupSearchResultsWindow = function()
422
+ { return document.getElementById("MSearchResultsWindow"); };
423
+
424
+ // Function: DOMSearchPanel
425
+ this.DOMSearchPanel = function()
426
+ { return document.getElementById("MSearchPanel"); };
427
+
428
+
429
+
430
+
431
+ // Group: Event Handlers
432
+ // ________________________________________________________________________
433
+
434
+
435
+ /*
436
+ Function: OnSearchFieldFocus
437
+ Called when focus is added or removed from the search field.
438
+ */
439
+ this.OnSearchFieldFocus = function(isActive)
440
+ {
441
+ this.Activate(isActive);
442
+ };
443
+
444
+
445
+ /*
446
+ Function: OnSearchFieldChange
447
+ Called when the content of the search field is changed.
448
+ */
449
+ this.OnSearchFieldChange = function()
450
+ {
451
+ if (this.keyTimeout)
452
+ {
453
+ clearTimeout(this.keyTimeout);
454
+ this.keyTimeout = 0;
455
+ };
456
+
457
+ var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
458
+
459
+ if (searchValue != this.lastSearchValue)
460
+ {
461
+ if (searchValue != "")
462
+ {
463
+ this.keyTimeout = setTimeout(this.name + ".Search()", this.keyTimeoutLength);
464
+ }
465
+ else
466
+ {
467
+ if (this.mode == "HTML")
468
+ { this.DOMPopupSearchResultsWindow().style.display = "none"; };
469
+ this.lastSearchValue = "";
470
+ };
471
+ };
472
+ };
473
+
474
+
475
+ /*
476
+ Function: OnSearchTypeFocus
477
+ Called when focus is added or removed from the search type.
478
+ */
479
+ this.OnSearchTypeFocus = function(isActive)
480
+ {
481
+ this.Activate(isActive);
482
+ };
483
+
484
+
485
+ /*
486
+ Function: OnSearchTypeChange
487
+ Called when the search type is changed.
488
+ */
489
+ this.OnSearchTypeChange = function()
490
+ {
491
+ var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
492
+
493
+ if (searchValue != "")
494
+ {
495
+ this.Search();
496
+ };
497
+ };
498
+
499
+
500
+
501
+ // Group: Action Functions
502
+ // ________________________________________________________________________
503
+
504
+
505
+ /*
506
+ Function: CloseResultsWindow
507
+ Closes the results window.
508
+ */
509
+ this.CloseResultsWindow = function()
510
+ {
511
+ this.DOMPopupSearchResultsWindow().style.display = "none";
512
+ this.Activate(false, true);
513
+ };
514
+
515
+
516
+ /*
517
+ Function: Search
518
+ Performs a search.
519
+ */
520
+ this.Search = function()
521
+ {
522
+ this.keyTimeout = 0;
523
+
524
+ var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
525
+ var searchTopic = this.DOMSearchType().value;
526
+
527
+ var pageExtension = searchValue.substr(0,1);
528
+
529
+ if (pageExtension.match(/^[a-z]/i))
530
+ { pageExtension = pageExtension.toUpperCase(); }
531
+ else if (pageExtension.match(/^[0-9]/))
532
+ { pageExtension = 'Numbers'; }
533
+ else
534
+ { pageExtension = "Symbols"; };
535
+
536
+ var resultsPage;
537
+ var resultsPageWithSearch;
538
+ var hasResultsPage;
539
+
540
+ // indexSectionsWithContent is defined in searchdata.js
541
+ if (indexSectionsWithContent[searchTopic][pageExtension] == true)
542
+ {
543
+ resultsPage = this.resultsPath + '/' + searchTopic + pageExtension + '.html';
544
+ resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
545
+ hasResultsPage = true;
546
+ }
547
+ else
548
+ {
549
+ resultsPage = this.resultsPath + '/NoResults.html';
550
+ resultsPageWithSearch = resultsPage;
551
+ hasResultsPage = false;
552
+ };
553
+
554
+ var resultsFrame;
555
+ if (this.mode == "HTML")
556
+ { resultsFrame = window.frames.MSearchResults; }
557
+ else if (this.mode == "FramedHTML")
558
+ { resultsFrame = window.top.frames['Content']; };
559
+
560
+
561
+ if (resultsPage != this.lastResultsPage ||
562
+
563
+ // Bug in IE. If everything becomes hidden in a run, none of them will be able to be reshown in the next for some
564
+ // reason. It counts the right number of results, and you can even read the display as "block" after setting it, but it
565
+ // just doesn't work in IE 6 or IE 7. So if we're on the right page but the previous search had no results, reload the
566
+ // page anyway to get around the bug.
567
+ (browserType == "IE" && hasResultsPage &&
568
+ (!resultsFrame.searchResults || resultsFrame.searchResults.lastMatchCount == 0)) )
569
+
570
+ {
571
+ resultsFrame.location.href = resultsPageWithSearch;
572
+ }
573
+
574
+ // So if the results page is right and there's no IE bug, reperform the search on the existing page. We have to check if there
575
+ // are results because NoResults.html doesn't have any JavaScript, and it would be useless to do anything on that page even
576
+ // if it did.
577
+ else if (hasResultsPage)
578
+ {
579
+ // We need to check if this exists in case the frame is present but didn't finish loading.
580
+ if (resultsFrame.searchResults)
581
+ { resultsFrame.searchResults.Search(searchValue); }
582
+
583
+ // Otherwise just reload instead of waiting.
584
+ else
585
+ { resultsFrame.location.href = resultsPageWithSearch; };
586
+ };
587
+
588
+
589
+ var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
590
+
591
+ if (this.mode == "HTML" && domPopupSearchResultsWindow.style.display != "block")
592
+ {
593
+ var domSearchType = this.DOMSearchType();
594
+
595
+ var left = GetXPosition(domSearchType);
596
+ var top = GetYPosition(domSearchType) + domSearchType.offsetHeight;
597
+
598
+ MoveToPosition(domPopupSearchResultsWindow, left, top);
599
+ domPopupSearchResultsWindow.style.display = 'block';
600
+ };
601
+
602
+
603
+ this.lastSearchValue = searchValue;
604
+ this.lastResultsPage = resultsPage;
605
+ };
606
+
607
+
608
+
609
+ // Group: Activation Functions
610
+ // Functions that handle whether the entire panel is active or not.
611
+ // ________________________________________________________________________
612
+
613
+
614
+ /*
615
+ Function: Activate
616
+
617
+ Activates or deactivates the search panel, resetting things to their default values if necessary. You can call this on every
618
+ control's OnBlur() and it will handle not deactivating the entire panel when focus is just switching between them transparently.
619
+
620
+ Parameters:
621
+
622
+ isActive - Whether you're activating or deactivating the panel.
623
+ ignoreDeactivateDelay - Set if you're positive the action will deactivate the panel and thus want to skip the delay.
624
+ */
625
+ this.Activate = function(isActive, ignoreDeactivateDelay)
626
+ {
627
+ // We want to ignore isActive being false while the results window is open.
628
+ if (isActive || (this.mode == "HTML" && this.DOMPopupSearchResultsWindow().style.display == "block"))
629
+ {
630
+ if (this.inactivateTimeout)
631
+ {
632
+ clearTimeout(this.inactivateTimeout);
633
+ this.inactivateTimeout = 0;
634
+ };
635
+
636
+ this.DOMSearchPanel().className = 'MSearchPanelActive';
637
+
638
+ var searchField = this.DOMSearchField();
639
+
640
+ if (searchField.value == 'Search')
641
+ { searchField.value = ""; }
642
+ }
643
+ else if (!ignoreDeactivateDelay)
644
+ {
645
+ this.inactivateTimeout = setTimeout(this.name + ".InactivateAfterTimeout()", this.inactivateTimeoutLength);
646
+ }
647
+ else
648
+ {
649
+ this.InactivateAfterTimeout();
650
+ };
651
+ };
652
+
653
+
654
+ /*
655
+ Function: InactivateAfterTimeout
656
+
657
+ Called by <inactivateTimeout>, which is set by <Activate()>. Inactivation occurs on a timeout because a control may
658
+ receive OnBlur() when focus is really transferring to another control in the search panel. In this case we don't want to
659
+ actually deactivate the panel because not only would that cause a visible flicker but it could also reset the search value.
660
+ So by doing it on a timeout instead, there's a short period where the second control's OnFocus() can cancel the deactivation.
661
+ */
662
+ this.InactivateAfterTimeout = function()
663
+ {
664
+ this.inactivateTimeout = 0;
665
+
666
+ this.DOMSearchPanel().className = 'MSearchPanelInactive';
667
+ this.DOMSearchField().value = "Search";
668
+
669
+ this.lastSearchValue = "";
670
+ this.lastResultsPage = "";
671
+ };
672
+ };
673
+
674
+
675
+
676
+
677
+ /* ________________________________________________________________________________________________________
678
+
679
+ Class: SearchResults
680
+ _________________________________________________________________________________________________________
681
+
682
+ The class that handles everything on the search results page.
683
+ _________________________________________________________________________________________________________
684
+ */
685
+
686
+
687
+ function SearchResults(name, mode)
688
+ {
689
+ /*
690
+ var: mode
691
+ The mode the search is going to work in, such as "HTML" or "FramedHTML".
692
+ */
693
+ this.mode = mode;
694
+
695
+ /*
696
+ var: lastMatchCount
697
+ The number of matches from the last run of <Search()>.
698
+ */
699
+ this.lastMatchCount = 0;
700
+
701
+
702
+ /*
703
+ Function: Toggle
704
+ Toggles the visibility of the passed element ID.
705
+ */
706
+ this.Toggle = function(id)
707
+ {
708
+ if (this.mode == "FramedHTML")
709
+ { return; };
710
+
711
+ var parentElement = document.getElementById(id);
712
+
713
+ var element = parentElement.firstChild;
714
+
715
+ while (element && element != parentElement)
716
+ {
717
+ if (element.nodeName == 'DIV' && element.className == 'ISubIndex')
718
+ {
719
+ if (element.style.display == 'block')
720
+ { element.style.display = "none"; }
721
+ else
722
+ { element.style.display = 'block'; }
723
+ };
724
+
725
+ if (element.nodeName == 'DIV' && element.hasChildNodes())
726
+ { element = element.firstChild; }
727
+ else if (element.nextSibling)
728
+ { element = element.nextSibling; }
729
+ else
730
+ {
731
+ do
732
+ {
733
+ element = element.parentNode;
734
+ }
735
+ while (element && element != parentElement && !element.nextSibling);
736
+
737
+ if (element && element != parentElement)
738
+ { element = element.nextSibling; };
739
+ };
740
+ };
741
+ };
742
+
743
+
744
+ /*
745
+ Function: Search
746
+
747
+ Searches for the passed string. If there is no parameter, it takes it from the URL query.
748
+
749
+ Always returns true, since other documents may try to call it and that may or may not be possible.
750
+ */
751
+ this.Search = function(search)
752
+ {
753
+ if (!search)
754
+ {
755
+ search = window.location.search;
756
+ search = search.substring(1); // Remove the leading ?
757
+ search = unescape(search);
758
+ };
759
+
760
+ search = search.replace(/^ +/, "");
761
+ search = search.replace(/ +$/, "");
762
+ search = search.toLowerCase();
763
+
764
+ if (search.match(/[^a-z0-9]/)) // Just a little speedup so it doesn't have to go through the below unnecessarily.
765
+ {
766
+ search = search.replace(/\_/g, "_und");
767
+ search = search.replace(/\ +/gi, "_spc");
768
+ search = search.replace(/\~/g, "_til");
769
+ search = search.replace(/\!/g, "_exc");
770
+ search = search.replace(/\@/g, "_att");
771
+ search = search.replace(/\#/g, "_num");
772
+ search = search.replace(/\$/g, "_dol");
773
+ search = search.replace(/\%/g, "_pct");
774
+ search = search.replace(/\^/g, "_car");
775
+ search = search.replace(/\&/g, "_amp");
776
+ search = search.replace(/\*/g, "_ast");
777
+ search = search.replace(/\(/g, "_lpa");
778
+ search = search.replace(/\)/g, "_rpa");
779
+ search = search.replace(/\-/g, "_min");
780
+ search = search.replace(/\+/g, "_plu");
781
+ search = search.replace(/\=/g, "_equ");
782
+ search = search.replace(/\{/g, "_lbc");
783
+ search = search.replace(/\}/g, "_rbc");
784
+ search = search.replace(/\[/g, "_lbk");
785
+ search = search.replace(/\]/g, "_rbk");
786
+ search = search.replace(/\:/g, "_col");
787
+ search = search.replace(/\;/g, "_sco");
788
+ search = search.replace(/\"/g, "_quo");
789
+ search = search.replace(/\'/g, "_apo");
790
+ search = search.replace(/\</g, "_lan");
791
+ search = search.replace(/\>/g, "_ran");
792
+ search = search.replace(/\,/g, "_com");
793
+ search = search.replace(/\./g, "_per");
794
+ search = search.replace(/\?/g, "_que");
795
+ search = search.replace(/\//g, "_sla");
796
+ search = search.replace(/[^a-z0-9\_]i/gi, "_zzz");
797
+ };
798
+
799
+ var resultRows = document.getElementsByTagName("div");
800
+ var matches = 0;
801
+
802
+ var i = 0;
803
+ while (i < resultRows.length)
804
+ {
805
+ var row = resultRows.item(i);
806
+
807
+ if (row.className == "SRResult")
808
+ {
809
+ var rowMatchName = row.id.toLowerCase();
810
+ rowMatchName = rowMatchName.replace(/^sr\d*_/, '');
811
+
812
+ if (search.length <= rowMatchName.length && rowMatchName.substr(0, search.length) == search)
813
+ {
814
+ row.style.display = "block";
815
+ matches++;
816
+ }
817
+ else
818
+ { row.style.display = "none"; };
819
+ };
820
+
821
+ i++;
822
+ };
823
+
824
+ document.getElementById("Searching").style.display="none";
825
+
826
+ if (matches == 0)
827
+ { document.getElementById("NoMatches").style.display="block"; }
828
+ else
829
+ { document.getElementById("NoMatches").style.display="none"; }
830
+
831
+ this.lastMatchCount = matches;
832
+
833
+ return true;
834
+ };
835
+ };
836
+