resin 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/amber/css/amber-normalize.css +73 -73
- data/amber/css/amber-normalize.less +1 -1
- data/amber/css/amber.css +106 -106
- data/amber/css/helios.css +242 -0
- data/amber/images/hsplitter.png +0 -0
- data/amber/images/vsplitter.png +0 -0
- data/amber/js/Benchfib.deploy.js +116 -38
- data/amber/js/Benchfib.js +120 -42
- data/amber/js/Canvas.deploy.js +674 -403
- data/amber/js/Canvas.js +682 -411
- data/amber/js/Compiler-AST.deploy.js +1150 -0
- data/amber/js/Compiler-AST.js +1591 -0
- data/amber/js/Compiler-Core.deploy.js +1562 -0
- data/amber/js/Compiler-Core.js +1972 -0
- data/amber/js/Compiler-Exceptions.deploy.js +114 -0
- data/amber/js/Compiler-Exceptions.js +161 -0
- data/amber/js/Compiler-IR.deploy.js +2326 -0
- data/amber/js/Compiler-IR.js +3146 -0
- data/amber/js/Compiler-Inlining.deploy.js +1147 -0
- data/amber/js/Compiler-Inlining.js +1514 -0
- data/amber/js/Compiler-Semantic.deploy.js +1207 -0
- data/amber/js/Compiler-Semantic.js +1628 -0
- data/amber/js/Compiler-Tests.deploy.js +646 -60
- data/amber/js/Compiler-Tests.js +843 -82
- data/amber/js/Compiler.deploy.js +1097 -159
- data/amber/js/Compiler.js +1414 -161
- data/amber/js/Examples.deploy.js +31 -15
- data/amber/js/Examples.js +33 -17
- data/amber/js/Helios-Announcements.deploy.js +127 -0
- data/amber/js/Helios-Announcements.js +157 -0
- data/amber/js/Helios-Browser.deploy.js +1473 -0
- data/amber/js/Helios-Browser.js +1953 -0
- data/amber/js/Helios-Commands.deploy.js +403 -0
- data/amber/js/Helios-Commands.js +563 -0
- data/amber/js/Helios-Core.deploy.js +1070 -0
- data/amber/js/Helios-Core.js +1445 -0
- data/amber/js/Helios-Environments.deploy.js +132 -0
- data/amber/js/Helios-Environments.js +179 -0
- data/amber/js/Helios-Inspector.deploy.js +855 -0
- data/amber/js/Helios-Inspector.js +1155 -0
- data/amber/js/Helios-KeyBindings.deploy.js +753 -0
- data/amber/js/Helios-KeyBindings.js +1023 -0
- data/amber/js/Helios-Layout.deploy.js +383 -0
- data/amber/js/Helios-Layout.js +523 -0
- data/amber/js/Helios-Workspace.deploy.js +799 -0
- data/amber/js/Helios-Workspace.js +1074 -0
- data/amber/js/IDE.deploy.js +2541 -1490
- data/amber/js/IDE.js +2721 -1660
- data/amber/js/Importer-Exporter.deploy.js +671 -0
- data/amber/js/Importer-Exporter.js +816 -0
- data/amber/js/Kernel-Announcements.deploy.js +137 -20
- data/amber/js/Kernel-Announcements.js +176 -22
- data/amber/js/Kernel-Classes.deploy.js +555 -168
- data/amber/js/Kernel-Classes.js +662 -205
- data/amber/js/Kernel-Collections.deploy.js +1403 -618
- data/amber/js/Kernel-Collections.js +1545 -690
- data/amber/js/Kernel-Exceptions.deploy.js +109 -45
- data/amber/js/Kernel-Exceptions.js +123 -49
- data/amber/js/Kernel-Methods.deploy.js +196 -81
- data/amber/js/Kernel-Methods.js +214 -89
- data/amber/js/Kernel-Objects.deploy.js +1542 -1117
- data/amber/js/Kernel-Objects.js +1593 -1148
- data/amber/js/Kernel-Tests.deploy.js +1725 -772
- data/amber/js/Kernel-Tests.js +2301 -1123
- data/amber/js/Kernel-Transcript.deploy.js +23 -25
- data/amber/js/Kernel-Transcript.js +24 -26
- data/amber/js/SUnit.deploy.js +204 -131
- data/amber/js/SUnit.js +222 -139
- data/amber/js/Spaces.deploy.js +240 -0
- data/amber/js/Spaces.js +326 -0
- data/amber/js/amber.js +26 -7
- data/amber/js/boot.js +65 -47
- data/amber/js/init.js +1 -1
- data/amber/js/lib/CodeMirror/amber.css +21 -21
- data/amber/js/lib/CodeMirror/codemirror.css +119 -13
- data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
- data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
- data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
- data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
- data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
- data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
- data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
- data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
- data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
- data/amber/st/Compiler-AST.st +505 -0
- data/amber/st/Compiler-Core.st +835 -0
- data/amber/st/Compiler-Exceptions.st +87 -0
- data/amber/st/Compiler-IR.st +1097 -0
- data/amber/st/Compiler-Inlining.st +650 -0
- data/amber/st/Compiler-Semantic.st +558 -0
- data/amber/st/Compiler-Tests.st +285 -381
- data/amber/st/Compiler.st +725 -2
- data/amber/st/Helios-Announcements.st +104 -0
- data/amber/st/Helios-Browser.st +708 -0
- data/amber/st/Helios-Commands.st +223 -0
- data/amber/st/Helios-Core.st +532 -0
- data/amber/st/Helios-Environments.st +98 -0
- data/amber/st/Helios-Inspector.st +367 -0
- data/amber/st/Helios-KeyBindings.st +337 -0
- data/amber/st/Helios-Layout.st +199 -0
- data/amber/st/Helios-Workspace.st +367 -0
- data/amber/st/IDE.st +75 -53
- data/amber/st/Importer-Exporter.st +386 -0
- data/amber/st/Kernel-Announcements.st +92 -0
- data/amber/st/Kernel-Classes.st +137 -15
- data/amber/st/Kernel-Collections.st +137 -47
- data/amber/st/Kernel-Exceptions.st +14 -0
- data/amber/st/Kernel-Methods.st +9 -1
- data/amber/st/Kernel-Objects.st +29 -5
- data/amber/st/Kernel-Tests.st +545 -199
- data/amber/st/SUnit.st +10 -0
- data/amber/st/Spaces.st +142 -0
- data/lib/resin/app.rb +1 -1
- metadata +86 -31
- data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
- data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
@@ -0,0 +1,1023 @@
|
|
1
|
+
smalltalk.addPackage('Helios-KeyBindings', {});
|
2
|
+
smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
|
3
|
+
smalltalk.addMethod(
|
4
|
+
"_applyOn_",
|
5
|
+
smalltalk.method({
|
6
|
+
selector: "applyOn:",
|
7
|
+
category: 'actions',
|
8
|
+
fn: function (aKeyBinder) {
|
9
|
+
var self = this;
|
10
|
+
smalltalk.send(self, "_subclassResponsibility", []);
|
11
|
+
return self;
|
12
|
+
},
|
13
|
+
args: ["aKeyBinder"],
|
14
|
+
source: "applyOn: aKeyBinder\x0a\x09self subclassResponsibility",
|
15
|
+
messageSends: ["subclassResponsibility"],
|
16
|
+
referencedClasses: []
|
17
|
+
}),
|
18
|
+
smalltalk.HLBinding);
|
19
|
+
|
20
|
+
smalltalk.addMethod(
|
21
|
+
"_isBindingAction",
|
22
|
+
smalltalk.method({
|
23
|
+
selector: "isBindingAction",
|
24
|
+
category: 'testing',
|
25
|
+
fn: function () {
|
26
|
+
var self = this;
|
27
|
+
return false;
|
28
|
+
},
|
29
|
+
args: [],
|
30
|
+
source: "isBindingAction\x0a\x09^ false",
|
31
|
+
messageSends: [],
|
32
|
+
referencedClasses: []
|
33
|
+
}),
|
34
|
+
smalltalk.HLBinding);
|
35
|
+
|
36
|
+
smalltalk.addMethod(
|
37
|
+
"_isBindingGroup",
|
38
|
+
smalltalk.method({
|
39
|
+
selector: "isBindingGroup",
|
40
|
+
category: 'testing',
|
41
|
+
fn: function () {
|
42
|
+
var self = this;
|
43
|
+
return false;
|
44
|
+
},
|
45
|
+
args: [],
|
46
|
+
source: "isBindingGroup\x0a\x09^ false",
|
47
|
+
messageSends: [],
|
48
|
+
referencedClasses: []
|
49
|
+
}),
|
50
|
+
smalltalk.HLBinding);
|
51
|
+
|
52
|
+
smalltalk.addMethod(
|
53
|
+
"_key",
|
54
|
+
smalltalk.method({
|
55
|
+
selector: "key",
|
56
|
+
category: 'accessing',
|
57
|
+
fn: function () {
|
58
|
+
var self = this;
|
59
|
+
return self['@key'];
|
60
|
+
},
|
61
|
+
args: [],
|
62
|
+
source: "key\x0a\x09^ key",
|
63
|
+
messageSends: [],
|
64
|
+
referencedClasses: []
|
65
|
+
}),
|
66
|
+
smalltalk.HLBinding);
|
67
|
+
|
68
|
+
smalltalk.addMethod(
|
69
|
+
"_key_",
|
70
|
+
smalltalk.method({
|
71
|
+
selector: "key:",
|
72
|
+
category: 'accessing',
|
73
|
+
fn: function (anInteger) {
|
74
|
+
var self = this;
|
75
|
+
self['@key'] = anInteger;
|
76
|
+
return self;
|
77
|
+
},
|
78
|
+
args: ["anInteger"],
|
79
|
+
source: "key: anInteger\x0a\x09key := anInteger",
|
80
|
+
messageSends: [],
|
81
|
+
referencedClasses: []
|
82
|
+
}),
|
83
|
+
smalltalk.HLBinding);
|
84
|
+
|
85
|
+
smalltalk.addMethod(
|
86
|
+
"_label",
|
87
|
+
smalltalk.method({
|
88
|
+
selector: "label",
|
89
|
+
category: 'accessing',
|
90
|
+
fn: function () {
|
91
|
+
var self = this;
|
92
|
+
return self['@label'];
|
93
|
+
},
|
94
|
+
args: [],
|
95
|
+
source: "label\x0a\x09^ label",
|
96
|
+
messageSends: [],
|
97
|
+
referencedClasses: []
|
98
|
+
}),
|
99
|
+
smalltalk.HLBinding);
|
100
|
+
|
101
|
+
smalltalk.addMethod(
|
102
|
+
"_label_",
|
103
|
+
smalltalk.method({
|
104
|
+
selector: "label:",
|
105
|
+
category: 'accessing',
|
106
|
+
fn: function (aString) {
|
107
|
+
var self = this;
|
108
|
+
self['@label'] = aString;
|
109
|
+
return self;
|
110
|
+
},
|
111
|
+
args: ["aString"],
|
112
|
+
source: "label: aString\x0a\x09label := aString",
|
113
|
+
messageSends: [],
|
114
|
+
referencedClasses: []
|
115
|
+
}),
|
116
|
+
smalltalk.HLBinding);
|
117
|
+
|
118
|
+
smalltalk.addMethod(
|
119
|
+
"_renderOn_html_",
|
120
|
+
smalltalk.method({
|
121
|
+
selector: "renderOn:html:",
|
122
|
+
category: 'rendering',
|
123
|
+
fn: function (aBindingHelper, html) {
|
124
|
+
var self = this;
|
125
|
+
return self;
|
126
|
+
},
|
127
|
+
args: ["aBindingHelper", "html"],
|
128
|
+
source: "renderOn: aBindingHelper html: html",
|
129
|
+
messageSends: [],
|
130
|
+
referencedClasses: []
|
131
|
+
}),
|
132
|
+
smalltalk.HLBinding);
|
133
|
+
|
134
|
+
smalltalk.addMethod(
|
135
|
+
"_shortcut",
|
136
|
+
smalltalk.method({
|
137
|
+
selector: "shortcut",
|
138
|
+
category: 'accessing',
|
139
|
+
fn: function () {
|
140
|
+
var self = this;
|
141
|
+
var $1;
|
142
|
+
$1 = smalltalk.send(smalltalk.String || String, "_fromCharCode_", [smalltalk.send(self, "_key", [])]);
|
143
|
+
return $1;
|
144
|
+
},
|
145
|
+
args: [],
|
146
|
+
source: "shortcut\x0a\x09^ String fromCharCode: self key",
|
147
|
+
messageSends: ["fromCharCode:", "key"],
|
148
|
+
referencedClasses: ["String"]
|
149
|
+
}),
|
150
|
+
smalltalk.HLBinding);
|
151
|
+
|
152
|
+
|
153
|
+
smalltalk.addMethod(
|
154
|
+
"_on_labelled_",
|
155
|
+
smalltalk.method({
|
156
|
+
selector: "on:labelled:",
|
157
|
+
category: 'instance creation',
|
158
|
+
fn: function (anInteger, aString) {
|
159
|
+
var self = this;
|
160
|
+
var $2, $3, $1;
|
161
|
+
$2 = smalltalk.send(self, "_new", []);
|
162
|
+
smalltalk.send($2, "_key_", [anInteger]);
|
163
|
+
smalltalk.send($2, "_label_", [aString]);
|
164
|
+
$3 = smalltalk.send($2, "_yourself", []);
|
165
|
+
$1 = $3;
|
166
|
+
return $1;
|
167
|
+
},
|
168
|
+
args: ["anInteger", "aString"],
|
169
|
+
source: "on: anInteger labelled: aString\x0a\x09^ self new\x0a \x09key: anInteger;\x0a label: aString;\x0a yourself",
|
170
|
+
messageSends: ["key:", "new", "label:", "yourself"],
|
171
|
+
referencedClasses: []
|
172
|
+
}),
|
173
|
+
smalltalk.HLBinding.klass);
|
174
|
+
|
175
|
+
|
176
|
+
smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback'], 'Helios-KeyBindings');
|
177
|
+
smalltalk.addMethod(
|
178
|
+
"_applyOn_",
|
179
|
+
smalltalk.method({
|
180
|
+
selector: "applyOn:",
|
181
|
+
category: 'actions',
|
182
|
+
fn: function (aKeyBinder) {
|
183
|
+
var self = this;
|
184
|
+
smalltalk.send(aKeyBinder, "_applyBindingAction_", [self]);
|
185
|
+
return self;
|
186
|
+
},
|
187
|
+
args: ["aKeyBinder"],
|
188
|
+
source: "applyOn: aKeyBinder\x0a\x09aKeyBinder applyBindingAction: self",
|
189
|
+
messageSends: ["applyBindingAction:"],
|
190
|
+
referencedClasses: []
|
191
|
+
}),
|
192
|
+
smalltalk.HLBindingAction);
|
193
|
+
|
194
|
+
smalltalk.addMethod(
|
195
|
+
"_callback",
|
196
|
+
smalltalk.method({
|
197
|
+
selector: "callback",
|
198
|
+
category: 'accessing',
|
199
|
+
fn: function () {
|
200
|
+
var self = this;
|
201
|
+
return self['@callback'];
|
202
|
+
},
|
203
|
+
args: [],
|
204
|
+
source: "callback\x0a\x09^ callback",
|
205
|
+
messageSends: [],
|
206
|
+
referencedClasses: []
|
207
|
+
}),
|
208
|
+
smalltalk.HLBindingAction);
|
209
|
+
|
210
|
+
smalltalk.addMethod(
|
211
|
+
"_callback_",
|
212
|
+
smalltalk.method({
|
213
|
+
selector: "callback:",
|
214
|
+
category: 'accessing',
|
215
|
+
fn: function (aBlock) {
|
216
|
+
var self = this;
|
217
|
+
self['@callback'] = aBlock;
|
218
|
+
return self;
|
219
|
+
},
|
220
|
+
args: ["aBlock"],
|
221
|
+
source: "callback: aBlock\x0a\x09callback := aBlock",
|
222
|
+
messageSends: [],
|
223
|
+
referencedClasses: []
|
224
|
+
}),
|
225
|
+
smalltalk.HLBindingAction);
|
226
|
+
|
227
|
+
smalltalk.addMethod(
|
228
|
+
"_isBindingAction",
|
229
|
+
smalltalk.method({
|
230
|
+
selector: "isBindingAction",
|
231
|
+
category: 'testing',
|
232
|
+
fn: function () {
|
233
|
+
var self = this;
|
234
|
+
return true;
|
235
|
+
},
|
236
|
+
args: [],
|
237
|
+
source: "isBindingAction\x0a\x09^ true",
|
238
|
+
messageSends: [],
|
239
|
+
referencedClasses: []
|
240
|
+
}),
|
241
|
+
smalltalk.HLBindingAction);
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
|
246
|
+
smalltalk.addMethod(
|
247
|
+
"_add_",
|
248
|
+
smalltalk.method({
|
249
|
+
selector: "add:",
|
250
|
+
category: 'accessing',
|
251
|
+
fn: function (aBinding) {
|
252
|
+
var self = this;
|
253
|
+
var $1;
|
254
|
+
$1 = smalltalk.send(smalltalk.send(self, "_bindings", []), "_add_", [aBinding]);
|
255
|
+
return $1;
|
256
|
+
},
|
257
|
+
args: ["aBinding"],
|
258
|
+
source: "add: aBinding\x0a\x09^ self bindings add: aBinding",
|
259
|
+
messageSends: ["add:", "bindings"],
|
260
|
+
referencedClasses: []
|
261
|
+
}),
|
262
|
+
smalltalk.HLBindingGroup);
|
263
|
+
|
264
|
+
smalltalk.addMethod(
|
265
|
+
"_addActionKey_labelled_callback_",
|
266
|
+
smalltalk.method({
|
267
|
+
selector: "addActionKey:labelled:callback:",
|
268
|
+
category: 'accessing',
|
269
|
+
fn: function (anInteger, aString, aBlock) {
|
270
|
+
var self = this;
|
271
|
+
var $1, $2;
|
272
|
+
$1 = smalltalk.send(smalltalk.HLBindingAction || HLBindingAction, "_on_labelled_", [anInteger, aString]);
|
273
|
+
smalltalk.send($1, "_callback_", [aBlock]);
|
274
|
+
$2 = smalltalk.send($1, "_yourself", []);
|
275
|
+
smalltalk.send(self, "_add_", [$2]);
|
276
|
+
return self;
|
277
|
+
},
|
278
|
+
args: ["anInteger", "aString", "aBlock"],
|
279
|
+
source: "addActionKey: anInteger labelled: aString callback: aBlock\x0a\x09self add: ((HLBindingAction on: anInteger labelled: aString)\x0a \x09callback: aBlock;\x0a yourself)",
|
280
|
+
messageSends: ["add:", "callback:", "on:labelled:", "yourself"],
|
281
|
+
referencedClasses: ["HLBindingAction"]
|
282
|
+
}),
|
283
|
+
smalltalk.HLBindingGroup);
|
284
|
+
|
285
|
+
smalltalk.addMethod(
|
286
|
+
"_addActionKey_labelled_command_",
|
287
|
+
smalltalk.method({
|
288
|
+
selector: "addActionKey:labelled:command:",
|
289
|
+
category: 'accessing',
|
290
|
+
fn: function (anInteger, aString, aCommand) {
|
291
|
+
var self = this;
|
292
|
+
var $1, $2;
|
293
|
+
$1 = smalltalk.send(smalltalk.HLBindingAction || HLBindingAction, "_on_labelled_", [anInteger, aString]);
|
294
|
+
smalltalk.send($1, "_command_", [aCommand]);
|
295
|
+
$2 = smalltalk.send($1, "_yourself", []);
|
296
|
+
smalltalk.send(self, "_add_", [$2]);
|
297
|
+
return self;
|
298
|
+
},
|
299
|
+
args: ["anInteger", "aString", "aCommand"],
|
300
|
+
source: "addActionKey: anInteger labelled: aString command: aCommand\x0a\x09self add: ((HLBindingAction on: anInteger labelled: aString)\x0a \x09command: aCommand;\x0a yourself)",
|
301
|
+
messageSends: ["add:", "command:", "on:labelled:", "yourself"],
|
302
|
+
referencedClasses: ["HLBindingAction"]
|
303
|
+
}),
|
304
|
+
smalltalk.HLBindingGroup);
|
305
|
+
|
306
|
+
smalltalk.addMethod(
|
307
|
+
"_addGroupKey_labelled_",
|
308
|
+
smalltalk.method({
|
309
|
+
selector: "addGroupKey:labelled:",
|
310
|
+
category: 'accessing',
|
311
|
+
fn: function (anInteger, aString) {
|
312
|
+
var self = this;
|
313
|
+
smalltalk.send(self, "_add_", [smalltalk.send(smalltalk.HLBindingGroup || HLBindingGroup, "_on_labelled_", [anInteger, aString])]);
|
314
|
+
return self;
|
315
|
+
},
|
316
|
+
args: ["anInteger", "aString"],
|
317
|
+
source: "addGroupKey: anInteger labelled: aString\x0a\x09self add: (HLBindingGroup on: anInteger labelled: aString)",
|
318
|
+
messageSends: ["add:", "on:labelled:"],
|
319
|
+
referencedClasses: ["HLBindingGroup"]
|
320
|
+
}),
|
321
|
+
smalltalk.HLBindingGroup);
|
322
|
+
|
323
|
+
smalltalk.addMethod(
|
324
|
+
"_applyOn_",
|
325
|
+
smalltalk.method({
|
326
|
+
selector: "applyOn:",
|
327
|
+
category: 'actions',
|
328
|
+
fn: function (aKeyBinder) {
|
329
|
+
var self = this;
|
330
|
+
smalltalk.send(aKeyBinder, "_applyBindingGroup_", [self]);
|
331
|
+
return self;
|
332
|
+
},
|
333
|
+
args: ["aKeyBinder"],
|
334
|
+
source: "applyOn: aKeyBinder\x0a\x09aKeyBinder applyBindingGroup: self",
|
335
|
+
messageSends: ["applyBindingGroup:"],
|
336
|
+
referencedClasses: []
|
337
|
+
}),
|
338
|
+
smalltalk.HLBindingGroup);
|
339
|
+
|
340
|
+
smalltalk.addMethod(
|
341
|
+
"_at_",
|
342
|
+
smalltalk.method({
|
343
|
+
selector: "at:",
|
344
|
+
category: 'accessing',
|
345
|
+
fn: function (aString) {
|
346
|
+
var self = this;
|
347
|
+
var $1;
|
348
|
+
$1 = smalltalk.send(smalltalk.send(self, "_bindings", []), "_detect_ifNone_", [function (each) {return smalltalk.send(smalltalk.send(each, "_label", []), "__eq", [aString]);}, function () {return nil;}]);
|
349
|
+
return $1;
|
350
|
+
},
|
351
|
+
args: ["aString"],
|
352
|
+
source: "at: aString\x0a\x09^ self bindings \x0a \x09detect: [ :each | each label = aString ]\x0a \x09ifNone: [ nil ]",
|
353
|
+
messageSends: ["detect:ifNone:", "=", "label", "bindings"],
|
354
|
+
referencedClasses: []
|
355
|
+
}),
|
356
|
+
smalltalk.HLBindingGroup);
|
357
|
+
|
358
|
+
smalltalk.addMethod(
|
359
|
+
"_atKey_",
|
360
|
+
smalltalk.method({
|
361
|
+
selector: "atKey:",
|
362
|
+
category: 'accessing',
|
363
|
+
fn: function (anInteger) {
|
364
|
+
var self = this;
|
365
|
+
var $1;
|
366
|
+
$1 = smalltalk.send(smalltalk.send(self, "_bindings", []), "_detect_ifNone_", [function (each) {return smalltalk.send(smalltalk.send(each, "_key", []), "__eq", [anInteger]);}, function () {return nil;}]);
|
367
|
+
return $1;
|
368
|
+
},
|
369
|
+
args: ["anInteger"],
|
370
|
+
source: "atKey: anInteger\x0a\x09^ self bindings \x0a \x09detect: [ :each | each key = anInteger ]\x0a \x09ifNone: [ nil ]",
|
371
|
+
messageSends: ["detect:ifNone:", "=", "key", "bindings"],
|
372
|
+
referencedClasses: []
|
373
|
+
}),
|
374
|
+
smalltalk.HLBindingGroup);
|
375
|
+
|
376
|
+
smalltalk.addMethod(
|
377
|
+
"_bindings",
|
378
|
+
smalltalk.method({
|
379
|
+
selector: "bindings",
|
380
|
+
category: 'accessing',
|
381
|
+
fn: function () {
|
382
|
+
var self = this;
|
383
|
+
var $1;
|
384
|
+
if (($receiver = self['@bindings']) == nil || $receiver == undefined) {
|
385
|
+
self['@bindings'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
|
386
|
+
$1 = self['@bindings'];
|
387
|
+
} else {
|
388
|
+
$1 = self['@bindings'];
|
389
|
+
}
|
390
|
+
return $1;
|
391
|
+
},
|
392
|
+
args: [],
|
393
|
+
source: "bindings\x0a\x09^ bindings ifNil: [ bindings := OrderedCollection new ]",
|
394
|
+
messageSends: ["ifNil:", "new"],
|
395
|
+
referencedClasses: ["OrderedCollection"]
|
396
|
+
}),
|
397
|
+
smalltalk.HLBindingGroup);
|
398
|
+
|
399
|
+
smalltalk.addMethod(
|
400
|
+
"_isBindingGroup",
|
401
|
+
smalltalk.method({
|
402
|
+
selector: "isBindingGroup",
|
403
|
+
category: 'testing',
|
404
|
+
fn: function () {
|
405
|
+
var self = this;
|
406
|
+
return true;
|
407
|
+
},
|
408
|
+
args: [],
|
409
|
+
source: "isBindingGroup\x0a\x09^ true",
|
410
|
+
messageSends: [],
|
411
|
+
referencedClasses: []
|
412
|
+
}),
|
413
|
+
smalltalk.HLBindingGroup);
|
414
|
+
|
415
|
+
smalltalk.addMethod(
|
416
|
+
"_renderOn_html_",
|
417
|
+
smalltalk.method({
|
418
|
+
selector: "renderOn:html:",
|
419
|
+
category: 'rendering',
|
420
|
+
fn: function (aBindingHelper, html) {
|
421
|
+
var self = this;
|
422
|
+
smalltalk.send(aBindingHelper, "_renderBindingGroup_on_", [self, html]);
|
423
|
+
return self;
|
424
|
+
},
|
425
|
+
args: ["aBindingHelper", "html"],
|
426
|
+
source: "renderOn: aBindingHelper html: html\x0a\x09aBindingHelper renderBindingGroup: self on: html",
|
427
|
+
messageSends: ["renderBindingGroup:on:"],
|
428
|
+
referencedClasses: []
|
429
|
+
}),
|
430
|
+
smalltalk.HLBindingGroup);
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
smalltalk.addClass('HLKeyBinder', smalltalk.Object, ['modifierKey', 'active', 'helper', 'bindings', 'selectedBinding'], 'Helios-KeyBindings');
|
435
|
+
smalltalk.addMethod(
|
436
|
+
"_activate",
|
437
|
+
smalltalk.method({
|
438
|
+
selector: "activate",
|
439
|
+
category: 'actions',
|
440
|
+
fn: function () {
|
441
|
+
var self = this;
|
442
|
+
self['@active'] = true;
|
443
|
+
smalltalk.send(smalltalk.send(self, "_helper", []), "_show", []);
|
444
|
+
return self;
|
445
|
+
},
|
446
|
+
args: [],
|
447
|
+
source: "activate\x0a\x09active := true.\x0a\x09self helper show",
|
448
|
+
messageSends: ["show", "helper"],
|
449
|
+
referencedClasses: []
|
450
|
+
}),
|
451
|
+
smalltalk.HLKeyBinder);
|
452
|
+
|
453
|
+
smalltalk.addMethod(
|
454
|
+
"_activationKey",
|
455
|
+
smalltalk.method({
|
456
|
+
selector: "activationKey",
|
457
|
+
category: 'accessing',
|
458
|
+
fn: function () {
|
459
|
+
var self = this;
|
460
|
+
return 32;
|
461
|
+
},
|
462
|
+
args: [],
|
463
|
+
source: "activationKey\x0a\x09\x22SPACE\x22\x0a\x09^ 32",
|
464
|
+
messageSends: [],
|
465
|
+
referencedClasses: []
|
466
|
+
}),
|
467
|
+
smalltalk.HLKeyBinder);
|
468
|
+
|
469
|
+
smalltalk.addMethod(
|
470
|
+
"_applyBinding_",
|
471
|
+
smalltalk.method({
|
472
|
+
selector: "applyBinding:",
|
473
|
+
category: 'actions',
|
474
|
+
fn: function (aBinding) {
|
475
|
+
var self = this;
|
476
|
+
smalltalk.send(aBinding, "_applyOn_", [self]);
|
477
|
+
return self;
|
478
|
+
},
|
479
|
+
args: ["aBinding"],
|
480
|
+
source: "applyBinding: aBinding\x0a aBinding applyOn: self",
|
481
|
+
messageSends: ["applyOn:"],
|
482
|
+
referencedClasses: []
|
483
|
+
}),
|
484
|
+
smalltalk.HLKeyBinder);
|
485
|
+
|
486
|
+
smalltalk.addMethod(
|
487
|
+
"_applyBindingAction_",
|
488
|
+
smalltalk.method({
|
489
|
+
selector: "applyBindingAction:",
|
490
|
+
category: 'actions',
|
491
|
+
fn: function (aBinding) {
|
492
|
+
var self = this;
|
493
|
+
smalltalk.send(smalltalk.send(aBinding, "_callback", []), "_value", []);
|
494
|
+
smalltalk.send(self, "_deactivate", []);
|
495
|
+
return self;
|
496
|
+
},
|
497
|
+
args: ["aBinding"],
|
498
|
+
source: "applyBindingAction: aBinding\x0a aBinding callback value.\x0a\x09self deactivate",
|
499
|
+
messageSends: ["value", "callback", "deactivate"],
|
500
|
+
referencedClasses: []
|
501
|
+
}),
|
502
|
+
smalltalk.HLKeyBinder);
|
503
|
+
|
504
|
+
smalltalk.addMethod(
|
505
|
+
"_applyBindingGroup_",
|
506
|
+
smalltalk.method({
|
507
|
+
selector: "applyBindingGroup:",
|
508
|
+
category: 'actions',
|
509
|
+
fn: function (aBinding) {
|
510
|
+
var self = this;
|
511
|
+
self['@selectedBinding'] = aBinding;
|
512
|
+
smalltalk.send(smalltalk.send(self, "_helper", []), "_refresh", []);
|
513
|
+
return self;
|
514
|
+
},
|
515
|
+
args: ["aBinding"],
|
516
|
+
source: "applyBindingGroup: aBinding\x0a selectedBinding := aBinding.\x0a self helper refresh",
|
517
|
+
messageSends: ["refresh", "helper"],
|
518
|
+
referencedClasses: []
|
519
|
+
}),
|
520
|
+
smalltalk.HLKeyBinder);
|
521
|
+
|
522
|
+
smalltalk.addMethod(
|
523
|
+
"_bindings",
|
524
|
+
smalltalk.method({
|
525
|
+
selector: "bindings",
|
526
|
+
category: 'accessing',
|
527
|
+
fn: function () {
|
528
|
+
var self = this;
|
529
|
+
var $1;
|
530
|
+
if (($receiver = self['@bindings']) == nil || $receiver == undefined) {
|
531
|
+
self['@bindings'] = smalltalk.send(smalltalk.HLBindingGroup || HLBindingGroup, "_new", []);
|
532
|
+
$1 = self['@bindings'];
|
533
|
+
} else {
|
534
|
+
$1 = self['@bindings'];
|
535
|
+
}
|
536
|
+
return $1;
|
537
|
+
},
|
538
|
+
args: [],
|
539
|
+
source: "bindings\x0a\x09^ bindings ifNil: [ bindings := HLBindingGroup new ]",
|
540
|
+
messageSends: ["ifNil:", "new"],
|
541
|
+
referencedClasses: ["HLBindingGroup"]
|
542
|
+
}),
|
543
|
+
smalltalk.HLKeyBinder);
|
544
|
+
|
545
|
+
smalltalk.addMethod(
|
546
|
+
"_deactivate",
|
547
|
+
smalltalk.method({
|
548
|
+
selector: "deactivate",
|
549
|
+
category: 'actions',
|
550
|
+
fn: function () {
|
551
|
+
var self = this;
|
552
|
+
self['@active'] = false;
|
553
|
+
self['@selectedBinding'] = nil;
|
554
|
+
smalltalk.send(smalltalk.send(self, "_helper", []), "_hide", []);
|
555
|
+
return self;
|
556
|
+
},
|
557
|
+
args: [],
|
558
|
+
source: "deactivate\x0a\x09active := false.\x0a selectedBinding := nil.\x0a\x09self helper hide",
|
559
|
+
messageSends: ["hide", "helper"],
|
560
|
+
referencedClasses: []
|
561
|
+
}),
|
562
|
+
smalltalk.HLKeyBinder);
|
563
|
+
|
564
|
+
smalltalk.addMethod(
|
565
|
+
"_escapeKey",
|
566
|
+
smalltalk.method({
|
567
|
+
selector: "escapeKey",
|
568
|
+
category: 'accessing',
|
569
|
+
fn: function () {
|
570
|
+
var self = this;
|
571
|
+
return 27;
|
572
|
+
},
|
573
|
+
args: [],
|
574
|
+
source: "escapeKey\x0a\x09\x22ESC\x22\x0a\x09^ 27",
|
575
|
+
messageSends: [],
|
576
|
+
referencedClasses: []
|
577
|
+
}),
|
578
|
+
smalltalk.HLKeyBinder);
|
579
|
+
|
580
|
+
smalltalk.addMethod(
|
581
|
+
"_flushBindings",
|
582
|
+
smalltalk.method({
|
583
|
+
selector: "flushBindings",
|
584
|
+
category: 'actions',
|
585
|
+
fn: function () {
|
586
|
+
var self = this;
|
587
|
+
self['@bindings'] = nil;
|
588
|
+
self['@helper'] = nil;
|
589
|
+
return self;
|
590
|
+
},
|
591
|
+
args: [],
|
592
|
+
source: "flushBindings\x0a\x09bindings := nil.\x0a helper := nil",
|
593
|
+
messageSends: [],
|
594
|
+
referencedClasses: []
|
595
|
+
}),
|
596
|
+
smalltalk.HLKeyBinder);
|
597
|
+
|
598
|
+
smalltalk.addMethod(
|
599
|
+
"_handleActiveKeyDown_",
|
600
|
+
smalltalk.method({
|
601
|
+
selector: "handleActiveKeyDown:",
|
602
|
+
category: 'events',
|
603
|
+
fn: function (event) {
|
604
|
+
var self = this;
|
605
|
+
var $1, $2;
|
606
|
+
$1 = smalltalk.send(smalltalk.send(smalltalk.send(event, "_which", []), "__eq", [smalltalk.send(self, "_escapeKey", [])]), "_or_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(event, "_which", []), "__eq", [71]), "_and_", [function () {return smalltalk.send(event, "_ctrlKey", []);}]);}]);
|
607
|
+
if (smalltalk.assert($1)) {
|
608
|
+
smalltalk.send(self, "_deactivate", []);
|
609
|
+
smalltalk.send(event, "_preventDefault", []);
|
610
|
+
return false;
|
611
|
+
}
|
612
|
+
$2 = smalltalk.send(self, "_handleBindingFor_", [event]);
|
613
|
+
return $2;
|
614
|
+
},
|
615
|
+
args: ["event"],
|
616
|
+
source: "handleActiveKeyDown: event\x0a\x0a\x09\x22ESC or ctrl+g deactivate the keyBinder\x22\x0a\x09(event which = self escapeKey or: [\x0a\x09\x09event which = 71 and: [ event ctrlKey ] ])\x0a \x09ifTrue: [ \x0a \x09self deactivate.\x0a\x09\x09\x09\x09event preventDefault.\x0a\x09\x09\x09\x09^ false ].\x0a \x0a \x22Handle the keybinding\x22\x0a ^ self handleBindingFor: event",
|
617
|
+
messageSends: ["ifTrue:", "deactivate", "preventDefault", "or:", "and:", "ctrlKey", "=", "which", "escapeKey", "handleBindingFor:"],
|
618
|
+
referencedClasses: []
|
619
|
+
}),
|
620
|
+
smalltalk.HLKeyBinder);
|
621
|
+
|
622
|
+
smalltalk.addMethod(
|
623
|
+
"_handleBindingFor_",
|
624
|
+
smalltalk.method({
|
625
|
+
selector: "handleBindingFor:",
|
626
|
+
category: 'events',
|
627
|
+
fn: function (anEvent) {
|
628
|
+
var self = this;
|
629
|
+
var binding;
|
630
|
+
binding = smalltalk.send(smalltalk.send(self, "_selectedBinding", []), "_atKey_", [smalltalk.send(anEvent, "_which", [])]);
|
631
|
+
if (($receiver = binding) == nil || $receiver == undefined) {
|
632
|
+
} else {
|
633
|
+
smalltalk.send(self, "_applyBinding_", [binding]);
|
634
|
+
smalltalk.send(anEvent, "_preventDefault", []);
|
635
|
+
return false;
|
636
|
+
}
|
637
|
+
return self;
|
638
|
+
},
|
639
|
+
args: ["anEvent"],
|
640
|
+
source: "handleBindingFor: anEvent\x0a\x09| binding |\x0a binding := self selectedBinding atKey: anEvent which.\x0a \x0a binding ifNotNil: [ \x0a \x09self applyBinding: binding.\x0a\x09\x09anEvent preventDefault.\x0a\x09\x09^ false ]",
|
641
|
+
messageSends: ["atKey:", "which", "selectedBinding", "ifNotNil:", "applyBinding:", "preventDefault"],
|
642
|
+
referencedClasses: []
|
643
|
+
}),
|
644
|
+
smalltalk.HLKeyBinder);
|
645
|
+
|
646
|
+
smalltalk.addMethod(
|
647
|
+
"_handleInactiveKeyDown_",
|
648
|
+
smalltalk.method({
|
649
|
+
selector: "handleInactiveKeyDown:",
|
650
|
+
category: 'events',
|
651
|
+
fn: function (event) {
|
652
|
+
var self = this;
|
653
|
+
var $1, $2;
|
654
|
+
$1 = smalltalk.send(smalltalk.send(event, "_which", []), "__eq", [smalltalk.send(self, "_activationKey", [])]);
|
655
|
+
if (smalltalk.assert($1)) {
|
656
|
+
$2 = smalltalk.send(event, "_ctrlKey", []);
|
657
|
+
if (smalltalk.assert($2)) {
|
658
|
+
smalltalk.send(self, "_activate", []);
|
659
|
+
smalltalk.send(event, "_preventDefault", []);
|
660
|
+
return false;
|
661
|
+
}
|
662
|
+
}
|
663
|
+
return self;
|
664
|
+
},
|
665
|
+
args: ["event"],
|
666
|
+
source: "handleInactiveKeyDown: event\x0a event which = self activationKey ifTrue: [\x0a \x09\x09event ctrlKey ifTrue: [\x0a\x09\x09\x09\x09\x09self activate. \x0a \x09\x09 event preventDefault. \x0a \x09^ false ] ]",
|
667
|
+
messageSends: ["ifTrue:", "activate", "preventDefault", "ctrlKey", "=", "activationKey", "which"],
|
668
|
+
referencedClasses: []
|
669
|
+
}),
|
670
|
+
smalltalk.HLKeyBinder);
|
671
|
+
|
672
|
+
smalltalk.addMethod(
|
673
|
+
"_handleKeyDown_",
|
674
|
+
smalltalk.method({
|
675
|
+
selector: "handleKeyDown:",
|
676
|
+
category: 'events',
|
677
|
+
fn: function (event) {
|
678
|
+
var self = this;
|
679
|
+
var $2, $1;
|
680
|
+
$2 = smalltalk.send(self, "_isActive", []);
|
681
|
+
if (smalltalk.assert($2)) {
|
682
|
+
$1 = smalltalk.send(self, "_handleActiveKeyDown_", [event]);
|
683
|
+
} else {
|
684
|
+
$1 = smalltalk.send(self, "_handleInactiveKeyDown_", [event]);
|
685
|
+
}
|
686
|
+
return $1;
|
687
|
+
},
|
688
|
+
args: ["event"],
|
689
|
+
source: "handleKeyDown: event\x0a\x09^ self isActive\x0a \x09ifTrue: [ self handleActiveKeyDown: event ]\x0a \x09ifFalse: [ self handleInactiveKeyDown: event ]",
|
690
|
+
messageSends: ["ifTrue:ifFalse:", "handleActiveKeyDown:", "handleInactiveKeyDown:", "isActive"],
|
691
|
+
referencedClasses: []
|
692
|
+
}),
|
693
|
+
smalltalk.HLKeyBinder);
|
694
|
+
|
695
|
+
smalltalk.addMethod(
|
696
|
+
"_helper",
|
697
|
+
smalltalk.method({
|
698
|
+
selector: "helper",
|
699
|
+
category: 'accessing',
|
700
|
+
fn: function () {
|
701
|
+
var self = this;
|
702
|
+
var $1;
|
703
|
+
if (($receiver = self['@helper']) == nil || $receiver == undefined) {
|
704
|
+
self['@helper'] = smalltalk.send(smalltalk.HLKeyBinderHelper || HLKeyBinderHelper, "_on_", [self]);
|
705
|
+
$1 = self['@helper'];
|
706
|
+
} else {
|
707
|
+
$1 = self['@helper'];
|
708
|
+
}
|
709
|
+
return $1;
|
710
|
+
},
|
711
|
+
args: [],
|
712
|
+
source: "helper\x0a\x09^ helper ifNil: [ helper := HLKeyBinderHelper on: self ]",
|
713
|
+
messageSends: ["ifNil:", "on:"],
|
714
|
+
referencedClasses: ["HLKeyBinderHelper"]
|
715
|
+
}),
|
716
|
+
smalltalk.HLKeyBinder);
|
717
|
+
|
718
|
+
smalltalk.addMethod(
|
719
|
+
"_initialize",
|
720
|
+
smalltalk.method({
|
721
|
+
selector: "initialize",
|
722
|
+
category: 'initialization',
|
723
|
+
fn: function () {
|
724
|
+
var self = this;
|
725
|
+
smalltalk.send(self, "_initialize", [], smalltalk.Object);
|
726
|
+
self['@active'] = false;
|
727
|
+
return self;
|
728
|
+
},
|
729
|
+
args: [],
|
730
|
+
source: "initialize\x0a\x09super initialize.\x0a active := false",
|
731
|
+
messageSends: ["initialize"],
|
732
|
+
referencedClasses: []
|
733
|
+
}),
|
734
|
+
smalltalk.HLKeyBinder);
|
735
|
+
|
736
|
+
smalltalk.addMethod(
|
737
|
+
"_isActive",
|
738
|
+
smalltalk.method({
|
739
|
+
selector: "isActive",
|
740
|
+
category: 'testing',
|
741
|
+
fn: function () {
|
742
|
+
var self = this;
|
743
|
+
var $1;
|
744
|
+
if (($receiver = self['@active']) == nil || $receiver == undefined) {
|
745
|
+
$1 = false;
|
746
|
+
} else {
|
747
|
+
$1 = self['@active'];
|
748
|
+
}
|
749
|
+
return $1;
|
750
|
+
},
|
751
|
+
args: [],
|
752
|
+
source: "isActive\x0a\x09^ active ifNil: [ false ]",
|
753
|
+
messageSends: ["ifNil:"],
|
754
|
+
referencedClasses: []
|
755
|
+
}),
|
756
|
+
smalltalk.HLKeyBinder);
|
757
|
+
|
758
|
+
smalltalk.addMethod(
|
759
|
+
"_selectedBinding",
|
760
|
+
smalltalk.method({
|
761
|
+
selector: "selectedBinding",
|
762
|
+
category: 'accessing',
|
763
|
+
fn: function () {
|
764
|
+
var self = this;
|
765
|
+
var $1;
|
766
|
+
if (($receiver = self['@selectedBinding']) == nil ||
|
767
|
+
$receiver == undefined) {
|
768
|
+
$1 = smalltalk.send(self, "_bindings", []);
|
769
|
+
} else {
|
770
|
+
$1 = self['@selectedBinding'];
|
771
|
+
}
|
772
|
+
return $1;
|
773
|
+
},
|
774
|
+
args: [],
|
775
|
+
source: "selectedBinding\x0a\x09^ selectedBinding ifNil: [ self bindings ]",
|
776
|
+
messageSends: ["ifNil:", "bindings"],
|
777
|
+
referencedClasses: []
|
778
|
+
}),
|
779
|
+
smalltalk.HLKeyBinder);
|
780
|
+
|
781
|
+
smalltalk.addMethod(
|
782
|
+
"_setupEvents",
|
783
|
+
smalltalk.method({
|
784
|
+
selector: "setupEvents",
|
785
|
+
category: 'events',
|
786
|
+
fn: function () {
|
787
|
+
var self = this;
|
788
|
+
smalltalk.send(smalltalk.send(window, "_jQuery_", ["body"]), "_keydown_", [function (event) {return smalltalk.send(self, "_handleKeyDown_", [event]);}]);
|
789
|
+
return self;
|
790
|
+
},
|
791
|
+
args: [],
|
792
|
+
source: "setupEvents\x0a\x09(window jQuery: 'body') keydown: [ :event | self handleKeyDown: event ]",
|
793
|
+
messageSends: ["keydown:", "handleKeyDown:", "jQuery:"],
|
794
|
+
referencedClasses: []
|
795
|
+
}),
|
796
|
+
smalltalk.HLKeyBinder);
|
797
|
+
|
798
|
+
smalltalk.addMethod(
|
799
|
+
"_systemIsMac",
|
800
|
+
smalltalk.method({
|
801
|
+
selector: "systemIsMac",
|
802
|
+
category: 'testing',
|
803
|
+
fn: function () {
|
804
|
+
var self = this;
|
805
|
+
var $1;
|
806
|
+
$1 = smalltalk.send(smalltalk.send(navigator, "_platform", []), "_match_", ["Mac"]);
|
807
|
+
return $1;
|
808
|
+
},
|
809
|
+
args: [],
|
810
|
+
source: "systemIsMac\x0a\x09^ navigator platform match: 'Mac'",
|
811
|
+
messageSends: ["match:", "platform"],
|
812
|
+
referencedClasses: []
|
813
|
+
}),
|
814
|
+
smalltalk.HLKeyBinder);
|
815
|
+
|
816
|
+
|
817
|
+
|
818
|
+
smalltalk.addClass('HLKeyBinderHelper', smalltalk.HLWidget, ['keyBinder'], 'Helios-KeyBindings');
|
819
|
+
smalltalk.addMethod(
|
820
|
+
"_hide",
|
821
|
+
smalltalk.method({
|
822
|
+
selector: "hide",
|
823
|
+
category: 'actions',
|
824
|
+
fn: function () {
|
825
|
+
var self = this;
|
826
|
+
smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_remove", []);
|
827
|
+
return self;
|
828
|
+
},
|
829
|
+
args: [],
|
830
|
+
source: "hide\x0a\x09rootDiv asJQuery remove",
|
831
|
+
messageSends: ["remove", "asJQuery"],
|
832
|
+
referencedClasses: []
|
833
|
+
}),
|
834
|
+
smalltalk.HLKeyBinderHelper);
|
835
|
+
|
836
|
+
smalltalk.addMethod(
|
837
|
+
"_keyBinder",
|
838
|
+
smalltalk.method({
|
839
|
+
selector: "keyBinder",
|
840
|
+
category: 'accessing',
|
841
|
+
fn: function () {
|
842
|
+
var self = this;
|
843
|
+
return self['@keyBinder'];
|
844
|
+
},
|
845
|
+
args: [],
|
846
|
+
source: "keyBinder\x0a\x09^ keyBinder",
|
847
|
+
messageSends: [],
|
848
|
+
referencedClasses: []
|
849
|
+
}),
|
850
|
+
smalltalk.HLKeyBinderHelper);
|
851
|
+
|
852
|
+
smalltalk.addMethod(
|
853
|
+
"_keyBinder_",
|
854
|
+
smalltalk.method({
|
855
|
+
selector: "keyBinder:",
|
856
|
+
category: 'accessing',
|
857
|
+
fn: function (aKeyBinder) {
|
858
|
+
var self = this;
|
859
|
+
self['@keyBinder'] = aKeyBinder;
|
860
|
+
return self;
|
861
|
+
},
|
862
|
+
args: ["aKeyBinder"],
|
863
|
+
source: "keyBinder: aKeyBinder\x0a\x09keyBinder := aKeyBinder",
|
864
|
+
messageSends: [],
|
865
|
+
referencedClasses: []
|
866
|
+
}),
|
867
|
+
smalltalk.HLKeyBinderHelper);
|
868
|
+
|
869
|
+
smalltalk.addMethod(
|
870
|
+
"_registerBindings",
|
871
|
+
smalltalk.method({
|
872
|
+
selector: "registerBindings",
|
873
|
+
category: 'keyBindings',
|
874
|
+
fn: function () {
|
875
|
+
var self = this;
|
876
|
+
return self;
|
877
|
+
},
|
878
|
+
args: [],
|
879
|
+
source: "registerBindings\x0a\x09\x22Do nothing\x22",
|
880
|
+
messageSends: [],
|
881
|
+
referencedClasses: []
|
882
|
+
}),
|
883
|
+
smalltalk.HLKeyBinderHelper);
|
884
|
+
|
885
|
+
smalltalk.addMethod(
|
886
|
+
"_renderBindingGroup_on_",
|
887
|
+
smalltalk.method({
|
888
|
+
selector: "renderBindingGroup:on:",
|
889
|
+
category: 'rendering',
|
890
|
+
fn: function (aBindingGroup, html) {
|
891
|
+
var self = this;
|
892
|
+
var $1, $3, $4, $5, $6, $2;
|
893
|
+
smalltalk.send(smalltalk.send(smalltalk.send(aBindingGroup, "_bindings", []), "_sorted_", [function (a, b) {return smalltalk.send(smalltalk.send(a, "_key", []), "__lt", [smalltalk.send(b, "_key", [])]);}]), "_do_", [function (each) {$1 = smalltalk.send(html, "_span", []);smalltalk.send($1, "_class_", ["command"]);$2 = smalltalk.send($1, "_with_", [function () {$3 = smalltalk.send(html, "_span", []);smalltalk.send($3, "_class_", ["label"]);$4 = smalltalk.send($3, "_with_", [smalltalk.send(smalltalk.send(each, "_shortcut", []), "_asLowercase", [])]);$4;$5 = smalltalk.send(html, "_a", []);smalltalk.send($5, "_class_", ["action"]);smalltalk.send($5, "_with_", [smalltalk.send(each, "_label", [])]);$6 = smalltalk.send($5, "_onClick_", [function () {return smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_applyBinding_", [each]);}]);return $6;}]);return $2;}]);
|
894
|
+
return self;
|
895
|
+
},
|
896
|
+
args: ["aBindingGroup", "html"],
|
897
|
+
source: "renderBindingGroup: aBindingGroup on: html\x0a\x09(aBindingGroup bindings \x0a \x09sorted: [ :a :b | a key < b key ])\x0a do: [ :each |\x0a\x09\x09\x09html span class: 'command'; with: [\x0a\x09\x09\x09\x09html span class: 'label'; with: each shortcut asLowercase.\x0a \x09\x09\x09\x09html a \x0a \x09class: 'action'; \x0a with: each label;\x0a \x09\x09\x09\x09\x09onClick: [ self keyBinder applyBinding: each ] ] ]",
|
898
|
+
messageSends: ["do:", "class:", "span", "with:", "asLowercase", "shortcut", "a", "label", "onClick:", "applyBinding:", "keyBinder", "sorted:", "<", "key", "bindings"],
|
899
|
+
referencedClasses: []
|
900
|
+
}),
|
901
|
+
smalltalk.HLKeyBinderHelper);
|
902
|
+
|
903
|
+
smalltalk.addMethod(
|
904
|
+
"_renderBindingOn_",
|
905
|
+
smalltalk.method({
|
906
|
+
selector: "renderBindingOn:",
|
907
|
+
category: 'rendering',
|
908
|
+
fn: function (html) {
|
909
|
+
var self = this;
|
910
|
+
smalltalk.send(smalltalk.send(self, "_selectedBinding", []), "_renderOn_html_", [self, html]);
|
911
|
+
return self;
|
912
|
+
},
|
913
|
+
args: ["html"],
|
914
|
+
source: "renderBindingOn: html\x0a\x09self selectedBinding renderOn: self html: html",
|
915
|
+
messageSends: ["renderOn:html:", "selectedBinding"],
|
916
|
+
referencedClasses: []
|
917
|
+
}),
|
918
|
+
smalltalk.HLKeyBinderHelper);
|
919
|
+
|
920
|
+
smalltalk.addMethod(
|
921
|
+
"_renderContentOn_",
|
922
|
+
smalltalk.method({
|
923
|
+
selector: "renderContentOn:",
|
924
|
+
category: 'rendering',
|
925
|
+
fn: function (html) {
|
926
|
+
var self = this;
|
927
|
+
var $1, $3, $2;
|
928
|
+
$1 = smalltalk.send(html, "_div", []);
|
929
|
+
smalltalk.send($1, "_class_", ["key_helper"]);
|
930
|
+
$2 = smalltalk.send($1, "_with_", [function () {smalltalk.send(self, "_renderSelectionOn_", [html]);$3 = smalltalk.send(self, "_renderBindingOn_", [html]);return $3;}]);
|
931
|
+
return self;
|
932
|
+
},
|
933
|
+
args: ["html"],
|
934
|
+
source: "renderContentOn: html\x0a\x09html div class: 'key_helper'; with: [\x0a \x09self \x0a \x09renderSelectionOn:html;\x0a \x09renderBindingOn: html ]",
|
935
|
+
messageSends: ["class:", "div", "with:", "renderSelectionOn:", "renderBindingOn:"],
|
936
|
+
referencedClasses: []
|
937
|
+
}),
|
938
|
+
smalltalk.HLKeyBinderHelper);
|
939
|
+
|
940
|
+
smalltalk.addMethod(
|
941
|
+
"_renderSelectionOn_",
|
942
|
+
smalltalk.method({
|
943
|
+
selector: "renderSelectionOn:",
|
944
|
+
category: 'rendering',
|
945
|
+
fn: function (html) {
|
946
|
+
var self = this;
|
947
|
+
var $1, $4, $3, $2;
|
948
|
+
$1 = smalltalk.send(html, "_span", []);
|
949
|
+
smalltalk.send($1, "_class_", ["selected"]);
|
950
|
+
$4 = smalltalk.send(smalltalk.send(self, "_selectedBinding", []), "_label", []);
|
951
|
+
if (($receiver = $4) == nil || $receiver == undefined) {
|
952
|
+
$3 = "Action";
|
953
|
+
} else {
|
954
|
+
$3 = $4;
|
955
|
+
}
|
956
|
+
$2 = smalltalk.send($1, "_with_", [$3]);
|
957
|
+
return self;
|
958
|
+
},
|
959
|
+
args: ["html"],
|
960
|
+
source: "renderSelectionOn: html\x0a\x09\x09html span \x0a \x09class: 'selected'; \x0a with: (self selectedBinding label ifNil: [ 'Action' ])",
|
961
|
+
messageSends: ["class:", "span", "with:", "ifNil:", "label", "selectedBinding"],
|
962
|
+
referencedClasses: []
|
963
|
+
}),
|
964
|
+
smalltalk.HLKeyBinderHelper);
|
965
|
+
|
966
|
+
smalltalk.addMethod(
|
967
|
+
"_selectedBinding",
|
968
|
+
smalltalk.method({
|
969
|
+
selector: "selectedBinding",
|
970
|
+
category: 'accessing',
|
971
|
+
fn: function () {
|
972
|
+
var self = this;
|
973
|
+
var $1;
|
974
|
+
$1 = smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_selectedBinding", []);
|
975
|
+
return $1;
|
976
|
+
},
|
977
|
+
args: [],
|
978
|
+
source: "selectedBinding\x0a\x09^ self keyBinder selectedBinding",
|
979
|
+
messageSends: ["selectedBinding", "keyBinder"],
|
980
|
+
referencedClasses: []
|
981
|
+
}),
|
982
|
+
smalltalk.HLKeyBinderHelper);
|
983
|
+
|
984
|
+
smalltalk.addMethod(
|
985
|
+
"_show",
|
986
|
+
smalltalk.method({
|
987
|
+
selector: "show",
|
988
|
+
category: 'actions',
|
989
|
+
fn: function () {
|
990
|
+
var self = this;
|
991
|
+
smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
|
992
|
+
return self;
|
993
|
+
},
|
994
|
+
args: [],
|
995
|
+
source: "show\x0a\x09self appendToJQuery: 'body' asJQuery",
|
996
|
+
messageSends: ["appendToJQuery:", "asJQuery"],
|
997
|
+
referencedClasses: []
|
998
|
+
}),
|
999
|
+
smalltalk.HLKeyBinderHelper);
|
1000
|
+
|
1001
|
+
|
1002
|
+
smalltalk.addMethod(
|
1003
|
+
"_on_",
|
1004
|
+
smalltalk.method({
|
1005
|
+
selector: "on:",
|
1006
|
+
category: 'instance creation',
|
1007
|
+
fn: function (aKeyBinder) {
|
1008
|
+
var self = this;
|
1009
|
+
var $2, $3, $1;
|
1010
|
+
$2 = smalltalk.send(self, "_new", []);
|
1011
|
+
smalltalk.send($2, "_keyBinder_", [aKeyBinder]);
|
1012
|
+
$3 = smalltalk.send($2, "_yourself", []);
|
1013
|
+
$1 = $3;
|
1014
|
+
return $1;
|
1015
|
+
},
|
1016
|
+
args: ["aKeyBinder"],
|
1017
|
+
source: "on: aKeyBinder\x0a\x09^ self new\x0a \x09keyBinder: aKeyBinder;\x0a yourself",
|
1018
|
+
messageSends: ["keyBinder:", "new", "yourself"],
|
1019
|
+
referencedClasses: []
|
1020
|
+
}),
|
1021
|
+
smalltalk.HLKeyBinderHelper.klass);
|
1022
|
+
|
1023
|
+
|