my_yard 0.0.3 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/GlobalSettings.rb +23 -0
- data/{src → lib}/MyYard.rb +47 -52
- data/{src → lib}/YardTheme.rb +12 -9
- data/{src → lib}/glade/MyYard.glade +151 -213
- data/{src → lib}/glade/YardTheme.glade +314 -407
- data/lib/my_yard.rb +7 -0
- data/my_yard +59 -34
- metadata +21 -148
- data/README.md +0 -25
- data/doc/GlobalSettings.html +0 -552
- data/doc/MyYard.html +0 -1201
- data/doc/TreeContext/Alternator.html +0 -297
- data/doc/TreeContext.html +0 -467
- data/doc/YardTheme.html +0 -746
- data/doc/YardThemeDefaults.html +0 -498
- data/doc/_index.html +0 -170
- data/doc/class_and_method_list.html +0 -322
- data/doc/class_list.html +0 -51
- data/doc/css/common.css +0 -45
- data/doc/css/full_list.css +0 -58
- data/doc/css/style.css +0 -474
- data/doc/file.README.html +0 -100
- data/doc/file_list.html +0 -56
- data/doc/frames.html +0 -17
- data/doc/img/logo.png +0 -0
- data/doc/index.html +0 -100
- data/doc/js/app.js +0 -243
- data/doc/js/full_list.js +0 -216
- data/doc/js/jquery.js +0 -4
- data/doc/just_file_list.html +0 -40
- data/doc/method_list.html +0 -843
- data/doc/top-level-namespace.html +0 -118
- data/home_my_yard/templates/visualruby/class/dot/superklass.erb +0 -3
- data/home_my_yard/templates/visualruby/class/html/constructor_details.erb +0 -8
- data/home_my_yard/templates/visualruby/class/html/subclasses.erb +0 -4
- data/home_my_yard/templates/visualruby/class/text/subclasses.erb +0 -5
- data/home_my_yard/templates/visualruby/constant/text/header.erb +0 -11
- data/home_my_yard/templates/visualruby/docstring/html/abstract.erb +0 -4
- data/home_my_yard/templates/visualruby/docstring/html/deprecated.erb +0 -1
- data/home_my_yard/templates/visualruby/docstring/html/index.erb +0 -5
- data/home_my_yard/templates/visualruby/docstring/html/note.erb +0 -6
- data/home_my_yard/templates/visualruby/docstring/html/private.erb +0 -4
- data/home_my_yard/templates/visualruby/docstring/html/returns_void.erb +0 -1
- data/home_my_yard/templates/visualruby/docstring/html/text.erb +0 -1
- data/home_my_yard/templates/visualruby/docstring/html/todo.erb +0 -6
- data/home_my_yard/templates/visualruby/docstring/text/abstract.erb +0 -2
- data/home_my_yard/templates/visualruby/docstring/text/deprecated.erb +0 -2
- data/home_my_yard/templates/visualruby/docstring/text/index.erb +0 -2
- data/home_my_yard/templates/visualruby/docstring/text/note.erb +0 -4
- data/home_my_yard/templates/visualruby/docstring/text/private.erb +0 -2
- data/home_my_yard/templates/visualruby/docstring/text/returns_void.erb +0 -1
- data/home_my_yard/templates/visualruby/docstring/text/text.erb +0 -1
- data/home_my_yard/templates/visualruby/docstring/text/todo.erb +0 -4
- data/home_my_yard/templates/visualruby/fulldoc/html/class_and_method.erb +0 -42
- data/home_my_yard/templates/visualruby/fulldoc/html/css/common.css +0 -1
- data/home_my_yard/templates/visualruby/fulldoc/html/css/full_list.css +0 -62
- data/home_my_yard/templates/visualruby/fulldoc/html/css/style.css +0 -476
- data/home_my_yard/templates/visualruby/fulldoc/html/frames.erb +0 -17
- data/home_my_yard/templates/visualruby/fulldoc/html/full_list.erb +0 -37
- data/home_my_yard/templates/visualruby/fulldoc/html/full_list_class.erb +0 -2
- data/home_my_yard/templates/visualruby/fulldoc/html/full_list_file.erb +0 -7
- data/home_my_yard/templates/visualruby/fulldoc/html/full_list_method.erb +0 -10
- data/home_my_yard/templates/visualruby/fulldoc/html/js/app.js +0 -243
- data/home_my_yard/templates/visualruby/fulldoc/html/js/full_list.js +0 -213
- data/home_my_yard/templates/visualruby/fulldoc/html/js/jquery.js +0 -4
- data/home_my_yard/templates/visualruby/fulldoc/html/just_files.erb +0 -33
- data/home_my_yard/templates/visualruby/layout/dot/header.erb +0 -6
- data/home_my_yard/templates/visualruby/layout/html/breadcrumb.erb +0 -11
- data/home_my_yard/templates/visualruby/layout/html/files.erb +0 -11
- data/home_my_yard/templates/visualruby/layout/html/footer.erb +0 -5
- data/home_my_yard/templates/visualruby/layout/html/headers.erb +0 -15
- data/home_my_yard/templates/visualruby/layout/html/index.erb +0 -2
- data/home_my_yard/templates/visualruby/layout/html/layout.erb +0 -30
- data/home_my_yard/templates/visualruby/layout/html/listing.erb +0 -4
- data/home_my_yard/templates/visualruby/layout/html/objects.erb +0 -32
- data/home_my_yard/templates/visualruby/layout/html/script_setup.erb +0 -4
- data/home_my_yard/templates/visualruby/layout/html/search.erb +0 -13
- data/home_my_yard/templates/visualruby/method/html/header.erb +0 -17
- data/home_my_yard/templates/visualruby/method/text/header.erb +0 -1
- data/home_my_yard/templates/visualruby/method_details/html/header.erb +0 -3
- data/home_my_yard/templates/visualruby/method_details/html/method_signature.erb +0 -25
- data/home_my_yard/templates/visualruby/method_details/html/source.erb +0 -10
- data/home_my_yard/templates/visualruby/method_details/text/header.erb +0 -10
- data/home_my_yard/templates/visualruby/method_details/text/method_signature.erb +0 -12
- data/home_my_yard/templates/visualruby/module/dot/child.erb +0 -1
- data/home_my_yard/templates/visualruby/module/dot/dependencies.erb +0 -3
- data/home_my_yard/templates/visualruby/module/dot/header.erb +0 -6
- data/home_my_yard/templates/visualruby/module/dot/info.erb +0 -14
- data/home_my_yard/templates/visualruby/module/html/attribute_details.erb +0 -10
- data/home_my_yard/templates/visualruby/module/html/attribute_summary.erb +0 -8
- data/home_my_yard/templates/visualruby/module/html/box_info.erb +0 -43
- data/home_my_yard/templates/visualruby/module/html/children.erb +0 -8
- data/home_my_yard/templates/visualruby/module/html/constant_summary.erb +0 -13
- data/home_my_yard/templates/visualruby/module/html/defines.erb +0 -3
- data/home_my_yard/templates/visualruby/module/html/header.erb +0 -5
- data/home_my_yard/templates/visualruby/module/html/inherited_attributes.erb +0 -14
- data/home_my_yard/templates/visualruby/module/html/inherited_constants.erb +0 -8
- data/home_my_yard/templates/visualruby/module/html/inherited_methods.erb +0 -19
- data/home_my_yard/templates/visualruby/module/html/item_summary.erb +0 -40
- data/home_my_yard/templates/visualruby/module/html/method_details_list.erb +0 -9
- data/home_my_yard/templates/visualruby/module/html/method_summary.erb +0 -14
- data/home_my_yard/templates/visualruby/module/html/methodmissing.erb +0 -12
- data/home_my_yard/templates/visualruby/module/html/pre_docstring.erb +0 -1
- data/home_my_yard/templates/visualruby/module/text/children.erb +0 -10
- data/home_my_yard/templates/visualruby/module/text/class_meths_list.erb +0 -8
- data/home_my_yard/templates/visualruby/module/text/extends.erb +0 -8
- data/home_my_yard/templates/visualruby/module/text/header.erb +0 -7
- data/home_my_yard/templates/visualruby/module/text/includes.erb +0 -8
- data/home_my_yard/templates/visualruby/module/text/instance_meths_list.erb +0 -8
- data/home_my_yard/templates/visualruby/onefile/html/files.erb +0 -5
- data/home_my_yard/templates/visualruby/onefile/html/headers.erb +0 -6
- data/home_my_yard/templates/visualruby/onefile/html/layout.erb +0 -17
- data/home_my_yard/templates/visualruby/onefile/html/readme.erb +0 -3
- data/home_my_yard/templates/visualruby/root/dot/child.erb +0 -3
- data/home_my_yard/templates/visualruby/tags/html/example.erb +0 -11
- data/home_my_yard/templates/visualruby/tags/html/index.erb +0 -3
- data/home_my_yard/templates/visualruby/tags/html/option.erb +0 -24
- data/home_my_yard/templates/visualruby/tags/html/overload.erb +0 -14
- data/home_my_yard/templates/visualruby/tags/html/see.erb +0 -8
- data/home_my_yard/templates/visualruby/tags/html/tag.erb +0 -20
- data/home_my_yard/templates/visualruby/tags/text/example.erb +0 -12
- data/home_my_yard/templates/visualruby/tags/text/index.erb +0 -1
- data/home_my_yard/templates/visualruby/tags/text/option.erb +0 -20
- data/home_my_yard/templates/visualruby/tags/text/overload.erb +0 -19
- data/home_my_yard/templates/visualruby/tags/text/see.erb +0 -11
- data/home_my_yard/templates/visualruby/tags/text/tag.erb +0 -13
- data/home_my_yard/themes/visualruby.yaml +0 -47
- data/my_yard-0.0.2.gem +0 -0
- data/my_yard.gemspec +0 -20
- data/notes +0 -9
- data/src/GlobalSettings.rb +0 -22
- data/src/glade/MyYard.glade~ +0 -611
- data/src/glade/YardTheme.glade~ +0 -1062
- /data/{src → lib}/YardThemeDefaults.rb +0 -0
@@ -1,243 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
var localStorage = {}, sessionStorage = {};
|
4
|
-
try { localStorage = window.localStorage; } catch (e) { }
|
5
|
-
try { sessionStorage = window.sessionStorage; } catch (e) { }
|
6
|
-
|
7
|
-
function createSourceLinks() {
|
8
|
-
$('.method_details_list .source_code').
|
9
|
-
before("<span class='showSource'>[<a href='#' class='toggleSource'>View source</a>]</span>");
|
10
|
-
$('.toggleSource').toggle(function() {
|
11
|
-
$(this).parent().nextAll('.source_code').slideDown(100);
|
12
|
-
$(this).text("Hide source");
|
13
|
-
},
|
14
|
-
function() {
|
15
|
-
$(this).parent().nextAll('.source_code').slideUp(100);
|
16
|
-
$(this).text("View source");
|
17
|
-
});
|
18
|
-
}
|
19
|
-
|
20
|
-
function createDefineLinks() {
|
21
|
-
var tHeight = 0;
|
22
|
-
$('.defines').after(" <a href='#' class='toggleDefines'>more...</a>");
|
23
|
-
$('.toggleDefines').toggle(function() {
|
24
|
-
tHeight = $(this).parent().prev().height();
|
25
|
-
$(this).prev().css('display', 'inline');
|
26
|
-
$(this).parent().prev().height($(this).parent().height());
|
27
|
-
$(this).text("(less)");
|
28
|
-
},
|
29
|
-
function() {
|
30
|
-
$(this).prev().hide();
|
31
|
-
$(this).parent().prev().height(tHeight);
|
32
|
-
$(this).text("more...");
|
33
|
-
});
|
34
|
-
}
|
35
|
-
|
36
|
-
function createFullTreeLinks() {
|
37
|
-
var tHeight = 0;
|
38
|
-
$('.inheritanceTree').toggle(function() {
|
39
|
-
tHeight = $(this).parent().prev().height();
|
40
|
-
$(this).parent().toggleClass('showAll');
|
41
|
-
$(this).text("(hide)");
|
42
|
-
$(this).parent().prev().height($(this).parent().height());
|
43
|
-
},
|
44
|
-
function() {
|
45
|
-
$(this).parent().toggleClass('showAll');
|
46
|
-
$(this).parent().prev().height(tHeight);
|
47
|
-
$(this).text("show all");
|
48
|
-
});
|
49
|
-
}
|
50
|
-
|
51
|
-
function searchFrameButtons() {
|
52
|
-
$('.full_list_link').click(function() {
|
53
|
-
toggleSearchFrame(this, $(this).attr('href'));
|
54
|
-
return false;
|
55
|
-
});
|
56
|
-
window.addEventListener('message', function(e) {
|
57
|
-
if (e.data === 'navEscape') {
|
58
|
-
$('#search_frame').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
|
-
$('#search_frame').slideUp(100);
|
67
|
-
$('#search a').removeClass('active inactive');
|
68
|
-
$(window).focus();
|
69
|
-
}
|
70
|
-
});
|
71
|
-
}
|
72
|
-
|
73
|
-
function toggleSearchFrame(id, link) {
|
74
|
-
var frame = $('#search_frame');
|
75
|
-
$('#search a').removeClass('active').addClass('inactive');
|
76
|
-
if (frame.attr('src') === link && frame.css('display') !== "none") {
|
77
|
-
frame.slideUp(100);
|
78
|
-
$('#search a').removeClass('active inactive');
|
79
|
-
}
|
80
|
-
else {
|
81
|
-
$(id).addClass('active').removeClass('inactive');
|
82
|
-
if (frame.attr('src') !== link) frame.attr('src', link);
|
83
|
-
frame.slideDown(100);
|
84
|
-
}
|
85
|
-
}
|
86
|
-
|
87
|
-
function linkSummaries() {
|
88
|
-
$('.summary_signature').click(function() {
|
89
|
-
document.location = $(this).find('a').attr('href');
|
90
|
-
});
|
91
|
-
}
|
92
|
-
|
93
|
-
function summaryToggle() {
|
94
|
-
$('.summary_toggle').click(function(e) {
|
95
|
-
e.preventDefault();
|
96
|
-
localStorage.summaryCollapsed = $(this).text();
|
97
|
-
$('.summary_toggle').each(function() {
|
98
|
-
$(this).text($(this).text() == "collapse" ? "expand" : "collapse");
|
99
|
-
var next = $(this).parent().parent().nextAll('ul.summary').first();
|
100
|
-
if (next.hasClass('compact')) {
|
101
|
-
next.toggle();
|
102
|
-
next.nextAll('ul.summary').first().toggle();
|
103
|
-
}
|
104
|
-
else if (next.hasClass('summary')) {
|
105
|
-
var list = $('<ul class="summary compact" />');
|
106
|
-
list.html(next.html());
|
107
|
-
list.find('.summary_desc, .note').remove();
|
108
|
-
list.find('a').each(function() {
|
109
|
-
$(this).html($(this).find('strong').html());
|
110
|
-
$(this).parent().html($(this)[0].outerHTML);
|
111
|
-
});
|
112
|
-
next.before(list);
|
113
|
-
next.toggle();
|
114
|
-
}
|
115
|
-
});
|
116
|
-
return false;
|
117
|
-
});
|
118
|
-
if (localStorage.summaryCollapsed == "collapse") {
|
119
|
-
$('.summary_toggle').first().click();
|
120
|
-
} else { localStorage.summaryCollapsed = "expand"; }
|
121
|
-
}
|
122
|
-
|
123
|
-
function generateTOC() {
|
124
|
-
if ($('#filecontents').length === 0) return;
|
125
|
-
var _toc = $('<ol class="top"></ol>');
|
126
|
-
var show = false;
|
127
|
-
var toc = _toc;
|
128
|
-
var counter = 0;
|
129
|
-
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
130
|
-
var i;
|
131
|
-
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
132
|
-
for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
|
133
|
-
var lastTag = parseInt(tags[0][1], 10);
|
134
|
-
$(tags.join(', ')).each(function() {
|
135
|
-
if ($(this).parents('.method_details .docstring').length != 0) return;
|
136
|
-
if (this.id == "filecontents") return;
|
137
|
-
show = true;
|
138
|
-
var thisTag = parseInt(this.tagName[1], 10);
|
139
|
-
if (this.id.length === 0) {
|
140
|
-
var proposedId = $(this).attr('toc-id');
|
141
|
-
if (typeof(proposedId) != "undefined") this.id = proposedId;
|
142
|
-
else {
|
143
|
-
var proposedId = $(this).text().replace(/[^a-z0-9-]/ig, '_');
|
144
|
-
if ($('#' + proposedId).length > 0) { proposedId += counter; counter++; }
|
145
|
-
this.id = proposedId;
|
146
|
-
}
|
147
|
-
}
|
148
|
-
if (thisTag > lastTag) {
|
149
|
-
for (i = 0; i < thisTag - lastTag; i++) {
|
150
|
-
var tmp = $('<ol/>'); toc.append(tmp); toc = tmp;
|
151
|
-
}
|
152
|
-
}
|
153
|
-
if (thisTag < lastTag) {
|
154
|
-
for (i = 0; i < lastTag - thisTag; i++) toc = toc.parent();
|
155
|
-
}
|
156
|
-
var title = $(this).attr('toc-title');
|
157
|
-
if (typeof(title) == "undefined") title = $(this).text();
|
158
|
-
toc.append('<li><a href="#' + this.id + '">' + title + '</a></li>');
|
159
|
-
lastTag = thisTag;
|
160
|
-
});
|
161
|
-
if (!show) return;
|
162
|
-
html = '<div id="toc"><p class="title hide_toc"><a href="#"><strong>Table of Contents</strong></a></p></div>';
|
163
|
-
$('#content').prepend(html);
|
164
|
-
$('#toc').append(_toc);
|
165
|
-
$('#toc .hide_toc').toggle(function() {
|
166
|
-
$('#toc .top').slideUp('fast');
|
167
|
-
$('#toc').toggleClass('hidden');
|
168
|
-
$('#toc .title small').toggle();
|
169
|
-
}, function() {
|
170
|
-
$('#toc .top').slideDown('fast');
|
171
|
-
$('#toc').toggleClass('hidden');
|
172
|
-
$('#toc .title small').toggle();
|
173
|
-
});
|
174
|
-
}
|
175
|
-
|
176
|
-
function navResizeFn(e) {
|
177
|
-
if (e.which !== 1) {
|
178
|
-
navResizeFnStop();
|
179
|
-
return;
|
180
|
-
}
|
181
|
-
|
182
|
-
sessionStorage.navWidth = e.pageX.toString();
|
183
|
-
$('.nav_wrap').css('width', e.pageX);
|
184
|
-
$('.nav_wrap').css('-ms-flex', 'inherit');
|
185
|
-
}
|
186
|
-
|
187
|
-
function navResizeFnStop() {
|
188
|
-
$(window).unbind('mousemove', navResizeFn);
|
189
|
-
window.removeEventListener('message', navMessageFn, false);
|
190
|
-
}
|
191
|
-
|
192
|
-
function navMessageFn(e) {
|
193
|
-
if (e.data.action === 'mousemove') navResizeFn(e.data.event);
|
194
|
-
if (e.data.action === 'mouseup') navResizeFnStop();
|
195
|
-
}
|
196
|
-
|
197
|
-
function navResizer() {
|
198
|
-
$('#resizer').mousedown(function(e) {
|
199
|
-
e.preventDefault();
|
200
|
-
$(window).mousemove(navResizeFn);
|
201
|
-
window.addEventListener('message', navMessageFn, false);
|
202
|
-
});
|
203
|
-
$(window).mouseup(navResizeFnStop);
|
204
|
-
|
205
|
-
if (sessionStorage.navWidth) {
|
206
|
-
navResizeFn({which: 1, pageX: parseInt(sessionStorage.navWidth, 10)});
|
207
|
-
}
|
208
|
-
}
|
209
|
-
|
210
|
-
function navExpander() {
|
211
|
-
var done = false, timer = setTimeout(postMessage, 500);
|
212
|
-
function postMessage() {
|
213
|
-
if (done) return;
|
214
|
-
clearTimeout(timer);
|
215
|
-
var opts = { action: 'expand', path: pathId };
|
216
|
-
document.getElementById('nav').contentWindow.postMessage(opts, '*');
|
217
|
-
done = true;
|
218
|
-
}
|
219
|
-
|
220
|
-
window.addEventListener('message', function(event) {
|
221
|
-
if (event.data === 'navReady') postMessage();
|
222
|
-
return false;
|
223
|
-
}, false);
|
224
|
-
}
|
225
|
-
|
226
|
-
function mainFocus() {
|
227
|
-
$('#main')[0].focus();
|
228
|
-
}
|
229
|
-
|
230
|
-
$(document).ready(function() {
|
231
|
-
navResizer();
|
232
|
-
navExpander();
|
233
|
-
createSourceLinks();
|
234
|
-
createDefineLinks();
|
235
|
-
createFullTreeLinks();
|
236
|
-
searchFrameButtons();
|
237
|
-
linkSummaries();
|
238
|
-
summaryToggle();
|
239
|
-
generateTOC();
|
240
|
-
mainFocus();
|
241
|
-
});
|
242
|
-
|
243
|
-
})();
|
@@ -1,213 +0,0 @@
|
|
1
|
-
(function() {
|
2
|
-
|
3
|
-
var $clicked = $(null);
|
4
|
-
var searchTimeout = null;
|
5
|
-
var searchCache = [];
|
6
|
-
var caseSensitiveMatch = false;
|
7
|
-
var ignoreKeyCodeMin = 8;
|
8
|
-
var ignoreKeyCodeMax = 46;
|
9
|
-
var commandKey = 91;
|
10
|
-
|
11
|
-
RegExp.escape = function(text) {
|
12
|
-
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
13
|
-
}
|
14
|
-
|
15
|
-
function escapeShortcut() {
|
16
|
-
$(document).keydown(function(evt) {
|
17
|
-
if (evt.which == 27) {
|
18
|
-
window.parent.postMessage('navEscape', '*');
|
19
|
-
}
|
20
|
-
});
|
21
|
-
}
|
22
|
-
|
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
|
-
|
46
|
-
if (evt.target.tagName === 'A') return true;
|
47
|
-
|
48
|
-
var elem = $clicked.find('> .item .object_link a')[0];
|
49
|
-
var e = evt.originalEvent;
|
50
|
-
var newEvent = new MouseEvent(evt.originalEvent.type);
|
51
|
-
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);
|
52
|
-
elem.dispatchEvent(newEvent);
|
53
|
-
});
|
54
|
-
}
|
55
|
-
|
56
|
-
function enableToggles() {
|
57
|
-
// show/hide nested classes on toggle click
|
58
|
-
$('#full_list a.toggle').on('click', function(evt) {
|
59
|
-
evt.stopPropagation();
|
60
|
-
evt.preventDefault();
|
61
|
-
$(this).parent().parent().toggleClass('collapsed');
|
62
|
-
highlight();
|
63
|
-
});
|
64
|
-
}
|
65
|
-
|
66
|
-
function populateSearchCache() {
|
67
|
-
$('#full_list li .item').each(function() {
|
68
|
-
var $node = $(this);
|
69
|
-
var $link = $node.find('.object_link a');
|
70
|
-
if ($link.length > 0) {
|
71
|
-
searchCache.push({
|
72
|
-
node: $node,
|
73
|
-
link: $link,
|
74
|
-
name: $link.text(),
|
75
|
-
fullName: $link.attr('title').split(' ')[0]
|
76
|
-
});
|
77
|
-
}
|
78
|
-
});
|
79
|
-
}
|
80
|
-
|
81
|
-
function enableSearch() {
|
82
|
-
$('#search input').keyup(function(event) {
|
83
|
-
if (ignoredKeyPress(event)) return;
|
84
|
-
if (this.value === "") {
|
85
|
-
clearSearch();
|
86
|
-
} else {
|
87
|
-
performSearch(this.value);
|
88
|
-
}
|
89
|
-
});
|
90
|
-
|
91
|
-
$('#full_list').after("<div id='noresults' style='display:none'></div>");
|
92
|
-
}
|
93
|
-
|
94
|
-
function ignoredKeyPress(event) {
|
95
|
-
if (
|
96
|
-
(event.keyCode > ignoreKeyCodeMin && event.keyCode < ignoreKeyCodeMax) ||
|
97
|
-
(event.keyCode == commandKey)
|
98
|
-
) {
|
99
|
-
return true;
|
100
|
-
} else {
|
101
|
-
return false;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
|
105
|
-
function clearSearch() {
|
106
|
-
clearSearchTimeout();
|
107
|
-
$('#full_list .found').removeClass('found').each(function() {
|
108
|
-
var $link = $(this).find('.object_link a');
|
109
|
-
$link.text($link.text());
|
110
|
-
});
|
111
|
-
$('#full_list, #content').removeClass('insearch');
|
112
|
-
$clicked.parents().removeClass('collapsed');
|
113
|
-
highlight();
|
114
|
-
}
|
115
|
-
|
116
|
-
function performSearch(searchString) {
|
117
|
-
clearSearchTimeout();
|
118
|
-
$('#full_list, #content').addClass('insearch');
|
119
|
-
$('#noresults').text('').hide();
|
120
|
-
partialSearch(searchString, 0);
|
121
|
-
}
|
122
|
-
|
123
|
-
function partialSearch(searchString, offset) {
|
124
|
-
var lastRowClass = '';
|
125
|
-
var i = null;
|
126
|
-
for (i = offset; i < Math.min(offset + 50, searchCache.length); i++) {
|
127
|
-
var item = searchCache[i];
|
128
|
-
var searchName = (searchString.indexOf('::') != -1 ? item.fullName : item.name);
|
129
|
-
var matchString = buildMatchString(searchString);
|
130
|
-
var matchRegexp = new RegExp(matchString, caseSensitiveMatch ? "" : "i");
|
131
|
-
if (searchName.match(matchRegexp) == null) {
|
132
|
-
item.node.removeClass('found');
|
133
|
-
item.link.text(item.link.text());
|
134
|
-
}
|
135
|
-
else {
|
136
|
-
item.node.addClass('found');
|
137
|
-
item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1');
|
138
|
-
lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2';
|
139
|
-
item.link.html(item.name.replace(matchRegexp, "<strong>$&</strong>"));
|
140
|
-
}
|
141
|
-
}
|
142
|
-
if(i == searchCache.length) {
|
143
|
-
searchDone();
|
144
|
-
} else {
|
145
|
-
searchTimeout = setTimeout(function() {
|
146
|
-
partialSearch(searchString, i);
|
147
|
-
}, 0);
|
148
|
-
}
|
149
|
-
}
|
150
|
-
|
151
|
-
function searchDone() {
|
152
|
-
searchTimeout = null;
|
153
|
-
highlight();
|
154
|
-
if ($('#full_list li:visible').size() === 0) {
|
155
|
-
$('#noresults').text('No results were found.').hide().fadeIn();
|
156
|
-
} else {
|
157
|
-
$('#noresults').text('').hide();
|
158
|
-
}
|
159
|
-
$('#content').removeClass('insearch');
|
160
|
-
}
|
161
|
-
|
162
|
-
function buildMatchString(searchString, event) {
|
163
|
-
caseSensitiveMatch = searchString.match(/[A-Z]/) != null;
|
164
|
-
var regexSearchString = RegExp.escape(searchString);
|
165
|
-
if (caseSensitiveMatch) {
|
166
|
-
regexSearchString += "|" +
|
167
|
-
$.map(searchString.split(''), function(e) { return RegExp.escape(e); }).
|
168
|
-
join('.+?');
|
169
|
-
}
|
170
|
-
return regexSearchString;
|
171
|
-
}
|
172
|
-
|
173
|
-
function highlight() {
|
174
|
-
$('#full_list li:visible').each(function(n) {
|
175
|
-
$(this).removeClass('even odd').addClass(n % 2 == 0 ? 'odd' : 'even');
|
176
|
-
});
|
177
|
-
}
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Expands the tree to the target element and its immediate
|
181
|
-
* children.
|
182
|
-
*/
|
183
|
-
function expandTo(path) {
|
184
|
-
var $target = $(document.getElementById('object_' + path));
|
185
|
-
$target.addClass('clicked');
|
186
|
-
$target.removeClass('collapsed');
|
187
|
-
$target.parentsUntil('#full_list', 'li').removeClass('collapsed');
|
188
|
-
if($target[0]) {
|
189
|
-
window.scrollTo(window.scrollX, $target.offset().top - 250);
|
190
|
-
highlight();
|
191
|
-
}
|
192
|
-
}
|
193
|
-
|
194
|
-
function windowEvents(event) {
|
195
|
-
var msg = event.data;
|
196
|
-
if (msg.action === "expand") {
|
197
|
-
expandTo(msg.path);
|
198
|
-
}
|
199
|
-
return false;
|
200
|
-
}
|
201
|
-
|
202
|
-
window.addEventListener("message", windowEvents, false);
|
203
|
-
|
204
|
-
$(document).ready(function() {
|
205
|
-
escapeShortcut();
|
206
|
-
navResizer();
|
207
|
-
enableLinks();
|
208
|
-
enableToggles();
|
209
|
-
populateSearchCache();
|
210
|
-
enableSearch();
|
211
|
-
});
|
212
|
-
|
213
|
-
})();
|