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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42717ea15b10916a6a8edf195ad8ea170e7ed4b6
4
- data.tar.gz: dc36cbe0dde1587310dd1f7f7b8acb986ed0e76c
3
+ metadata.gz: f77234678d84b3d33b037d9ee4e751b24bdfc6d7
4
+ data.tar.gz: 71bc45162df3b72a4afc35a71a50b0bc60c2af73
5
5
  SHA512:
6
- metadata.gz: 4c0917b87a483e89be53197c16b8ecdc783f167d3e3dc9dd60b03def406f1d40d00061b84041458d82104cceef4df921e2d49e6a49605cdc5d4b1439496f7efb
7
- data.tar.gz: 897658a24ec968849c3924f46b6a9c4f566fe2c4c5db445e54ffe116998df144a7452a14e64fdf17d05acd87235f5ce614899d470085c4d65c8a2b711cf13380
6
+ metadata.gz: 5870241f2cf857d0d056c7ec7d99db4a7d4f60a0ef1076ce839dd3655f380451d742592d6a3d948f22d20ca38f5b856acef4f43cfc883e95d90e25c043e336f7
7
+ data.tar.gz: d017c395743a8251d1422d71cf82304a5036152ce426aabefdc6effe84985787980714a4a9f952de62b64f93a71a52591c0431952fd42bf221ac6a309fce88d8
@@ -1,5 +1,4 @@
1
- var key_cmds = {f: 'fold', u: 'unfold', p: 'prev', n: 'next'};
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
- document.onkeypress = function(e) {
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
  })();
@@ -1,3 +1,3 @@
1
1
  module TreeHtml
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
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.5
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: 2017-12-04 00:00:00.000000000 Z
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.2.2
95
+ rubygems_version: 2.6.8
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: generate plain css tree structure