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,1445 @@
|
|
1
|
+
smalltalk.addPackage('Helios-Core', {});
|
2
|
+
smalltalk.addClass('HLTab', smalltalk.Object, ['widget', 'label'], 'Helios-Core');
|
3
|
+
smalltalk.addMethod(
|
4
|
+
"_activate",
|
5
|
+
smalltalk.method({
|
6
|
+
selector: "activate",
|
7
|
+
category: 'accessing',
|
8
|
+
fn: function () {
|
9
|
+
var self = this;
|
10
|
+
smalltalk.send(smalltalk.send(self, "_manager", []), "_activate_", [self]);
|
11
|
+
return self;
|
12
|
+
},
|
13
|
+
args: [],
|
14
|
+
source: "activate\x0a\x09self manager activate: self",
|
15
|
+
messageSends: ["activate:", "manager"],
|
16
|
+
referencedClasses: []
|
17
|
+
}),
|
18
|
+
smalltalk.HLTab);
|
19
|
+
|
20
|
+
smalltalk.addMethod(
|
21
|
+
"_add",
|
22
|
+
smalltalk.method({
|
23
|
+
selector: "add",
|
24
|
+
category: 'accessing',
|
25
|
+
fn: function () {
|
26
|
+
var self = this;
|
27
|
+
smalltalk.send(smalltalk.send(self, "_manager", []), "_addTab_", [self]);
|
28
|
+
return self;
|
29
|
+
},
|
30
|
+
args: [],
|
31
|
+
source: "add\x0a\x09self manager addTab: self",
|
32
|
+
messageSends: ["addTab:", "manager"],
|
33
|
+
referencedClasses: []
|
34
|
+
}),
|
35
|
+
smalltalk.HLTab);
|
36
|
+
|
37
|
+
smalltalk.addMethod(
|
38
|
+
"_isActive",
|
39
|
+
smalltalk.method({
|
40
|
+
selector: "isActive",
|
41
|
+
category: 'testing',
|
42
|
+
fn: function () {
|
43
|
+
var self = this;
|
44
|
+
var $1;
|
45
|
+
$1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_manager", []), "_activeTab", []), "__eq", [self]);
|
46
|
+
return $1;
|
47
|
+
},
|
48
|
+
args: [],
|
49
|
+
source: "isActive\x0a\x09^ self manager activeTab = self",
|
50
|
+
messageSends: ["=", "activeTab", "manager"],
|
51
|
+
referencedClasses: []
|
52
|
+
}),
|
53
|
+
smalltalk.HLTab);
|
54
|
+
|
55
|
+
smalltalk.addMethod(
|
56
|
+
"_label",
|
57
|
+
smalltalk.method({
|
58
|
+
selector: "label",
|
59
|
+
category: 'accessing',
|
60
|
+
fn: function () {
|
61
|
+
var self = this;
|
62
|
+
var $1;
|
63
|
+
if (($receiver = self['@label']) == nil || $receiver == undefined) {
|
64
|
+
$1 = "";
|
65
|
+
} else {
|
66
|
+
$1 = self['@label'];
|
67
|
+
}
|
68
|
+
return $1;
|
69
|
+
},
|
70
|
+
args: [],
|
71
|
+
source: "label\x0a\x09^ label ifNil: [ '' ]",
|
72
|
+
messageSends: ["ifNil:"],
|
73
|
+
referencedClasses: []
|
74
|
+
}),
|
75
|
+
smalltalk.HLTab);
|
76
|
+
|
77
|
+
smalltalk.addMethod(
|
78
|
+
"_label_",
|
79
|
+
smalltalk.method({
|
80
|
+
selector: "label:",
|
81
|
+
category: 'accessing',
|
82
|
+
fn: function (aString) {
|
83
|
+
var self = this;
|
84
|
+
self['@label'] = aString;
|
85
|
+
return self;
|
86
|
+
},
|
87
|
+
args: ["aString"],
|
88
|
+
source: "label: aString\x0a\x09label := aString",
|
89
|
+
messageSends: [],
|
90
|
+
referencedClasses: []
|
91
|
+
}),
|
92
|
+
smalltalk.HLTab);
|
93
|
+
|
94
|
+
smalltalk.addMethod(
|
95
|
+
"_manager",
|
96
|
+
smalltalk.method({
|
97
|
+
selector: "manager",
|
98
|
+
category: 'accessing',
|
99
|
+
fn: function () {
|
100
|
+
var self = this;
|
101
|
+
var $1;
|
102
|
+
$1 = smalltalk.send(smalltalk.HLManager || HLManager, "_current", []);
|
103
|
+
return $1;
|
104
|
+
},
|
105
|
+
args: [],
|
106
|
+
source: "manager\x0a\x09^ HLManager current",
|
107
|
+
messageSends: ["current"],
|
108
|
+
referencedClasses: ["HLManager"]
|
109
|
+
}),
|
110
|
+
smalltalk.HLTab);
|
111
|
+
|
112
|
+
smalltalk.addMethod(
|
113
|
+
"_widget",
|
114
|
+
smalltalk.method({
|
115
|
+
selector: "widget",
|
116
|
+
category: 'accessing',
|
117
|
+
fn: function () {
|
118
|
+
var self = this;
|
119
|
+
return self['@widget'];
|
120
|
+
},
|
121
|
+
args: [],
|
122
|
+
source: "widget\x0a\x09^ widget",
|
123
|
+
messageSends: [],
|
124
|
+
referencedClasses: []
|
125
|
+
}),
|
126
|
+
smalltalk.HLTab);
|
127
|
+
|
128
|
+
smalltalk.addMethod(
|
129
|
+
"_widget_",
|
130
|
+
smalltalk.method({
|
131
|
+
selector: "widget:",
|
132
|
+
category: 'accessing',
|
133
|
+
fn: function (aWidget) {
|
134
|
+
var self = this;
|
135
|
+
self['@widget'] = aWidget;
|
136
|
+
return self;
|
137
|
+
},
|
138
|
+
args: ["aWidget"],
|
139
|
+
source: "widget: aWidget\x0a\x09widget := aWidget",
|
140
|
+
messageSends: [],
|
141
|
+
referencedClasses: []
|
142
|
+
}),
|
143
|
+
smalltalk.HLTab);
|
144
|
+
|
145
|
+
|
146
|
+
smalltalk.addMethod(
|
147
|
+
"_on_labelled_",
|
148
|
+
smalltalk.method({
|
149
|
+
selector: "on:labelled:",
|
150
|
+
category: 'instance creation',
|
151
|
+
fn: function (aWidget, aString) {
|
152
|
+
var self = this;
|
153
|
+
var $2, $3, $1;
|
154
|
+
$2 = smalltalk.send(self, "_new", []);
|
155
|
+
smalltalk.send($2, "_widget_", [aWidget]);
|
156
|
+
smalltalk.send($2, "_label_", [aString]);
|
157
|
+
$3 = smalltalk.send($2, "_yourself", []);
|
158
|
+
$1 = $3;
|
159
|
+
return $1;
|
160
|
+
},
|
161
|
+
args: ["aWidget", "aString"],
|
162
|
+
source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
|
163
|
+
messageSends: ["widget:", "new", "label:", "yourself"],
|
164
|
+
referencedClasses: []
|
165
|
+
}),
|
166
|
+
smalltalk.HLTab.klass);
|
167
|
+
|
168
|
+
|
169
|
+
smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
|
170
|
+
smalltalk.addMethod(
|
171
|
+
"_manager",
|
172
|
+
smalltalk.method({
|
173
|
+
selector: "manager",
|
174
|
+
category: 'accessing',
|
175
|
+
fn: function () {
|
176
|
+
var self = this;
|
177
|
+
var $1;
|
178
|
+
$1 = smalltalk.send(smalltalk.HLManager || HLManager, "_current", []);
|
179
|
+
return $1;
|
180
|
+
},
|
181
|
+
args: [],
|
182
|
+
source: "manager\x0a\x09^ HLManager current",
|
183
|
+
messageSends: ["current"],
|
184
|
+
referencedClasses: ["HLManager"]
|
185
|
+
}),
|
186
|
+
smalltalk.HLWidget);
|
187
|
+
|
188
|
+
smalltalk.addMethod(
|
189
|
+
"_refresh",
|
190
|
+
smalltalk.method({
|
191
|
+
selector: "refresh",
|
192
|
+
category: 'updating',
|
193
|
+
fn: function () {
|
194
|
+
var self = this;
|
195
|
+
var $1;
|
196
|
+
$1 = smalltalk.send(self, "_wrapper", []);
|
197
|
+
if (($receiver = $1) == nil || $receiver == undefined) {
|
198
|
+
return self;
|
199
|
+
} else {
|
200
|
+
}
|
201
|
+
smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_empty", []);
|
202
|
+
smalltalk.send(function (html) {return smalltalk.send(self, "_renderContentOn_", [html]);}, "_appendToJQuery_", [smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", [])]);
|
203
|
+
return self;
|
204
|
+
},
|
205
|
+
args: [],
|
206
|
+
source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
|
207
|
+
messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
|
208
|
+
referencedClasses: []
|
209
|
+
}),
|
210
|
+
smalltalk.HLWidget);
|
211
|
+
|
212
|
+
smalltalk.addMethod(
|
213
|
+
"_registerBindings",
|
214
|
+
smalltalk.method({
|
215
|
+
selector: "registerBindings",
|
216
|
+
category: 'keybindings',
|
217
|
+
fn: function () {
|
218
|
+
var self = this;
|
219
|
+
smalltalk.send(self, "_registerBindingsOn_", [smalltalk.send(smalltalk.send(smalltalk.send(self, "_manager", []), "_keyBinder", []), "_bindings", [])]);
|
220
|
+
return self;
|
221
|
+
},
|
222
|
+
args: [],
|
223
|
+
source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
|
224
|
+
messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
|
225
|
+
referencedClasses: []
|
226
|
+
}),
|
227
|
+
smalltalk.HLWidget);
|
228
|
+
|
229
|
+
smalltalk.addMethod(
|
230
|
+
"_registerBindingsOn_",
|
231
|
+
smalltalk.method({
|
232
|
+
selector: "registerBindingsOn:",
|
233
|
+
category: 'keybindings',
|
234
|
+
fn: function (aBindingGroup) {
|
235
|
+
var self = this;
|
236
|
+
return self;
|
237
|
+
},
|
238
|
+
args: ["aBindingGroup"],
|
239
|
+
source: "registerBindingsOn: aBindingGroup",
|
240
|
+
messageSends: [],
|
241
|
+
referencedClasses: []
|
242
|
+
}),
|
243
|
+
smalltalk.HLWidget);
|
244
|
+
|
245
|
+
smalltalk.addMethod(
|
246
|
+
"_renderContentOn_",
|
247
|
+
smalltalk.method({
|
248
|
+
selector: "renderContentOn:",
|
249
|
+
category: 'rendering',
|
250
|
+
fn: function (html) {
|
251
|
+
var self = this;
|
252
|
+
return self;
|
253
|
+
},
|
254
|
+
args: ["html"],
|
255
|
+
source: "renderContentOn: html\x0a",
|
256
|
+
messageSends: [],
|
257
|
+
referencedClasses: []
|
258
|
+
}),
|
259
|
+
smalltalk.HLWidget);
|
260
|
+
|
261
|
+
smalltalk.addMethod(
|
262
|
+
"_renderOn_",
|
263
|
+
smalltalk.method({
|
264
|
+
selector: "renderOn:",
|
265
|
+
category: 'rendering',
|
266
|
+
fn: function (html){
|
267
|
+
var self=this;
|
268
|
+
smalltalk.send(self,"_registerBindings",[]);
|
269
|
+
self["@wrapper"]=smalltalk.send(html,"_div",[]);
|
270
|
+
smalltalk.send((function(renderer){
|
271
|
+
return smalltalk.send(self,"_renderContentOn_",[renderer]);
|
272
|
+
}),"_appendToJQuery_",[smalltalk.send(self["@wrapper"],"_asJQuery",[])]);
|
273
|
+
return self},
|
274
|
+
args: ["html"],
|
275
|
+
source: "renderOn: html\x0a self registerBindings.\x0a\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
|
276
|
+
messageSends: ["registerBindings", "div", "appendToJQuery:", "asJQuery", "renderContentOn:"],
|
277
|
+
referencedClasses: []
|
278
|
+
}),
|
279
|
+
smalltalk.HLWidget);
|
280
|
+
|
281
|
+
smalltalk.addMethod(
|
282
|
+
"_wrapper",
|
283
|
+
smalltalk.method({
|
284
|
+
selector: "wrapper",
|
285
|
+
category: 'accessing',
|
286
|
+
fn: function () {
|
287
|
+
var self = this;
|
288
|
+
return self['@wrapper'];
|
289
|
+
},
|
290
|
+
args: [],
|
291
|
+
source: "wrapper\x0a\x09^ wrapper",
|
292
|
+
messageSends: [],
|
293
|
+
referencedClasses: []
|
294
|
+
}),
|
295
|
+
smalltalk.HLWidget);
|
296
|
+
|
297
|
+
|
298
|
+
smalltalk.addMethod(
|
299
|
+
"_canBeOpenAsTab",
|
300
|
+
smalltalk.method({
|
301
|
+
selector: "canBeOpenAsTab",
|
302
|
+
category: 'testing',
|
303
|
+
fn: function () {
|
304
|
+
var self = this;
|
305
|
+
return false;
|
306
|
+
},
|
307
|
+
args: [],
|
308
|
+
source: "canBeOpenAsTab\x0a\x09^ false",
|
309
|
+
messageSends: [],
|
310
|
+
referencedClasses: []
|
311
|
+
}),
|
312
|
+
smalltalk.HLWidget.klass);
|
313
|
+
|
314
|
+
smalltalk.addMethod(
|
315
|
+
"_openAsTab",
|
316
|
+
smalltalk.method({
|
317
|
+
selector: "openAsTab",
|
318
|
+
category: 'accessing',
|
319
|
+
fn: function () {
|
320
|
+
var self = this;
|
321
|
+
smalltalk.send(smalltalk.send(smalltalk.HLManager || HLManager, "_current", []), "_addTab_", [smalltalk.send(smalltalk.HLTab || HLTab, "_on_labelled_", [smalltalk.send(self, "_new", []), smalltalk.send(self, "_tabLabel", [])])]);
|
322
|
+
return self;
|
323
|
+
},
|
324
|
+
args: [],
|
325
|
+
source: "openAsTab\x0a\x09HLManager current addTab: (HLTab on: self new labelled: self tabLabel)",
|
326
|
+
messageSends: ["addTab:", "on:labelled:", "new", "tabLabel", "current"],
|
327
|
+
referencedClasses: ["HLTab", "HLManager"]
|
328
|
+
}),
|
329
|
+
smalltalk.HLWidget.klass);
|
330
|
+
|
331
|
+
smalltalk.addMethod(
|
332
|
+
"_tabLabel",
|
333
|
+
smalltalk.method({
|
334
|
+
selector: "tabLabel",
|
335
|
+
category: 'accessing',
|
336
|
+
fn: function () {
|
337
|
+
var self = this;
|
338
|
+
return "Tab";
|
339
|
+
},
|
340
|
+
args: [],
|
341
|
+
source: "tabLabel\x0a\x09^ 'Tab'",
|
342
|
+
messageSends: [],
|
343
|
+
referencedClasses: []
|
344
|
+
}),
|
345
|
+
smalltalk.HLWidget.klass);
|
346
|
+
|
347
|
+
smalltalk.addMethod(
|
348
|
+
"_tabPriority",
|
349
|
+
smalltalk.method({
|
350
|
+
selector: "tabPriority",
|
351
|
+
category: 'accessing',
|
352
|
+
fn: function () {
|
353
|
+
var self = this;
|
354
|
+
return 500;
|
355
|
+
},
|
356
|
+
args: [],
|
357
|
+
source: "tabPriority\x0a\x09^ 500",
|
358
|
+
messageSends: [],
|
359
|
+
referencedClasses: []
|
360
|
+
}),
|
361
|
+
smalltalk.HLWidget.klass);
|
362
|
+
|
363
|
+
|
364
|
+
smalltalk.addClass('HLDebugger', smalltalk.HLWidget, [], 'Helios-Core');
|
365
|
+
|
366
|
+
|
367
|
+
smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, ['hiddenInput'], 'Helios-Core');
|
368
|
+
smalltalk.addMethod(
|
369
|
+
"_blur",
|
370
|
+
smalltalk.method({
|
371
|
+
selector: "blur",
|
372
|
+
category: 'events',
|
373
|
+
fn: function () {
|
374
|
+
var self = this;
|
375
|
+
smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_blur", []);
|
376
|
+
return self;
|
377
|
+
},
|
378
|
+
args: [],
|
379
|
+
source: "blur\x0a\x09hiddenInput asJQuery blur",
|
380
|
+
messageSends: ["blur", "asJQuery"],
|
381
|
+
referencedClasses: []
|
382
|
+
}),
|
383
|
+
smalltalk.HLFocusableWidget);
|
384
|
+
|
385
|
+
smalltalk.addMethod(
|
386
|
+
"_focus",
|
387
|
+
smalltalk.method({
|
388
|
+
selector: "focus",
|
389
|
+
category: 'events',
|
390
|
+
fn: function () {
|
391
|
+
var self = this;
|
392
|
+
smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_focus", []);
|
393
|
+
return self;
|
394
|
+
},
|
395
|
+
args: [],
|
396
|
+
source: "focus\x0a\x09hiddenInput asJQuery focus",
|
397
|
+
messageSends: ["focus", "asJQuery"],
|
398
|
+
referencedClasses: []
|
399
|
+
}),
|
400
|
+
smalltalk.HLFocusableWidget);
|
401
|
+
|
402
|
+
smalltalk.addMethod(
|
403
|
+
"_focusClass",
|
404
|
+
smalltalk.method({
|
405
|
+
selector: "focusClass",
|
406
|
+
category: 'accessing',
|
407
|
+
fn: function () {
|
408
|
+
var self = this;
|
409
|
+
return "focused";
|
410
|
+
},
|
411
|
+
args: [],
|
412
|
+
source: "focusClass\x0a\x09^ 'focused'",
|
413
|
+
messageSends: [],
|
414
|
+
referencedClasses: []
|
415
|
+
}),
|
416
|
+
smalltalk.HLFocusableWidget);
|
417
|
+
|
418
|
+
smalltalk.addMethod(
|
419
|
+
"_hasFocus",
|
420
|
+
smalltalk.method({
|
421
|
+
selector: "hasFocus",
|
422
|
+
category: 'events',
|
423
|
+
fn: function () {
|
424
|
+
var self = this;
|
425
|
+
var $1;
|
426
|
+
$1 = smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_notNil", []), "_and_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_hasClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
|
427
|
+
return $1;
|
428
|
+
},
|
429
|
+
args: [],
|
430
|
+
source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery hasClass: self focusClass ]",
|
431
|
+
messageSends: ["and:", "hasClass:", "focusClass", "asJQuery", "wrapper", "notNil"],
|
432
|
+
referencedClasses: []
|
433
|
+
}),
|
434
|
+
smalltalk.HLFocusableWidget);
|
435
|
+
|
436
|
+
smalltalk.addMethod(
|
437
|
+
"_renderContentOn_",
|
438
|
+
smalltalk.method({
|
439
|
+
selector: "renderContentOn:",
|
440
|
+
category: 'rendering',
|
441
|
+
fn: function (html) {
|
442
|
+
var self = this;
|
443
|
+
return self;
|
444
|
+
},
|
445
|
+
args: ["html"],
|
446
|
+
source: "renderContentOn: html",
|
447
|
+
messageSends: [],
|
448
|
+
referencedClasses: []
|
449
|
+
}),
|
450
|
+
smalltalk.HLFocusableWidget);
|
451
|
+
|
452
|
+
smalltalk.addMethod(
|
453
|
+
"_renderHiddenInputOn_",
|
454
|
+
smalltalk.method({
|
455
|
+
selector: "renderHiddenInputOn:",
|
456
|
+
category: 'rendering',
|
457
|
+
fn: function (html) {
|
458
|
+
var self = this;
|
459
|
+
var $1, $2;
|
460
|
+
$1 = smalltalk.send(html, "_input", []);
|
461
|
+
smalltalk.send($1, "_style_", ["position: absolute; left: -100000px;"]);
|
462
|
+
smalltalk.send($1, "_onBlur_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_removeClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
|
463
|
+
$2 = smalltalk.send($1, "_onFocus_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(self, "_wrapper", []), "_asJQuery", []), "_addClass_", [smalltalk.send(self, "_focusClass", [])]);}]);
|
464
|
+
self['@hiddenInput'] = $2;
|
465
|
+
return self;
|
466
|
+
},
|
467
|
+
args: ["html"],
|
468
|
+
source: "renderHiddenInputOn: html\x0a\x09hiddenInput := html input\x0a \x09style: 'position: absolute; left: -100000px;';\x0a \x09onBlur: [ self wrapper asJQuery removeClass: self focusClass ];\x0a onFocus: [ self wrapper asJQuery addClass: self focusClass ]",
|
469
|
+
messageSends: ["style:", "input", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
|
470
|
+
referencedClasses: []
|
471
|
+
}),
|
472
|
+
smalltalk.HLFocusableWidget);
|
473
|
+
|
474
|
+
smalltalk.addMethod(
|
475
|
+
"_renderOn_",
|
476
|
+
smalltalk.method({
|
477
|
+
selector: "renderOn:",
|
478
|
+
category: 'rendering',
|
479
|
+
fn: function (html) {
|
480
|
+
var self = this;
|
481
|
+
var $1, $2;
|
482
|
+
smalltalk.send(self, "_registerBindings", []);
|
483
|
+
smalltalk.send(self, "_renderHiddenInputOn_", [html]);
|
484
|
+
$1 = smalltalk.send(html, "_div", []);
|
485
|
+
smalltalk.send($1, "_class_", ["hl_widget"]);
|
486
|
+
smalltalk.send($1, "_onClick_", [function () {return smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_focus", []);}]);
|
487
|
+
$2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(self, "_renderContentOn_", [html]);}]);
|
488
|
+
self['@wrapper'] = $2;
|
489
|
+
return self;
|
490
|
+
},
|
491
|
+
args: ["html"],
|
492
|
+
source: "renderOn: html\x0a\x09self registerBindings.\x0a\x09self renderHiddenInputOn: html.\x0a \x0a wrapper := html div \x0a \x09class: 'hl_widget'; \x0a onClick: [ hiddenInput asJQuery focus ];\x0a with: [\x0a\x09\x09\x09self renderContentOn: html ]",
|
493
|
+
messageSends: ["registerBindings", "renderHiddenInputOn:", "class:", "div", "onClick:", "focus", "asJQuery", "with:", "renderContentOn:"],
|
494
|
+
referencedClasses: []
|
495
|
+
}),
|
496
|
+
smalltalk.HLFocusableWidget);
|
497
|
+
|
498
|
+
|
499
|
+
|
500
|
+
smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
|
501
|
+
smalltalk.addMethod(
|
502
|
+
"_activateFirstListItem",
|
503
|
+
smalltalk.method({
|
504
|
+
selector: "activateFirstListItem",
|
505
|
+
category: 'actions',
|
506
|
+
fn: function (){
|
507
|
+
var self=this;
|
508
|
+
smalltalk.send(self,"_activateListItem_",[smalltalk.send(window,"_jQuery_",[smalltalk.send(smalltalk.send(smalltalk.send(self["@wrapper"],"_asJQuery",[]),"_find_",["li"]),"_get_",[(0)])])]);
|
509
|
+
return self},
|
510
|
+
args: [],
|
511
|
+
source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li') get: 0))",
|
512
|
+
messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
|
513
|
+
referencedClasses: []
|
514
|
+
}),
|
515
|
+
smalltalk.HLListWidget);
|
516
|
+
|
517
|
+
smalltalk.addMethod(
|
518
|
+
"_activateListItem_",
|
519
|
+
smalltalk.method({
|
520
|
+
selector: "activateListItem:",
|
521
|
+
category: 'actions',
|
522
|
+
fn: function (aListItem) {
|
523
|
+
var self = this;
|
524
|
+
var $1, $2, $3;
|
525
|
+
var parent;
|
526
|
+
var position;
|
527
|
+
$1 = smalltalk.send(aListItem, "_get_", [0]);
|
528
|
+
if (($receiver = $1) == nil || $receiver == undefined) {
|
529
|
+
return self;
|
530
|
+
} else {
|
531
|
+
}
|
532
|
+
position = aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1;
|
533
|
+
parent = smalltalk.send(aListItem, "_parent", []);
|
534
|
+
smalltalk.send(smalltalk.send(parent, "_children", []), "_removeClass_", ["active"]);
|
535
|
+
smalltalk.send(aListItem, "_addClass_", ["active"]);
|
536
|
+
$2 = smalltalk.send(smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", []), "__lt", [0]);
|
537
|
+
if (smalltalk.assert($2)) {
|
538
|
+
smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop", []), "__plus", [smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", [])]), "__minus", [10])]);
|
539
|
+
}
|
540
|
+
$3 = smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", []), "__plus", [smalltalk.send(aListItem, "_height", [])]), "__gt", [smalltalk.send(parent, "_height", [])]);
|
541
|
+
if (smalltalk.assert($3)) {
|
542
|
+
smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop_", [smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(parent, "_get_", [0]), "_scrollTop", []), "__plus", [smalltalk.send(aListItem, "_height", [])]), "__minus", [smalltalk.send(smalltalk.send(parent, "_height", []), "__minus", [smalltalk.send(smalltalk.send(aListItem, "_position", []), "_top", [])])]), "__plus", [10])]);
|
543
|
+
}
|
544
|
+
smalltalk.send(self, "_selectItem_", [smalltalk.send(smalltalk.send(self, "_items", []), "_at_", [smalltalk.send(smalltalk.send(aListItem, "_attr_", ["list-data"]), "_asNumber", [])])]);
|
545
|
+
return self;
|
546
|
+
},
|
547
|
+
args: ["aListItem"],
|
548
|
+
source: "activateListItem: aListItem\x0a\x09| parent position |\x0a \x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x0a\x09<position = aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1>.\x0a\x0a parent := aListItem parent.\x0a\x09parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a \x22Move the scrollbar to show the active element\x22\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ].\x0a \x0a \x22Activate the corresponding item\x22\x0a self selectItem: (self items at: (aListItem attr: 'list-data') asNumber)",
|
549
|
+
messageSends: ["ifNil:", "get:", "parent", "removeClass:", "children", "addClass:", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "<", "height", ">", "selectItem:", "at:", "asNumber", "attr:", "items"],
|
550
|
+
referencedClasses: []
|
551
|
+
}),
|
552
|
+
smalltalk.HLListWidget);
|
553
|
+
|
554
|
+
smalltalk.addMethod(
|
555
|
+
"_cssClassForItem_",
|
556
|
+
smalltalk.method({
|
557
|
+
selector: "cssClassForItem:",
|
558
|
+
category: 'accessing',
|
559
|
+
fn: function (anObject) {
|
560
|
+
var self = this;
|
561
|
+
var $2, $1;
|
562
|
+
$2 = smalltalk.send(smalltalk.send(self, "_selectedItem", []), "__eq", [anObject]);
|
563
|
+
if (smalltalk.assert($2)) {
|
564
|
+
$1 = "active";
|
565
|
+
} else {
|
566
|
+
$1 = "inactive";
|
567
|
+
}
|
568
|
+
return $1;
|
569
|
+
},
|
570
|
+
args: ["anObject"],
|
571
|
+
source: "cssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09\x09ifFalse: [ 'inactive' ]",
|
572
|
+
messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
|
573
|
+
referencedClasses: []
|
574
|
+
}),
|
575
|
+
smalltalk.HLListWidget);
|
576
|
+
|
577
|
+
smalltalk.addMethod(
|
578
|
+
"_defaultItems",
|
579
|
+
smalltalk.method({
|
580
|
+
selector: "defaultItems",
|
581
|
+
category: 'defaults',
|
582
|
+
fn: function () {
|
583
|
+
var self = this;
|
584
|
+
return [];
|
585
|
+
},
|
586
|
+
args: [],
|
587
|
+
source: "defaultItems\x0a\x09^ #()",
|
588
|
+
messageSends: [],
|
589
|
+
referencedClasses: []
|
590
|
+
}),
|
591
|
+
smalltalk.HLListWidget);
|
592
|
+
|
593
|
+
smalltalk.addMethod(
|
594
|
+
"_focus",
|
595
|
+
smalltalk.method({
|
596
|
+
selector: "focus",
|
597
|
+
category: 'actions',
|
598
|
+
fn: function (){
|
599
|
+
var self=this;
|
600
|
+
var $1,$2;
|
601
|
+
smalltalk.send(self,"_focus",[],smalltalk.HLFocusableWidget);
|
602
|
+
$1=smalltalk.send(smalltalk.send(self,"_items",[]),"_isEmpty",[]);
|
603
|
+
if(! smalltalk.assert($1)){
|
604
|
+
$2=smalltalk.send(self,"_selectedItem",[]);
|
605
|
+
if(($receiver = $2) == nil || $receiver == undefined){
|
606
|
+
smalltalk.send(self,"_activateFirstListItem",[]);
|
607
|
+
} else {
|
608
|
+
$2;
|
609
|
+
};
|
610
|
+
};
|
611
|
+
return self},
|
612
|
+
args: [],
|
613
|
+
source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
|
614
|
+
messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
|
615
|
+
referencedClasses: []
|
616
|
+
}),
|
617
|
+
smalltalk.HLListWidget);
|
618
|
+
|
619
|
+
smalltalk.addMethod(
|
620
|
+
"_iconForItem_",
|
621
|
+
smalltalk.method({
|
622
|
+
selector: "iconForItem:",
|
623
|
+
category: 'accessing',
|
624
|
+
fn: function (anObject) {
|
625
|
+
var self = this;
|
626
|
+
return "";
|
627
|
+
},
|
628
|
+
args: ["anObject"],
|
629
|
+
source: "iconForItem: anObject\x0a\x09^ ''",
|
630
|
+
messageSends: [],
|
631
|
+
referencedClasses: []
|
632
|
+
}),
|
633
|
+
smalltalk.HLListWidget);
|
634
|
+
|
635
|
+
smalltalk.addMethod(
|
636
|
+
"_items",
|
637
|
+
smalltalk.method({
|
638
|
+
selector: "items",
|
639
|
+
category: 'accessing',
|
640
|
+
fn: function () {
|
641
|
+
var self = this;
|
642
|
+
var $1;
|
643
|
+
if (($receiver = self['@items']) == nil || $receiver == undefined) {
|
644
|
+
self['@items'] = smalltalk.send(self, "_defaultItems", []);
|
645
|
+
$1 = self['@items'];
|
646
|
+
} else {
|
647
|
+
$1 = self['@items'];
|
648
|
+
}
|
649
|
+
return $1;
|
650
|
+
},
|
651
|
+
args: [],
|
652
|
+
source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
|
653
|
+
messageSends: ["ifNil:", "defaultItems"],
|
654
|
+
referencedClasses: []
|
655
|
+
}),
|
656
|
+
smalltalk.HLListWidget);
|
657
|
+
|
658
|
+
smalltalk.addMethod(
|
659
|
+
"_items_",
|
660
|
+
smalltalk.method({
|
661
|
+
selector: "items:",
|
662
|
+
category: 'accessing',
|
663
|
+
fn: function (aCollection) {
|
664
|
+
var self = this;
|
665
|
+
self['@items'] = aCollection;
|
666
|
+
return self;
|
667
|
+
},
|
668
|
+
args: ["aCollection"],
|
669
|
+
source: "items: aCollection\x0a\x09items := aCollection",
|
670
|
+
messageSends: [],
|
671
|
+
referencedClasses: []
|
672
|
+
}),
|
673
|
+
smalltalk.HLListWidget);
|
674
|
+
|
675
|
+
smalltalk.addMethod(
|
676
|
+
"_renderButtonsOn_",
|
677
|
+
smalltalk.method({
|
678
|
+
selector: "renderButtonsOn:",
|
679
|
+
category: 'rendering',
|
680
|
+
fn: function (html) {
|
681
|
+
var self = this;
|
682
|
+
return self;
|
683
|
+
},
|
684
|
+
args: ["html"],
|
685
|
+
source: "renderButtonsOn: html",
|
686
|
+
messageSends: [],
|
687
|
+
referencedClasses: []
|
688
|
+
}),
|
689
|
+
smalltalk.HLListWidget);
|
690
|
+
|
691
|
+
smalltalk.addMethod(
|
692
|
+
"_renderContentOn_",
|
693
|
+
smalltalk.method({
|
694
|
+
selector: "renderContentOn:",
|
695
|
+
category: 'rendering',
|
696
|
+
fn: function (html) {
|
697
|
+
var self = this;
|
698
|
+
var $1, $2, $3, $4;
|
699
|
+
$1 = smalltalk.send(html, "_ul", []);
|
700
|
+
smalltalk.send($1, "_class_", ["nav nav-pills nav-stacked"]);
|
701
|
+
$2 = smalltalk.send($1, "_with_", [function () {return smalltalk.send(self, "_renderListOn_", [html]);}]);
|
702
|
+
$3 = smalltalk.send(html, "_div", []);
|
703
|
+
smalltalk.send($3, "_class_", ["pane_actions form-actions"]);
|
704
|
+
$4 = smalltalk.send($3, "_with_", [function () {return smalltalk.send(self, "_renderButtonsOn_", [html]);}]);
|
705
|
+
smalltalk.send(self, "_setupKeyBindings", []);
|
706
|
+
return self;
|
707
|
+
},
|
708
|
+
args: ["html"],
|
709
|
+
source: "renderContentOn: html\x0a\x09html ul \x0a \x09class: 'nav nav-pills nav-stacked';\x0a with: [ self renderListOn: html ].\x0a html div class: 'pane_actions form-actions'; with: [\x0a \x09self renderButtonsOn: html ].\x0a \x0a self setupKeyBindings",
|
710
|
+
messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
|
711
|
+
referencedClasses: []
|
712
|
+
}),
|
713
|
+
smalltalk.HLListWidget);
|
714
|
+
|
715
|
+
smalltalk.addMethod(
|
716
|
+
"_renderItem_on_",
|
717
|
+
smalltalk.method({
|
718
|
+
selector: "renderItem:on:",
|
719
|
+
category: 'rendering',
|
720
|
+
fn: function (anObject, html) {
|
721
|
+
var self = this;
|
722
|
+
var $2, $3, $1;
|
723
|
+
var li;
|
724
|
+
li = smalltalk.send(html, "_li", []);
|
725
|
+
smalltalk.send(li, "_class_", [smalltalk.send(self, "_cssClassForItem_", [anObject])]);
|
726
|
+
smalltalk.send(li, "_at_put_", ["list-data", smalltalk.send(smalltalk.send(smalltalk.send(self, "_items", []), "_indexOf_", [anObject]), "_asString", [])]);
|
727
|
+
$1 = smalltalk.send(li, "_with_", [function () {$2 = smalltalk.send(html, "_a", []);smalltalk.send($2, "_with_", [function () {smalltalk.send(smalltalk.send(html, "_tag_", ["i"]), "_class_", [smalltalk.send(self, "_iconForItem_", [anObject])]);return smalltalk.send(self, "_renderItemLabel_on_", [anObject, html]);}]);$3 = smalltalk.send($2, "_onClick_", [function () {return smalltalk.send(self, "_activateListItem_", [smalltalk.send(li, "_asJQuery", [])]);}]);return $3;}]);
|
728
|
+
return self;
|
729
|
+
},
|
730
|
+
args: ["anObject", "html"],
|
731
|
+
source: "renderItem: anObject on: html\x0a\x09| li |\x0a \x0a\x09li := html li.\x0a li\x0a \x09class: (self cssClassForItem: anObject);\x0a at: 'list-data' put: (self items indexOf: anObject) asString;\x0a with: [ \x0a \x09html a\x0a \x09with: [ \x0a \x09\x09(html tag: 'i') class: (self iconForItem: anObject).\x0a \x09\x09\x09\x09\x09self renderItemLabel: anObject on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a \x09self activateListItem: li asJQuery ] ]",
|
732
|
+
messageSends: ["li", "class:", "cssClassForItem:", "at:put:", "asString", "indexOf:", "items", "with:", "iconForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
|
733
|
+
referencedClasses: []
|
734
|
+
}),
|
735
|
+
smalltalk.HLListWidget);
|
736
|
+
|
737
|
+
smalltalk.addMethod(
|
738
|
+
"_renderItemLabel_on_",
|
739
|
+
smalltalk.method({
|
740
|
+
selector: "renderItemLabel:on:",
|
741
|
+
category: 'rendering',
|
742
|
+
fn: function (anObject, html) {
|
743
|
+
var self = this;
|
744
|
+
smalltalk.send(html, "_with_", [smalltalk.send(anObject, "_asString", [])]);
|
745
|
+
return self;
|
746
|
+
},
|
747
|
+
args: ["anObject", "html"],
|
748
|
+
source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
|
749
|
+
messageSends: ["with:", "asString"],
|
750
|
+
referencedClasses: []
|
751
|
+
}),
|
752
|
+
smalltalk.HLListWidget);
|
753
|
+
|
754
|
+
smalltalk.addMethod(
|
755
|
+
"_renderListOn_",
|
756
|
+
smalltalk.method({
|
757
|
+
selector: "renderListOn:",
|
758
|
+
category: 'rendering',
|
759
|
+
fn: function (html) {
|
760
|
+
var self = this;
|
761
|
+
smalltalk.send(smalltalk.send(self, "_items", []), "_do_", [function (each) {return smalltalk.send(self, "_renderItem_on_", [each, html]);}]);
|
762
|
+
return self;
|
763
|
+
},
|
764
|
+
args: ["html"],
|
765
|
+
source: "renderListOn: html\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
|
766
|
+
messageSends: ["do:", "renderItem:on:", "items"],
|
767
|
+
referencedClasses: []
|
768
|
+
}),
|
769
|
+
smalltalk.HLListWidget);
|
770
|
+
|
771
|
+
smalltalk.addMethod(
|
772
|
+
"_selectItem_",
|
773
|
+
smalltalk.method({
|
774
|
+
selector: "selectItem:",
|
775
|
+
category: 'actions',
|
776
|
+
fn: function (anObject) {
|
777
|
+
var self = this;
|
778
|
+
smalltalk.send(self, "_selectedItem_", [anObject]);
|
779
|
+
return self;
|
780
|
+
},
|
781
|
+
args: ["anObject"],
|
782
|
+
source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
|
783
|
+
messageSends: ["selectedItem:"],
|
784
|
+
referencedClasses: []
|
785
|
+
}),
|
786
|
+
smalltalk.HLListWidget);
|
787
|
+
|
788
|
+
smalltalk.addMethod(
|
789
|
+
"_selectedItem",
|
790
|
+
smalltalk.method({
|
791
|
+
selector: "selectedItem",
|
792
|
+
category: 'accessing',
|
793
|
+
fn: function () {
|
794
|
+
var self = this;
|
795
|
+
return self['@selectedItem'];
|
796
|
+
},
|
797
|
+
args: [],
|
798
|
+
source: "selectedItem\x0a\x09^ selectedItem",
|
799
|
+
messageSends: [],
|
800
|
+
referencedClasses: []
|
801
|
+
}),
|
802
|
+
smalltalk.HLListWidget);
|
803
|
+
|
804
|
+
smalltalk.addMethod(
|
805
|
+
"_selectedItem_",
|
806
|
+
smalltalk.method({
|
807
|
+
selector: "selectedItem:",
|
808
|
+
category: 'accessing',
|
809
|
+
fn: function (anObject) {
|
810
|
+
var self = this;
|
811
|
+
self['@selectedItem'] = anObject;
|
812
|
+
return self;
|
813
|
+
},
|
814
|
+
args: ["anObject"],
|
815
|
+
source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
|
816
|
+
messageSends: [],
|
817
|
+
referencedClasses: []
|
818
|
+
}),
|
819
|
+
smalltalk.HLListWidget);
|
820
|
+
|
821
|
+
smalltalk.addMethod(
|
822
|
+
"_setupKeyBindings",
|
823
|
+
smalltalk.method({
|
824
|
+
selector: "setupKeyBindings",
|
825
|
+
category: 'events',
|
826
|
+
fn: function () {
|
827
|
+
var self = this;
|
828
|
+
var $1, $2, $3;
|
829
|
+
var next;
|
830
|
+
smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_unbind_", ["keydown"]);
|
831
|
+
smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_keydown_", [function (e) {var selected;selected = smalltalk.send(window, "_jQuery_", [".focused .nav-pills .active"]);$1 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [38]);if (smalltalk.assert($1)) {smalltalk.send(self, "_activateListItem_", [smalltalk.send(selected, "_prev", [])]);}$2 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [40]);if (smalltalk.assert($2)) {next = smalltalk.send(selected, "_next", []);next;$3 = smalltalk.send(next, "_get_", [0]);if (($receiver = $3) == nil || $receiver == undefined) {next = smalltalk.send(window, "_jQuery_", [".focused .nav-pills li:first-child"]);next;} else {$3;}return smalltalk.send(self, "_activateListItem_", [next]);}}]);
|
832
|
+
return self;
|
833
|
+
},
|
834
|
+
args: [],
|
835
|
+
source: "setupKeyBindings\x0a\x09| next |\x0a\x09hiddenInput asJQuery unbind: 'keydown'.\x0a\x0a\x09hiddenInput asJQuery keydown: [ :e | | selected |\x0a \x09selected := window jQuery: '.focused .nav-pills .active'.\x0a e which = 38 ifTrue: [ \x0a \x09self activateListItem: selected prev ].\x0a \x09e which = 40 ifTrue: [\x0a \x09next := selected next.\x0a (next get: 0) ifNil: [ next := window jQuery: '.focused .nav-pills li:first-child' ].\x0a\x09\x09\x09self activateListItem: next ] ]",
|
836
|
+
messageSends: ["unbind:", "asJQuery", "keydown:", "jQuery:", "ifTrue:", "activateListItem:", "prev", "=", "which", "next", "ifNil:", "get:"],
|
837
|
+
referencedClasses: []
|
838
|
+
}),
|
839
|
+
smalltalk.HLListWidget);
|
840
|
+
|
841
|
+
|
842
|
+
|
843
|
+
smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
|
844
|
+
smalltalk.addMethod(
|
845
|
+
"_next",
|
846
|
+
smalltalk.method({
|
847
|
+
selector: "next",
|
848
|
+
category: 'accessing',
|
849
|
+
fn: function () {
|
850
|
+
var self = this;
|
851
|
+
return self['@next'];
|
852
|
+
},
|
853
|
+
args: [],
|
854
|
+
source: "next\x0a\x09^ next",
|
855
|
+
messageSends: [],
|
856
|
+
referencedClasses: []
|
857
|
+
}),
|
858
|
+
smalltalk.HLNavigationListWidget);
|
859
|
+
|
860
|
+
smalltalk.addMethod(
|
861
|
+
"_next_",
|
862
|
+
smalltalk.method({
|
863
|
+
selector: "next:",
|
864
|
+
category: 'accessing',
|
865
|
+
fn: function (aWidget) {
|
866
|
+
var self = this;
|
867
|
+
var $1;
|
868
|
+
self['@next'] = aWidget;
|
869
|
+
$1 = smalltalk.send(smalltalk.send(aWidget, "_previous", []), "__eq", [self]);
|
870
|
+
if (!smalltalk.assert($1)) {
|
871
|
+
smalltalk.send(aWidget, "_previous_", [self]);
|
872
|
+
}
|
873
|
+
return self;
|
874
|
+
},
|
875
|
+
args: ["aWidget"],
|
876
|
+
source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
|
877
|
+
messageSends: ["ifFalse:", "previous:", "=", "previous"],
|
878
|
+
referencedClasses: []
|
879
|
+
}),
|
880
|
+
smalltalk.HLNavigationListWidget);
|
881
|
+
|
882
|
+
smalltalk.addMethod(
|
883
|
+
"_nextFocus",
|
884
|
+
smalltalk.method({
|
885
|
+
selector: "nextFocus",
|
886
|
+
category: 'actions',
|
887
|
+
fn: function () {
|
888
|
+
var self = this;
|
889
|
+
var $1;
|
890
|
+
$1 = smalltalk.send(self, "_next", []);
|
891
|
+
if (($receiver = $1) == nil || $receiver == undefined) {
|
892
|
+
} else {
|
893
|
+
smalltalk.send(smalltalk.send(self, "_next", []), "_focus", []);
|
894
|
+
}
|
895
|
+
return self;
|
896
|
+
},
|
897
|
+
args: [],
|
898
|
+
source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
|
899
|
+
messageSends: ["ifNotNil:", "focus", "next"],
|
900
|
+
referencedClasses: []
|
901
|
+
}),
|
902
|
+
smalltalk.HLNavigationListWidget);
|
903
|
+
|
904
|
+
smalltalk.addMethod(
|
905
|
+
"_previous",
|
906
|
+
smalltalk.method({
|
907
|
+
selector: "previous",
|
908
|
+
category: 'accessing',
|
909
|
+
fn: function () {
|
910
|
+
var self = this;
|
911
|
+
return self['@previous'];
|
912
|
+
},
|
913
|
+
args: [],
|
914
|
+
source: "previous\x0a\x09^ previous",
|
915
|
+
messageSends: [],
|
916
|
+
referencedClasses: []
|
917
|
+
}),
|
918
|
+
smalltalk.HLNavigationListWidget);
|
919
|
+
|
920
|
+
smalltalk.addMethod(
|
921
|
+
"_previous_",
|
922
|
+
smalltalk.method({
|
923
|
+
selector: "previous:",
|
924
|
+
category: 'accessing',
|
925
|
+
fn: function (aWidget) {
|
926
|
+
var self = this;
|
927
|
+
var $1;
|
928
|
+
self['@previous'] = aWidget;
|
929
|
+
$1 = smalltalk.send(smalltalk.send(aWidget, "_next", []), "__eq", [self]);
|
930
|
+
if (!smalltalk.assert($1)) {
|
931
|
+
smalltalk.send(aWidget, "_next_", [self]);
|
932
|
+
}
|
933
|
+
return self;
|
934
|
+
},
|
935
|
+
args: ["aWidget"],
|
936
|
+
source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
|
937
|
+
messageSends: ["ifFalse:", "next:", "=", "next"],
|
938
|
+
referencedClasses: []
|
939
|
+
}),
|
940
|
+
smalltalk.HLNavigationListWidget);
|
941
|
+
|
942
|
+
smalltalk.addMethod(
|
943
|
+
"_previousFocus",
|
944
|
+
smalltalk.method({
|
945
|
+
selector: "previousFocus",
|
946
|
+
category: 'actions',
|
947
|
+
fn: function () {
|
948
|
+
var self = this;
|
949
|
+
var $1;
|
950
|
+
$1 = smalltalk.send(self, "_previous", []);
|
951
|
+
if (($receiver = $1) == nil || $receiver == undefined) {
|
952
|
+
} else {
|
953
|
+
smalltalk.send(smalltalk.send(self, "_previous", []), "_focus", []);
|
954
|
+
}
|
955
|
+
return self;
|
956
|
+
},
|
957
|
+
args: [],
|
958
|
+
source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
|
959
|
+
messageSends: ["ifNotNil:", "focus", "previous"],
|
960
|
+
referencedClasses: []
|
961
|
+
}),
|
962
|
+
smalltalk.HLNavigationListWidget);
|
963
|
+
|
964
|
+
smalltalk.addMethod(
|
965
|
+
"_setupKeyBindings",
|
966
|
+
smalltalk.method({
|
967
|
+
selector: "setupKeyBindings",
|
968
|
+
category: 'events',
|
969
|
+
fn: function () {
|
970
|
+
var self = this;
|
971
|
+
var $1, $2;
|
972
|
+
smalltalk.send(self, "_setupKeyBindings", [], smalltalk.HLListWidget);
|
973
|
+
smalltalk.send(smalltalk.send(self['@hiddenInput'], "_asJQuery", []), "_keydown_", [function (e) {$1 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [39]);if (smalltalk.assert($1)) {smalltalk.send(self, "_nextFocus", []);}$2 = smalltalk.send(smalltalk.send(e, "_which", []), "__eq", [37]);if (smalltalk.assert($2)) {return smalltalk.send(self, "_previousFocus", []);}}]);
|
974
|
+
return self;
|
975
|
+
},
|
976
|
+
args: [],
|
977
|
+
source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x0a\x09hiddenInput asJQuery keydown: [ :e |\x0a e which = 39 ifTrue: [ \x0a \x09self nextFocus ].\x0a\x09\x09e which = 37 ifTrue: [ \x0a \x09self previousFocus ] ]",
|
978
|
+
messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery"],
|
979
|
+
referencedClasses: []
|
980
|
+
}),
|
981
|
+
smalltalk.HLNavigationListWidget);
|
982
|
+
|
983
|
+
|
984
|
+
|
985
|
+
smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment'], 'Helios-Core');
|
986
|
+
smalltalk.addMethod(
|
987
|
+
"_activate_",
|
988
|
+
smalltalk.method({
|
989
|
+
selector: "activate:",
|
990
|
+
category: 'actions',
|
991
|
+
fn: function (aTab) {
|
992
|
+
var self = this;
|
993
|
+
var $1;
|
994
|
+
smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_flushBindings", []);
|
995
|
+
self['@activeTab'] = aTab;
|
996
|
+
smalltalk.send(self, "_refresh", []);
|
997
|
+
$1 = smalltalk.send(self, "_show_", [aTab]);
|
998
|
+
return self;
|
999
|
+
},
|
1000
|
+
args: ["aTab"],
|
1001
|
+
source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09activeTab := aTab.\x0a \x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09show: aTab",
|
1002
|
+
messageSends: ["flushBindings", "keyBinder", "refresh", "show:"],
|
1003
|
+
referencedClasses: []
|
1004
|
+
}),
|
1005
|
+
smalltalk.HLManager);
|
1006
|
+
|
1007
|
+
smalltalk.addMethod(
|
1008
|
+
"_activeTab",
|
1009
|
+
smalltalk.method({
|
1010
|
+
selector: "activeTab",
|
1011
|
+
category: 'accessing',
|
1012
|
+
fn: function () {
|
1013
|
+
var self = this;
|
1014
|
+
return self['@activeTab'];
|
1015
|
+
},
|
1016
|
+
args: [],
|
1017
|
+
source: "activeTab\x0a\x09^ activeTab",
|
1018
|
+
messageSends: [],
|
1019
|
+
referencedClasses: []
|
1020
|
+
}),
|
1021
|
+
smalltalk.HLManager);
|
1022
|
+
|
1023
|
+
smalltalk.addMethod(
|
1024
|
+
"_addTab_",
|
1025
|
+
smalltalk.method({
|
1026
|
+
selector: "addTab:",
|
1027
|
+
category: 'actions',
|
1028
|
+
fn: function (aTab) {
|
1029
|
+
var self = this;
|
1030
|
+
smalltalk.send(smalltalk.send(self, "_tabs", []), "_add_", [aTab]);
|
1031
|
+
smalltalk.send(self, "_activate_", [aTab]);
|
1032
|
+
return self;
|
1033
|
+
},
|
1034
|
+
args: ["aTab"],
|
1035
|
+
source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
|
1036
|
+
messageSends: ["add:", "tabs", "activate:"],
|
1037
|
+
referencedClasses: []
|
1038
|
+
}),
|
1039
|
+
smalltalk.HLManager);
|
1040
|
+
|
1041
|
+
smalltalk.addMethod(
|
1042
|
+
"_defaultEnvironment",
|
1043
|
+
smalltalk.method({
|
1044
|
+
selector: "defaultEnvironment",
|
1045
|
+
category: 'defaults',
|
1046
|
+
fn: function () {
|
1047
|
+
var self = this;
|
1048
|
+
var $1;
|
1049
|
+
$1 = smalltalk.send(smalltalk.HLLocalEnvironment || HLLocalEnvironment, "_new", []);
|
1050
|
+
return $1;
|
1051
|
+
},
|
1052
|
+
args: [],
|
1053
|
+
source: "defaultEnvironment\x0a\x09^ HLLocalEnvironment new",
|
1054
|
+
messageSends: ["new"],
|
1055
|
+
referencedClasses: ["HLLocalEnvironment"]
|
1056
|
+
}),
|
1057
|
+
smalltalk.HLManager);
|
1058
|
+
|
1059
|
+
smalltalk.addMethod(
|
1060
|
+
"_environment",
|
1061
|
+
smalltalk.method({
|
1062
|
+
selector: "environment",
|
1063
|
+
category: 'accessing',
|
1064
|
+
fn: function () {
|
1065
|
+
var self = this;
|
1066
|
+
var $1;
|
1067
|
+
if (($receiver = self['@environment']) == nil || $receiver == undefined) {
|
1068
|
+
self['@environment'] = smalltalk.send(self, "_defaultEnvironment", []);
|
1069
|
+
$1 = self['@environment'];
|
1070
|
+
} else {
|
1071
|
+
$1 = self['@environment'];
|
1072
|
+
}
|
1073
|
+
return $1;
|
1074
|
+
},
|
1075
|
+
args: [],
|
1076
|
+
source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
|
1077
|
+
messageSends: ["ifNil:", "defaultEnvironment"],
|
1078
|
+
referencedClasses: []
|
1079
|
+
}),
|
1080
|
+
smalltalk.HLManager);
|
1081
|
+
|
1082
|
+
smalltalk.addMethod(
|
1083
|
+
"_environment_",
|
1084
|
+
smalltalk.method({
|
1085
|
+
selector: "environment:",
|
1086
|
+
category: 'accessing',
|
1087
|
+
fn: function (anEnvironment) {
|
1088
|
+
var self = this;
|
1089
|
+
self['@environment'] = anEnvironment;
|
1090
|
+
return self;
|
1091
|
+
},
|
1092
|
+
args: ["anEnvironment"],
|
1093
|
+
source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
|
1094
|
+
messageSends: [],
|
1095
|
+
referencedClasses: []
|
1096
|
+
}),
|
1097
|
+
smalltalk.HLManager);
|
1098
|
+
|
1099
|
+
smalltalk.addMethod(
|
1100
|
+
"_initialize",
|
1101
|
+
smalltalk.method({
|
1102
|
+
selector: "initialize",
|
1103
|
+
category: 'initialization',
|
1104
|
+
fn: function () {
|
1105
|
+
var self = this;
|
1106
|
+
smalltalk.send(self, "_initialize", [], smalltalk.HLWidget);
|
1107
|
+
smalltalk.send(smalltalk.send(self, "_keyBinder", []), "_setupEvents", []);
|
1108
|
+
return self;
|
1109
|
+
},
|
1110
|
+
args: [],
|
1111
|
+
source: "initialize\x0a\x09super initialize.\x0a self keyBinder setupEvents",
|
1112
|
+
messageSends: ["initialize", "setupEvents", "keyBinder"],
|
1113
|
+
referencedClasses: []
|
1114
|
+
}),
|
1115
|
+
smalltalk.HLManager);
|
1116
|
+
|
1117
|
+
smalltalk.addMethod(
|
1118
|
+
"_keyBinder",
|
1119
|
+
smalltalk.method({
|
1120
|
+
selector: "keyBinder",
|
1121
|
+
category: 'accessing',
|
1122
|
+
fn: function () {
|
1123
|
+
var self = this;
|
1124
|
+
var $1;
|
1125
|
+
if (($receiver = self['@keyBinder']) == nil || $receiver == undefined) {
|
1126
|
+
self['@keyBinder'] = smalltalk.send(smalltalk.HLKeyBinder || HLKeyBinder, "_new", []);
|
1127
|
+
$1 = self['@keyBinder'];
|
1128
|
+
} else {
|
1129
|
+
$1 = self['@keyBinder'];
|
1130
|
+
}
|
1131
|
+
return $1;
|
1132
|
+
},
|
1133
|
+
args: [],
|
1134
|
+
source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
|
1135
|
+
messageSends: ["ifNil:", "new"],
|
1136
|
+
referencedClasses: ["HLKeyBinder"]
|
1137
|
+
}),
|
1138
|
+
smalltalk.HLManager);
|
1139
|
+
|
1140
|
+
smalltalk.addMethod(
|
1141
|
+
"_refresh",
|
1142
|
+
smalltalk.method({
|
1143
|
+
selector: "refresh",
|
1144
|
+
category: 'rendering',
|
1145
|
+
fn: function () {
|
1146
|
+
var self = this;
|
1147
|
+
smalltalk.send(smalltalk.send(window, "_jQuery_", [".navbar"]), "_remove", []);
|
1148
|
+
smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_remove", []);
|
1149
|
+
smalltalk.send(self, "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
|
1150
|
+
return self;
|
1151
|
+
},
|
1152
|
+
args: [],
|
1153
|
+
source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09(window jQuery: '#container') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
|
1154
|
+
messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
|
1155
|
+
referencedClasses: []
|
1156
|
+
}),
|
1157
|
+
smalltalk.HLManager);
|
1158
|
+
|
1159
|
+
smalltalk.addMethod(
|
1160
|
+
"_removeTab_",
|
1161
|
+
smalltalk.method({
|
1162
|
+
selector: "removeTab:",
|
1163
|
+
category: 'actions',
|
1164
|
+
fn: function (aTab) {
|
1165
|
+
var self = this;
|
1166
|
+
var $1;
|
1167
|
+
$1 = smalltalk.send(smalltalk.send(self, "_tabs", []), "_includes_", [aTab]);
|
1168
|
+
if (!smalltalk.assert($1)) {
|
1169
|
+
return self;
|
1170
|
+
}
|
1171
|
+
smalltalk.send(smalltalk.send(self, "_tabs", []), "_remove_", [aTab]);
|
1172
|
+
smalltalk.send(self, "_refresh", []);
|
1173
|
+
return self;
|
1174
|
+
},
|
1175
|
+
args: ["aTab"],
|
1176
|
+
source: "removeTab: aTab\x0a\x09\x22Todo: activate the previously activated tab. Keep a history of tabs selection\x22\x0a\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self tabs remove: aTab.\x0a\x09self refresh",
|
1177
|
+
messageSends: ["ifFalse:", "includes:", "tabs", "remove:", "refresh"],
|
1178
|
+
referencedClasses: []
|
1179
|
+
}),
|
1180
|
+
smalltalk.HLManager);
|
1181
|
+
|
1182
|
+
smalltalk.addMethod(
|
1183
|
+
"_renderAddOn_",
|
1184
|
+
smalltalk.method({
|
1185
|
+
selector: "renderAddOn:",
|
1186
|
+
category: 'rendering',
|
1187
|
+
fn: function (html) {
|
1188
|
+
var self = this;
|
1189
|
+
var $1, $3, $4, $5, $7, $8, $6, $2;
|
1190
|
+
$1 = smalltalk.send(html, "_li", []);
|
1191
|
+
smalltalk.send($1, "_class_", ["dropdown"]);
|
1192
|
+
$2 = smalltalk.send($1, "_with_", [function () {$3 = smalltalk.send(html, "_a", []);smalltalk.send($3, "_class_", ["dropdown-toggle"]);smalltalk.send($3, "_at_put_", ["data-toggle", "dropdown"]);$4 = smalltalk.send($3, "_with_", [function () {smalltalk.send(html, "_with_", ["Open..."]);return smalltalk.send(smalltalk.send(html, "_tag_", ["b"]), "_class_", ["caret"]);}]);$4;$5 = smalltalk.send(html, "_ul", []);smalltalk.send($5, "_class_", ["dropdown-menu"]);$6 = smalltalk.send($5, "_with_", [function () {return smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.send(smalltalk.HLWidget || HLWidget, "_withAllSubclasses", []), "_select_", [function (each) {return smalltalk.send(each, "_canBeOpenAsTab", []);}]), "_sorted_", [function (a, b) {return smalltalk.send(smalltalk.send(a, "_tabPriority", []), "__lt", [smalltalk.send(b, "_tabPriority", [])]);}]), "_do_", [function (each) {return smalltalk.send(smalltalk.send(html, "_li", []), "_with_", [function () {$7 = smalltalk.send(html, "_a", []);smalltalk.send($7, "_with_", [smalltalk.send(each, "_tabLabel", [])]);$8 = smalltalk.send($7, "_onClick_", [function () {return smalltalk.send(each, "_openAsTab", []);}]);return $8;}]);}]);}]);return $6;}]);
|
1193
|
+
return self;
|
1194
|
+
},
|
1195
|
+
args: ["html"],
|
1196
|
+
source: "renderAddOn: html\x0a html li \x0a \x09class: 'dropdown';\x0a with: [ \x0a\x09\x09\x09html a \x0a \x09\x09class: 'dropdown-toggle';\x0a \x09 \x09at: 'data-toggle' put: 'dropdown';\x0a \x09with: [ \x0a \x09\x09html with: 'Open...'.\x0a \x09\x09\x09\x09\x09(html tag: 'b') class: 'caret' ].\x0a html ul \x0a \x09\x09class: 'dropdown-menu';\x0a with: [\x0a \x09((HLWidget withAllSubclasses\x0a \x09select: [ :each | each canBeOpenAsTab ])\x0a sorted: [ :a :b | a tabPriority < b tabPriority ])\x0a do: [ :each |\x0a \x09\x09\x09\x09\x09\x09\x09html li with: [\x0a \x09\x09\x09html a \x0a \x09with: each tabLabel;\x0a \x09\x09\x09\x09\x09\x09\x09\x09onClick: [ each openAsTab ] ] ] ] ]",
|
1197
|
+
messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
|
1198
|
+
referencedClasses: ["HLWidget"]
|
1199
|
+
}),
|
1200
|
+
smalltalk.HLManager);
|
1201
|
+
|
1202
|
+
smalltalk.addMethod(
|
1203
|
+
"_renderContentOn_",
|
1204
|
+
smalltalk.method({
|
1205
|
+
selector: "renderContentOn:",
|
1206
|
+
category: 'rendering',
|
1207
|
+
fn: function (html) {
|
1208
|
+
var self = this;
|
1209
|
+
var $1, $3, $4, $2;
|
1210
|
+
$1 = smalltalk.send(html, "_div", []);
|
1211
|
+
smalltalk.send($1, "_class_", ["navbar navbar-fixed-top"]);
|
1212
|
+
$2 = smalltalk.send($1, "_with_", [function () {$3 = smalltalk.send(html, "_div", []);smalltalk.send($3, "_class_", ["navbar-inner"]);$4 = smalltalk.send($3, "_with_", [function () {return smalltalk.send(self, "_renderTabsOn_", [html]);}]);return $4;}]);
|
1213
|
+
smalltalk.send(smalltalk.send(html, "_div", []), "_id_", ["container"]);
|
1214
|
+
return self;
|
1215
|
+
},
|
1216
|
+
args: ["html"],
|
1217
|
+
source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'navbar navbar-fixed-top';\x0a\x09\x09with: [ html div \x0a\x09\x09\x09class: 'navbar-inner';\x0a\x09\x09\x09with: [ self renderTabsOn: html ] ].\x0a\x09html div id: 'container'",
|
1218
|
+
messageSends: ["class:", "div", "with:", "renderTabsOn:", "id:"],
|
1219
|
+
referencedClasses: []
|
1220
|
+
}),
|
1221
|
+
smalltalk.HLManager);
|
1222
|
+
|
1223
|
+
smalltalk.addMethod(
|
1224
|
+
"_renderTabsOn_",
|
1225
|
+
smalltalk.method({
|
1226
|
+
selector: "renderTabsOn:",
|
1227
|
+
category: 'rendering',
|
1228
|
+
fn: function (html) {
|
1229
|
+
var self = this;
|
1230
|
+
var $1, $3, $5, $4, $7, $8, $6, $2;
|
1231
|
+
$1 = smalltalk.send(html, "_ul", []);
|
1232
|
+
smalltalk.send($1, "_class_", ["nav"]);
|
1233
|
+
$2 = smalltalk.send($1, "_with_", [function () {smalltalk.send(smalltalk.send(self, "_tabs", []), "_do_", [function (each) {$3 = smalltalk.send(html, "_li", []);$5 = smalltalk.send(each, "_isActive", []);if (smalltalk.assert($5)) {$4 = "active";} else {$4 = "inactive";}smalltalk.send($3, "_class_", [$4]);$6 = smalltalk.send($3, "_with_", [function () {$7 = smalltalk.send(html, "_a", []);smalltalk.send($7, "_with_", [function () {smalltalk.send(smalltalk.send(smalltalk.send(html, "_tag_", ["i"]), "_class_", ["icon-remove-circle"]), "_onClick_", [function () {return smalltalk.send(self, "_removeTab_", [each]);}]);return smalltalk.send(html, "_with_", [smalltalk.send(each, "_label", [])]);}]);$8 = smalltalk.send($7, "_onClick_", [function () {return smalltalk.send(each, "_activate", []);}]);return $8;}]);return $6;}]);return smalltalk.send(self, "_renderAddOn_", [html]);}]);
|
1234
|
+
return self;
|
1235
|
+
},
|
1236
|
+
args: ["html"],
|
1237
|
+
source: "renderTabsOn: html\x0a\x09html ul \x0a\x09\x09class: 'nav';\x0a\x09\x09with: [ \x0a \x09self tabs do: [ :each |\x0a\x09\x09\x09\x09html li \x0a\x09\x09\x09\x09\x09class: (each isActive ifTrue: [ 'active' ] ifFalse: [ 'inactive' ]);\x0a\x09\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09\x09html a\x0a\x09\x09\x09\x09\x09\x09\x09with: [\x0a \x09\x09\x09\x09\x09\x09\x09((html tag: 'i') class: 'icon-remove-circle')\x0a \x09\x09\x09\x09\x09\x09\x09\x09\x09onClick: [ self removeTab: each ].\x0a \x09html with: each label ];\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ each activate ] ] ].\x0a\x09\x09\x09self renderAddOn: html ]",
|
1238
|
+
messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "label", "a", "activate", "tabs", "renderAddOn:"],
|
1239
|
+
referencedClasses: []
|
1240
|
+
}),
|
1241
|
+
smalltalk.HLManager);
|
1242
|
+
|
1243
|
+
smalltalk.addMethod(
|
1244
|
+
"_show_",
|
1245
|
+
smalltalk.method({
|
1246
|
+
selector: "show:",
|
1247
|
+
category: 'rendering',
|
1248
|
+
fn: function (aTab) {
|
1249
|
+
var self = this;
|
1250
|
+
smalltalk.send(smalltalk.send(window, "_jQuery_", ["#container"]), "_empty", []);
|
1251
|
+
smalltalk.send(smalltalk.send(aTab, "_widget", []), "_appendToJQuery_", [smalltalk.send("#container", "_asJQuery", [])]);
|
1252
|
+
return self;
|
1253
|
+
},
|
1254
|
+
args: ["aTab"],
|
1255
|
+
source: "show: aTab\x0a\x09(window jQuery: '#container') empty.\x0a\x09aTab widget appendToJQuery: '#container' asJQuery",
|
1256
|
+
messageSends: ["empty", "jQuery:", "appendToJQuery:", "asJQuery", "widget"],
|
1257
|
+
referencedClasses: []
|
1258
|
+
}),
|
1259
|
+
smalltalk.HLManager);
|
1260
|
+
|
1261
|
+
smalltalk.addMethod(
|
1262
|
+
"_tabs",
|
1263
|
+
smalltalk.method({
|
1264
|
+
selector: "tabs",
|
1265
|
+
category: 'accessing',
|
1266
|
+
fn: function () {
|
1267
|
+
var self = this;
|
1268
|
+
var $1;
|
1269
|
+
if (($receiver = self['@tabs']) == nil || $receiver == undefined) {
|
1270
|
+
self['@tabs'] = smalltalk.send(smalltalk.OrderedCollection || OrderedCollection, "_new", []);
|
1271
|
+
$1 = self['@tabs'];
|
1272
|
+
} else {
|
1273
|
+
$1 = self['@tabs'];
|
1274
|
+
}
|
1275
|
+
return $1;
|
1276
|
+
},
|
1277
|
+
args: [],
|
1278
|
+
source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
|
1279
|
+
messageSends: ["ifNil:", "new"],
|
1280
|
+
referencedClasses: ["OrderedCollection"]
|
1281
|
+
}),
|
1282
|
+
smalltalk.HLManager);
|
1283
|
+
|
1284
|
+
|
1285
|
+
smalltalk.HLManager.klass.iVarNames = ['current'];
|
1286
|
+
smalltalk.addMethod(
|
1287
|
+
"_current",
|
1288
|
+
smalltalk.method({
|
1289
|
+
selector: "current",
|
1290
|
+
category: 'accessing',
|
1291
|
+
fn: function () {
|
1292
|
+
var self = this;
|
1293
|
+
var $1;
|
1294
|
+
if (($receiver = self['@current']) == nil || $receiver == undefined) {
|
1295
|
+
self['@current'] = smalltalk.send(smalltalk.send(self, "_basicNew", []), "_initialize", []);
|
1296
|
+
$1 = self['@current'];
|
1297
|
+
} else {
|
1298
|
+
$1 = self['@current'];
|
1299
|
+
}
|
1300
|
+
return $1;
|
1301
|
+
},
|
1302
|
+
args: [],
|
1303
|
+
source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
|
1304
|
+
messageSends: ["ifNil:", "initialize", "basicNew"],
|
1305
|
+
referencedClasses: []
|
1306
|
+
}),
|
1307
|
+
smalltalk.HLManager.klass);
|
1308
|
+
|
1309
|
+
smalltalk.addMethod(
|
1310
|
+
"_initialize",
|
1311
|
+
smalltalk.method({
|
1312
|
+
selector: "initialize",
|
1313
|
+
category: 'initialization',
|
1314
|
+
fn: function () {
|
1315
|
+
var self = this;
|
1316
|
+
smalltalk.send(smalltalk.send(self, "_current", []), "_appendToJQuery_", [smalltalk.send("body", "_asJQuery", [])]);
|
1317
|
+
return self;
|
1318
|
+
},
|
1319
|
+
args: [],
|
1320
|
+
source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
|
1321
|
+
messageSends: ["appendToJQuery:", "asJQuery", "current"],
|
1322
|
+
referencedClasses: []
|
1323
|
+
}),
|
1324
|
+
smalltalk.HLManager.klass);
|
1325
|
+
|
1326
|
+
smalltalk.addMethod(
|
1327
|
+
"_new",
|
1328
|
+
smalltalk.method({
|
1329
|
+
selector: "new",
|
1330
|
+
category: 'instance creation',
|
1331
|
+
fn: function () {
|
1332
|
+
var self = this;
|
1333
|
+
smalltalk.send(self, "_shouldNotImplement", []);
|
1334
|
+
return self;
|
1335
|
+
},
|
1336
|
+
args: [],
|
1337
|
+
source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
|
1338
|
+
messageSends: ["shouldNotImplement"],
|
1339
|
+
referencedClasses: []
|
1340
|
+
}),
|
1341
|
+
smalltalk.HLManager.klass);
|
1342
|
+
|
1343
|
+
|
1344
|
+
smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
|
1345
|
+
|
1346
|
+
smalltalk.addMethod(
|
1347
|
+
"_canBeOpenAsTab",
|
1348
|
+
smalltalk.method({
|
1349
|
+
selector: "canBeOpenAsTab",
|
1350
|
+
category: 'testing',
|
1351
|
+
fn: function () {
|
1352
|
+
var self = this;
|
1353
|
+
return true;
|
1354
|
+
},
|
1355
|
+
args: [],
|
1356
|
+
source: "canBeOpenAsTab\x0a\x09^ true",
|
1357
|
+
messageSends: [],
|
1358
|
+
referencedClasses: []
|
1359
|
+
}),
|
1360
|
+
smalltalk.HLSUnit.klass);
|
1361
|
+
|
1362
|
+
smalltalk.addMethod(
|
1363
|
+
"_tabLabel",
|
1364
|
+
smalltalk.method({
|
1365
|
+
selector: "tabLabel",
|
1366
|
+
category: 'accessing',
|
1367
|
+
fn: function () {
|
1368
|
+
var self = this;
|
1369
|
+
return "SUnit";
|
1370
|
+
},
|
1371
|
+
args: [],
|
1372
|
+
source: "tabLabel\x0a\x09^ 'SUnit'",
|
1373
|
+
messageSends: [],
|
1374
|
+
referencedClasses: []
|
1375
|
+
}),
|
1376
|
+
smalltalk.HLSUnit.klass);
|
1377
|
+
|
1378
|
+
smalltalk.addMethod(
|
1379
|
+
"_tabPriority",
|
1380
|
+
smalltalk.method({
|
1381
|
+
selector: "tabPriority",
|
1382
|
+
category: 'accessing',
|
1383
|
+
fn: function () {
|
1384
|
+
var self = this;
|
1385
|
+
return 1000;
|
1386
|
+
},
|
1387
|
+
args: [],
|
1388
|
+
source: "tabPriority\x0a\x09^ 1000",
|
1389
|
+
messageSends: [],
|
1390
|
+
referencedClasses: []
|
1391
|
+
}),
|
1392
|
+
smalltalk.HLSUnit.klass);
|
1393
|
+
|
1394
|
+
|
1395
|
+
smalltalk.addClass('HLTranscript', smalltalk.HLWidget, [], 'Helios-Core');
|
1396
|
+
|
1397
|
+
smalltalk.addMethod(
|
1398
|
+
"_canBeOpenAsTab",
|
1399
|
+
smalltalk.method({
|
1400
|
+
selector: "canBeOpenAsTab",
|
1401
|
+
category: 'testing',
|
1402
|
+
fn: function () {
|
1403
|
+
var self = this;
|
1404
|
+
return true;
|
1405
|
+
},
|
1406
|
+
args: [],
|
1407
|
+
source: "canBeOpenAsTab\x0a\x09^ true",
|
1408
|
+
messageSends: [],
|
1409
|
+
referencedClasses: []
|
1410
|
+
}),
|
1411
|
+
smalltalk.HLTranscript.klass);
|
1412
|
+
|
1413
|
+
smalltalk.addMethod(
|
1414
|
+
"_tabLabel",
|
1415
|
+
smalltalk.method({
|
1416
|
+
selector: "tabLabel",
|
1417
|
+
category: 'accessing',
|
1418
|
+
fn: function () {
|
1419
|
+
var self = this;
|
1420
|
+
return "Transcript";
|
1421
|
+
},
|
1422
|
+
args: [],
|
1423
|
+
source: "tabLabel\x0a\x09^ 'Transcript'",
|
1424
|
+
messageSends: [],
|
1425
|
+
referencedClasses: []
|
1426
|
+
}),
|
1427
|
+
smalltalk.HLTranscript.klass);
|
1428
|
+
|
1429
|
+
smalltalk.addMethod(
|
1430
|
+
"_tabPriority",
|
1431
|
+
smalltalk.method({
|
1432
|
+
selector: "tabPriority",
|
1433
|
+
category: 'accessing',
|
1434
|
+
fn: function () {
|
1435
|
+
var self = this;
|
1436
|
+
return 600;
|
1437
|
+
},
|
1438
|
+
args: [],
|
1439
|
+
source: "tabPriority\x0a\x09^ 600",
|
1440
|
+
messageSends: [],
|
1441
|
+
referencedClasses: []
|
1442
|
+
}),
|
1443
|
+
smalltalk.HLTranscript.klass);
|
1444
|
+
|
1445
|
+
|