summaryrefslogtreecommitdiff
path: root/lib/rdoc/generator/template/darkfish/js/darkfish.js
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-05 01:41:25 +0000
commitd42d6e690e3f553b971322eae783ac6b0d4d9692 (patch)
tree2004bf4517ee7b81466c300cf30092e62e65467e /lib/rdoc/generator/template/darkfish/js/darkfish.js
parent670c6e8ce9d4a12bb4832e10fab27365398649bf (diff)
* lib/rdoc.rb, lib/rdoc, test/rdoc: Update to RDoc 4.2.0.alpha(313287)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/generator/template/darkfish/js/darkfish.js')
-rw-r--r--lib/rdoc/generator/template/darkfish/js/darkfish.js43
1 files changed, 32 insertions, 11 deletions
diff --git a/lib/rdoc/generator/template/darkfish/js/darkfish.js b/lib/rdoc/generator/template/darkfish/js/darkfish.js
index 06fef3b215..b789a65631 100644
--- a/lib/rdoc/generator/template/darkfish/js/darkfish.js
+++ b/lib/rdoc/generator/template/darkfish/js/darkfish.js
@@ -44,14 +44,6 @@ function hookSourceViews() {
$('.method-heading').click( showSource );
};
-function toggleDebuggingSection() {
- $('.debugging-section').slideToggle();
-};
-
-function hookDebuggingToggle() {
- $('#debugging-toggle img').click( toggleDebuggingSection );
-};
-
function hookSearch() {
var input = $('#search-field').eq(0);
var result = $('#search-results').eq(0);
@@ -129,12 +121,41 @@ function highlightClickTarget( event ) {
};
};
+function loadAsync(path, success) {
+ $.ajax({
+ url: rdoc_rel_prefix + path,
+ dataType: 'script',
+ success: success,
+ cache: true
+ });
+};
$(document).ready( function() {
hookSourceViews();
- hookDebuggingToggle();
- hookSearch();
highlightLocationTarget();
-
$('ul.link-list a').bind( "click", highlightClickTarget );
+
+ var search_scripts_loaded = {
+ navigation_loaded: false,
+ search_loaded: false,
+ search_index_loaded: false,
+ searcher_loaded: false,
+ }
+
+ var search_success_function = function(variable) {
+ return (function (data, status, xhr) {
+ search_scripts_loaded[variable] = true;
+
+ if (search_scripts_loaded['navigation_loaded'] == true &&
+ search_scripts_loaded['search_loaded'] == true &&
+ search_scripts_loaded['search_index_loaded'] == true &&
+ search_scripts_loaded['searcher_loaded'] == true)
+ hookSearch();
+ });
+ }
+
+ loadAsync('js/navigation.js', search_success_function('navigation_loaded'));
+ loadAsync('js/search.js', search_success_function('search_loaded'));
+ loadAsync('js/search_index.js', search_success_function('search_index_loaded'));
+ loadAsync('js/searcher.js', search_success_function('searcher_loaded'));
});