Skip to content

Commit cfde4f9

Browse files
committed
Use gem search index instead of global index.
1 parent 4d81a1e commit cfde4f9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/rdoc/generator/template/darkfish/_head.rhtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
<script type="text/javascript">
66
var rdoc_rel_prefix = "<%= asset_rel_prefix %>/";
7+
var index_rel_prefix = "<%= rel_prefix %>/";
78
</script>
89

910
<script src="<%= asset_rel_prefix %>/js/jquery.js"></script>

lib/rdoc/generator/template/darkfish/js/darkfish.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function hookSearch() {
5959
var html = '';
6060

6161
// TODO add relative path to <script> per-page
62-
html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
62+
html += '<p class="search-match"><a href="' + index_rel_prefix + result.path + '">' + this.hlt(result.title);
6363
if (result.params)
6464
html += '<span class="params">' + result.params + '</span>';
6565
html += '</a>';
@@ -121,9 +121,9 @@ function highlightClickTarget( event ) {
121121
};
122122
};
123123

124-
function loadAsync(path, success) {
124+
function loadAsync(path, success, prefix) {
125125
$.ajax({
126-
url: rdoc_rel_prefix + path,
126+
url: prefix + path,
127127
dataType: 'script',
128128
success: success,
129129
cache: true
@@ -154,8 +154,8 @@ $(document).ready( function() {
154154
});
155155
}
156156

157-
loadAsync('js/navigation.js', search_success_function('navigation_loaded'));
158-
loadAsync('js/search.js', search_success_function('search_loaded'));
159-
loadAsync('js/search_index.js', search_success_function('search_index_loaded'));
160-
loadAsync('js/searcher.js', search_success_function('searcher_loaded'));
157+
loadAsync('js/navigation.js', search_success_function('navigation_loaded'), rdoc_rel_prefix);
158+
loadAsync('js/search.js', search_success_function('search_loaded'), rdoc_rel_prefix);
159+
loadAsync('js/search_index.js', search_success_function('search_index_loaded'), index_rel_prefix);
160+
loadAsync('js/searcher.js', search_success_function('searcher_loaded'), rdoc_rel_prefix);
161161
});

0 commit comments

Comments
 (0)