Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/voloko/sdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed Apr 26, 2009
2 parents 9aab8e3 + b7d4ed4 commit 34b4a1e
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 31 deletions.
2 changes: 1 addition & 1 deletion VERSION.yml
@@ -1,4 +1,4 @@
---
:minor: 2
:patch: 11
:patch: 12
:major: 0
41 changes: 27 additions & 14 deletions lib/sdoc/generator/template/direct/resources/js/searchdoc.js
Expand Up @@ -28,6 +28,10 @@ Searchdoc.Navigation = new function() {
case 38: //Event.KEY_UP:
case 39: //Event.KEY_RIGHT:
case 40: //Event.KEY_DOWN:
case 73: // i
case 67: // c (dvorak)
case 75: // k
case 84: // t (dvorak)
this.clearMoveTimeout();
break;
}
Expand All @@ -37,28 +41,33 @@ Searchdoc.Navigation = new function() {
if (!this.navigationActive) return;
switch(e.keyCode) {
case 37: //Event.KEY_LEFT:
if (this.moveLeft())
e.preventDefault();
if (this.moveLeft()) e.preventDefault();
break;
case 38: //Event.KEY_UP:
if (this.moveUp())
e.preventDefault();
this.startMoveTimeout(false);
case 73: // i
case 67: // c (dvorak)
if (e.keyCode == 38 || e.ctrlKey) {
if (this.moveUp()) e.preventDefault();
this.startMoveTimeout(false);
}
break;
case 39: //Event.KEY_RIGHT:
if (this.moveRight())
e.preventDefault();
if (this.moveRight()) e.preventDefault();
break;
case 40: //Event.KEY_DOWN:
if (this.moveDown())
e.preventDefault();
this.startMoveTimeout(true);
case 75: // k
case 84: // t (dvorak)
if (e.keyCode == 40 || e.ctrlKey) {
if (this.moveDown()) e.preventDefault();
this.startMoveTimeout(true);
}
break;
case 9: //Event.KEY_TAB:
case 13: //Event.KEY_RETURN:
if (this.$current) this.select(this.$current);
break;
}
if (e.ctrlKey && e.shiftKey) this.select(this.$current);
}

this.clearMoveTimeout = function() {
Expand Down Expand Up @@ -464,10 +473,14 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {
}

this.select = function($li) {
this.highlight($li);
var path = $li[0].searchdoc_tree_data.path;
if (path) this.panel.open(path);
}

this.highlight = function($li) {
if (this.$current) this.$current.removeClass('current');
this.$current = $li.addClass('current');
if (path) this.panel.open(path);
}

this.toggle = function($li) {
Expand All @@ -481,7 +494,7 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {

this.moveRight = function() {
if (!this.$current) {
this.select(this.$list.find('li:first'));
this.highlight(this.$list.find('li:first'));
return;
}
if (this.$current.hasClass('closed')) {
Expand All @@ -491,7 +504,7 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {

this.moveLeft = function() {
if (!this.$current) {
this.select(this.$list.find('li:first'));
this.highlight(this.$list.find('li:first'));
return;
}
if (!this.$current.hasClass('closed')) {
Expand All @@ -509,7 +522,7 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {

this.move = function(isDown) {
if (!this.$current) {
this.select(this.$list.find('li:first'));
this.highlight(this.$list.find('li:first'));
return true;
}
var next = this.$current[0];
Expand Down
41 changes: 27 additions & 14 deletions lib/sdoc/generator/template/shtml/resources/js/searchdoc.js
Expand Up @@ -28,6 +28,10 @@ Searchdoc.Navigation = new function() {
case 38: //Event.KEY_UP:
case 39: //Event.KEY_RIGHT:
case 40: //Event.KEY_DOWN:
case 73: // i
case 67: // c (dvorak)
case 75: // k
case 84: // t (dvorak)
this.clearMoveTimeout();
break;
}
Expand All @@ -37,28 +41,33 @@ Searchdoc.Navigation = new function() {
if (!this.navigationActive) return;
switch(e.keyCode) {
case 37: //Event.KEY_LEFT:
if (this.moveLeft())
e.preventDefault();
if (this.moveLeft()) e.preventDefault();
break;
case 38: //Event.KEY_UP:
if (this.moveUp())
e.preventDefault();
this.startMoveTimeout(false);
case 73: // i
case 67: // c (dvorak)
if (e.keyCode == 38 || e.ctrlKey) {
if (this.moveUp()) e.preventDefault();
this.startMoveTimeout(false);
}
break;
case 39: //Event.KEY_RIGHT:
if (this.moveRight())
e.preventDefault();
if (this.moveRight()) e.preventDefault();
break;
case 40: //Event.KEY_DOWN:
if (this.moveDown())
e.preventDefault();
this.startMoveTimeout(true);
case 75: // k
case 84: // t (dvorak)
if (e.keyCode == 40 || e.ctrlKey) {
if (this.moveDown()) e.preventDefault();
this.startMoveTimeout(true);
}
break;
case 9: //Event.KEY_TAB:
case 13: //Event.KEY_RETURN:
if (this.$current) this.select(this.$current);
break;
}
if (e.ctrlKey && e.shiftKey) this.select(this.$current);
}

this.clearMoveTimeout = function() {
Expand Down Expand Up @@ -464,10 +473,14 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {
}

this.select = function($li) {
this.highlight($li);
var path = $li[0].searchdoc_tree_data.path;
if (path) this.panel.open(path);
}

this.highlight = function($li) {
if (this.$current) this.$current.removeClass('current');
this.$current = $li.addClass('current');
if (path) this.panel.open(path);
}

this.toggle = function($li) {
Expand All @@ -481,7 +494,7 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {

this.moveRight = function() {
if (!this.$current) {
this.select(this.$list.find('li:first'));
this.highlight(this.$list.find('li:first'));
return;
}
if (this.$current.hasClass('closed')) {
Expand All @@ -491,7 +504,7 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {

this.moveLeft = function() {
if (!this.$current) {
this.select(this.$list.find('li:first'));
this.highlight(this.$list.find('li:first'));
return;
}
if (!this.$current.hasClass('closed')) {
Expand All @@ -509,7 +522,7 @@ Searchdoc.Tree.prototype = $.extend({}, Searchdoc.Navigation, new function() {

this.move = function(isDown) {
if (!this.$current) {
this.select(this.$list.find('li:first'));
this.highlight(this.$list.find('li:first'));
return true;
}
var next = this.$current[0];
Expand Down
4 changes: 2 additions & 2 deletions sdoc.gemspec
Expand Up @@ -2,11 +2,11 @@

Gem::Specification.new do |s|
s.name = %q{sdoc}
s.version = "0.2.11.1"
s.version = "0.2.12.1"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Volodya Kolesnikov"]
s.date = %q{2009-04-21}
s.date = %q{2009-04-24}
s.email = %q{voloko@gmail.com}
s.executables = ["sdoc", "sdoc-merge"]
s.extra_rdoc_files = [
Expand Down

0 comments on commit 34b4a1e

Please sign in to comment.