dirtravel 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/doc/js/app.js CHANGED
@@ -1,3 +1,9 @@
1
+ (function() {
2
+
3
+ var localStorage = {}, sessionStorage = {};
4
+ try { localStorage = window.localStorage; } catch (e) { }
5
+ try { sessionStorage = window.sessionStorage; } catch (e) { }
6
+
1
7
  function createSourceLinks() {
2
8
  $('.method_details_list .source_code').
3
9
  before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
@@ -16,7 +22,7 @@ function createDefineLinks() {
16
22
  $('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
17
23
  $('.toggleDefines').toggle(function() {
18
24
  tHeight = $(this).parent().prev().height();
19
- $(this).prev().show();
25
+ $(this).prev().css('display', 'inline');
20
26
  $(this).parent().prev().height($(this).parent().height());
21
27
  $(this).text("(less)");
22
28
  },
@@ -42,29 +48,39 @@ function createFullTreeLinks() {
42
48
  });
43
49
  }
44
50
 
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() {
51
+ function searchFrameButtons() {
52
52
  $('.full_list_link').click(function() {
53
53
  toggleSearchFrame(this, $(this).attr('href'));
54
54
  return false;
55
55
  });
56
+ window.addEventListener('message', function(e) {
57
+ if (e.data === 'navEscape') {
58
+ $('#nav').slideUp(100);
59
+ $('#search a').removeClass('active inactive');
60
+ $(window).focus();
61
+ }
62
+ });
63
+
64
+ $(window).resize(function() {
65
+ if ($('#search:visible').length === 0) {
66
+ $('#nav').removeAttr('style');
67
+ $('#search a').removeClass('active inactive');
68
+ $(window).focus();
69
+ }
70
+ });
56
71
  }
57
72
 
58
73
  function toggleSearchFrame(id, link) {
59
- var frame = $('#search_frame');
74
+ var frame = $('#nav');
60
75
  $('#search a').removeClass('active').addClass('inactive');
61
- if (frame.attr('src') == link && frame.css('display') != "none") {
76
+ if (frame.attr('src') === link && frame.css('display') !== "none") {
62
77
  frame.slideUp(100);
63
78
  $('#search a').removeClass('active inactive');
64
79
  }
65
80
  else {
66
81
  $(id).addClass('active').removeClass('inactive');
67
- frame.attr('src', link).slideDown(100);
82
+ if (frame.attr('src') !== link) frame.attr('src', link);
83
+ frame.slideDown(100);
68
84
  }
69
85
  }
70
86
 
@@ -74,38 +90,10 @@ function linkSummaries() {
74
90
  });
75
91
  }
76
92
 
77
- function framesInit() {
78
- if (hasFrames) {
79
- document.body.className = 'frames';
80
- $('#menu .noframes a').attr('href', document.location);
81
- window.top.document.title = $('html head title').text();
82
- }
83
- else {
84
- $('#menu .noframes a').text('frames').attr('href', framesUrl);
85
- }
86
- }
87
-
88
- function keyboardShortcuts() {
89
- if (window.top.frames.main) return;
90
- $(document).keypress(function(evt) {
91
- if (evt.altKey || evt.ctrlKey || evt.metaKey || evt.shiftKey) return;
92
- if (typeof evt.target !== "undefined" &&
93
- (evt.target.nodeName == "INPUT" ||
94
- evt.target.nodeName == "TEXTAREA")) return;
95
- switch (evt.charCode) {
96
- case 67: case 99: $('#class_list_link').click(); break; // 'c'
97
- case 77: case 109: $('#method_list_link').click(); break; // 'm'
98
- case 70: case 102: $('#file_list_link').click(); break; // 'f'
99
- default: break;
100
- }
101
- });
102
- }
103
-
104
93
  function summaryToggle() {
105
- $('.summary_toggle').click(function() {
106
- if (localStorage) {
107
- localStorage.summaryCollapsed = $(this).text();
108
- }
94
+ $('.summary_toggle').click(function(e) {
95
+ e.preventDefault();
96
+ localStorage.summaryCollapsed = $(this).text();
109
97
  $('.summary_toggle').each(function() {
110
98
  $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
111
99
  var next = $(this).parent().parent().nextAll('ul.summary').first();
@@ -127,18 +115,52 @@ function summaryToggle() {
127
115
  });
128
116
  return false;
129
117
  });
130
- if (localStorage) {
131
- if (localStorage.summaryCollapsed == "collapse") {
132
- $('.summary_toggle').first().click();
133
- }
134
- else localStorage.summaryCollapsed = "expand";
135
- }
118
+ if (localStorage.summaryCollapsed == "collapse") {
119
+ $('.summary_toggle').first().click();
120
+ } else { localStorage.summaryCollapsed = "expand"; }
136
121
  }
137
122
 
138
- function fixOutsideWorldLinks() {
139
- $('a').each(function() {
140
- if (window.location.host != this.host) this.target = '_parent';
123
+ function constantSummaryToggle() {
124
+ $('.constants_summary_toggle').click(function(e) {
125
+ e.preventDefault();
126
+ localStorage.summaryCollapsed = $(this).text();
127
+ $('.constants_summary_toggle').each(function() {
128
+ $(this).text($(this).text() == "collapse" ? "expand" : "collapse");
129
+ var next = $(this).parent().parent().nextAll('dl.constants').first();
130
+ if (next.hasClass('compact')) {
131
+ next.toggle();
132
+ next.nextAll('dl.constants').first().toggle();
133
+ }
134
+ else if (next.hasClass('constants')) {
135
+ var list = $('<dl class="constants compact" />');
136
+ list.html(next.html());
137
+ list.find('dt').each(function() {
138
+ $(this).addClass('summary_signature');
139
+ $(this).text( $(this).text().split('=')[0]);
140
+ if ($(this).has(".deprecated").length) {
141
+ $(this).addClass('deprecated');
142
+ };
143
+ });
144
+ // Add the value of the constant as "Tooltip" to the summary object
145
+ list.find('pre.code').each(function() {
146
+ console.log($(this).parent());
147
+ var dt_element = $(this).parent().prev();
148
+ var tooltip = $(this).text();
149
+ if (dt_element.hasClass("deprecated")) {
150
+ tooltip = 'Deprecated. ' + tooltip;
151
+ };
152
+ dt_element.attr('title', tooltip);
153
+ });
154
+ list.find('.docstring, .tags, dd').remove();
155
+ next.before(list);
156
+ next.toggle();
157
+ }
158
+ });
159
+ return false;
141
160
  });
161
+ if (localStorage.summaryCollapsed == "collapse") {
162
+ $('.constants_summary_toggle').first().click();
163
+ } else { localStorage.summaryCollapsed = "expand"; }
142
164
  }
143
165
 
144
166
  function generateTOC() {
@@ -149,6 +171,7 @@ function generateTOC() {
149
171
  var counter = 0;
150
172
  var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
151
173
  var i;
174
+ var curli;
152
175
  if ($('#filecontents h1').length > 1) tags.unshift('h1');
153
176
  for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
154
177
  var lastTag = parseInt(tags[0][1], 10);
@@ -168,19 +191,29 @@ function generateTOC() {
168
191
  }
169
192
  if (thisTag > lastTag) {
170
193
  for (i = 0; i < thisTag - lastTag; i++) {
171
- var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
194
+ if ( typeof(curli) == "undefined" ) {
195
+ curli = $('<li/>');
196
+ toc.append(curli);
197
+ }
198
+ toc = $('<ol/>');
199
+ curli.append(toc);
200
+ curli = undefined;
172
201
  }
173
202
  }
174
203
  if (thisTag < lastTag) {
175
- for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
204
+ for (i = 0; i < lastTag - thisTag; i++) {
205
+ toc = toc.parent();
206
+ toc = toc.parent();
207
+ }
176
208
  }
177
209
  var title = $(this).attr('toc-title');
178
210
  if (typeof(title) == "undefined") title = $(this).text();
179
- toc.append('<li><a href="#' + this.id + '">' + title + '</a></li>');
211
+ curli =$('<li><a href="#' + this.id + '">' + title + '</a></li>');
212
+ toc.append(curli);
180
213
  lastTag = thisTag;
181
214
  });
182
215
  if (!show) return;
183
- 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>';
216
+ html = '<div id="toc"><p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p></div>';
184
217
  $('#content').prepend(html);
185
218
  $('#toc').append(_toc);
186
219
  $('#toc .hide_toc').toggle(function() {
@@ -192,23 +225,90 @@ function generateTOC() {
192
225
  $('#toc').toggleClass('hidden');
193
226
  $('#toc .title small').toggle();
194
227
  });
195
- $('#toc .float_toc').toggle(function() {
196
- $(this).text('float');
197
- $('#toc').toggleClass('nofloat');
198
- }, function() {
199
- $(this).text('left');
200
- $('#toc').toggleClass('nofloat');
228
+ }
229
+
230
+ function navResizeFn(e) {
231
+ if (e.which !== 1) {
232
+ navResizeFnStop();
233
+ return;
234
+ }
235
+
236
+ sessionStorage.navWidth = e.pageX.toString();
237
+ $('.nav_wrap').css('width', e.pageX);
238
+ $('.nav_wrap').css('-ms-flex', 'inherit');
239
+ }
240
+
241
+ function navResizeFnStop() {
242
+ $(window).unbind('mousemove', navResizeFn);
243
+ window.removeEventListener('message', navMessageFn, false);
244
+ }
245
+
246
+ function navMessageFn(e) {
247
+ if (e.data.action === 'mousemove') navResizeFn(e.data.event);
248
+ if (e.data.action === 'mouseup') navResizeFnStop();
249
+ }
250
+
251
+ function navResizer() {
252
+ $('#resizer').mousedown(function(e) {
253
+ e.preventDefault();
254
+ $(window).mousemove(navResizeFn);
255
+ window.addEventListener('message', navMessageFn, false);
201
256
  });
257
+ $(window).mouseup(navResizeFnStop);
258
+
259
+ if (sessionStorage.navWidth) {
260
+ navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)});
261
+ }
262
+ }
263
+
264
+ function navExpander() {
265
+ var done = false, timer = setTimeout(postMessage, 500);
266
+ function postMessage() {
267
+ if (done) return;
268
+ clearTimeout(timer);
269
+ var opts = { action: 'expand', path: pathId };
270
+ document.getElementById('nav').contentWindow.postMessage(opts, '*');
271
+ done = true;
272
+ }
273
+
274
+ window.addEventListener('message', function(event) {
275
+ if (event.data === 'navReady') postMessage();
276
+ return false;
277
+ }, false);
202
278
  }
203
279
 
204
- $(framesInit);
205
- $(createSourceLinks);
206
- $(createDefineLinks);
207
- $(createFullTreeLinks);
208
- $(fixBoxInfoHeights);
209
- $(searchFrameLinks);
210
- $(linkSummaries);
211
- $(keyboardShortcuts);
212
- $(summaryToggle);
213
- $(fixOutsideWorldLinks);
214
- $(generateTOC);
280
+ function mainFocus() {
281
+ var hash = window.location.hash;
282
+ if (hash !== '' && $(hash)[0]) {
283
+ $(hash)[0].scrollIntoView();
284
+ }
285
+
286
+ setTimeout(function() { $('#main').focus(); }, 10);
287
+ }
288
+
289
+ function navigationChange() {
290
+ // This works around the broken anchor navigation with the YARD template.
291
+ window.onpopstate = function() {
292
+ var hash = window.location.hash;
293
+ if (hash !== '' && $(hash)[0]) {
294
+ $(hash)[0].scrollIntoView();
295
+ }
296
+ };
297
+ }
298
+
299
+ $(document).ready(function() {
300
+ navResizer();
301
+ navExpander();
302
+ createSourceLinks();
303
+ createDefineLinks();
304
+ createFullTreeLinks();
305
+ searchFrameButtons();
306
+ linkSummaries();
307
+ summaryToggle();
308
+ constantSummaryToggle();
309
+ generateTOC();
310
+ mainFocus();
311
+ navigationChange();
312
+ });
313
+
314
+ })();
data/doc/js/full_list.js CHANGED
@@ -1,8 +1,8 @@
1
- var inSearch = null;
2
- var searchIndex = 0;
1
+ (function() {
2
+
3
+ var $clicked = $(null);
4
+ var searchTimeout = null;
3
5
  var searchCache = [];
4
- var searchString = '';
5
- var regexSearchString = '';
6
6
  var caseSensitiveMatch = false;
7
7
  var ignoreKeyCodeMin = 8;
8
8
  var ignoreKeyCodeMax = 46;
@@ -12,167 +12,205 @@ RegExp.escape = function(text) {
12
12
  return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
13
13
  }
14
14
 
15
- function fullListSearch() {
16
- // generate cache
17
- searchCache = [];
18
- $('#full_list li').each(function() {
19
- var link = $(this).find('.object_link a');
20
- if (link.length === 0) return;
21
- var fullName = link.attr('title').split(' ')[0];
22
- searchCache.push({name:link.text(), fullName:fullName, node:$(this), link:link});
15
+ function escapeShortcut() {
16
+ $(document).keydown(function(evt) {
17
+ if (evt.which == 27) {
18
+ window.parent.postMessage('navEscape', '*');
19
+ }
23
20
  });
21
+ }
24
22
 
25
- $('#search input').keyup(function(event) {
26
- if ((event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax)
27
- || event.keyCode == commandKey)
28
- return;
29
- searchString = this.value;
30
- caseSensitiveMatch = searchString.match(/[A-Z]/) != null;
31
- regexSearchString = RegExp.escape(searchString);
32
- if (caseSensitiveMatch) {
33
- regexSearchString += "|" +
34
- $.map(searchString.split(''), function(e) { return RegExp.escape(e); }).
35
- join('.+?');
36
- }
37
- if (searchString === "") {
38
- clearTimeout(inSearch);
39
- inSearch = null;
40
- $('ul .search_uncollapsed').removeClass('search_uncollapsed');
41
- $('#full_list, #content').removeClass('insearch');
42
- $('#full_list li').removeClass('found').each(function() {
43
-
44
- var link = $(this).find('.object_link a');
45
- if (link.length > 0) link.text(link.text());
23
+ function navResizer() {
24
+ $(window).mousemove(function(e) {
25
+ window.parent.postMessage({
26
+ action: 'mousemove', event: {pageX: e.pageX, which: e.which}
27
+ }, '*');
28
+ }).mouseup(function(e) {
29
+ window.parent.postMessage({action: 'mouseup'}, '*');
30
+ });
31
+ window.parent.postMessage("navReady", "*");
32
+ }
33
+
34
+ function clearSearchTimeout() {
35
+ clearTimeout(searchTimeout);
36
+ searchTimeout = null;
37
+ }
38
+
39
+ function enableLinks() {
40
+ // load the target page in the parent window
41
+ $('#full_list li').on('click', function(evt) {
42
+ $('#full_list li').removeClass('clicked');
43
+ $clicked = $(this);
44
+ $clicked.addClass('clicked');
45
+ evt.stopPropagation();
46
+
47
+ if (evt.target.tagName === 'A') return true;
48
+
49
+ var elem = $clicked.find('> .item .object_link a')[0];
50
+ var e = evt.originalEvent;
51
+ var newEvent = new MouseEvent(evt.originalEvent.type);
52
+ newEvent.initMouseEvent(e.type, e.canBubble, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget);
53
+ elem.dispatchEvent(newEvent);
54
+ evt.preventDefault();
55
+ return false;
56
+ });
57
+ }
58
+
59
+ function enableToggles() {
60
+ // show/hide nested classes on toggle click
61
+ $('#full_list a.toggle').on('click', function(evt) {
62
+ evt.stopPropagation();
63
+ evt.preventDefault();
64
+ $(this).parent().parent().toggleClass('collapsed');
65
+ highlight();
66
+ });
67
+ }
68
+
69
+ function populateSearchCache() {
70
+ $('#full_list li .item').each(function() {
71
+ var $node = $(this);
72
+ var $link = $node.find('.object_link a');
73
+ if ($link.length > 0) {
74
+ searchCache.push({
75
+ node: $node,
76
+ link: $link,
77
+ name: $link.text(),
78
+ fullName: $link.attr('title').split(' ')[0]
46
79
  });
47
- if (clicked) {
48
- clicked.parents('ul').each(function() {
49
- $(this).removeClass('collapsed').prev().removeClass('collapsed');
50
- });
51
- }
52
- highlight();
53
80
  }
54
- else {
55
- if (inSearch) clearTimeout(inSearch);
56
- searchIndex = 0;
57
- lastRowClass = '';
58
- $('#full_list, #content').addClass('insearch');
59
- $('#noresults').text('');
60
- searchItem();
81
+ });
82
+ }
83
+
84
+ function enableSearch() {
85
+ $('#search input').keyup(function(event) {
86
+ if (ignoredKeyPress(event)) return;
87
+ if (this.value === "") {
88
+ clearSearch();
89
+ } else {
90
+ performSearch(this.value);
61
91
  }
62
92
  });
63
93
 
64
- $('#search input').focus();
65
- $('#full_list').after("<div id='noresults'></div>");
94
+ $('#full_list').after("<div id='noresults' style='display:none'></div>");
95
+ }
96
+
97
+ function ignoredKeyPress(event) {
98
+ if (
99
+ (event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) ||
100
+ (event.keyCode == commandKey)
101
+ ) {
102
+ return true;
103
+ } else {
104
+ return false;
105
+ }
66
106
  }
67
107
 
68
- var lastRowClass = '';
69
- function searchItem() {
70
- for (var i = 0; i < searchCache.length / 50; i++) {
71
- var item = searchCache[searchIndex];
108
+ function clearSearch() {
109
+ clearSearchTimeout();
110
+ $('#full_list .found').removeClass('found').each(function() {
111
+ var $link = $(this).find('.object_link a');
112
+ $link.text($link.text());
113
+ });
114
+ $('#full_list, #content').removeClass('insearch');
115
+ $clicked.parents().removeClass('collapsed');
116
+ highlight();
117
+ }
118
+
119
+ function performSearch(searchString) {
120
+ clearSearchTimeout();
121
+ $('#full_list, #content').addClass('insearch');
122
+ $('#noresults').text('').hide();
123
+ partialSearch(searchString, 0);
124
+ }
125
+
126
+ function partialSearch(searchString, offset) {
127
+ var lastRowClass = '';
128
+ var i = null;
129
+ for (i = offset; i < Math.min(offset + 50, searchCache.length); i++) {
130
+ var item = searchCache[i];
72
131
  var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name);
73
- var matchString = regexSearchString;
132
+ var matchString = buildMatchString(searchString);
74
133
  var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i");
75
134
  if (searchName.match(matchRegexp) == null) {
76
135
  item.node.removeClass('found');
136
+ item.link.text(item.link.text());
77
137
  }
78
138
  else {
79
- item.node.css('padding-left', '10px').addClass('found');
80
- item.node.parents().addClass('search_uncollapsed');
139
+ item.node.addClass('found');
81
140
  item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1');
82
141
  lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2';
83
142
  item.link.html(item.name.replace(matchRegexp, "<strong>$&</strong>"));
84
143
  }
85
-
86
- if (searchCache.length === searchIndex + 1) {
87
- searchDone();
88
- return;
89
- }
90
- else {
91
- searchIndex++;
92
- }
93
144
  }
94
- inSearch = setTimeout('searchItem()', 0);
145
+ if(i == searchCache.length) {
146
+ searchDone();
147
+ } else {
148
+ searchTimeout = setTimeout(function() {
149
+ partialSearch(searchString, i);
150
+ }, 0);
151
+ }
95
152
  }
96
153
 
97
154
  function searchDone() {
98
- highlight(true);
155
+ searchTimeout = null;
156
+ highlight();
99
157
  if ($('#full_list li:visible').size() === 0) {
100
158
  $('#noresults').text('No results were found.').hide().fadeIn();
101
- }
102
- else {
103
- $('#noresults').text('');
159
+ } else {
160
+ $('#noresults').text('').hide();
104
161
  }
105
162
  $('#content').removeClass('insearch');
106
- clearTimeout(inSearch);
107
- inSearch = null;
108
163
  }
109
164
 
110
- clicked = null;
111
- function linkList() {
112
- $('#full_list li, #full_list li a:last').click(function(evt) {
113
- if ($(this).hasClass('toggle')) return true;
114
- if ($(this).find('.object_link a').length === 0) {
115
- $(this).children('a.toggle').click();
116
- return false;
117
- }
118
- if (this.tagName.toLowerCase() == "li") {
119
- var toggle = $(this).children('a.toggle');
120
- if (toggle.size() > 0 && evt.pageX < toggle.offset().left) {
121
- toggle.click();
122
- return false;
123
- }
124
- }
125
- if (clicked) clicked.removeClass('clicked');
126
- var win = window.top.frames.main ? window.top.frames.main : window.parent;
127
- if (this.tagName.toLowerCase() == "a") {
128
- clicked = $(this).parent('li').addClass('clicked');
129
- win.location = this.href;
130
- }
131
- else {
132
- clicked = $(this).addClass('clicked');
133
- win.location = $(this).find('a:last').attr('href');
134
- }
135
- return false;
136
- });
165
+ function buildMatchString(searchString, event) {
166
+ caseSensitiveMatch = searchString.match(/[A-Z]/) != null;
167
+ var regexSearchString = RegExp.escape(searchString);
168
+ if (caseSensitiveMatch) {
169
+ regexSearchString += "|" +
170
+ $.map(searchString.split(''), function(e) { return RegExp.escape(e); }).
171
+ join('.+?');
172
+ }
173
+ return regexSearchString;
137
174
  }
138
175
 
139
- function collapse() {
140
- if (!$('#full_list').hasClass('class')) return;
141
- $('#full_list.class a.toggle').click(function() {
142
- $(this).parent().toggleClass('collapsed').next().toggleClass('collapsed');
143
- highlight();
144
- return false;
176
+ function highlight() {
177
+ $('#full_list li:visible').each(function(n) {
178
+ $(this).removeClass('even odd').addClass(n % 2 == 0 ? 'odd' : 'even');
145
179
  });
146
- $('#full_list.class ul').each(function() {
147
- $(this).addClass('collapsed').prev().addClass('collapsed');
148
- });
149
- $('#full_list.class').children().removeClass('collapsed');
150
- highlight();
151
180
  }
152
181
 
153
- function highlight(no_padding) {
154
- var n = 1;
155
- $('#full_list li:visible').each(function() {
156
- var next = n == 1 ? 2 : 1;
157
- $(this).removeClass("r" + next).addClass("r" + n);
158
- if (!no_padding && $('#full_list').hasClass('class')) {
159
- $(this).css('padding-left', (10 + $(this).parents('ul').size() * 15) + 'px');
160
- }
161
- n = next;
162
- });
182
+ /**
183
+ * Expands the tree to the target element and its immediate
184
+ * children.
185
+ */
186
+ function expandTo(path) {
187
+ var $target = $(document.getElementById('object_' + path));
188
+ $target.addClass('clicked');
189
+ $target.removeClass('collapsed');
190
+ $target.parentsUntil('#full_list', 'li').removeClass('collapsed');
191
+ if($target[0]) {
192
+ window.scrollTo(window.scrollX, $target.offset().top - 250);
193
+ highlight();
194
+ }
163
195
  }
164
196
 
165
- function escapeShortcut() {
166
- $(document).keydown(function(evt) {
167
- if (evt.which == 27) {
168
- $('#search_frame', window.top.document).slideUp(100);
169
- $('#search a', window.top.document).removeClass('active inactive');
170
- $(window.top).focus();
171
- }
172
- });
197
+ function windowEvents(event) {
198
+ var msg = event.data;
199
+ if (msg.action === "expand") {
200
+ expandTo(msg.path);
201
+ }
202
+ return false;
173
203
  }
174
204
 
175
- $(escapeShortcut);
176
- $(fullListSearch);
177
- $(linkList);
178
- $(collapse);
205
+ window.addEventListener("message", windowEvents, false);
206
+
207
+ $(document).ready(function() {
208
+ escapeShortcut();
209
+ navResizer();
210
+ enableLinks();
211
+ enableToggles();
212
+ populateSearchCache();
213
+ enableSearch();
214
+ });
215
+
216
+ })();