closure 1.4.3 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +12 -12
  3. data/closure-compiler/README.md +503 -0
  4. data/closure-compiler/compiler.jar +0 -0
  5. data/closure-templates/SoyToJsSrcCompiler.jar +0 -0
  6. data/closure-templates/soyutils.js +1593 -469
  7. data/closure-templates/soyutils_usegoog.js +1105 -223
  8. data/docs/SCRIPT.md +5 -5
  9. data/docs/closure/Closure/BeanShell.html +63 -54
  10. data/docs/closure/Closure/Compiler/Compilation.html +124 -107
  11. data/docs/closure/Closure/Compiler/Error.html +28 -21
  12. data/docs/closure/Closure/Compiler.html +81 -76
  13. data/docs/closure/Closure/FileResponse.html +113 -98
  14. data/docs/closure/Closure/Goog.html +264 -253
  15. data/docs/closure/Closure/Middleware.html +66 -55
  16. data/docs/closure/Closure/Script/NotFound.html +28 -21
  17. data/docs/closure/Closure/Script/RenderStackOverflow.html +28 -21
  18. data/docs/closure/Closure/Script.html +212 -203
  19. data/docs/closure/Closure/Server.html +100 -90
  20. data/docs/closure/Closure/ShowExceptions.html +63 -52
  21. data/docs/closure/Closure/Sources.html +254 -246
  22. data/docs/closure/Closure/Templates/Error.html +28 -21
  23. data/docs/closure/Closure/Templates.html +88 -80
  24. data/docs/closure/Closure.html +181 -163
  25. data/docs/closure/_index.html +42 -38
  26. data/docs/closure/class_list.html +19 -8
  27. data/docs/closure/css/full_list.css +4 -2
  28. data/docs/closure/css/style.css +68 -51
  29. data/docs/closure/file.LICENSE.html +24 -217
  30. data/docs/closure/file.README.html +54 -47
  31. data/docs/closure/file_list.html +20 -9
  32. data/docs/closure/frames.html +18 -5
  33. data/docs/closure/index.html +54 -47
  34. data/docs/closure/js/app.js +60 -46
  35. data/docs/closure/js/full_list.js +24 -10
  36. data/docs/closure/js/jquery.js +4 -16
  37. data/docs/closure/method_list.html +74 -175
  38. data/docs/closure/top-level-namespace.html +29 -20
  39. data/lib/closure/compiler.rb +32 -42
  40. data/lib/closure/goog.rb +12 -12
  41. data/lib/closure/server.rb +6 -6
  42. data/lib/closure/show_exceptions.rb +15 -12
  43. data/lib/closure/version.rb +1 -1
  44. data/scripts/git.erb +183 -0
  45. data/scripts/hello/compiler.js.erb +2 -2
  46. data/scripts/hello/hello.js +1 -1
  47. data/scripts/hello/index.erb +6 -0
  48. data/scripts/hello/legume.js +12 -7
  49. data/scripts/index.erb +15 -13
  50. data/scripts/modules/compiler.js.erb +3 -3
  51. data/scripts/modules/compiler_build.js +3 -3
  52. data/scripts/modules/compiler_build.map +13 -12159
  53. data/scripts/modules/compiler_build_api.js +1 -1
  54. data/scripts/modules/compiler_build_app.js +74 -71
  55. data/scripts/modules/compiler_build_settings.js +2 -2
  56. data/scripts/modules/index.erb +5 -3
  57. data/scripts/modules/settings.js +1 -1
  58. data/scripts/svn.erb +11 -11
  59. data/scripts/welcome.erb +7 -6
  60. metadata +65 -81
  61. data/closure-compiler/README +0 -292
  62. data/scripts/hello/compiler_build.js +0 -5
  63. data/scripts/hello/compiler_build.map +0 -748
  64. data/scripts/hello/compiler_debug.js +0 -119
  65. data/scripts/modules/compiler_debug.js +0 -6
  66. data/scripts/modules/compiler_debug_api.js +0 -11
  67. data/scripts/modules/compiler_debug_app.js +0 -2414
  68. data/scripts/modules/compiler_debug_settings.js +0 -39
  69. data/scripts/rails/index.erb +0 -46
  70. data/scripts/rails/rails_ujs.js +0 -96
