voloko-sdoc 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- e.preventDefault();
40
+ if (this.moveLeft())
41
+ e.preventDefault();
42
42
  break;
43
43
  case 38: //Event.KEY_UP:
44
- this.moveUp();
45
- e.preventDefault();
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
- e.preventDefault();
49
+ if (this.moveRight())
50
+ e.preventDefault();
51
51
  break;
52
52
  case 40: //Event.KEY_DOWN:
53
- this.moveDown();
54
- e.preventDefault();
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
- if (!index.match(regexps[0])) return false;
209
- for (var i=1, l = regexps.length; i < l; i++) {
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 = matchPass2;
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][1] <=> b[:info][1] : # or namespace
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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voloko-sdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladimir Kolesnikov