aboutsummaryrefslogtreecommitdiffstats
path: root/WebApp.st
blob: a3e0c1d29c65858ebeead4bed8e611653c5a291f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
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.
]