1
0
Fork 0

WebApp: Work on a simple web application

This commit is contained in:
Holger Hans Peter Freyther 2010-12-11 09:45:25 +01:00
parent 39c1d7ec47
commit 6130b0b9d9
1 changed files with 153 additions and 0 deletions

153
WebApp.st Normal file
View File

@ -0,0 +1,153 @@
PackageLoader fileInPackage: 'Iliad-Core'.
PackageLoader fileInPackage: 'Iliad-Swazoo'.
FileStream fileIn: 'A3A8.st'.
FileStream fileIn: 'Messages.st'.
FileStream fileIn: 'BSSAP.st'.
FileStream fileIn: 'BSSMAP.st'.
FileStream fileIn: 'GSM48.st'.
FileStream fileIn: 'SCCPHandler.st'.
FileStream fileIn: 'GSMDriver.st'.
Iliad.ILWidget subclass: ServerConfigWidget [
| app |
ServerConfigWidget class >> initWith: anApp [
^ self new
app: anApp;
yourself
]
app: anApp [
app := anApp.
]
contents [
^ [:e |
e div class: 'server'; build: [:div |
div h1: 'Server Config'.
].
]
]
]
Iliad.ILWidget subclass: PhoneConfigWidget [
| app |
PhoneConfigWidget class >> initWith: anApp [
^ self new
app: anApp;
yourself
]
app: anApp [
app := anApp.
]
contents [
^ [:e |
e div
class: 'config';
build: [:div |
div h1: 'Phone Config'.
div a
action: [self connectServer];
text: 'Connect'.
].
]
]
connectServer [
]
]
Iliad.ILWidget subclass: LUWidget [
| app |
LUWidget class >> initWith: anApp [
^ self new
app: anApp; yourself
]
app: anApp [
app := anApp.
]
contents [
^ [:e |
e div
class: 'lu';
build: [:div |
div h1: 'LU Widget'.
].
]
]
]
Iliad.ILWidget subclass: CallWidget [
| app |
CallWidget class >> initWith: anApp [
^ self new
app: anApp; yourself
]
app: anApp [
app := anApp.
]
contents [
^ [:e |
e div
class: 'call';
build: [:div |
div h1: 'Call Widget'.
].
]
]
]
Iliad.ILApplication subclass: GSMTestphoneApp [
| config call lu serverConfig gsmServer gsmConfig |
GSMTestphoneApp class >> path [ ^ 'testphone' ]
gsmConfig [
^ gsmConfig ifNil: [gsmConfig := PhoneConfig new]
]
gsmServer [
^ gsmServer ifNil: [gsmServer := IPAConfig new]
]
phoneConfig [
^ config ifNil: [config := PhoneConfigWidget initWith: self]
]
serverConfig [
^ serverConfig ifNil: [serverConfig := ServerConfigWidget initWith: self]
]
call [
^ call ifNil: [call := CallWidget initWith: self]
]
lu [
^ lu ifNil: [lu := LUWidget initWith: self]
]
index [
<category: 'controllers'>
^ [:e |
e build: self serverConfig.
e build: self phoneConfig.
e build: self call.
e build: self lu.
].
]
]
Eval [
Iliad.SwazooIliad startOn: 8080.
stdin next.
]