resin 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. data/amber/css/amber-normalize.css +73 -73
  2. data/amber/css/amber-normalize.less +1 -1
  3. data/amber/css/amber.css +106 -106
  4. data/amber/css/helios.css +242 -0
  5. data/amber/images/hsplitter.png +0 -0
  6. data/amber/images/vsplitter.png +0 -0
  7. data/amber/js/Benchfib.deploy.js +116 -38
  8. data/amber/js/Benchfib.js +120 -42
  9. data/amber/js/Canvas.deploy.js +674 -403
  10. data/amber/js/Canvas.js +682 -411
  11. data/amber/js/Compiler-AST.deploy.js +1150 -0
  12. data/amber/js/Compiler-AST.js +1591 -0
  13. data/amber/js/Compiler-Core.deploy.js +1562 -0
  14. data/amber/js/Compiler-Core.js +1972 -0
  15. data/amber/js/Compiler-Exceptions.deploy.js +114 -0
  16. data/amber/js/Compiler-Exceptions.js +161 -0
  17. data/amber/js/Compiler-IR.deploy.js +2326 -0
  18. data/amber/js/Compiler-IR.js +3146 -0
  19. data/amber/js/Compiler-Inlining.deploy.js +1147 -0
  20. data/amber/js/Compiler-Inlining.js +1514 -0
  21. data/amber/js/Compiler-Semantic.deploy.js +1207 -0
  22. data/amber/js/Compiler-Semantic.js +1628 -0
  23. data/amber/js/Compiler-Tests.deploy.js +646 -60
  24. data/amber/js/Compiler-Tests.js +843 -82
  25. data/amber/js/Compiler.deploy.js +1097 -159
  26. data/amber/js/Compiler.js +1414 -161
  27. data/amber/js/Examples.deploy.js +31 -15
  28. data/amber/js/Examples.js +33 -17
  29. data/amber/js/Helios-Announcements.deploy.js +127 -0
  30. data/amber/js/Helios-Announcements.js +157 -0
  31. data/amber/js/Helios-Browser.deploy.js +1473 -0
  32. data/amber/js/Helios-Browser.js +1953 -0
  33. data/amber/js/Helios-Commands.deploy.js +403 -0
  34. data/amber/js/Helios-Commands.js +563 -0
  35. data/amber/js/Helios-Core.deploy.js +1070 -0
  36. data/amber/js/Helios-Core.js +1445 -0
  37. data/amber/js/Helios-Environments.deploy.js +132 -0
  38. data/amber/js/Helios-Environments.js +179 -0
  39. data/amber/js/Helios-Inspector.deploy.js +855 -0
  40. data/amber/js/Helios-Inspector.js +1155 -0
  41. data/amber/js/Helios-KeyBindings.deploy.js +753 -0
  42. data/amber/js/Helios-KeyBindings.js +1023 -0
  43. data/amber/js/Helios-Layout.deploy.js +383 -0
  44. data/amber/js/Helios-Layout.js +523 -0
  45. data/amber/js/Helios-Workspace.deploy.js +799 -0
  46. data/amber/js/Helios-Workspace.js +1074 -0
  47. data/amber/js/IDE.deploy.js +2541 -1490
  48. data/amber/js/IDE.js +2721 -1660
  49. data/amber/js/Importer-Exporter.deploy.js +671 -0
  50. data/amber/js/Importer-Exporter.js +816 -0
  51. data/amber/js/Kernel-Announcements.deploy.js +137 -20
  52. data/amber/js/Kernel-Announcements.js +176 -22
  53. data/amber/js/Kernel-Classes.deploy.js +555 -168
  54. data/amber/js/Kernel-Classes.js +662 -205
  55. data/amber/js/Kernel-Collections.deploy.js +1403 -618
  56. data/amber/js/Kernel-Collections.js +1545 -690
  57. data/amber/js/Kernel-Exceptions.deploy.js +109 -45
  58. data/amber/js/Kernel-Exceptions.js +123 -49
  59. data/amber/js/Kernel-Methods.deploy.js +196 -81
  60. data/amber/js/Kernel-Methods.js +214 -89
  61. data/amber/js/Kernel-Objects.deploy.js +1542 -1117
  62. data/amber/js/Kernel-Objects.js +1593 -1148
  63. data/amber/js/Kernel-Tests.deploy.js +1725 -772
  64. data/amber/js/Kernel-Tests.js +2301 -1123
  65. data/amber/js/Kernel-Transcript.deploy.js +23 -25
  66. data/amber/js/Kernel-Transcript.js +24 -26
  67. data/amber/js/SUnit.deploy.js +204 -131
  68. data/amber/js/SUnit.js +222 -139
  69. data/amber/js/Spaces.deploy.js +240 -0
  70. data/amber/js/Spaces.js +326 -0
  71. data/amber/js/amber.js +26 -7
  72. data/amber/js/boot.js +65 -47
  73. data/amber/js/init.js +1 -1
  74. data/amber/js/lib/CodeMirror/amber.css +21 -21
  75. data/amber/js/lib/CodeMirror/codemirror.css +119 -13
  76. data/amber/js/lib/CodeMirror/codemirror.js +2219 -1220
  77. data/amber/js/lib/CodeMirror/smalltalk.js +134 -129
  78. data/amber/js/lib/bootstrap/css/bootstrap.css +5837 -0
  79. data/amber/js/lib/bootstrap/css/bootstrap.min.css +841 -0
  80. data/amber/js/lib/bootstrap/img/glyphicons-halflings-white.png +0 -0
  81. data/amber/js/lib/bootstrap/img/glyphicons-halflings.png +0 -0
  82. data/amber/js/lib/bootstrap/js/bootstrap.js +2038 -0
  83. data/amber/js/lib/bootstrap/js/bootstrap.min.js +7 -0
  84. data/amber/js/lib/jQuery/jquery-1.8.2.min.js +2 -0
  85. data/amber/js/lib/jQuery/jquery-ui-1.8.24.custom.min.js +125 -0
  86. data/amber/st/Compiler-AST.st +505 -0
  87. data/amber/st/Compiler-Core.st +835 -0
  88. data/amber/st/Compiler-Exceptions.st +87 -0
  89. data/amber/st/Compiler-IR.st +1097 -0
  90. data/amber/st/Compiler-Inlining.st +650 -0
  91. data/amber/st/Compiler-Semantic.st +558 -0
  92. data/amber/st/Compiler-Tests.st +285 -381
  93. data/amber/st/Compiler.st +725 -2
  94. data/amber/st/Helios-Announcements.st +104 -0
  95. data/amber/st/Helios-Browser.st +708 -0
  96. data/amber/st/Helios-Commands.st +223 -0
  97. data/amber/st/Helios-Core.st +532 -0
  98. data/amber/st/Helios-Environments.st +98 -0
  99. data/amber/st/Helios-Inspector.st +367 -0
  100. data/amber/st/Helios-KeyBindings.st +337 -0
  101. data/amber/st/Helios-Layout.st +199 -0
  102. data/amber/st/Helios-Workspace.st +367 -0
  103. data/amber/st/IDE.st +75 -53
  104. data/amber/st/Importer-Exporter.st +386 -0
  105. data/amber/st/Kernel-Announcements.st +92 -0
  106. data/amber/st/Kernel-Classes.st +137 -15
  107. data/amber/st/Kernel-Collections.st +137 -47
  108. data/amber/st/Kernel-Exceptions.st +14 -0
  109. data/amber/st/Kernel-Methods.st +9 -1
  110. data/amber/st/Kernel-Objects.st +29 -5
  111. data/amber/st/Kernel-Tests.st +545 -199
  112. data/amber/st/SUnit.st +10 -0
  113. data/amber/st/Spaces.st +142 -0
  114. data/lib/resin/app.rb +1 -1
  115. metadata +86 -31
  116. data/amber/js/lib/jQuery/jquery-1.4.4.min.js +0 -167
  117. data/amber/js/lib/jQuery/jquery-1.6.4.min.js +0 -4