@@ -6,19 +6,21 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.7.3
9
+ &mdash; Documentation by YARD 0.8.7.6
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
18
19
  relpath = '';
19
- if (relpath != '') relpath += '/';
20
+ framesUrl = "frames.html#!file.README.html";
20
21
  </script>
21
22
 
23
+
22
24
  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
23
25
 
24
26
  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
@@ -26,39 +28,44 @@
26
28
 
27
29
  </head>
28
30
  <body>
29
- <script type="text/javascript" charset="utf-8">
30
- if (window.top.frames.main) document.body.className = 'frames';
31
- </script>
32
-
33
31
  <div id="header">
34
32
  <div id="menu">
35
33
 
36
- <a href="_index.html" title="Index">Index</a> &raquo;
34
+ <a href="_index.html">Index</a> &raquo;
37
35
  <span class="title">File: README</span>
38
36
 
39
-
37
+
40
38
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
39
  </div>
42
40
 
43
41
  <div id="search">
44
42
 
45
- <a id="class_list_link" href="#">Class List</a>
43
+ <a class="full_list_link" id="class_list_link"
44
+ href="class_list.html">
45
+ Class List
46
+ </a>
46
47
 
47
- <a id="method_list_link" href="#">Method List</a>
48
+ <a class="full_list_link" id="method_list_link"
49
+ href="method_list.html">
50
+ Method List
51
+ </a>
48
52
 
49
- <a id="file_list_link" href="#">File List</a>
53
+ <a class="full_list_link" id="file_list_link"
54
+ href="file_list.html">
55
+ File List
56
+ </a>
50
57
 
51
58
  </div>
52
59
  <div class="clear"></div>
53
60
  </div>
54
-
61
+
55
62
  <iframe id="search_frame"></iframe>
56
-
63
+
57
64
  <div id="content"><div id='filecontents'><h1 id="closure-script">Closure Script</h1>
58
65
 
59
66
  <p>A development environment for Google Closure Tools.</p>
60
67
 
61
- <p>Licensed under the Apache License, Version 2.0 (the “License”);
68
+ <p>Licensed under the Apache License, Version 2.0 (the “License”);
62
69
  <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a></p>
63
70
 
64
71
  <h1 id="installing">Installing</h1>
@@ -74,47 +81,47 @@ under Windows. Mac OSX and most Linux will have a compatible Ruby by default.</
74
81
 
75
82
  <h3 id="step-1-download-to-a-new-folder">Step 1: Download to a new folder</h3>
76
83
 
77
- <pre class="code">cd ~/empty-dir
78
- curl -LO https://github.com/downloads/dturnbull/closure-script/closure-1.4.0.jar
79
- </pre>
84
+ <pre class="code ruby"><code class="ruby">cd ~/empty-dir
85
+ curl -LO https://github.com/downloads/AE9RB/closure-script/closure-1.4.2.jar
86
+ </code></pre>
80
87
 
81
88
  <h3 id="step-2-start-server-from-the-new-folder">Step 2: Start server from the new folder</h3>
82
89
 
83
- <pre class="code">java -jar closure-1.4.0.jar
84
- </pre>
90
+ <pre class="code ruby"><code class="ruby">java -jar closure-1.4.2.jar
91
+ </code></pre>
85
92
 
86
93
  <h3 id="step-3-open-a-web-browser">Step 3: Open a web browser</h3>
87
94
 
88
- <pre class="code">http://localhost:8080/
89
- </pre>
95
+ <pre class="code ruby"><code class="ruby">http://localhost:8080/
96
+ </code></pre>
90
97
 
91
98
  <h2 id="ruby-gem">Ruby (.gem)</h2>
92
99
 
93
100
  <h3 id="step-1-install-the-gem">Step 1: Install the gem</h3>
94
101
 
95
- <pre class="code"><span class='id gem'>gem</span> <span class='id install'>install</span> <span class='id closure'>closure</span>
96
- </pre>
102
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_closure'>closure</span>
103
+ </code></pre>
97
104
 
98
105
  <h3 id="step-2-start-server-from-a-new-folder">Step 2: Start server from a new folder</h3>
99
106
 
