tree_html 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tree_html/tree_html.js +32 -3
- data/lib/tree_html/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f77234678d84b3d33b037d9ee4e751b24bdfc6d7
|
4
|
+
data.tar.gz: 71bc45162df3b72a4afc35a71a50b0bc60c2af73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5870241f2cf857d0d056c7ec7d99db4a7d4f60a0ef1076ce839dd3655f380451d742592d6a3d948f22d20ca38f5b856acef4f43cfc883e95d90e25c043e336f7
|
7
|
+
data.tar.gz: d017c395743a8251d1422d71cf82304a5036152ce426aabefdc6effe84985787980714a4a9f952de62b64f93a71a52591c0431952fd42bf221ac6a309fce88d8
|
data/lib/tree_html/tree_html.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
var
|
2
|
-
(function(){
|
1
|
+
var TreeHtml = (function(){
|
3
2
|
var cmd, node, action;
|
4
3
|
var id = 0;
|
5
4
|
|
@@ -94,11 +93,41 @@ var key_cmds = {f: 'fold', u: 'unfold', p: 'prev', n: 'next'};
|
|
94
93
|
}
|
95
94
|
};
|
96
95
|
|
97
|
-
|
96
|
+
var key_cmds = {f: 'fold', u: 'unfold', p: 'prev', n: 'next'};
|
97
|
+
|
98
|
+
var resp_keypress = [function(e) {
|
98
99
|
e = e || window.event;
|
99
100
|
(cmd = match_key(e)) &&
|
100
101
|
(action = actions[cmd]) &&
|
101
102
|
(node = hovering()) &&
|
102
103
|
action(node);
|
104
|
+
}];
|
105
|
+
|
106
|
+
document.onkeypress = function(e) {
|
107
|
+
for(var i = 0; i < resp_keypress.length; i++) {
|
108
|
+
resp_keypress[i](e);
|
109
|
+
}
|
110
|
+
};
|
111
|
+
|
112
|
+
return {
|
113
|
+
debug: function() {
|
114
|
+
debugger;
|
115
|
+
},
|
116
|
+
more_onkeypress: function(f) {
|
117
|
+
resp_keypress.push(f);
|
118
|
+
},
|
119
|
+
hover_press: function(key, fun) {
|
120
|
+
var conn = Math.random().toString();
|
121
|
+
key_cmds[key] = conn;
|
122
|
+
actions[conn] = fun;
|
123
|
+
},
|
124
|
+
no_hover_press: function(key) {
|
125
|
+
delete actions[key_cmds[key]];
|
126
|
+
delete key_cmds[key];
|
127
|
+
},
|
128
|
+
sub_hover_press: function(old, neo) {
|
129
|
+
key_cmds[neo] = key_cmds[old];
|
130
|
+
delete key_cmds[old];
|
131
|
+
},
|
103
132
|
};
|
104
133
|
})();
|
data/lib/tree_html/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tree_html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ken
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.6.8
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: generate plain css tree structure
|