@@ -0,0 +1,753 @@
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
+ fn: function (aKeyBinder) {
8
+ var self = this;
9
+ smalltalk.send(self, "_subclassResponsibility", []);
10
+ return self;
11
+ }
12
+ }),
13
+ smalltalk.HLBinding);
14
+
15
+ smalltalk.addMethod(
16
+ "_isBindingAction",
17
+ smalltalk.method({
18
+ selector: "isBindingAction",
19
+ fn: function () {
20
+ var self = this;
21
+ return false;
22
+ }
23
+ }),
24
+ smalltalk.HLBinding);
25
+
26
+ smalltalk.addMethod(
27
+ "_isBindingGroup",
28
+ smalltalk.method({
29
+ selector: "isBindingGroup",
30
+ fn: function () {
31
+ var self = this;
32
+ return false;
33
+ }
34
+ }),
35
+ smalltalk.HLBinding);
36
+
37
+ smalltalk.addMethod(
38
+ "_key",
39
+ smalltalk.method({
40
+ selector: "key",
41
+ fn: function () {
42
+ var self = this;
43
+ return self['@key'];
44
+ }
45
+ }),
46
+ smalltalk.HLBinding);
47
+
48
+ smalltalk.addMethod(
49
+ "_key_",
50
+ smalltalk.method({
51
+ selector: "key:",
52
+ fn: function (anInteger) {
53
+ var self = this;
54
+ self['@key'] = anInteger;
55
+ return self;
56
+ }
57
+ }),
58
+ smalltalk.HLBinding);
59
+
60
+ smalltalk.addMethod(
61
+ "_label",
62
+ smalltalk.method({
63
+ selector: "label",
64
+ fn: function () {
65
+ var self = this;
66
+ return self['@label'];
67
+ }
68
+ }),
69
+ smalltalk.HLBinding);
70
+
71
+ smalltalk.addMethod(
72
+ "_label_",
73
+ smalltalk.method({
74
+ selector: "label:",
75
+ fn: function (aString) {
76
+ var self = this;
77
+ self['@label'] = aString;
78
+ return self;
79
+ }
80
+ }),
81
+ smalltalk.HLBinding);
82
+
83
+ smalltalk.addMethod(
84
+ "_renderOn_html_",
85
+ smalltalk.method({
86
+ selector: "renderOn:html:",
87
+ fn: function (aBindingHelper, html) {
88
+ var self = this;
89
+ return self;
90
+ }
91
+ }),
92
+ smalltalk.HLBinding);
93
+
94
+ smalltalk.addMethod(
95
+ "_shortcut",
96
+ smalltalk.method({
97
+ selector: "shortcut",
98
+ fn: function () {
99
+ var self = this;
100
+ var $1;
101
+ $1 = smalltalk.send(smalltalk.String || String, "_fromCharCode_", [smalltalk.send(self, "_key", [])]);
102
+ return $1;
103
+ }
104
+ }),
105
+ smalltalk.HLBinding);
106
+
107
+
108
+ smalltalk.addMethod(
109
+ "_on_labelled_",
110
+ smalltalk.method({
111
+ selector: "on:labelled:",
112
+ fn: function (anInteger, aString) {
113
+ var self = this;
114
+ var $2, $3, $1;
115
+ $2 = smalltalk.send(self, "_new", []);
116
+ smalltalk.send($2, "_key_", [anInteger]);
117
+ smalltalk.send($2, "_label_", [aString]);
118
+ $3 = smalltalk.send($2, "_yourself", []);
119
+ $1 = $3;
120
+ return $1;
121
+ }
122
+ }),
123
+ smalltalk.HLBinding.klass);
124
+
125
+
126
+ smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['callback'], 'Helios-KeyBindings');
127
+ smalltalk.addMethod(
128
+ "_applyOn_",
129
+ smalltalk.method({
130
+ selector: "applyOn:",
131
+ fn: function (aKeyBinder) {
132
+ var self = this;
133
+ smalltalk.send(aKeyBinder, "_applyBindingAction_", [self]);
134
+ return self;
135
+ }
136
+ }),
137
+ smalltalk.HLBindingAction);
138
+
139
+ smalltalk.addMethod(
140
+ "_callback",
141
+ smalltalk.method({
142
+ selector: "callback",
143
+ fn: function () {
144
+ var self = this;
145
+ return self['@callback'];
146
+ }
147
+ }),
148
+ smalltalk.HLBindingAction);
149
+
150
+ smalltalk.addMethod(
151
+ "_callback_",
152
+ smalltalk.method({
153
+ selector: "callback:",
154
+ fn: function (aBlock) {
155
+ var self = this;
156
+ self['@callback'] = aBlock;
157
+ return self;
158
+ }
159
+ }),
160
+ smalltalk.HLBindingAction);
161
+
162
+ smalltalk.addMethod(
163
+ "_isBindingAction",
164
+ smalltalk.method({
165
+ selector: "isBindingAction",
166
+ fn: function () {
167
+ var self = this;
168
+ return true;
169
+ }
170
+ }),
171
+ smalltalk.HLBindingAction);
172
+
173
+
174
+
175
+ smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
176
+ smalltalk.addMethod(
177
+ "_add_",
178
+ smalltalk.method({
179
+ selector: "add:",
180
+ fn: function (aBinding) {
181
+ var self = this;
182
+ var $1;
183
+ $1 = smalltalk.send(smalltalk.send(self, "_bindings", []), "_add_", [aBinding]);
184
+ return $1;
185
+ }
186
+ }),
187
+ smalltalk.HLBindingGroup);
188
+
189
+ smalltalk.addMethod(
190
+ "_addActionKey_labelled_callback_",
191
+ smalltalk.method({
192
+ selector: "addActionKey:labelled:callback:",
193
+ fn: function (anInteger, aString, aBlock) {
194
+ var self = this;
195
+ var $1, $2;
196
+ $1 = smalltalk.send(smalltalk.HLBindingAction || HLBindingAction, "_on_labelled_", [anInteger, aString]);
197
+ smalltalk.send($1, "_callback_", [aBlock]);
198
+ $2 = smalltalk.send($1, "_yourself", []);
199
+ smalltalk.send(self, "_add_", [$2]);
200
+ return self;
201
+ }
202
+ }),
203
+ smalltalk.HLBindingGroup);
204
+
205
+ smalltalk.addMethod(
206
+ "_addActionKey_labelled_command_",
207
+ smalltalk.method({
208
+ selector: "addActionKey:labelled:command:",
209
+ fn: function (anInteger, aString, aCommand) {
210
+ var self = this;
211
+ var $1, $2;
212
+ $1 = smalltalk.send(smalltalk.HLBindingAction || HLBindingAction, "_on_labelled_", [anInteger, aString]);
213
+ smalltalk.send($1, "_command_", [aCommand]);
214
+ $2 = smalltalk.send($1, "_yourself", []);
215
+ smalltalk.send(self, "_add_", [$2]);
216
+ return self;
217
+ }
218
+ }),
219
+ smalltalk.HLBindingGroup);
220
+
221
+ smalltalk.addMethod(
222
+ "_addGroupKey_labelled_",
223
+ smalltalk.method({
224
+ selector: "addGroupKey:labelled:",
225
+ fn: function (anInteger, aString) {
226
+ var self = this;
227
+ smalltalk.send(self, "_add_", [smalltalk.send(smalltalk.HLBindingGroup || HLBindingGroup, "_on_labelled_", [anInteger, aString])]);
228
+ return self;
229
+ }
230
+ }),
231
+ smalltalk.HLBindingGroup);
232
+
233
+ smalltalk.addMethod(
234
+ "_applyOn_",
235
+ smalltalk.method({
236
+ selector: "applyOn:",
237
+ fn: function (aKeyBinder) {
238
+ var self = this;
239
+ smalltalk.send(aKeyBinder, "_applyBindingGroup_", [self]);
240
+ return self;
241
+ }
242
+ }),
243
+ smalltalk.HLBindingGroup);
244
+
245
+ smalltalk.addMethod(
246
+ "_at_",
247
+ smalltalk.method({
248
+ selector: "at:",
249
+ fn: function (aString) {
250
+ var self = this;
251
+ var $1;
252
+ $1 = smalltalk.send(smalltalk.send(self, "_bindings", []), "_detect_ifNone_", [function (each) {return smalltalk.send(smalltalk.send(each, "_label", []), "__eq", [aString]);}, function () {return nil;}]);
253
+ return $1;
254
+ }
255
+ }),
256
+ smalltalk.HLBindingGroup);
257
+
258
+ smalltalk.addMethod(
259
+ "_atKey_",
260
+ smalltalk.method({
261
+ selector: "atKey:",
262
+ fn: function (anInteger) {
263
+ var self = this;
264
+ var $1;
265
+ $1 = smalltalk.send(smalltalk.send(self, "_bindings", []), "_detect_ifNone_", [function (each) {return smalltalk.send(smalltalk.send(each, "_key", []), "__eq", [anInteger]);}, function () {return nil;}]);
266
+ return $1;
267
+ }
268
+ }),
269
+ smalltalk.HLBindingGroup);
270
+
271
+ smalltalk.addMethod(
272
+ "_bindings",
273
+ smalltalk.method({
274
+ selector: "bindings",
275
+ fn: function () {
276
+ var self = this;
277
+ var $1;
278
+ if (($receiver = self['@bindings']) == nil || $receiver == undefined) {
279
+ self['@bindings'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
280
+ $1 = self['@bindings'];
281
+ } else {
282
+ $1 = self['@bindings'];
283
+ }
284
+ return $1;
285
+ }
286
+ }),
287
+ smalltalk.HLBindingGroup);
288
+
289
+ smalltalk.addMethod(
290
+ "_isBindingGroup",
291
+ smalltalk.method({
292
+ selector: "isBindingGroup",
293
+ fn: function () {
294
+ var self = this;
295
+ return true;
296
+ }
297
+ }),
298
+ smalltalk.HLBindingGroup);
299
+
300
+ smalltalk.addMethod(
301
+ "_renderOn_html_",
302
+ smalltalk.method({
303
+ selector: "renderOn:html:",
304
+ fn: function (aBindingHelper, html) {
305
+ var self = this;
306
+ smalltalk.send(aBindingHelper, "_renderBindingGroup_on_", [self, html]);
307
+ return self;
308
+ }
309
+ }),
310
+ smalltalk.HLBindingGroup);
311
+
312
+
313
+
314
+ smalltalk.addClass('HLKeyBinder', smalltalk.Object, ['modifierKey', 'active', 'helper', 'bindings', 'selectedBinding'], 'Helios-KeyBindings');
315
+ smalltalk.addMethod(
316
+ "_activate",
317
+ smalltalk.method({
318
+ selector: "activate",
319
+ fn: function () {
320
+ var self = this;
321
+ self['@active'] = true;
322
+ smalltalk.send(smalltalk.send(self, "_helper", []), "_show", []);
323
+ return self;
324
+ }
325
+ }),
326
+ smalltalk.HLKeyBinder);
327
+
328
+ smalltalk.addMethod(
329
+ "_activationKey",
330
+ smalltalk.method({
331
+ selector: "activationKey",
332
+ fn: function () {
333
+ var self = this;
334
+ return 32;
335
+ }
336
+ }),
337
+ smalltalk.HLKeyBinder);
338
+
339
+ smalltalk.addMethod(
340
+ "_applyBinding_",
341
+ smalltalk.method({
342
+ selector: "applyBinding:",
343
+ fn: function (aBinding) {
344
+ var self = this;
345
+ smalltalk.send(aBinding, "_applyOn_", [self]);
346
+ return self;
347
+ }
348
+ }),
349
+ smalltalk.HLKeyBinder);
350
+
351
+ smalltalk.addMethod(
352
+ "_applyBindingAction_",
353
+ smalltalk.method({
354
+ selector: "applyBindingAction:",
355
+ fn: function (aBinding) {
356
+ var self = this;
357
+ smalltalk.send(smalltalk.send(aBinding, "_callback", []), "_value", []);
358
+ smalltalk.send(self, "_deactivate", []);
359
+ return self;
360
+ }
361
+ }),
362
+ smalltalk.HLKeyBinder);
363
+
364
+ smalltalk.addMethod(
365
+ "_applyBindingGroup_",
366
+ smalltalk.method({
367
+ selector: "applyBindingGroup:",
368
+ fn: function (aBinding) {
369
+ var self = this;
370
+ self['@selectedBinding'] = aBinding;
371
+ smalltalk.send(smalltalk.send(self, "_helper", []), "_refresh", []);
372
+ return self;
373
+ }
374
+ }),
375
+ smalltalk.HLKeyBinder);
376
+
377
+ smalltalk.addMethod(
378
+ "_bindings",
379
+ smalltalk.method({
380
+ selector: "bindings",
381
+ fn: function () {
382
+ var self = this;
383
+ var $1;
384
+ if (($receiver = self['@bindings']) == nil || $receiver == undefined) {
385
+ self['@bindings'] = smalltalk.send(smalltalk.HLBindingGroup || HLBindingGroup, "_new", []);
386
+ $1 = self['@bindings'];
387
+ } else {
388
+ $1 = self['@bindings'];
389
+ }
390
+ return $1;
391
+ }
392
+ }),
393
+ smalltalk.HLKeyBinder);
394
+
395
+ smalltalk.addMethod(
396
+ "_deactivate",
397
+ smalltalk.method({
398
+ selector: "deactivate",
399
+ fn: function () {
400
+ var self = this;
401
+ self['@active'] = false;
402
+ self['@selectedBinding'] = nil;
403
+ smalltalk.send(smalltalk.send(self, "_helper", []), "_hide", []);
404
+ return self;
405
+ }
406
+ }),
407
+ smalltalk.HLKeyBinder);
408
+
409
+ smalltalk.addMethod(
410
+ "_escapeKey",
411
+ smalltalk.method({
412
+ selector: "escapeKey",
413
+ fn: function () {
414
+ var self = this;
415
+ return 27;
416
+ }
417
+ }),
418
+ smalltalk.HLKeyBinder);
419
+
420
+ smalltalk.addMethod(
421
+ "_flushBindings",
422
+ smalltalk.method({
423
+ selector: "flushBindings",
424
+ fn: function () {
425
+ var self = this;
426
+ self['@bindings'] = nil;
427
+ self['@helper'] = nil;
428
+ return self;
429
+ }
430
+ }),
431
+ smalltalk.HLKeyBinder);
432
+
433
+ smalltalk.addMethod(
434
+ "_handleActiveKeyDown_",
435
+ smalltalk.method({
436
+ selector: "handleActiveKeyDown:",
437
+ fn: function (event) {
438
+ var self = this;
439
+ var $1, $2;
440
+ $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", []);}]);}]);
441
+ if (smalltalk.assert($1)) {
442
+ smalltalk.send(self, "_deactivate", []);
443
+ smalltalk.send(event, "_preventDefault", []);
444
+ return false;
445
+ }
446
+ $2 = smalltalk.send(self, "_handleBindingFor_", [event]);
447
+ return $2;
448
+ }
449
+ }),
450
+ smalltalk.HLKeyBinder);
451
+
452
+ smalltalk.addMethod(
453
+ "_handleBindingFor_",
454
+ smalltalk.method({
455
+ selector: "handleBindingFor:",
456
+ fn: function (anEvent) {
457
+ var self = this;
458
+ var binding;
459
+ binding = smalltalk.send(smalltalk.send(self, "_selectedBinding", []), "_atKey_", [smalltalk.send(anEvent, "_which", [])]);
460
+ if (($receiver = binding) == nil || $receiver == undefined) {
461
+ } else {
462
+ smalltalk.send(self, "_applyBinding_", [binding]);
463
+ smalltalk.send(anEvent, "_preventDefault", []);
464
+ return false;
465
+ }
466
+ return self;
467
+ }
468
+ }),
469
+ smalltalk.HLKeyBinder);
470
+
471
+ smalltalk.addMethod(
472
+ "_handleInactiveKeyDown_",
473
+ smalltalk.method({
474
+ selector: "handleInactiveKeyDown:",
475
+ fn: function (event) {
476
+ var self = this;
477
+ var $1, $2;
478
+ $1 = smalltalk.send(smalltalk.send(event, "_which", []), "__eq", [smalltalk.send(self, "_activationKey", [])]);
479
+ if (smalltalk.assert($1)) {
480
+ $2 = smalltalk.send(event, "_ctrlKey", []);
481
+ if (smalltalk.assert($2)) {
482
+ smalltalk.send(self, "_activate", []);
483
+ smalltalk.send(event, "_preventDefault", []);
484
+ return false;
485
+ }
486
+ }
487
+ return self;
488
+ }
489
+ }),
490
+ smalltalk.HLKeyBinder);
491
+
492
+ smalltalk.addMethod(
493
+ "_handleKeyDown_",
494
+ smalltalk.method({
495
+ selector: "handleKeyDown:",
496
+ fn: function (event) {
497
+ var self = this;
498
+ var $2, $1;
499
+ $2 = smalltalk.send(self, "_isActive", []);
500
+ if (smalltalk.assert($2)) {
501
+ $1 = smalltalk.send(self, "_handleActiveKeyDown_", [event]);
502
+ } else {
503
+ $1 = smalltalk.send(self, "_handleInactiveKeyDown_", [event]);
504
+ }
505
+ return $1;
506
+ }
507
+ }),
508
+ smalltalk.HLKeyBinder);
509
+
510
+ smalltalk.addMethod(
511
+ "_helper",
512
+ smalltalk.method({
513
+ selector: "helper",
514
+ fn: function () {
515
+ var self = this;
516
+ var $1;
517
+ if (($receiver = self['@helper']) == nil || $receiver == undefined) {
518
+ self['@helper'] = smalltalk.send(smalltalk.HLKeyBinderHelper || HLKeyBinderHelper, "_on_", [self]);
519
+ $1 = self['@helper'];
520
+ } else {
521
+ $1 = self['@helper'];
522
+ }
523
+ return $1;
524
+ }
525
+ }),
526
+ smalltalk.HLKeyBinder);
527
+
528
+ smalltalk.addMethod(
529
+ "_initialize",
530
+ smalltalk.method({
531
+ selector: "initialize",
532
+ fn: function () {
533
+ var self = this;
534
+ smalltalk.send(self, "_initialize", [], smalltalk.Object);
535
+ self['@active'] = false;
536
+ return self;
537
+ }
538
+ }),
539
+ smalltalk.HLKeyBinder);
540
+
541
+ smalltalk.addMethod(
542
+ "_isActive",
543
+ smalltalk.method({
544
+ selector: "isActive",
545
+ fn: function () {
546
+ var self = this;
547
+ var $1;
548
+ if (($receiver = self['@active']) == nil || $receiver == undefined) {
549
+ $1 = false;
550
+ } else {
551
+ $1 = self['@active'];
552
+ }
553
+ return $1;
554
+ }
555
+ }),
556
+ smalltalk.HLKeyBinder);
557
+
558
+ smalltalk.addMethod(
559
+ "_selectedBinding",
560
+ smalltalk.method({
561
+ selector: "selectedBinding",
562
+ fn: function () {
563
+ var self = this;
564
+ var $1;
565
+ if (($receiver = self['@selectedBinding']) == nil ||
566
+ $receiver == undefined) {
567
+ $1 = smalltalk.send(self, "_bindings", []);
568
+ } else {
569
+ $1 = self['@selectedBinding'];
570
+ }
571
+ return $1;
572
+ }
573
+ }),
574
+ smalltalk.HLKeyBinder);
575
+
576
+ smalltalk.addMethod(
577
+ "_setupEvents",
578
+ smalltalk.method({
579
+ selector: "setupEvents",
580
+ fn: function () {
581
+ var self = this;
582
+ smalltalk.send(smalltalk.send(window, "_jQuery_", ["body"]), "_keydown_", [function (event) {return smalltalk.send(self, "_handleKeyDown_", [event]);}]);
583
+ return self;
584
+ }
585
+ }),
586
+ smalltalk.HLKeyBinder);
587
+
588
+ smalltalk.addMethod(
589
+ "_systemIsMac",
590
+ smalltalk.method({
591
+ selector: "systemIsMac",
592
+ fn: function () {
593
+ var self = this;
594
+ var $1;
595
+ $1 = smalltalk.send(smalltalk.send(navigator, "_platform", []), "_match_", ["Mac"]);
596
+ return $1;
597
+ }
598
+ }),
599
+ smalltalk.HLKeyBinder);
600
+
601
+
602
+
603
+ smalltalk.addClass('HLKeyBinderHelper', smalltalk.HLWidget, ['keyBinder'], 'Helios-KeyBindings');
604
+ smalltalk.addMethod(
605
+ "_hide",
606
+ smalltalk.method({
607
+ selector: "hide",
608
+ fn: function () {
609
+ var self = this;
610
+ smalltalk.send(smalltalk.send(self['@rootDiv'], "_asJQuery", []), "_remove", []);
611
+ return self;
612
+ }
613
+ }),
614
+ smalltalk.HLKeyBinderHelper);
615
+
616
+ smalltalk.addMethod(
617
+ "_keyBinder",
618
+ smalltalk.method({
619
+ selector: "keyBinder",
620
+ fn: function () {
621
+ var self = this;
622
+ return self['@keyBinder'];
623
+ }
624
+ }),
625
+ smalltalk.HLKeyBinderHelper);
626
+
627
+ smalltalk.addMethod(
628
+ "_keyBinder_",
629
+ smalltalk.method({
630
+ selector: "keyBinder:",
631
+ fn: function (aKeyBinder) {
632
+ var self = this;
633
+ self['@keyBinder'] = aKeyBinder;
634
+ return self;
635
+ }
636
+ }),
637
+ smalltalk.HLKeyBinderHelper);
638
+
639
+ smalltalk.addMethod(
640
+ "_registerBindings",
641
+ smalltalk.method({
642
+ selector: "registerBindings",
643
+ fn: function () {
644
+ var self = this;
645
+ return self;
646
+ }
647
+ }),
648
+ smalltalk.HLKeyBinderHelper);
649
+
650
+ smalltalk.addMethod(
651
+ "_renderBindingGroup_on_",
652
+ smalltalk.method({
653
+ selector: "renderBindingGroup:on:",
654
+ fn: function (aBindingGroup, html) {
655
+ var self = this;
656
+ var $1, $3, $4, $5, $6, $2;
657
+ 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;}]);
658
+ return self;
659
+ }
660
+ }),
661
+ smalltalk.HLKeyBinderHelper);
662
+
663
+ smalltalk.addMethod(
664
+ "_renderBindingOn_",
665
+ smalltalk.method({
666
+ selector: "renderBindingOn:",
667
+ fn: function (html) {
668
+ var self = this;
669
+ smalltalk.send(smalltalk.send(self, "_selectedBinding", []), "_renderOn_html_", [self, html]);
670
+ return self;
671
+ }
672
+ }),
673
+ smalltalk.HLKeyBinderHelper);
674
+
675
+ smalltalk.addMethod(
676
+ "_renderContentOn_",
677
+ smalltalk.method({
678
+ selector: "renderContentOn:",
679
+ fn: function (html) {
680
+ var self = this;
681
+ var $1, $3, $2;
682
+ $1 = smalltalk.send(html, "_div", []);
683
+ smalltalk.send($1, "_class_", ["key_helper"]);
684
+ $2 = smalltalk.send($1, "_with_", [function () {smalltalk.send(self, "_renderSelectionOn_", [html]);$3 = smalltalk.send(self, "_renderBindingOn_", [html]);return $3;}]);
685
+ return self;
686
+ }
687
+ }),
688
+ smalltalk.HLKeyBinderHelper);
689
+
690
+ smalltalk.addMethod(
691
+ "_renderSelectionOn_",
692
+ smalltalk.method({
693
+ selector: "renderSelectionOn:",
694
+ fn: function (html) {
695
+ var self = this;
696
+ var $1, $4, $3, $2;
697
+ $1 = smalltalk.send(html, "_span", []);
698
+ smalltalk.send($1, "_class_", ["selected"]);
699
+ $4 = smalltalk.send(smalltalk.send(self, "_selectedBinding", []), "_label", []);
700
+ if (($receiver = $4) == nil || $receiver == undefined) {
701
+ $3 = "Action";
702
+ } else {
703
+ $3 = $4;
704
+ }
705
+ $2 = smalltalk.send($1, "_with_", [$3]);
706
+ return self;
707
+ }
708
+ }),
709
+ smalltalk.HLKeyBinderHelper);
710
+
711
+ smalltalk.addMethod(
712
+ "_selectedBinding",
713
+ smalltalk.method({
714
+ selector: "selectedBinding",
715
+ fn: function () {
716
+ var self = this;
717
+ var $1;
718
+ $1 = smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_selectedBinding", []);
719
+ return $1;
720
+ }
721
+ }),
722
+ smalltalk.HLKeyBinderHelper);
723
+
724
+ smalltalk.addMethod(
725
+ "_show",
726
+ smalltalk.method({
727
+ selector: "show",
728
+ fn: function () {
729
+ var self = this;
730
+ smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
731
+ return self;
732
+ }
733
+ }),
734
+ smalltalk.HLKeyBinderHelper);
735
+
736
+
737
+ smalltalk.addMethod(
738
+ "_on_",
739
+ smalltalk.method({
740
+ selector: "on:",
741
+ fn: function (aKeyBinder) {
742
+ var self = this;
743
+ var $2, $3, $1;
744
+ $2 = smalltalk.send(self, "_new", []);
745
+ smalltalk.send($2, "_keyBinder_", [aKeyBinder]);
746
+ $3 = smalltalk.send($2, "_yourself", []);
747
+ $1 = $3;
748
+ return $1;
749
+ }
750
+ }),
751
+ smalltalk.HLKeyBinderHelper.klass);
752
+
753
+