100
- <pre class="code"><span class='id cd'>cd</span> <span class='op'>~</span><span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>empty-dir
101
- </span></span></pre>
107
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_cd'>cd</span> <span class='op'>~</span><span class='tstring'><span class='regexp_beg'>/</span><span class='regexp_end'>empty-dir
108
+ </span></span></code></pre>
102
109
 
103
110
  <h3 id="step-3-open-a-web-browser-1">Step 3: Open a web browser</h3>
104
111
 
105
- <pre class="code">http://localhost:8080/
106
- </pre>
112
+ <pre class="code ruby"><code class="ruby">http://localhost:8080/
113
+ </code></pre>
107
114
 
108
115
  <h1 id="the-closure-script-method">The Closure Script Method</h1>
109
116
 
110
117
  <p>When you start the server for the first time in an empty folder, the home page
111
- will prompt you to install scaffolding. This includes three example projects to
118
+ will prompt you to install scaffolding. This includes three example projects to
112
119
  demonstrate soy, modules, and unobtrusive markup. Dissecting and working with
113
120
  these examples is the fast track to understanding The Closure Script Method.</p>
114
121
 
115
122
  <h2 id="the-server">The Server</h2>
116
123
 
117
- <p>Closure Script is a high-performance, multi-threaded web application engineered
124
+ <p>Closure Script is a high-performance, multi-threaded web application engineered
118
125
  exclusively for the needs of Google Closure Javascript development.</p>
119
126
 
120
127
  <p>You will be freed from the command line. All error output from the compiler
@@ -131,11 +138,11 @@ Ruby developers will recognize that Closure Script is Rack middleware. This mak
131
138
  to include the Closure Script build tool in a Rails application. If you’re not developing a
132
139
  Ruby application, your <code>config.ru</code> will probably never be more complex than the following:</p>
133
140
 
134
- <pre class="code"><span class='id require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>closure</span><span class='tstring_end'>'</span></span>
135
- <span class='const'>Closure</span><span class='period'>.</span><span class='id add_source'>add_source</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span>
136
- <span class='id use'>use</span> <span class='const'>Closure</span><span class='op'>::</span><span class='const'>Middleware</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>index</span><span class='tstring_end'>'</span></span>
137
- <span class='id run'>run</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id new'>new</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>.</span><span class='tstring_end'>'</span></span>
138
- </pre>
141
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>closure</span><span class='tstring_end'>&#39;</span></span>
142
+ <span class='const'>Closure</span><span class='period'>.</span><span class='id identifier rubyid_add_source'>add_source</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>/</span><span class='tstring_end'>&#39;</span></span>
143
+ <span class='id identifier rubyid_use'>use</span> <span class='const'>Closure</span><span class='op'>::</span><span class='const'>Middleware</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>index</span><span class='tstring_end'>&#39;</span></span>
144
+ <span class='id identifier rubyid_run'>run</span> <span class='const'>Rack</span><span class='op'>::</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span>
145
+ </code></pre>
139
146
 
140
147
  <p>The add_source command may be duplicated for each source Javascript folder you want to
141
148
  serve. The first argument is the local filesystem path, the second is the mount point
@@ -159,11 +166,11 @@ as they are served. Scripts may also render other Scripts and pass variables if
159
166
  need that complexity. Scripts default to a MIME type of text/html so <code>demo.erb</code> is
160
167
  the same as <code>demo.html.erb</code>.</p>
161
168
 
162
- <pre class="code">&lt;html&gt;
169
+ <pre class="code ruby"><code class="ruby">&lt;html&gt;
163
170
  &lt;head&gt;
164
- &lt;script src='compiler.js?&lt;%= query_string %&gt;'&gt;&lt;/script&gt;
171
+ &lt;script src=&#39;compiler.js?&lt;%= query_string %&gt;&#39;&gt;&lt;/script&gt;
165
172
  &lt;/head&gt;
166
- </pre>
173
+ </code></pre>
167
174
 
168
175
  <h3 id="compiler-scripts">Compiler Scripts</h3>
169
176
 
@@ -182,7 +189,7 @@ even when working with modules.</p>
182
189
  <p>A very simple compiler.js.erb is as follows. Check the scaffold for practical examples
183
190
  that use the query string.</p>
184
191
 
