Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjqmsamp.pls
More file actions
409 lines (390 loc) · 19.4 KB
/
Copy pathjqmsamp.pls
File metadata and controls
409 lines (390 loc) · 19.4 KB
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
*---------------------------------------------------------------
.
. Program Name: jqmsamp
. Description: JQuery Mobile Sample
. This program must be run as a .plm mime type
. Theme css: css/themes/sunbeltapp.min.css
.
. Revision History:
.
. 17-09-28 whk
. Original code
.
GLobalInit FORM %1
GlobalTheme DIM %1
GlobalTrans DIM %10
INCLUDE plbequ.inc
INCLUDE plbmeth.inc
INCLUDE plbstdlib.inc
*---------------------------------------------------------------
.
Runtime RUNTIME
Client CLIENT
.
.
.
mainPageForm PLFORM jqmsampfm.pwf
optPageForm PLFORM jqmsampfo.pwf
sampPage1Form PLFORM jqmsampf1.pwf
sampPage2Form PLFORM jqmsampf2.pwf
sampPage3Form PLFORM jqmsampf3.pwf
sampPage4Form PLFORM jqmsampf4.pwf
.
headerMain INIT "<a data-plbid='stop' class='ui-btn ui-icon-power ui-btn-icon-notext ui-corner-all' href='##'>Stop</a>":
"<h1 style='height: 2em'>Sample Pages</h1>":
"<a data-plbid='options' class='ui-btn ui-icon-grid ui-btn-icon-notext ui-corner-all' href='##'>Options</a>"
TestPageTable INIT "<ul id='pages' data-role='listview' data-inset='true'>":
"<li data-role='list-divider'>Sample JQuery Mobile Pages</li>":
"<li><a id='page1' href='##'>Regular Controls</a></li>":
"<li><a id='page2' href='##'>Auto Enhanced Controls</a></li>":
"<li><a id='page3' href='##'>Advanced Edit Types</a></li>":
"<li><a id='page4' href='##'>Responsive Grid</a></li>":
"<li><a id='page5' href='##'>Collapsible</a ></li>":
"</ul>"
headerSamp1 INIT "<a data-plbid='back' class='ui-btn ui-icon-back ui-btn-icon-notext ui-corner-all' href='##'>Back</a>":
"<h1 style='height: 2em'>Regular Controls</h1>"
headerSamp2 INIT "<a data-plbid='back' class='ui-btn ui-icon-back ui-btn-icon-notext ui-corner-all' href='##'>Back</a>":
"<h1 style='height: 2em'>Auto Enhanced Controls</h1>"
headerSamp3 INIT "<a data-plbid='back' class='ui-btn ui-icon-back ui-btn-icon-notext ui-corner-all' href='##'>Back</a>":
"<h1 style='height: 2em'>Tests</h1>"
headerSamp4 INIT "<a data-plbid='back' class='ui-btn ui-icon-back ui-btn-icon-notext ui-corner-all' href='##'>Back</a>":
"<h1 style='height: 2em'>Responsive Grid</h1>"
headerOptions INIT "<div class='ui-grid-a ui-btn-right'>":
"<a data-plbid='reset' class='ui-btn ui-icon-delete ui-btn-icon-notext ui-corner-all' href='##'>Reset</a>":
"<a data-plbid='update' class='ui-btn ui-icon-check ui-btn-icon-notext ui-corner-all' href='##'>Update</a>":
"</div>":
"<h1 style='height: 2em'>Options</h1>":
"<a data-plbid='back' class='ui-btn ui-icon-back ui-btn-icon-notext ui-corner-all' href='##'>Back</a>"
optPageHtml INIT "<form>":
"<div class='ui-field-contain'>":
"<label for='selectTrans'>Pick Your Transition:</label>":
"<select name='selectTrans' id='selectTrans'>":
"<option value='1'>fade</option>":
"<option value='2'>pop</option>":
"<option value='3'>flip</option>":
"<option value='4'>turn</option>":
"<option value='5'>flow</option>":
"<option value='6'>slidefade</option>":
"<option value='7'>slide</option>":
"<option value='4'>slideup</option>":
"<option value='8'>slidedown</option>":
"<option value='9'>none</option>":
"</select>":
"</div>":
"<fieldset data-role='controlgroup' data-type='horizontal'>":
"<legend>Pick Your Theme:</legend>":
"<input name='radioTheme' id='radioThemea' type='radio' checked='checked' value='a'>":
"<label for='radioThemea'>A</label>":
"<input name='radioTheme' id='radioThemeb' type='radio' value='b'>":
"<label for='radioThemeb'>B</label>":
"<input name='radioTheme' id='radioThemec' type='radio' value='c'>":
"<label for='radioThemec'>C</label>":
"<input name='radioTheme' id='radioThemed' type='radio' value='d'>":
"<label for='radioThemed'>D</label>":
"<input name='radioTheme' id='radioThemee' type='radio' value='e'>":
"<label for='radioThemee'>E</label>":
"</fieldset>":
"</form>"
optThemeHtml INIT "<h3>Theme Shown Below:</h3>":
"<ul data-role='listview' data-inset='true' data-theme='?' data-divider-theme='?'>":
"<li data-role='list-divider'>Mail</li>":
"<li><a href='#'>Inbox</a></li>":
"<li><a href='#'>Outbox</a></li>":
"</ul>":
"<fieldset data-role='controlgroup' data-theme='?' data-type='horizontal' data-role='fieldcontain'>":
"<legend>Cache settings:</legend>":
"<input type='radio' name='radio-choice-a1' id='radio-choice-a1' value='on' checked='checked' />":
"<label for='radio-choice-a1'>On</label>":
"<input type='radio' name='radio-choice-a1' id='radio-choice-b1' value='off' />":
"<label for='radio-choice-b1'>Off</label>":
"</fieldset>"
sampPage3Html INIT "<form>":
"<label for='search-1'>Search:</label>":
"<input name='search-1' id='search-1' type='search' value=''>":
"<label for='date-1'>Date: data-clear-btn='false'</label>":
"<input name='date-1' id='date-1' type='date' value='' data-clear-btn='false'>":
"<label for='month-1'>Month: data-clear-btn='false'</label>":
"<input name='month-1' id='month-1' type='month' value='' data-clear-btn='false'>":
"<label for='time-2'>Time: data-clear-btn='true'</label>":
"<input name='time-2' id='time-2' type='time' value='' data-clear-btn='true'>":
"<label for='tel-1'>Tel: data-clear-btn='false'</label>":
"<input name='tel-1' id='tel-1' type='tel' value='' data-clear-btn='false'>":
"<label for='email-1'>Email: data-clear-btn='false'</label>":
"<input name='email-1' id='email-1' type='email' value='' data-clear-btn='false'>":
"<label for='url-1'>Url: data-clear-btn='false'</label>":
"<input name='url-1' id='url-1' type='url' value='' data-clear-btn='false'>":
"<label for='password-1'>Password: data-clear-btn='false'</label>":
"<input name='password-1' id='password-1' type='password' value='' data-clear-btn='false' autocomplete='off'>":
"<label for='color-1'>Color: data-clear-btn='false'</label>":
"<input name='color-1' id='color-1' type='color' value='' data-clear-btn='false'>":
"</form>"
sampPage5Html INIT "<div data-role=#"collapsible#">":
"<h3>I'm a single collapsible element</h3>":
"<p>I'm the content inside of the single collapsible element.</p>":
"</div>":
"<div data-role=#"collapsible-set#">":
"<div data-role=#"collapsible#" data-collapsed=#"false#">":
"<h3>I'm expanded on page load </h3>":
"<p>I am collapsible content that is visible on page load. </p>":
"<p>That's because of the data-collapsed=#"false#" attribute </p>":
"</div>":
"<div data-role=#"collapsible#">":
"<h3>Expand me I have something to say </h3>":
"<p> I am closed on page load, but still part of an accordion. </p>":
"<div data-role=#"collapsible#">":
"<h3> Wait, are you nested? </h3>":
"<p> Yes! You can even nest your collapsible content! </p>":
"</div>":
"</div>":
"</div>"
.
footerAll INIT "<h4>JQuery Mobile Samples</h4>"
.
. Data for event processing
.
JsonData DIM 200
EventInfo XDATA
EventId DIM 20
JsonOptToDisk FORM "6" // JSON_SAVE_USE_INDENT+JSON_SAVE_USE_EOR
.
HtmlData DIM 4096
NewTheme INIT "a"
.
nResult FORM 2 //ERB
Options1 FORM "002" // $JQMOPT_FIXED_HDRFTR
Options2 FORM "003" // $JQMOPT_FIXED_HDRFTR + $JQMOPT_AUTO_ENHANCE
*................................................................
.
. Code start
.
CALL Main
LOOP
EVENTWAIT
REPEAT
STOP
*................................................................
.
. mainEvent - Main page toolbar handler
.
mainEvent LFUNCTION
ENTRY
EventInfo.LoadJson Using JsonData
CALL FetchJsonStr USING EventInfo,"id",EventId
MATCH "stop" TO EventId
IF Equal
STOP
ENDIF
MATCH "options" TO EventId
IF Equal
ACTIVATE sampOption
ENDIF
FUNCTIONEND
*................................................................
.
. mainPagePanelEvent - Main page panel events
.
mainPagePanelEvent LFUNCTION
ENTRY
EventInfo.LoadJson Using JsonData
CALL FetchJsonStr USING EventInfo,"id",EventId
MATCH "page1" TO EventId
IF Equal
sampPage1.Activate
ENDIF
MATCH "page2" TO EventId
IF Equal
sampPage2.Activate
ENDIF
MATCH "page3" TO EventId
IF Equal
sampPage3Panel1.InnerHtml Using sampPage3Html
sampPage3.Activate
ENDIF
MATCH "page4" TO EventId
IF Equal
sampPage3Panel1.InnerHtml Using sampPage3Html
sampPage4.Activate
ENDIF
MATCH "page5" TO EventId
IF Equal
sampPage3Panel1.InnerHtml Using sampPage5Html
ACTIVATE sampPage3
ENDIF
FUNCTIONEND
*................................................................
.
. optionEvent - Option page toolbar handler
.
optionEvent LFUNCTION
ENTRY
EventInfo.LoadJson Using JsonData
CALL FetchJsonStr USING EventInfo,"id",EventId
MATCH "back" TO EventId
IF Equal
Runtime.JqmPage Using $JQMPAGE_BACK
ENDIF
MATCH "update" TO EventId
IF Equal
Client.JqGet Giving GlobalTrans Using "##selectTrans option:selected","text"
Runtime.JqmOptions Using *Transition=GlobalTrans
MATCH NewTheme To GlobalTheme
IF Not Equal
MOVE NewTheme To GlobalTheme
CHAIN "jqmsamp"
ELSE
Runtime.JqmPage Using $JQMPAGE_BACK
ENDIF
ENDIF
MATCH "reset" TO EventId
IF Equal
MOVE "0" to GlobalInit
CHAIN "jqmsamp"
ENDIF
FUNCTIONEND
*................................................................
.
. optionPanEvent - Option page panel event handler
.
optionPanEvent LFUNCTION
ENTRY
EventInfo.LoadJson Using JsonData
EventInfo.SaveJson Using "event.json", JsonOptToDisk
CALL FetchJsonStr USING EventInfo,"id",EventId
MOVE optThemeHtml to HtmlData
SWITCH EventId
CASE "radioThemea"
MOVE "a" to NewTheme
REPLACE "?a" in HtmlData
sampOptionPanel2.InnerHtml Using HtmlData
CASE "radioThemeb"
MOVE "b" to NewTheme
REPLACE "?b" in HtmlData
sampOptionPanel2.InnerHtml Using HtmlData
CASE "radioThemec"
MOVE "c" to NewTheme
REPLACE "?c" in HtmlData
sampOptionPanel2.InnerHtml Using HtmlData
CASE "radioThemed"
MOVE "d" to NewTheme
REPLACE "?d" in HtmlData
sampOptionPanel2.InnerHtml Using HtmlData
CASE "radioThemee"
MOVE "e" to NewTheme
REPLACE "?e" in HtmlData
sampOptionPanel2.InnerHtml Using HtmlData
ENDSWITCH
FUNCTIONEND
*................................................................
.
. sampleEvent1 - Smaple event 1
.
sampleEvent1 LFUNCTION
ENTRY
EventInfo.LoadJson Using JsonData
CALL FetchJsonStr USING EventInfo,"id",EventId
MATCH "back" TO EventId
IF Equal
Runtime.JqmPage Using $JQMPAGE_BACK
ENDIF
FUNCTIONEND
*................................................................
.
. sampleEvent3 - Smaple event 3
.
sampleEvent3 LFUNCTION
ENTRY
EventInfo.LoadJson Using JsonData
CALL FetchJsonStr USING EventInfo,"id",EventId
MATCH "back" TO EventId
IF Equal
Runtime.JqmPage Using $JQMPAGE_BACK
ENDIF
FUNCTIONEND
*................................................................
.
. sampleEvent4 - Smaple event 4
.
sampleEvent4 LFUNCTION
ENTRY
EventInfo.LoadJson Using JsonData
CALL FetchJsonStr USING EventInfo,"id",EventId
MATCH "back" TO EventId
IF Equal
Runtime.JqmPage Using $JQMPAGE_BACK
ENDIF
FUNCTIONEND
*................................................................
.
. Main - Main program entry point
.
.
Main LFUNCTION
ENTRY
WINHIDE
.
. First load the main form
.
IF (GlobalInit = 0 )
MOVE "a" to GlobalTheme
MOVE "fade" to GlobalTrans
MOVE "1" to GlobalInit
ENDIF
MATCH "d" to GlobalTheme
IF Equal
ADD "8" To Options1 // $JQMOPT_NO_BGCOLOR
ADD "8" To Options2 // $JQMOPT_NO_BGCOLOR
ENDIF
Runtime.JqmOptions Giving nResult: //ERB
Using headerMain, footerAll, GlobalTrans,*Theme=GlobalTheme,*Options=Options1
IF ( nResult == 1 ) //ERB
ALERT STOP, "JQuery Mobile mode not being used!", nResult //ERB
STOP //ERB
ENDIF //ERB
.
FORMLOAD mainPageForm
EVENTREG mainPage,200,mainEvent,ARG1=JsonData
.
. Setup a table of test pages on the main page
.
mainPagePanel1.InnerHtml Using TestPageTable
mainPagePanel1.EnableJqEvent Using "click","##pages li a"
EVENTREG mainPagePanel1,200,mainPagePanelEvent,ARG1=JsonData
.
. Load the options page
.
Runtime.JqmOptions Using headerOptions
FORMLOAD optPageForm
sampOptionPanel1.InnerHtml Using optPageHtml
sampOptionPanel1.EnableJqEvent Using "click","input"
sampOptionPanel1.EnableJqEvent Using "change","##selectTrans"
MOVE optThemeHtml to HtmlData
REPLACE "?a" in HtmlData
sampOptionPanel2.InnerHtml Using HtmlData
EVENTREG sampOption,200,optionEvent,ARG1=JsonData
EVENTREG sampOptionPanel1,200,optionPanEvent,ARG1=JsonData
.
. Next load the samples pages
.
Runtime.JqmOptions Using headerSamp1
FORMLOAD sampPage1Form
EVENTREG sampPage1,200,sampleEvent1,ARG1=JsonData
.
. Load the auto enhanced controls page
.
Runtime.JqmOptions Using headerSamp2,*Options=Options2
FORMLOAD sampPage2Form
EVENTREG sampPage2,200,sampleEvent1,ARG1=JsonData
.
. Load the generic samples page
.
Runtime.JqmOptions Using headerSamp3,*Options=Options1
FORMLOAD sampPage3Form
EVENTREG sampPage3,200,sampleEvent3,ARG1=JsonData
.
. Load the ui-block samples page
.
Runtime.JqmOptions Using headerSamp4,*Options=Options2
FORMLOAD sampPage4Form
EVENTREG sampPage4,200,sampleEvent4,ARG1=JsonData
.
FUNCTIONEND
You can’t perform that action at this time.
