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.
- 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,337 @@
|
|
|
1
|
+
Smalltalk current createPackage: 'Helios-KeyBindings' properties: #{}!
|
|
2
|
+
Object subclass: #HLBinding
|
|
3
|
+
instanceVariableNames: 'key label'
|
|
4
|
+
package: 'Helios-KeyBindings'!
|
|
5
|
+
|
|
6
|
+
!HLBinding methodsFor: 'accessing'!
|
|
7
|
+
|
|
8
|
+
key
|
|
9
|
+
^ key
|
|
10
|
+
!
|
|
11
|
+
|
|
12
|
+
key: anInteger
|
|
13
|
+
key := anInteger
|
|
14
|
+
!
|
|
15
|
+
|
|
16
|
+
label
|
|
17
|
+
^ label
|
|
18
|
+
!
|
|
19
|
+
|
|
20
|
+
label: aString
|
|
21
|
+
label := aString
|
|
22
|
+
!
|
|
23
|
+
|
|
24
|
+
shortcut
|
|
25
|
+
^ String fromCharCode: self key
|
|
26
|
+
! !
|
|
27
|
+
|
|
28
|
+
!HLBinding methodsFor: 'actions'!
|
|
29
|
+
|
|
30
|
+
applyOn: aKeyBinder
|
|
31
|
+
self subclassResponsibility
|
|
32
|
+
! !
|
|
33
|
+
|
|
34
|
+
!HLBinding methodsFor: 'rendering'!
|
|
35
|
+
|
|
36
|
+
renderOn: aBindingHelper html: html
|
|
37
|
+
! !
|
|
38
|
+
|
|
39
|
+
!HLBinding methodsFor: 'testing'!
|
|
40
|
+
|
|
41
|
+
isBindingAction
|
|
42
|
+
^ false
|
|
43
|
+
!
|
|
44
|
+
|
|
45
|
+
isBindingGroup
|
|
46
|
+
^ false
|
|
47
|
+
! !
|
|
48
|
+
|
|
49
|
+
!HLBinding class methodsFor: 'instance creation'!
|
|
50
|
+
|
|
51
|
+
on: anInteger labelled: aString
|
|
52
|
+
^ self new
|
|
53
|
+
key: anInteger;
|
|
54
|
+
label: aString;
|
|
55
|
+
yourself
|
|
56
|
+
! !
|
|
57
|
+
|
|
58
|
+
HLBinding subclass: #HLBindingAction
|
|
59
|
+
instanceVariableNames: 'callback'
|
|
60
|
+
package: 'Helios-KeyBindings'!
|
|
61
|
+
|
|
62
|
+
!HLBindingAction methodsFor: 'accessing'!
|
|
63
|
+
|
|
64
|
+
callback
|
|
65
|
+
^ callback
|
|
66
|
+
!
|
|
67
|
+
|
|
68
|
+
callback: aBlock
|
|
69
|
+
callback := aBlock
|
|
70
|
+
! !
|
|
71
|
+
|
|
72
|
+
!HLBindingAction methodsFor: 'actions'!
|
|
73
|
+
|
|
74
|
+
applyOn: aKeyBinder
|
|
75
|
+
aKeyBinder applyBindingAction: self
|
|
76
|
+
! !
|
|
77
|
+
|
|
78
|
+
!HLBindingAction methodsFor: 'testing'!
|
|
79
|
+
|
|
80
|
+
isBindingAction
|
|
81
|
+
^ true
|
|
82
|
+
! !
|
|
83
|
+
|
|
84
|
+
HLBinding subclass: #HLBindingGroup
|
|
85
|
+
instanceVariableNames: 'bindings'
|
|
86
|
+
package: 'Helios-KeyBindings'!
|
|
87
|
+
|
|
88
|
+
!HLBindingGroup methodsFor: 'accessing'!
|
|
89
|
+
|
|
90
|
+
add: aBinding
|
|
91
|
+
^ self bindings add: aBinding
|
|
92
|
+
!
|
|
93
|
+
|
|
94
|
+
addActionKey: anInteger labelled: aString callback: aBlock
|
|
95
|
+
self add: ((HLBindingAction on: anInteger labelled: aString)
|
|
96
|
+
callback: aBlock;
|
|
97
|
+
yourself)
|
|
98
|
+
!
|
|
99
|
+
|
|
100
|
+
addActionKey: anInteger labelled: aString command: aCommand
|
|
101
|
+
self add: ((HLBindingAction on: anInteger labelled: aString)
|
|
102
|
+
command: aCommand;
|
|
103
|
+
yourself)
|
|
104
|
+
!
|
|
105
|
+
|
|
106
|
+
addGroupKey: anInteger labelled: aString
|
|
107
|
+
self add: (HLBindingGroup on: anInteger labelled: aString)
|
|
108
|
+
!
|
|
109
|
+
|
|
110
|
+
at: aString
|
|
111
|
+
^ self bindings
|
|
112
|
+
detect: [ :each | each label = aString ]
|
|
113
|
+
ifNone: [ nil ]
|
|
114
|
+
!
|
|
115
|
+
|
|
116
|
+
atKey: anInteger
|
|
117
|
+
^ self bindings
|
|
118
|
+
detect: [ :each | each key = anInteger ]
|
|
119
|
+
ifNone: [ nil ]
|
|
120
|
+
!
|
|
121
|
+
|
|
122
|
+
bindings
|
|
123
|
+
^ bindings ifNil: [ bindings := OrderedCollection new ]
|
|
124
|
+
! !
|
|
125
|
+
|
|
126
|
+
!HLBindingGroup methodsFor: 'actions'!
|
|
127
|
+
|
|
128
|
+
applyOn: aKeyBinder
|
|
129
|
+
aKeyBinder applyBindingGroup: self
|
|
130
|
+
! !
|
|
131
|
+
|
|
132
|
+
!HLBindingGroup methodsFor: 'rendering'!
|
|
133
|
+
|
|
134
|
+
renderOn: aBindingHelper html: html
|
|
135
|
+
aBindingHelper renderBindingGroup: self on: html
|
|
136
|
+
! !
|
|
137
|
+
|
|
138
|
+
!HLBindingGroup methodsFor: 'testing'!
|
|
139
|
+
|
|
140
|
+
isBindingGroup
|
|
141
|
+
^ true
|
|
142
|
+
! !
|
|
143
|
+
|
|
144
|
+
Object subclass: #HLKeyBinder
|
|
145
|
+
instanceVariableNames: 'modifierKey active helper bindings selectedBinding'
|
|
146
|
+
package: 'Helios-KeyBindings'!
|
|
147
|
+
|
|
148
|
+
!HLKeyBinder methodsFor: 'accessing'!
|
|
149
|
+
|
|
150
|
+
activationKey
|
|
151
|
+
"SPACE"
|
|
152
|
+
^ 32
|
|
153
|
+
!
|
|
154
|
+
|
|
155
|
+
bindings
|
|
156
|
+
^ bindings ifNil: [ bindings := HLBindingGroup new ]
|
|
157
|
+
!
|
|
158
|
+
|
|
159
|
+
escapeKey
|
|
160
|
+
"ESC"
|
|
161
|
+
^ 27
|
|
162
|
+
!
|
|
163
|
+
|
|
164
|
+
helper
|
|
165
|
+
^ helper ifNil: [ helper := HLKeyBinderHelper on: self ]
|
|
166
|
+
!
|
|
167
|
+
|
|
168
|
+
selectedBinding
|
|
169
|
+
^ selectedBinding ifNil: [ self bindings ]
|
|
170
|
+
! !
|
|
171
|
+
|
|
172
|
+
!HLKeyBinder methodsFor: 'actions'!
|
|
173
|
+
|
|
174
|
+
activate
|
|
175
|
+
active := true.
|
|
176
|
+
self helper show
|
|
177
|
+
!
|
|
178
|
+
|
|
179
|
+
applyBinding: aBinding
|
|
180
|
+
aBinding applyOn: self
|
|
181
|
+
!
|
|
182
|
+
|
|
183
|
+
applyBindingAction: aBinding
|
|
184
|
+
aBinding callback value.
|
|
185
|
+
self deactivate
|
|
186
|
+
!
|
|
187
|
+
|
|
188
|
+
applyBindingGroup: aBinding
|
|
189
|
+
selectedBinding := aBinding.
|
|
190
|
+
self helper refresh
|
|
191
|
+
!
|
|
192
|
+
|
|
193
|
+
deactivate
|
|
194
|
+
active := false.
|
|
195
|
+
selectedBinding := nil.
|
|
196
|
+
self helper hide
|
|
197
|
+
!
|
|
198
|
+
|
|
199
|
+
flushBindings
|
|
200
|
+
bindings := nil.
|
|
201
|
+
helper := nil
|
|
202
|
+
! !
|
|
203
|
+
|
|
204
|
+
!HLKeyBinder methodsFor: 'events'!
|
|
205
|
+
|
|
206
|
+
handleActiveKeyDown: event
|
|
207
|
+
|
|
208
|
+
"ESC or ctrl+g deactivate the keyBinder"
|
|
209
|
+
(event which = self escapeKey or: [
|
|
210
|
+
event which = 71 and: [ event ctrlKey ] ])
|
|
211
|
+
ifTrue: [
|
|
212
|
+
self deactivate.
|
|
213
|
+
event preventDefault.
|
|
214
|
+
^ false ].
|
|
215
|
+
|
|
216
|
+
"Handle the keybinding"
|
|
217
|
+
^ self handleBindingFor: event
|
|
218
|
+
!
|
|
219
|
+
|
|
220
|
+
handleBindingFor: anEvent
|
|
221
|
+
| binding |
|
|
222
|
+
binding := self selectedBinding atKey: anEvent which.
|
|
223
|
+
|
|
224
|
+
binding ifNotNil: [
|
|
225
|
+
self applyBinding: binding.
|
|
226
|
+
anEvent preventDefault.
|
|
227
|
+
^ false ]
|
|
228
|
+
!
|
|
229
|
+
|
|
230
|
+
handleInactiveKeyDown: event
|
|
231
|
+
event which = self activationKey ifTrue: [
|
|
232
|
+
event ctrlKey ifTrue: [
|
|
233
|
+
self activate.
|
|
234
|
+
event preventDefault.
|
|
235
|
+
^ false ] ]
|
|
236
|
+
!
|
|
237
|
+
|
|
238
|
+
handleKeyDown: event
|
|
239
|
+
^ self isActive
|
|
240
|
+
ifTrue: [ self handleActiveKeyDown: event ]
|
|
241
|
+
ifFalse: [ self handleInactiveKeyDown: event ]
|
|
242
|
+
!
|
|
243
|
+
|
|
244
|
+
setupEvents
|
|
245
|
+
(window jQuery: 'body') keydown: [ :event | self handleKeyDown: event ]
|
|
246
|
+
! !
|
|
247
|
+
|
|
248
|
+
!HLKeyBinder methodsFor: 'initialization'!
|
|
249
|
+
|
|
250
|
+
initialize
|
|
251
|
+
super initialize.
|
|
252
|
+
active := false
|
|
253
|
+
! !
|
|
254
|
+
|
|
255
|
+
!HLKeyBinder methodsFor: 'testing'!
|
|
256
|
+
|
|
257
|
+
isActive
|
|
258
|
+
^ active ifNil: [ false ]
|
|
259
|
+
!
|
|
260
|
+
|
|
261
|
+
systemIsMac
|
|
262
|
+
^ navigator platform match: 'Mac'
|
|
263
|
+
! !
|
|
264
|
+
|
|
265
|
+
HLWidget subclass: #HLKeyBinderHelper
|
|
266
|
+
instanceVariableNames: 'keyBinder'
|
|
267
|
+
package: 'Helios-KeyBindings'!
|
|
268
|
+
|
|
269
|
+
!HLKeyBinderHelper methodsFor: 'accessing'!
|
|
270
|
+
|
|
271
|
+
keyBinder
|
|
272
|
+
^ keyBinder
|
|
273
|
+
!
|
|
274
|
+
|
|
275
|
+
keyBinder: aKeyBinder
|
|
276
|
+
keyBinder := aKeyBinder
|
|
277
|
+
!
|
|
278
|
+
|
|
279
|
+
selectedBinding
|
|
280
|
+
^ self keyBinder selectedBinding
|
|
281
|
+
! !
|
|
282
|
+
|
|
283
|
+
!HLKeyBinderHelper methodsFor: 'actions'!
|
|
284
|
+
|
|
285
|
+
hide
|
|
286
|
+
rootDiv asJQuery remove
|
|
287
|
+
!
|
|
288
|
+
|
|
289
|
+
show
|
|
290
|
+
self appendToJQuery: 'body' asJQuery
|
|
291
|
+
! !
|
|
292
|
+
|
|
293
|
+
!HLKeyBinderHelper methodsFor: 'keyBindings'!
|
|
294
|
+
|
|
295
|
+
registerBindings
|
|
296
|
+
"Do nothing"
|
|
297
|
+
! !
|
|
298
|
+
|
|
299
|
+
!HLKeyBinderHelper methodsFor: 'rendering'!
|
|
300
|
+
|
|
301
|
+
renderBindingGroup: aBindingGroup on: html
|
|
302
|
+
(aBindingGroup bindings
|
|
303
|
+
sorted: [ :a :b | a key < b key ])
|
|
304
|
+
do: [ :each |
|
|
305
|
+
html span class: 'command'; with: [
|
|
306
|
+
html span class: 'label'; with: each shortcut asLowercase.
|
|
307
|
+
html a
|
|
308
|
+
class: 'action';
|
|
309
|
+
with: each label;
|
|
310
|
+
onClick: [ self keyBinder applyBinding: each ] ] ]
|
|
311
|
+
!
|
|
312
|
+
|
|
313
|
+
renderBindingOn: html
|
|
314
|
+
self selectedBinding renderOn: self html: html
|
|
315
|
+
!
|
|
316
|
+
|
|
317
|
+
renderContentOn: html
|
|
318
|
+
html div class: 'key_helper'; with: [
|
|
319
|
+
self
|
|
320
|
+
renderSelectionOn:html;
|
|
321
|
+
renderBindingOn: html ]
|
|
322
|
+
!
|
|
323
|
+
|
|
324
|
+
renderSelectionOn: html
|
|
325
|
+
html span
|
|
326
|
+
class: 'selected';
|
|
327
|
+
with: (self selectedBinding label ifNil: [ 'Action' ])
|
|
328
|
+
! !
|
|
329
|
+
|
|
330
|
+
!HLKeyBinderHelper class methodsFor: 'instance creation'!
|
|
331
|
+
|
|
332
|
+
on: aKeyBinder
|
|
333
|
+
^ self new
|
|
334
|
+
keyBinder: aKeyBinder;
|
|
335
|
+
yourself
|
|
336
|
+
! !
|
|
337
|
+
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Smalltalk current createPackage: 'Helios-Layout' properties: #{}!
|
|
2
|
+
Widget subclass: #HLContainer
|
|
3
|
+
instanceVariableNames: 'splitter'
|
|
4
|
+
package: 'Helios-Layout'!
|
|
5
|
+
|
|
6
|
+
!HLContainer methodsFor: 'accessing'!
|
|
7
|
+
|
|
8
|
+
splitter
|
|
9
|
+
^ splitter
|
|
10
|
+
!
|
|
11
|
+
|
|
12
|
+
splitter: aSplitter
|
|
13
|
+
splitter := aSplitter
|
|
14
|
+
! !
|
|
15
|
+
|
|
16
|
+
!HLContainer methodsFor: 'rendering'!
|
|
17
|
+
|
|
18
|
+
renderOn: html
|
|
19
|
+
html div
|
|
20
|
+
id: 'container';
|
|
21
|
+
with: self splitter.
|
|
22
|
+
|
|
23
|
+
(window jQuery: window) bind: 'resize' do: [ self splitter resize ]
|
|
24
|
+
! !
|
|
25
|
+
|
|
26
|
+
!HLContainer class methodsFor: 'instance creation'!
|
|
27
|
+
|
|
28
|
+
with: aSplitter
|
|
29
|
+
^ self new
|
|
30
|
+
splitter: aSplitter;
|
|
31
|
+
yourself
|
|
32
|
+
! !
|
|
33
|
+
|
|
34
|
+
Widget subclass: #HLSplitter
|
|
35
|
+
instanceVariableNames: 'firstWidget secondWidget firstPane secondPane splitter'
|
|
36
|
+
package: 'Helios-Layout'!
|
|
37
|
+
|
|
38
|
+
!HLSplitter methodsFor: 'accessing'!
|
|
39
|
+
|
|
40
|
+
cssClass
|
|
41
|
+
^ 'splitter'
|
|
42
|
+
!
|
|
43
|
+
|
|
44
|
+
firstWidget
|
|
45
|
+
^ firstWidget
|
|
46
|
+
!
|
|
47
|
+
|
|
48
|
+
firstWidget: aWidget
|
|
49
|
+
firstWidget := aWidget
|
|
50
|
+
!
|
|
51
|
+
|
|
52
|
+
secondWidget
|
|
53
|
+
^ secondWidget
|
|
54
|
+
!
|
|
55
|
+
|
|
56
|
+
secondWidget: aWidget
|
|
57
|
+
secondWidget := aWidget
|
|
58
|
+
! !
|
|
59
|
+
|
|
60
|
+
!HLSplitter methodsFor: 'rendering'!
|
|
61
|
+
|
|
62
|
+
panesCssClass
|
|
63
|
+
^ 'panes'
|
|
64
|
+
!
|
|
65
|
+
|
|
66
|
+
renderOn: html
|
|
67
|
+
html div class: self panesCssClass; with: [
|
|
68
|
+
firstPane := html div class: 'pane'; with: self firstWidget.
|
|
69
|
+
splitter := html div class: self cssClass.
|
|
70
|
+
secondPane := html div class: 'pane'; with: self secondWidget ].
|
|
71
|
+
|
|
72
|
+
self
|
|
73
|
+
setupSplitter;
|
|
74
|
+
resize
|
|
75
|
+
!
|
|
76
|
+
|
|
77
|
+
resize
|
|
78
|
+
self firstWidget isHeliosSplitter ifTrue: [ self firstWidget resize ].
|
|
79
|
+
self secondWidget isHeliosSplitter ifTrue: [ self secondWidget resize ]
|
|
80
|
+
!
|
|
81
|
+
|
|
82
|
+
setupSplitter
|
|
83
|
+
! !
|
|
84
|
+
|
|
85
|
+
!HLSplitter methodsFor: 'testing'!
|
|
86
|
+
|
|
87
|
+
isHeliosSplitter
|
|
88
|
+
^ true
|
|
89
|
+
! !
|
|
90
|
+
|
|
91
|
+
!HLSplitter class methodsFor: 'instance creation'!
|
|
92
|
+
|
|
93
|
+
with: aWidget with: anotherWidget
|
|
94
|
+
^ self new
|
|
95
|
+
firstWidget: aWidget;
|
|
96
|
+
secondWidget: anotherWidget;
|
|
97
|
+
yourself
|
|
98
|
+
! !
|
|
99
|
+
|
|
100
|
+
HLSplitter subclass: #HLHorizontalSplitter
|
|
101
|
+
instanceVariableNames: ''
|
|
102
|
+
package: 'Helios-Layout'!
|
|
103
|
+
|
|
104
|
+
!HLHorizontalSplitter methodsFor: 'accessing'!
|
|
105
|
+
|
|
106
|
+
cssClass
|
|
107
|
+
^ super cssClass, ' horizontal'
|
|
108
|
+
!
|
|
109
|
+
|
|
110
|
+
panesCssClass
|
|
111
|
+
^ super panesCssClass, ' horizontal'
|
|
112
|
+
! !
|
|
113
|
+
|
|
114
|
+
!HLHorizontalSplitter methodsFor: 'actions'!
|
|
115
|
+
|
|
116
|
+
resize
|
|
117
|
+
self resize: splitter asJQuery offset top
|
|
118
|
+
!
|
|
119
|
+
|
|
120
|
+
resize: anInteger
|
|
121
|
+
| container position |
|
|
122
|
+
|
|
123
|
+
container := firstPane asJQuery parent.
|
|
124
|
+
position := anInteger - container offset top.
|
|
125
|
+
|
|
126
|
+
firstPane asJQuery height: ((position min: container height - 100) max: 100).
|
|
127
|
+
secondPane asJQuery height: (((container height - position) min: container height - 100) max: 100) - 6.
|
|
128
|
+
|
|
129
|
+
super resize
|
|
130
|
+
!
|
|
131
|
+
|
|
132
|
+
startResizing: aSplitter
|
|
133
|
+
aSplitter width: splitter asJQuery width
|
|
134
|
+
! !
|
|
135
|
+
|
|
136
|
+
!HLHorizontalSplitter methodsFor: 'rendering'!
|
|
137
|
+
|
|
138
|
+
setupSplitter
|
|
139
|
+
splitter asJQuery draggable: #{
|
|
140
|
+
'axis' -> 'y'.
|
|
141
|
+
'containment' -> splitter asJQuery parent.
|
|
142
|
+
'helper' -> 'clone'.
|
|
143
|
+
'start' -> [ :e :ui | self startResizing: ui helper ].
|
|
144
|
+
'drag' -> [ :e :ui | self resize: ui offset top ] }
|
|
145
|
+
! !
|
|
146
|
+
|
|
147
|
+
HLSplitter subclass: #HLVerticalSplitter
|
|
148
|
+
instanceVariableNames: ''
|
|
149
|
+
package: 'Helios-Layout'!
|
|
150
|
+
|
|
151
|
+
!HLVerticalSplitter methodsFor: 'accessing'!
|
|
152
|
+
|
|
153
|
+
cssClass
|
|
154
|
+
^ super cssClass, ' vertical'
|
|
155
|
+
!
|
|
156
|
+
|
|
157
|
+
panesCssClass
|
|
158
|
+
^ super panesCssClass, ' vertical'
|
|
159
|
+
! !
|
|
160
|
+
|
|
161
|
+
!HLVerticalSplitter methodsFor: 'actions'!
|
|
162
|
+
|
|
163
|
+
resize
|
|
164
|
+
self resize: splitter asJQuery offset left
|
|
165
|
+
!
|
|
166
|
+
|
|
167
|
+
resize: anInteger
|
|
168
|
+
| container position |
|
|
169
|
+
|
|
170
|
+
container := firstPane asJQuery parent.
|
|
171
|
+
position := anInteger - container offset left.
|
|
172
|
+
|
|
173
|
+
firstPane asJQuery width: ((position min: container width - 100) max: 100).
|
|
174
|
+
secondPane asJQuery width: (((container width - position) min: container width - 100) max: 100) - 6.
|
|
175
|
+
|
|
176
|
+
super resize
|
|
177
|
+
!
|
|
178
|
+
|
|
179
|
+
startResizing: aSplitter
|
|
180
|
+
aSplitter height: splitter asJQuery height
|
|
181
|
+
! !
|
|
182
|
+
|
|
183
|
+
!HLVerticalSplitter methodsFor: 'rendering'!
|
|
184
|
+
|
|
185
|
+
setupSplitter
|
|
186
|
+
splitter asJQuery draggable: #{
|
|
187
|
+
'axis' -> 'x'.
|
|
188
|
+
'containment' -> splitter asJQuery parent.
|
|
189
|
+
'helper' -> 'clone'.
|
|
190
|
+
'start' -> [ :e :ui | self startResizing: ui helper ].
|
|
191
|
+
'drag' -> [ :e :ui | self resize: ui offset left ] }
|
|
192
|
+
! !
|
|
193
|
+
|
|
194
|
+
!Object methodsFor: '*Helios-Layout'!
|
|
195
|
+
|
|
196
|
+
isHeliosSplitter
|
|
197
|
+
^ false
|
|
198
|
+
! !
|
|
199
|
+
|