185
- <pre class="code">&lt;%
192
+ <pre class="code ruby"><code class="ruby">&lt;%
186
193
  args = %w{
187
194
  --compilation_level ADVANCED_OPTIMIZATIONS
188
195
  --js_output_file compiler_build.js
@@ -190,7 +197,7 @@ args = %w{
190
197
  }
191
198
  @response = goog.compile(args).to_response
192
199
  %&gt;
193
- </pre>
200
+ </code></pre>
194
201
 
195
202
  <h3 id="testing">Testing</h3>
196
203
 
@@ -199,21 +206,21 @@ browsers are not allowed to. The <code>alltests.js</code> file in Closure Librar
199
206
  generated by a program that scans the filesystem. Here’s a replacement in
200
207
  Closure Script so that a manual build step never has to be executed again:</p>
201
208
 
202
- <pre class="code">&lt;% all_test_files = Dir.glob expand_path '**/*_test.html'
209
+ <pre class="code ruby"><code class="ruby">&lt;% all_test_files = Dir.glob expand_path &#39;**/*_test.html&#39;
203
210
  json_strings = all_test_files.map { |x| relative_src(x).dump }
204
- -%&gt;var _allTests = [&lt;%= json_strings.join(',') %&gt;];
205
- </pre>
211
+ -%&gt;var _allTests = [&lt;%= json_strings.join(&#39;,&#39;) %&gt;];
212
+ </code></pre>
206
213
 
207
214
  <p>Since all of Ruby is at your disposal, you could even pull fixture data from SQL
208
215
  or a web service. Perhaps a fixture refresh happens when the developer pushes a
209
216
  form button. The svn.erb tool is a complex example that uses threads and a
210
217
  background process. You’re only limited by your imagination.</p>
211
218
  </div></div>
212
-
219
+
213
220
  <div id="footer">
214
- Generated on Sun Oct 23 22:43:16 2011 by
221
+ Generated on Sun Mar 20 12:44:16 2016 by
215
222
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
216
- 0.7.3 (ruby-1.9.2).
223
+ 0.8.7.6 (ruby-2.2.1).
217
224
  </div>
218
225
 
219
226
  </body>
@@ -2,11 +2,11 @@ function createSourceLinks() {
2
2
  $('.method_details_list .source_code').
3
3
  before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
4
4
  $('.toggleSource').toggle(function() {
5
- $(this).parent().next().slideDown(100);
5
+ $(this).parent().nextAll('.source_code').slideDown(100);
6
6
  $(this).text("Hide source");
7
7
  },
8
8
  function() {
9
- $(this).parent().next().slideUp(100);
9
+ $(this).parent().nextAll('.source_code').slideUp(100);
10
10
  $(this).text("View source");
11
11
  });
12
12
  }
@@ -44,21 +44,14 @@ function createFullTreeLinks() {
44
44
 
45
45
  function fixBoxInfoHeights() {
46
46
  $('dl.box dd.r1, dl.box dd.r2').each(function() {
47
- $(this).prev().height($(this).height());
47
+ $(this).prev().height($(this).height());
48
48
  });
49
49
  }
50
50
 
51
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');
52
+ $('.full_list_link').click(function() {
53
+ toggleSearchFrame(this, $(this).attr('href'));
54
+ return false;
62
55
  });
63
56
  }
64
57
 
@@ -82,10 +75,18 @@ function linkSummaries() {
82
75
  }
83
76
 
84
77
  function framesInit() {
85
- if (window.top.frames.main) {
78
+ if (hasFrames) {
86
79
  document.body.className = 'frames';
87
80
  $('#menu .noframes a').attr('href', document.location);
88
- $('html head title', window.parent.document).text($('html head title').text());
81
+ try {
82
+ window.top.document.title = $('html head title').text();
83
+ } catch(error) {
84
+ // some browsers will not allow this when serving from file://
85
+ // but we don't want to stop the world.
86
+ }
87
+ }
88
+ else {
89
+ $('#menu .noframes a').text('frames').attr('href', framesUrl);
89
90
  }
90
91
  }
91
92
 
@@ -107,28 +108,34 @@ function keyboardShortcuts() {
107
108
 
108
109
  function summaryToggle() {
109
110
  $('.summary_toggle').click(function() {
110
- localStorage.summaryCollapsed = $(this).text();
111
- $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
112
- var next = $(this).parent().parent().next();
113
- if (next.hasClass('compact')) {
114
- next.toggle();
115
- next.next().toggle();
116
- }
117
- else if (next.hasClass('summary')) {
118
- var list = $('<ul class="summary compact" />');
119
- list.html(next.html());
120
- list.find('.summary_desc, .note').remove();
121
- list.find('a').each(function() {
122
- $(this).html($(this).find('strong').html());
123
- $(this).parent().html($(this)[0].outerHTML);
124
- });
125
- next.before(list);
126
- next.toggle();
111
+ if (localStorage) {
112
+ localStorage.summaryCollapsed = $(this).text();
127
113
  }
114
+ $('.summary_toggle').each(function() {
115
+ $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
116
+ var next = $(this).parent().parent().nextAll('ul.summary').first();
117
+ if (next.hasClass('compact')) {
118
+ next.toggle();
119
+ next.nextAll('ul.summary').first().toggle();
120
+ }
121
+ else if (next.hasClass('summary')) {
122
+ var list = $('<ul class="summary compact" />');
123
+ list.html(next.html());
124
+ list.find('.summary_desc, .note').remove();
125
+ list.find('a').each(function() {
126
+ $(this).html($(this).find('strong').html());
127
+ $(this).parent().html($(this)[0].outerHTML);
128
+ });
129
+ next.before(list);
130
+ next.toggle();
131
+ }
132
+ });
128
133
  return false;
129
134
  });
130
135
  if (localStorage) {
131
- if (localStorage.summaryCollapsed == "collapse") $('.summary_toggle').click();
136
+ if (localStorage.summaryCollapsed == "collapse") {
137
+ $('.summary_toggle').first().click();
138
+ }
132
139
  else localStorage.summaryCollapsed = "expand";
133
140
  }
134
141
  }
@@ -151,30 +158,37 @@ function generateTOC() {
151
158
  for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
152
159
  var lastTag = parseInt(tags[0][1], 10);
153
160
  $(tags.join(', ')).each(function() {
161
+ if ($(this).parents('.method_details .docstring').length != 0) return;
154
162
  if (this.id == "filecontents") return;
155
163
  show = true;
156
164
  var thisTag = parseInt(this.tagName[1], 10);
157
165
  if (this.id.length === 0) {
158
- var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
159
- if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
160
- this.id = proposedId;
166
+ var proposedId = $(this).attr('toc-id');
167
+ if (typeof(proposedId) != "undefined") this.id = proposedId;
168
+ else {
169
+ var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
170
+ if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
171
+ this.id = proposedId;
172
+ }
161
173
  }
162
- if (thisTag > lastTag) {
163
- for (i = 0; i < thisTag - lastTag; i++) {
164
- var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
165
- }
174
+ if (thisTag > lastTag) {
175
+ for (i = 0; i < thisTag - lastTag; i++) {
176
+ var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
177
+ }
166
178
  }
167
- if (thisTag < lastTag) {
168
- for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
179
+ if (thisTag < lastTag) {
180
+ for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
169
181
  }
170
- toc.append('<li><a href="#' + this.id + '">' + $(this).text() + '</a></li>');
182
+ var title = $(this).attr('toc-title');
183
+ if (typeof(title) == "undefined") title = $(this).text();
184
+ toc.append('<li><a href="#' + this.id + '">' + title + '</a></li>');
171
185
  lastTag = thisTag;
172
186
  });
173
187
  if (!show) return;
174
188
  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>';
175
189
  $('#content').prepend(html);
176
190
  $('#toc').append(_toc);
177
- $('#toc .hide_toc').toggle(function() {
191
+ $('#toc .hide_toc').toggle(function() {
178
192
  $('#toc .top').slideUp('fast');
179
193
  $('#toc').toggleClass('hidden');
180
194
  $('#toc .title small').toggle();
@@ -183,7 +197,7 @@ function generateTOC() {
183
197
  $('#toc').toggleClass('hidden');
184
198
  $('#toc .title small').toggle();
185
199
  });
186
- $('#toc .float_toc').toggle(function() {
200
+ $('#toc .float_toc').toggle(function() {
187
201
  $(this).text('float');
188
202
  $('#toc').toggleClass('nofloat');
189
203
  }, function() {
@@ -202,4 +216,4 @@ $(linkSummaries);
202
216
  $(keyboardShortcuts);
203
217
  $(summaryToggle);
204
218
  $(fixOutsideWorldLinks);
205
- $(generateTOC);
219
+ $(generateTOC);
@@ -4,6 +4,9 @@ var searchCache = [];
4
4
  var searchString = '';
5
5
  var regexSearchString = '';
6
6
  var caseSensitiveMatch = false;
7
+ var ignoreKeyCodeMin = 8;
8
+ var ignoreKeyCodeMax = 46;
9
+ var commandKey = 91;
7
10
 
8
11
  RegExp.escape = function(text) {
9
12
  return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
@@ -14,16 +17,20 @@ function fullListSearch() {
14
17
  searchCache = [];
15
18
  $('#full_list li').each(function() {
16
19
  var link = $(this).find('.object_link a');
20
+ if (link.length === 0) return;
17
21
  var fullName = link.attr('title').split(' ')[0];
18
22
  searchCache.push({name:link.text(), fullName:fullName, node:$(this), link:link});
19
23
  });
20
-
21
- $('#search input').keyup(function() {
24
+
25
+ $('#search input').keyup(function(event) {
26
+ if ((event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax)
27
+ || event.keyCode == commandKey)
28
+ return;
22
29
  searchString = this.value;
23
30
  caseSensitiveMatch = searchString.match(/[A-Z]/) != null;
24
31
  regexSearchString = RegExp.escape(searchString);
25
32
  if (caseSensitiveMatch) {
26
- regexSearchString += "|" +
33
+ regexSearchString += "|" +
27
34
  $.map(searchString.split(''), function(e) { return RegExp.escape(e); }).
28
35
  join('.+?');
29
36
  }
@@ -33,9 +40,9 @@ function fullListSearch() {
33
40
  $('ul .search_uncollapsed').removeClass('search_uncollapsed');
34
41
  $('#full_list, #content').removeClass('insearch');
35
42
  $('#full_list li').removeClass('found').each(function() {
36
-
43
+
37
44
  var link = $(this).find('.object_link a');
38
- link.text(link.text());
45
+ if (link.length > 0) link.text(link.text());
39
46
  });
40
47
  if (clicked) {
41
48
  clicked.parents('ul').each(function() {
@@ -53,7 +60,7 @@ function fullListSearch() {
53
60
  searchItem();
54
61
  }
55
62
  });
56
-
63
+
57
64
  $('#search input').focus();
58
65
  $('#full_list').after("<div id='noresults'></div>");
59
66
  }
@@ -105,6 +112,10 @@ function linkList() {
105
112
  $('#full_list li, #full_list li a:last').click(function(evt) {
106
113
  if ($(this).hasClass('toggle')) return true;
107
114
  if (this.tagName.toLowerCase() == "li") {
115
+ if ($(this).find('.object_link a').length === 0) {
116
+ $(this).children('a.toggle').click();
117
+ return false;
118
+ }
108
119
  var toggle = $(this).children('a.toggle');
109
120
  if (toggle.size() > 0 && evt.pageX < toggle.offset().left) {
110
121
  toggle.click();
@@ -112,9 +123,12 @@ function linkList() {
112
123
  }
113
124
  }
114
125
  if (clicked) clicked.removeClass('clicked');
115
- var win = window.top.frames.main ? window.top.frames.main : window.parent;
126
+ var win;
127
+ try {
128
+ win = window.top.frames.main ? window.top.frames.main : window.parent;
129
+ } catch (e) { win = window.parent; }
116
130
  if (this.tagName.toLowerCase() == "a") {
117
- clicked = $(this).parent('li').addClass('clicked');
131
+ clicked = $(this).parents('li').addClass('clicked');
118
132
  win.location = this.href;
119
133
  }
120
134
  else {
@@ -127,10 +141,10 @@ function linkList() {
127
141
 
128
142
  function collapse() {
129
143
  if (!$('#full_list').hasClass('class')) return;
130
- $('#full_list.class a.toggle').click(function() {
144
+ $('#full_list.class a.toggle').click(function() {
131
145
  $(this).parent().toggleClass('collapsed').next().toggleClass('collapsed');
132
146
  highlight();
133
- return false;
147
+ return false;
134
148
  });
135
149
  $('#full_list.class ul').each(function() {
136
150
  $(this).addClass('collapsed').prev().addClass('collapsed');