voloko-sdoc 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,21 +37,21 @@ Searchdoc.Navigation = new function() {
|
|
37
37
|
if (!this.navigationActive) return;
|
38
38
|
switch(e.keyCode) {
|
39
39
|
case 37: //Event.KEY_LEFT:
|
40
|
-
this.moveLeft()
|
41
|
-
|
40
|
+
if (this.moveLeft())
|
41
|
+
e.preventDefault();
|
42
42
|
break;
|
43
43
|
case 38: //Event.KEY_UP:
|
44
|
-
this.moveUp()
|
45
|
-
|
44
|
+
if (this.moveUp())
|
45
|
+
e.preventDefault();
|
46
46
|
this.startMoveTimeout(false);
|
47
47
|
break;
|
48
48
|
case 39: //Event.KEY_RIGHT:
|
49
|
-
this.moveRight()
|
50
|
-
|
49
|
+
if (this.moveRight())
|
50
|
+
e.preventDefault();
|
51
51
|
break;
|
52
52
|
case 40: //Event.KEY_DOWN:
|
53
|
-
this.moveDown()
|
54
|
-
|
53
|
+
if (this.moveDown())
|
54
|
+
e.preventDefault();
|
55
55
|
this.startMoveTimeout(true);
|
56
56
|
break;
|
57
57
|
case 9: //Event.KEY_TAB:
|
@@ -89,11 +89,11 @@ Searchdoc.Navigation = new function() {
|
|
89
89
|
}
|
90
90
|
|
91
91
|
this.moveUp = function() {
|
92
|
-
this.move(false);
|
92
|
+
return this.move(false);
|
93
93
|
}
|
94
94
|
|
95
95
|
this.moveDown = function() {
|
96
|
-
this.move(true);
|
96
|
+
return this.move(true);
|
97
97
|
}
|
98
98
|
}
|
99
99
|
|
@@ -205,9 +205,8 @@ Searchdoc.Searcher.prototype = new function() {
|
|
205
205
|
}
|
206
206
|
|
207
207
|
function matchPassRegexp(index, longIndex, queries, regexps) {
|
208
|
-
|
209
|
-
|
210
|
-
if (!index.match(regexps[i]) && !longIndex.match(regexps[i])) return false;
|
208
|
+
for (var i=0, l = regexps.length; i < l; i++) {
|
209
|
+
if (!index.match(regexps[i]) && (i == 0 || !longIndex.indexOf(regexps[i]))) return false;
|
211
210
|
};
|
212
211
|
return true;
|
213
212
|
}
|
@@ -268,7 +267,7 @@ Searchdoc.Searcher.prototype = new function() {
|
|
268
267
|
matchFunc = matchPass1;
|
269
268
|
hltFunc = highlightQuery;
|
270
269
|
} else if (state.pass == 1) {
|
271
|
-
matchFunc =
|
270
|
+
matchFunc = matchPass1;
|
272
271
|
hltFunc = highlightQuery;
|
273
272
|
} else if (state.pass == 2) {
|
274
273
|
matchFunc = matchPassRegexp;
|
@@ -395,6 +394,7 @@ Searchdoc.Panel.prototype = $.extend({}, Searchdoc.Navigation, new function() {
|
|
395
394
|
scrollIntoView($next[0], this.$view[0]);
|
396
395
|
this.$current = $next;
|
397
396
|
}
|
397
|
+
return true;
|
398
398
|
}
|
399
399
|
|
400
400
|
function renderItem(result) {
|
data/lib/sdoc/merge.rb
CHANGED
@@ -51,7 +51,7 @@ class SDoc::Merge
|
|
51
51
|
name,
|
52
52
|
'',
|
53
53
|
'',
|
54
|
-
subtree
|
54
|
+
append_path(subtree, name)
|
55
55
|
]
|
56
56
|
tree << item
|
57
57
|
end
|
@@ -63,6 +63,14 @@ class SDoc::Merge
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
+
def append_path subtree, path
|
67
|
+
subtree.map do |item|
|
68
|
+
item[1] = path + '/' + item[1] unless item[1].empty?
|
69
|
+
item[3] = append_path item[3], path
|
70
|
+
item
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
66
74
|
def merge_search_index
|
67
75
|
items = []
|
68
76
|
@directories.each_with_index do |dir, i|
|
@@ -86,7 +94,10 @@ class SDoc::Merge
|
|
86
94
|
items.sort! do |a, b|
|
87
95
|
a[:info][5] == b[:info][5] ? # type (class/method/file)
|
88
96
|
(a[:info][0] == b[:info][0] ? # or name
|
89
|
-
a[:info][
|
97
|
+
(a[:info][6] == b[:info][6] ? # or doc part
|
98
|
+
a[:info][1] <=> b[:info][1] : # or namespace
|
99
|
+
a[:info][6] <=> b[:info][6]
|
100
|
+
) :
|
90
101
|
a[:info][0] <=> b[:info][0]
|
91
102
|
) :
|
92
103
|
a[:info][5] <=> b[:info][5]
|