-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleMaker.js
More file actions
6499 lines (5502 loc) · 435 KB
/
ModuleMaker.js
File metadata and controls
6499 lines (5502 loc) · 435 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
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// ModuleMaker.js
//
// Created 2025/03/11 by Dave Henderson ([email protected])
// Updated 2025/09/27 by Dave Henderson ([email protected])
//
// Unless a valid Cliquesoft Private License (CPLv1) has been purchased for your
// device, this software is licensed under the Cliquesoft Public License (CPLv2)
// as found on the Cliquesoft website at www.cliquesoft.org.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the appropriate Cliquesoft License for details.
// GLOBALS
var _oModuleMaker; // used for this modules' AJAX communication
var _nModuleMakerTimeout = 0; // used to acknowledge the module's html/css has loaded so any preliminary initialization javascript calls can start
var _sModuleMakerUriSocial = ''; // used to indicate it needs to be refreshed if changed
var _bModuleMakerToggle = true; // used to indicate which section to show: Objects (true), Actions (false)
var _sModuleMakerEvents = {
onLoad: '-Load from Search Results-',
onFocus: 'Focus',
onBlur: 'Lost Focus',
onMouseOver: 'Cursor Over Object',
onMouseOut: 'Cursor Outside Object',
onChange: 'Change Selection',
onKeyPress: 'Key Press',
onKeyDown: 'Key Pressed',
onKeyUp: 'Key Released',
onClick: 'Mouse Click',
onDblClick: 'Mouse Double Click',
onMouseDown: 'Mouse Button Press',
onMouseUp: 'Mouse Button Release'
};
// REMOVED 2025/09/19 - individual elements can't utilize this event
// onUnload: 'Unload',
// -- ModuleMaker API --
function ModuleMaker(sAction,Callback) {
// sAction the available actions that this function can process: initialize (module)
// Callback the callback to execute upon success; value can be a string or function()
var HTML = "";
var AT = sAction.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase().split(' '); // https://stackoverflow.com/questions/18379254/regex-to-split-camel-case
// if (_bSecurityInvalid) {
// Project(_sProjectUI,'fail',"There is an invalid character for one of your values that must be corrected first.");
// return false;
// }
switch(sAction) {
// --- STARTUP ACTIONS ---
// Initializes the UI
case "Initialize": // WARNING: the 'A' and 'T' values are capitalized!
if (! document.getElementById('idModules_ModuleMaker')){ // if the HTML/css side hasn't loaded yet, then...
if (_nModuleMakerTimeout == 30) { // check if we've met the 30 second timeout threshold
_nModuleMakerTimeout == 0; // reset the value
Project(_sProjectUI,'fail',"The HTML file for the module could not be loaded. Please contact support for assistance."); // relay the error to the end user
return false; // exit since we can't use this module under these conditions
}
// if we've made it here, the modules' html hasn't yet loaded, so let wait a second and try again
_nModuleMakerTimeout++; // increase the timeout counter by one for each failed attempt
setTimeout(ModuleMaker(sAction,Callback),1000);
return false; // in any case, exit this function to prevent JS problems!
}
// UPDATED 2025/05/14
// ajax(_oModuleMaker,4,'post',_sUriProject+"code/ModuleMaker.php",'A='+sAction+'&T=Module&sUsername='+getCookie('sUsername')+'&sSessionID='+escape(getCookie('sSessionID')),'','','','','',function(){ModuleMaker('s_'+sAction,Callback);},function(){ModuleMaker('fail',Callback,'popup');},function(){ModuleMaker('busy',Callback);},function(){ModuleMaker('timeout',Callback);},function(){ModuleMaker('inactive',Callback,'popup');});
// UPDATED 2025/07/15
// ajax(_oModuleMaker,4,'post',_sUriProject+"code/ModuleMaker.php",'A='+sAction+'&T=Module&sUsername='+Cookie('Obtain','sUsername')+'&sSessionID='+escape(Cookie('Obtain','sSessionID')),'','','','','',function(){ModuleMaker('s_'+sAction,Callback);},function(){ModuleMaker('fail',Callback,'popup');},function(){ModuleMaker('busy',Callback);},function(){ModuleMaker('timeout',Callback);},function(){ModuleMaker('inactive',Callback,'popup');});
Ajax('Call',_oModuleMaker,_sUriProject+"code/ModuleMaker.php",'!'+sAction+'!,>Module<,(sUsername),(sSessionID)','',function(){ModuleMaker('s_'+sAction,Callback);});
break;
case "s_Initialize": // success!
// document.getElementById('idModules_ModuleMaker').selectedIndex = -1; // so these doesn't trip the safeguard in the 'LoadModules' function
// document.getElementById('idModules2_ModuleMaker').selectedIndex = -1;
// UPDATED 2025/08/14 - to prevent race conditions
// ModuleMaker('LoadModules',"document.getElementById('idModules_ModuleMaker').selectedIndex = 0",'idModules_ModuleMaker'); // now load the modules to the main listbox and set the index to 0
// ModuleMaker('LoadModules',"document.getElementById('idModules2_ModuleMaker').selectedIndex = 0",'','2','Saved'); // also add the modules to the 'Order of Operations' category and set the index to 0
// ModuleMaker('LoadModules',null,'2');
// ModuleMaker('LoadModules',null,'3');
// document.getElementById('idModules3_ModuleMaker').selectedIndex = -1;
// UPDATED 2025/08/14 - to prevent race conditions
// ModuleMaker('LoadModules',null,'idModules3_ModuleMaker','3');
// ModuleMaker('LoadModules',null,'idModules4_ModuleMaker','4');
// ModuleMaker('LoadModules',null,'idModules5_ModuleMaker','5');
// ModuleMaker('LoadThemes',null);
// UPDATED 2025/08/07
// ModuleMaker('LoadStyles',"ModuleMaker('CloneStyles',null,'idStyles_ModuleMaker','idStyles3_ModuleMaker','*',true);",'idStyles_ModuleMaker','');
// UPDATED 2025/08/14 - to prevent race conditions
// ModuleMaker('LoadStyles',"Listbox('CopyOptions','idStyles_ModuleMaker','idStyles3_ModuleMaker','',2,1);",'idStyles_ModuleMaker','');
ModuleMaker('LoadModules',function(){
Listbox('CopyOptions','idModules_ModuleMaker','idModules3_ModuleMaker','',2,1);
Listbox('CopyOptions','idModules_ModuleMaker','idModules4_ModuleMaker','',2,1);
Listbox('CopyOptions','idModules_ModuleMaker','idModules5_ModuleMaker','',2,1);
ModuleMaker('LoadModules',function(){
ModuleMaker('LoadThemes',function(){
ModuleMaker('LoadStyles',function(){
// UPDATED 2025/08/25
// Listbox('CopyOptions','idStyles_ModuleMaker','idStyles3_ModuleMaker','',2,1);
// UPDATED 2025/08/29
// Listbox('CopyOptions','idStyles_ModuleMaker','idStyles3_ModuleMaker','Objects',2,1);
// Listbox('CopyOptions','idStyles_ModuleMaker','idStyles3_ModuleMaker','Custom',0,'*');
// REMOVED 2025/08/29 - these are now part of LoadStyles
// Listbox('CopyOptions','idStyles_ModuleMaker','idStyles3_ModuleMaker','Objects');
// Listbox('CopyOptions','idStyles_ModuleMaker','idStyles3_ModuleMaker','Custom');
ModuleMaker('LoadRestore');
},'idStyles_ModuleMaker','');
});
},'','2','Saved');
},'idModules_ModuleMaker');
ModuleMaker('AdjustForm',null,null,null,'events');
break;
// --- CODE TAB ---
// Publish the Selected Module
case "PublishModule": // creates and packages the module for distribution EXAMPLES
// Callback [string][function] a callback function for a successful operation function(){alert 'hello world';}
// arguments[2] [string][object] the listbox object (id) that was manipulated this
// do NOT process this function if 'Select...' or 'New' was selected from the Module list
if (document.getElementById('idModules3_ModuleMaker').selectedIndex == 0) {
Project(_sProjectUI,'fail',"You must select a module or library before publishing.");
return false;
}
// UPDATED 2025/09/17
// var oClicked = (typeof arguments[2] === "object") ? arguments[2] : document.getElementById(arguments[2]);
if (arguments[2] == '') { var oClicked = ''; } // if there's no object to disable...
else { var oClicked = (typeof arguments[2] === "object") ? arguments[2] : document.getElementById(arguments[2]); } // otherwise assign a value to the variable
// UPDATED 2025/07/15
// ajax(_oModuleMaker,4,'post',_sUriProject+"code/ModuleMaker.php",'A=publish&T=module&sUsername='+Cookie('Obtain','sUsername')+'&sSessionID='+escape(Cookie('Obtain','sSessionID'))+'&id='+document.getElementById('idModules3_ModuleMaker').value,'','',oClicked,'','',function(){ModuleMaker('s_'+sAction,Callback);},function(){ModuleMaker('fail',Callback,'notice');},function(){ModuleMaker('busy',Callback);},function(){ModuleMaker('timeout',Callback);},function(){ModuleMaker('inactive',Callback,'notice');});
Ajax('Call',_oModuleMaker,_sUriProject+"code/ModuleMaker.php",'!'+AT[0]+'!,>'+AT[1]+'<,(sUsername),(sSessionID),&id='+document.getElementById('nidModules3_ModuleMaker').value+'&idThemes'+document.getElementById('idThemes_ModuleMaker').value,oClicked,function(){ModuleMaker('s_'+sAction,Callback);});
break;
case "s_PublishModule": // success!
// send a notification to the user
Project(_sProjectUI,'succ');
break;
// Adjust Form Objects
case "DefineValidate": // allows the user to select which characters are valid for input EXAMPLES
var HTML = "<div id='divPopupClose' onClick=\"Project('Popup','hide');\">×</div>" +
"<h3> Define Validate String </h3>" +
"<div class='divBody divBodyFull'>" +
" <ul class='ModuleMaker'>" +
" <li><input type='button' id='oToggleCase_ModuleMaker' value='↑' class='button OEButton' onClick=\"ModuleMaker('c_DefineValidate');\" /><input type='button' id='oCustomValidate_ModuleMaker' value='Custom' class='button OTButton space' onClick=\"Project('Popup','hide',null,null,"document.getElementById('sValidate_ModuleMaker').focus();");\" />" +
" <li><select id='sLogic_ModuleMaker' size='1' class='listbox' onChange=\"ModuleMaker('t_DefineValidate',this);\"><option value='allow'>Allow</option><option value='prevent'>Prevent</option></select>" +
" <li onClick=\"ModuleMaker('t_DefineValidate',this);\">a-z</li>" +
" <li onClick=\"ModuleMaker('t_DefineValidate',this);\">A-Z</li>" +
" <li onClick=\"ModuleMaker('t_DefineValidate',this);\">0-9</li>" +
" </ul>" +
" <table class='ModuleMaker'>" +
" <tr>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">0</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">1</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">2</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">3</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">4</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">5</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">6</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">7</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">8</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">9</td>" +
" </tr>" +
" <tr>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">a</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">b</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">c</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">d</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">e</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">f</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">g</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">h</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">i</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">j</td>" +
" </tr>" +
" <tr>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">k</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">l</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">m</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">n</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">o</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">p</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">q</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">r</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">s</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">t</td>" +
" </tr>" +
" <tr>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">u</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">v</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">w</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">x</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">y</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">z</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">_</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">-</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">+</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">=</td>" +
" </tr>" +
" <tr>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">[</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">]</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">{</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">}</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">(</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">)</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\"><</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">></td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">/</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">\\</td>" +
" </tr>" +
" <tr>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">?</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">!</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">@</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">#</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">$</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">%</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">^</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">&</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">*</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">|</td>" +
" </tr>" +
" <tr>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">.</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">,</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">;</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">:</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">'</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">\"</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">`</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">~</td>" +
" <td onClick=\"ModuleMaker('t_DefineValidate',this);\">[ ]</td>" + // spacebar
" <td class='disabled' onClick=\"ModuleMaker('t_DefineValidate',this);\"></td>" + // null
" </tr>" +
" </table>" +
"</div>";
// display the popup to the user
document.getElementById('divPopup').className = 'Popup_ModuleMaker';
document.getElementById('divPopup').innerHTML = HTML;
ModuleMaker('p_DefineValidate'); // process any existing selections before the popup is shown
Project('Popup','show','',true);
break;
case "c_DefineValidate": // toggle the case of applicable characters between upper and lower
var oCells = document.getElementById('divPopup').getElementsByTagName('td');
if (oCells[10].innerHTML == 'a') {
document.getElementById('oToggleCase_ModuleMaker').value = '\u21a1'; // ↓
for (let i=10; i<37; i++)
{ oCells[i].innerHTML = oCells[i].innerHTML.toUpperCase(); }
} else {
document.getElementById('oToggleCase_ModuleMaker').value = '\u219f'; // ↑
for (let i=10; i<37; i++)
{ oCells[i].innerHTML = oCells[i].innerHTML.toLowerCase(); }
}
for (let i=10; i<37; i++) { oCells[i].className = ''; } // remove any applied classes from the affected <td>'s
ModuleMaker('p_DefineValidate','case'); // process any existing selections before the popup is shown
break;
case "p_DefineValidate": // process the existing characters in the textbox when the popup is shown
var oCells = document.getElementById('divPopup').getElementsByTagName('td');
var oLIs = document.getElementById('divPopup').getElementsByTagName('li');
var sExisting = document.getElementById('sValidate_ModuleMaker').value;
var s_Chars = '';
var nStart = (arguments.length < 2) ? 0 : 10; // defines all the characters, or just the alphabet (for upper/lowercase)
var nFinish = (arguments.length < 2) ? oCells.length : 37;
if (sExisting.substring(0,1) == '!') {
document.getElementById('sLogic_ModuleMaker').selectedIndex = 1;
sExisting = sExisting.substring(1);
}
if (/a-z/.test(sExisting)) {
oLIs[2].className = 'data';
sExisting = sExisting.replace(/a-z/, '');
}
if (/A-Z/.test(sExisting)) {
oLIs[3].className = 'data';
sExisting = sExisting.replace(/A-Z/, '');
}
if (/0-9/.test(sExisting)) {
oLIs[4].className = 'data';
sExisting = sExisting.replace(/0-9/, '');
}
s_Chars = sExisting.split(''); // split the remaining characters into an array (each per index)
for (let i=0; i<s_Chars.length; i++) { // cycle those characters against...
for (let j=nStart; j<nFinish; j++) { // all the characters in the table...
if (s_Chars[i] == oCells[j].innerHTML) { // if one matches, then...
oCells[j].className = 'data'; // mark it as selected
break; // go to the next character in the pre-selected string
}
}
}
break;
case "t_DefineValidate": // toggle the character in the validate string
if (arguments[1].innerHTML == '') { return true; } // do nothing if the blank square was pressed
var oValidate = document.getElementById('sValidate_ModuleMaker');
if (arguments[1].id == 'sLogic_ModuleMaker') {
if (arguments[1].value == 'allow') { oValidate.value = oValidate.value.replace(/^!/, ''); }
else { oValidate.value = '!' + oValidate.value; }
return true;
}
if (arguments[1].className != 'data') { // if we are selecting a character, then...
arguments[1].className = 'data'; // add the class to indicate it's selected
if (arguments[1].innerHTML == '[ ]') // if the space was selected, then...
{ oValidate.value += ' '; }
else // otherwise a "normal" character was selected, so...
{ oValidate.value += arguments[1].innerHTML; } // add the character to the string
} else { // otherwise we are de-selecting a character, so...
let sRE = (arguments[1].innerHTML != '[') ? new RegExp(arguments[1].innerHTML, 'g') : new RegExp(/\[/, 'g'); // NOTE: we must escape this character since it denotes character classes
arguments[1].className = ''; // remove the class to indicate it's de-selected
if (arguments[1].innerHTML == '[ ]') // remove the character from the string
{ oValidate.value = oValidate.value.replace(sRE, ''); }
else
{ oValidate.value = oValidate.value.replace(sRE, ''); }
}
break;
// Adjust Form Objects
case "AdjustForm": // adjusts all the object values in the form EXAMPLES
// LEFT OFF - swap: arguments[4]>arguments[2]; actually turn these sections into 'r_ACTION' that can be called independently (and in a chain); turn this top section into a general call named ''
// Callback [string][function] a callback function for a successful operation function(){alert 'hello world';}
// arguments[2] [string][object] the listbox object (id) that was manipulated this NOTE: pass 'null'/'' if 'arguments[4]=languages'
// arguments[3] [string] the associated textbox id to the listbox 'sModules_ModuleMaker' NOTE: pass 'null'/'' if 'arguments[4]=languages'; pass 'enable/disable' if 'arguments[4]=actions'; pass a numeric index value for 'modules'
// arguments[4] [string] the field formerly adjusted: 'modules'
// clear,modules,tabs,groups,objects,actions,events,languages,API,operation
// MOVED 2025/07/17 - moved this into the loadtabs function
if (1 == 0) {
// if (arguments[2] != null && arguments[2] != '') { // if we're just clearing the 'languages', then we don't need to process the below
if (arguments[4] != 'API' && arguments[4] != 'edit' && arguments[4] != 'events' && arguments[4] != 'languages' && arguments[4] != 'styles') {
var oListbox = (typeof arguments[2] === "object") ? arguments[2] : document.getElementById(arguments[2]);
var sStatus = 'enable';
// NOTE 2025/06/04 - this is disrupting Tabs/Groups/Objects sections on 'Code' tab when 'New...' is selected
if (oListbox.selectedIndex < 2) { sStatus = 'disable'; } // if 'Select...' or 'New' was selected, then we need to clear/reset the entire form; otherwise just 'waterfall'
// this had to be incorporated due to 'idActions' since it has non-editable events as well as editable functions
// if (arguments[3] == 'sActions_ModuleMaker' && ! parseInt(document.getElementById('idActions_ModuleMaker').value)) { sStatus = 'disable'; }
// UPDATED 2025/04/22
// if (arguments[3] == 'sActions_ModuleMaker' && document.getElementById('idActions_ModuleMaker').selectedIndex < 16) { sStatus = 'disable'; }
// REMOVED 2025/05/06
if (arguments[3] == 'sActions_ModuleMaker' && document.getElementById('idActions_ModuleMaker').selectedIndex < (Listbox('CountOptions','idActions_ModuleMaker','Events')+2)) { sStatus = 'disable'; }
// adjust the parent listboxes' associated "New" textbox "display" value
// if (oListbox.selectedIndex == 1) { // if 'New' was selected from the listbox, then...
// UPDATED 2025/04/26
// if (arguments[3] != null) { // this had to be incorporated due to 'sLanguage'
if (arguments[3] != null && isNaN(arguments[3])) { // this had to be incorporated due to 'languages' [null] && 'modules' [numeric]
if (oListbox.value == '+') { // if 'New' (or 'Use' for API parameters) was selected from the listbox, then...
// REMOVED 2025/06/19 - this was updating the placeholder for everything (e.g. 'Fields')
// document.getElementById(arguments[3]).placeholder = 'Module Name';
document.getElementById(arguments[3]).value = ''; // remove any prior value
document.getElementById(arguments[3]).style.display = 'block'; // show the associated textbox
document.getElementById(arguments[3]).focus(); // and set focus to it
} else {
document.getElementById(arguments[3]).style.display = 'none'; // otherwise, 'Select...' -or- a saved value was selected so hide the associated textbox (for new entries)
}
}
// adjust the parent listboxes' associated "Delete","Edit","Save" icons "display" value
// UPDATED 2025/04/26
// if (oListbox.selectedIndex < 2) {
if (oListbox.selectedIndex < 2 && isNaN(arguments[3])) { // this had to be incorporated due to 'modules' [numeric]
// document.getElementById(arguments[3]).parentNode.getElementsByClassName('delete')[0].style.display = 'none';
// document.getElementById(arguments[3]).parentNode.getElementsByClassName('edit')[0].style.display = 'none';
// if (oListbox.selectedIndex == 0) {
// document.getElementById(arguments[3]).parentNode.getElementsByClassName('save')[0].style.display = 'none';
// } else {
// arguments[2].parentNode.getElementsByClassName('save')[0].style.marginTop = '-26px';
// document.getElementById(arguments[3]).parentNode.getElementsByClassName('save')[0].style.display = 'block';
// }
oListbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
oListbox.parentNode.getElementsByClassName('edit')[0].style.display = 'none';
if (oListbox.selectedIndex == 0) {
oListbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
} else {
oListbox.parentNode.getElementsByClassName('save')[0].style.marginTop = '-26px';
oListbox.parentNode.getElementsByClassName('save')[0].style.display = 'block';
}
// UPDATED 2025/04/26
// } else {
} else if (isNaN(arguments[3])) { // this had to be incorporated due to 'modules' [numeric]
// document.getElementById(arguments[3]).parentNode.getElementsByClassName('delete')[0].style.display = 'none';
// document.getElementById(arguments[3]).parentNode.getElementsByClassName('edit')[0].style.display = 'block';
// document.getElementById(arguments[3]).parentNode.getElementsByClassName('save')[0].style.display = 'none';
oListbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
// this had to be incorporated due to 'idActions' since it has non-editable events as well as editable functions
if (arguments[3] != 'sActions_ModuleMaker' || (arguments[3] == 'sActions_ModuleMaker' && parseInt(document.getElementById('idActions_ModuleMaker').value)))
{ oListbox.parentNode.getElementsByClassName('edit')[0].style.display = 'block'; }
oListbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
}
}
}
switch(arguments[4]) {
// NOTE: these are solo and not part of the "waterfall" actions
case "API":
var oAPI = document.getElementById('idParameters_ModuleMaker');
var sAPI = document.getElementById('idActions_ModuleMaker').options[document.getElementById('idActions_ModuleMaker').selectedIndex].text + '(';
for (var i=0; i<oAPI.options.length; i++) {
if (i == 0) { sAPI += oAPI.options[i].text; continue; }
sAPI += ', ' + oAPI.options[i].text;
}
sAPI += ');';
document.getElementById('sAPI_ModuleMaker').value = sAPI;
break;
case "edit":
arguments[2].style.display = 'none';
arguments[2].parentNode.getElementsByClassName('delete')[0].style.display = 'block';
// this had to be incorporated due to 'idActions' since it has non-deletable events as well as deletable functions
// UPDATED 2025/04/22
// if (arguments[3] != 'sActions_ModuleMaker' || (arguments[3] == 'sActions_ModuleMaker' && document.getElementById('idActions_ModuleMaker').selectedIndex > 15)) {
if (arguments[3] != 'sActions_ModuleMaker' || (arguments[3] == 'sActions_ModuleMaker' && document.getElementById('idActions_ModuleMaker').selectedIndex >= (Listbox('CountOptions','idActions_ModuleMaker','Events')+2))) {
arguments[2].parentNode.getElementsByClassName('save')[0].style.marginTop = '-27px';
arguments[2].parentNode.getElementsByClassName('save')[0].style.display = 'block';
}
if (arguments[3] != null) { // this had to be incorporated due to 'languages'
// this had to be incorporated due to 'idActions' since it has non-deletable events as well as deletable functions
// UPDATED 2025/04/22
// if (arguments[3] != 'sActions_ModuleMaker' || (arguments[3] == 'sActions_ModuleMaker' && document.getElementById('idActions_ModuleMaker').selectedIndex > 15)) {
if (arguments[3] != 'sActions_ModuleMaker' || (arguments[3] == 'sActions_ModuleMaker' && document.getElementById('idActions_ModuleMaker').selectedIndex >= (Listbox('CountOptions','idActions_ModuleMaker','Events')+2))) {
document.getElementById(arguments[3]).placeholder = 'New Name';
// UPDATED 2025/08/16
// document.getElementById(arguments[3]).value = ''; // remove any prior value
document.getElementById(arguments[3]).value = document.getElementById(arguments[5]).options[document.getElementById(arguments[5]).selectedIndex].text; // default to the existing name
document.getElementById(arguments[3]).style.display = 'block'; // show the associated textbox
document.getElementById(arguments[3]).focus(); // and set focus to it
}
}
break;
case "edited":
var oListbox = (typeof arguments[2] === "object") ? arguments[2] : document.getElementById(arguments[2]);
if (oListbox.value == '+') { // if 'New' (or 'Use' for API parameters) was selected from the listbox, then...
//alert('new');
document.getElementById(arguments[3]).value = ''; // remove any prior value from the associated textbox
document.getElementById(arguments[3]).style.display = 'block'; // show the associated textbox
document.getElementById(arguments[3]).focus(); // and set focus to it
} else {
//alert('NOT new');
document.getElementById(arguments[3]).style.display = 'none'; // otherwise, 'Select...' -or- a saved value was selected so hide the associated textbox (for new entries)
}
if (oListbox.selectedIndex < 2) {
//alert('top - none/save');
oListbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
oListbox.parentNode.getElementsByClassName('edit')[0].style.display = 'none';
if (oListbox.selectedIndex == 0) {
oListbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
} else {
oListbox.parentNode.getElementsByClassName('save')[0].style.marginTop = '-26px';
oListbox.parentNode.getElementsByClassName('save')[0].style.display = 'block';
}
} else {
//alert('btm - edit');
oListbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
// this had to be incorporated due to 'idActions' since it has non-editable events as well as editable functions
if (arguments[3] != 'sActions_ModuleMaker' || (arguments[3] == 'sActions_ModuleMaker' && parseInt(document.getElementById('idActions_ModuleMaker').value)))
{ oListbox.parentNode.getElementsByClassName('edit')[0].style.display = 'block'; }
oListbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
}
break;
case "events":
if (arguments[2] == '' || arguments[2] == null)
{ document.getElementById('idActions_ModuleMaker').selectedIndex = 0; }
document.getElementById('sAPI_ModuleMaker').value = '';
document.getElementById('sHeader_ModuleMaker').value = '';
// hide the "New..." textbox and all associated icons
var oTextbox = document.getElementById('sActions_ModuleMaker');
oTextbox.style.display = 'none';
oTextbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
oTextbox.parentNode.getElementsByClassName('edit')[0].style.display = 'none';
oTextbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
// reset the javascript event <option>'s
if (arguments[2] == '' || arguments[2] == null) { // if we need a total reset of the javascript events, then...
document.getElementById('ogEvents_ModuleMaker').innerHTML = '';
for (Key in _sModuleMakerEvents)
{ Listbox('AddOption','idActions_ModuleMaker', Key, _sModuleMakerEvents[Key], 'Events'); }
} else { // otherwise we need just a reset of the selected <option>, so...
var oListbox = document.getElementById('idActions_ModuleMaker');
for (Key in _sModuleMakerEvents) { // cycle each key in the object to find a match
if (_sModuleMakerEvents[Key] == oListbox.options[oListbox.selectedIndex].text) { // once found...
oListbox.options[oListbox.selectedIndex].value = Key; // set the listbox value to the key
break; // exit the 'for' loop
}
}
}
break;
// MOVED 2025/07/17 - moved this into the loadtabs function
// case "languages":
// // erase the value from its associated textboxes
// document.getElementById('sPlaceholder_ModuleMaker').value = '';
// document.getElementById('sLabel_ModuleMaker').value = '';
// document.getElementById('sTooltip_ModuleMaker').value = '';
// document.getElementById('idLanguage_ModuleMaker').value = '+';
// break;
case "themes":
document.getElementById('idStyles_ModuleMaker').selectedIndex == 0; // this triggers the 'if' in the block below
case "styles":
// UPDATED 2025/07/22 - we have to increase by 1 since index below starts at 0
// var nPredefined = 2 + Listbox('CountOptions','idStyles_ModuleMaker','Application') + Listbox('CountOptions','idStyles_ModuleMaker','Objects');
// UPDATED 2025/08/11 - don't need +1 since j=2 to start with
// var nPredefined = 1 + Listbox('CountOptions','idStyles_ModuleMaker','Application') + Listbox('CountOptions','idStyles_ModuleMaker','Objects');
var nPredefined = Listbox('CountOptions','idStyles_ModuleMaker','Application') + Listbox('CountOptions','idStyles_ModuleMaker','Objects');
var sParent = '';
var sValue = '';
var sText = '';
var oStyles;
document.getElementById('sCSS_ModuleMaker').value = ''; // erase all css in the <textarea>
if (arguments[3] == '') { document.getElementById('ogCustom_ModuleMaker').innerHTML = ''; } // erase any custom styles that were part of the selected theme
Listbox('OptionClass','idStyles_ModuleMaker','delete','data','*'); // remove all 'data' classes from the <option>'s
//alert('styles length |'+document.getElementById('idStyles_ModuleMaker').options.length+'|, nPredefined |'+nPredefined+'|');
for (var i=2; i<nPredefined+2; i++) { // reset the <option> values from database id's to their original string values
//alert('iterating |'+document.getElementById('idStyles_ModuleMaker').options[i].value+'|'+document.getElementById('idStyles_ModuleMaker').options[i].text+'|'+document.getElementById('idStyles_ModuleMaker').options[i].className+'|');
oStyles = document.getElementById('idStyles_ModuleMaker').options[i];
sText = oStyles.text;
// NOTE: we had to use indexOf to detect the class name since a space would be added somehow
if (oStyles.className.indexOf('parent') > -1) { sParent = sText;
//alert('CHANGE! (parent) |'+sText+'|'+sParent+'|');
} // if we've iterated to a "parent" <option> store its name for potential later use
if (oStyles.className.indexOf('GrandChild') > -1 && oStyles.className.indexOf('GreatGrandChild') == -1) { sParent = sText.replace(/ /, '');
//alert('parent is now |'+sParent+'|');
} // if we've iterated to a "GrandChild" <option> store its name for potential later use
if (sText.indexOf('100% width') > -1) { sValue = sParent+'100'; } // if we've iterated to a "full width" style, replace with 100(%) plus its parent name
else if (sText.indexOf(' width') > -1) { sValue = sParent+sText.substring(0,3).replace(/\//, ''); } // if we've iterated to a "width" style, keep just the numeric values plus its parent name
else if (sText.indexOf('in Header') > -1) { sValue = 'HeaderButton'; } // if we've iterated to special button placement, store its target plus its parent name
// REMOVED
// else if (sText.indexOf('in labels') > -1) { sValue = sParent+'labels'; } // if we've iterated to an object being in the <labels> area
else if (sText.indexOf('label') > -1 && sText != 'labels') { sValue = sParent+'Label'; } // if we've iterated to an associated label, add it to the parent name
else if (sText.indexOf('line') > -1) { sValue = sParent+'Line'; } // if we've iterated to hide a whole line, add it to the parent name
else if (sText.indexOf('toggle') > -1) { sValue = sParent+'Toggle'; } // if we've iterated to the 'password toggle', add it to the parent name
else if (sText.indexOf(' Table') > -1) { sValue = sText.replace(/ /, ''); } // if we've iterated to a tab table, then remove spacing NOTE: this is a GrandChild
else if (sText.indexOf('Column ') > -1) { sValue = sParent+sText.replace(/ /, ''); } // if we've iterated to a table column, then remove spacing NOTE: this is a GreatGrandChild
else if (sText.indexOf('Individual') > -1) { sValue = sParent+' li'; } // if we've iterated to the 'Individual' tab option
else if (sText.indexOf('Selected') > -1) { sValue = sParent+' li.selected'; } // if we've iterated to the 'selected' tab option
else if (sText.indexOf('List') > -1) { sValue = 'Group ul'; } // if we've iterated to the group 'List'
else if (sText.indexOf('Line') > -1) { sValue = 'Group ul li'; } // if we've iterated to the group 'List'
// REMOVED
// else if (sText == 'OBJECT SPECIFIC') { sValue = ''; } // restore this one to a blank value
else { sValue = sText; } // otherwise transpose verbatim
//if (sText.indexOf(' width') > -1) { alert('parent, text, sValue |'+sParent+'|'+sText+'|'+sValue+'|'); }
if (sText.indexOf(' width') > -1) {
//document.getElementById('debug').value += sValue.replace(/ /, '')+"\n";
document.getElementById('idStyles_ModuleMaker').options[i].value = sValue.replace(/ /, ''); }
else {
//document.getElementById('debug').value += sValue+"\n";
document.getElementById('idStyles_ModuleMaker').options[i].value = sValue; }
}
// RE-ESTABLISHED 2025/07/22 - the 'style' below needs to be moved into specific functions
break;
case "style":
//alert('totals: |'+oListbox.selectedIndex+'|' + (2 + Listbox('CountOptions','idStyles_ModuleMaker','Application') + Listbox('CountOptions','idStyles_ModuleMaker','Objects')) + '|');
// if any of the pre-defined styles are selected then we need to hide all the "edit" chrome (that was shown from above)
var oListbox = document.getElementById('idStyles_ModuleMaker');
if (oListbox.selectedIndex != 1 && oListbox.selectedIndex < (2 + Listbox('CountOptions','idStyles_ModuleMaker','Application') + Listbox('CountOptions','idStyles_ModuleMaker','Objects'))) {
oListbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
oListbox.parentNode.getElementsByClassName('edit')[0].style.display = 'none';
oListbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
document.getElementById('sStyles_ModuleMaker').style.display = 'none';
}
break;
// REMOVED 2025/04/08 - this would never get executed
// if (arguments[2] != null && arguments[2] != '') // if we're just clearing the 'languages', then we don't need to process the below line
// { if (oListbox.selectedIndex <2 && document.getElementById(arguments[3]).value == '') {return true;} } // otherwise if the "Select..." or "New" options are shown -AND- the associated textbox just got shown, then there's no need to execute a callback
// LEFT OFF - make sure all the form objects enable/disable correctly
// VER2 - move most of the below into the "LoadModules|Groups|Tabs|etc" functions instead of this large collection of code
// NOTE: these are combined, "waterfall" actions
case "clear": // if we want to reset the entire form, otherwise each 'case' below will trigger a 'waterfall' adjustment to the form objects
case "modules":
var nIndex = isNaN(arguments[3]) ? '' : arguments[3];
//alert('modules: arg[3],id,status |'+arguments[3]+'|'+'idModules'+nIndex+'_ModuleMaker'+'|'+sStatus+'|');
// MOVED 2025/07/17 - moved this into the loadtabs function
// // return the 'tabs' and 'Actions' listboxes to "Select..."
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').selectedIndex = 0;
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').options.length = isNaN(arguments[3]) ? 2 : 1;
// MOVED 2025/06/04
// // enable/disable the following fields
// if (sStatus == 'disable') {
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').className += ' disabled';
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').disabled = true;
// } else {
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').className = document.getElementById('idTabs'+nIndex+'_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').disabled = false;
//// MOVED BELOW 2025/05/08
//// sStatus = 'disable'; // indicate we need to disable everything below this object on the form in our "waterfall"
// }
// perform some additional actions if this isn't the primary 'modules' object
if (isNaN(arguments[3])) { // this had to be incorporated due to 'modules' [numeric]
// MOVED 2025/06/20 - moved below in the tabs section
// document.getElementById('idActions_ModuleMaker').selectedIndex = 0;
// document.getElementById('idActions_ModuleMaker').options.length = 2;
// document.getElementById('ogFunctions_ModuleMaker').innerHTML = ''; // NOTE: we need to do this instead of setting an 'options.length' value (which was causing blank lines)
// document.getElementById('sDataType_ModuleMaker').selectedIndex = 0;
// document.getElementById('idParameters_ModuleMaker').length = 0;
// erase the value from their associated textboxes & hide them
// MOVED 2025/07/17 - moved this into the loadtabs function
// document.getElementById('sTabs_ModuleMaker').value = '';
// document.getElementById('sTabs_ModuleMaker').style.display = 'none';
// document.getElementById('sParameters_ModuleMaker').value = '';
// document.getElementById('sDefault_ModuleMaker').value = '';
// enable/disable the following fields
if (sStatus == 'disable') {
// MOVED 04-26-2025
// document.getElementById('idTabs_ModuleMaker').className += ' disabled';
// document.getElementById('idTabs_ModuleMaker').disabled = true;
// REMOVED 04-?-2025 - these need to be enabled/disabled upon an action selection
// document.getElementById('idModules2_ModuleMaker').className += ' disabled';
// document.getElementById('idModules2_ModuleMaker').disabled = true;
// document.getElementById('idActions2_ModuleMaker').className += ' disabled';
// document.getElementById('idActions2_ModuleMaker').disabled = true;
// document.getElementById('objOperationsUp_ModuleMaker').className += ' disabled';
// document.getElementById('objOperationsUp_ModuleMaker').disabled = true;
// document.getElementById('objOperationsDown_ModuleMaker').className += ' disabled';
// document.getElementById('objOperationsDown_ModuleMaker').disabled = true;
// document.getElementById('objOperationsSave_ModuleMaker').className += ' disabled';
// document.getElementById('objOperationsSave_ModuleMaker').disabled = true;
// document.getElementById('idOperations_ModuleMaker').className += ' disabled';
// document.getElementById('idOperations_ModuleMaker').disabled = true;
// MOVED 2025/06/20 - moved below in the tabs section
// document.getElementById('idActions_ModuleMaker').className += ' disabled';
// document.getElementById('idActions_ModuleMaker').disabled = true;
// document.getElementById('sScript_ModuleMaker').className += ' disabled';
// document.getElementById('sScript_ModuleMaker').disabled = true;
// document.getElementById('objSaveCode_ModuleMaker').className += ' disabled';
// document.getElementById('objSaveCode_ModuleMaker').disabled = true;
// document.getElementById('sAPI_ModuleMaker').className += ' disabled';
// document.getElementById('sAPI_ModuleMaker').disabled = true;
// document.getElementById('sHeader_ModuleMaker').className += ' disabled';
// document.getElementById('sHeader_ModuleMaker').disabled = true;
} else {
// MOVED 04-26-2025
// document.getElementById('idTabs_ModuleMaker').className = document.getElementById('idTabs_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idTabs_ModuleMaker').disabled = false;
if (document.getElementById('idModules_ModuleMaker').selectedIndex > 1) { // if the user selected a saved module, then...
// REMOVED 04-?-2025 - these need to be enabled/disabled upon an action selection
// document.getElementById('idModules2_ModuleMaker').className = document.getElementById('idModules2_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idModules2_ModuleMaker').disabled = false;
// document.getElementById('idActions2_ModuleMaker').className = document.getElementById('idActions2_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idActions2_ModuleMaker').disabled = false;
// document.getElementById('objOperationsUp_ModuleMaker').className = document.getElementById('objOperationsUp_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('objOperationsUp_ModuleMaker').disabled = false;
// document.getElementById('objOperationsDown_ModuleMaker').className = document.getElementById('objOperationsDown_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('objOperationsDown_ModuleMaker').disabled = false;
// document.getElementById('objOperationsSave_ModuleMaker').className = document.getElementById('objOperationsSave_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('objOperationsSave_ModuleMaker').disabled = false;
// document.getElementById('idOperations_ModuleMaker').className = document.getElementById('idOperations_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idOperations_ModuleMaker').disabled = false;
// MOVED 2025/06/20 - moved below in the tabs section
// document.getElementById('idActions_ModuleMaker').className = document.getElementById('idActions_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idActions_ModuleMaker').disabled = false;
// document.getElementById('sScript_ModuleMaker').className = document.getElementById('sType_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sScript_ModuleMaker').disabled = false;
// document.getElementById('objSaveCode_ModuleMaker').className = document.getElementById('objSaveCode_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('objSaveCode_ModuleMaker').disabled = false;
// document.getElementById('sAPI_ModuleMaker').className = document.getElementById('sAPI_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sAPI_ModuleMaker').disabled = false;
// document.getElementById('sHeader_ModuleMaker').className = document.getElementById('sHeader_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sHeader_ModuleMaker').disabled = false;
}
// MOVED 2025/07/17 - moved this into the loadtabs function
// document.getElementById('ogEvents_ModuleMaker').style.display = 'none';
// MOVED 2025/06/06 - moved below so it works with both tabs
// sStatus = 'disable'; // indicate we need to disable everything below this object on the form in our "waterfall"
}
}
if (sStatus == 'enable') { sStatus = 'disable'; } // indicate we need to disable everything below this object on the form in our "waterfall"
case "tabs":
var nIndex = isNaN(arguments[3]) ? '' : arguments[3];
if (oListbox.id == 'idTabs'+nIndex+'_ModuleMaker') { sStatus = 'enable'; } // this undoes the top-level assignment of this variable if we're manipulating the tabs
//alert('tabs: arg[3],id,status |'+arguments[3]+'|'+'idTabs'+nIndex+'_ModuleMaker'+'|'+sStatus+'|');
// MOVED 2025/07/17 - moved this into the loadtabs function
// // return the 'groups' listbox to "Select..."
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').selectedIndex = 0;
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').options.length = isNaN(arguments[3]) ? 2 : 1;
// MOVED 2025/06/04
// REMOVED 2025/05/16 - this was enabling, prematurely, the 'Groups' <select> on the 'Design' tab when a module was selected
// // enable/disable the following fields
// if (sStatus == 'disable') {
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').className += ' disabled';
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').disabled = true;
// } else {
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').className = document.getElementById('idGroups'+nIndex+'_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').disabled = false;
//// MOVED BELOW 2025/05/08
//// sStatus = 'disable'; // indicate we need to disable everything below this object on the form in our "waterfall"
// }
// MOVED 2025/07/17 - moved this into the loadtabs function
// if (sStatus == 'disable') {
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').className += ' disabled';
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').disabled = true;
// } else {
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').className = document.getElementById('idTabs'+nIndex+'_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idTabs'+nIndex+'_ModuleMaker').disabled = false;
// MOVED BELOW 2025/05/08
// sStatus = 'disable'; // indicate we need to disable everything below this object on the form in our "waterfall"
// }
if (isNaN(arguments[3])) { // this had to be incorporated due to 'modules' [numeric]
// MOVED 2025/07/17 - moved this into the loadtabs function
// document.getElementById('idActions_ModuleMaker').selectedIndex = 0;
// document.getElementById('idActions_ModuleMaker').options.length = 2;
// document.getElementById('ogFunctions_ModuleMaker').innerHTML = ''; // NOTE: we need to do this instead of setting an 'options.length' value (which was causing blank lines)
// document.getElementById('sDataType_ModuleMaker').selectedIndex = 0;
// document.getElementById('idParameters_ModuleMaker').length = 0;
// // erase the value from their associated textboxes & hide them
// document.getElementById('sTabs_ModuleMaker').value = '';
// document.getElementById('sTabs_ModuleMaker').style.display = 'none';
// document.getElementById('sParameters_ModuleMaker').value = '';
// document.getElementById('sDefault_ModuleMaker').value = '';
//alert('tab adjustment |'+sStatus+'|'+nIndex+'|'+document.getElementById('idTabs_ModuleMaker').selectedIndex+'|');
//if (sStatus == 'enable' && nIndex == '' && document.getElementById('idTabs_ModuleMaker').selectedIndex == 0) {
if (nIndex == '' && document.getElementById('idTabs_ModuleMaker').selectedIndex > 0) {
// document.getElementById('idActions_ModuleMaker').className += ' disabled';
// document.getElementById('idActions_ModuleMaker').disabled = true;
// document.getElementById('sScript_ModuleMaker').className += ' disabled';
// document.getElementById('sScript_ModuleMaker').disabled = true;
// document.getElementById('objSaveCode_ModuleMaker').className += ' disabled';
// document.getElementById('objSaveCode_ModuleMaker').disabled = true;
// document.getElementById('sAPI_ModuleMaker').className += ' disabled';
// document.getElementById('sAPI_ModuleMaker').disabled = true;
// document.getElementById('sHeader_ModuleMaker').className += ' disabled';
// document.getElementById('sHeader_ModuleMaker').disabled = true;
//} else if (sStatus == 'disable' && nIndex == '' && document.getElementById('idTabs_ModuleMaker').selectedIndex == 0) {
} else if (nIndex == '' && document.getElementById('idTabs_ModuleMaker').selectedIndex == 0) {
// document.getElementById('idActions_ModuleMaker').className = document.getElementById('idActions_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idActions_ModuleMaker').disabled = false;
// document.getElementById('sScript_ModuleMaker').className = document.getElementById('sType_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sScript_ModuleMaker').disabled = false;
// document.getElementById('objSaveCode_ModuleMaker').className = document.getElementById('objSaveCode_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('objSaveCode_ModuleMaker').disabled = false;
// document.getElementById('sAPI_ModuleMaker').className = document.getElementById('sAPI_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sAPI_ModuleMaker').disabled = false;
// document.getElementById('sHeader_ModuleMaker').className = document.getElementById('sHeader_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sHeader_ModuleMaker').disabled = false;
// document.getElementById('ogEvents_ModuleMaker').style.display = 'none';
}
}
// perform some additional actions if this isn't the primary 'modules' object
if (isNaN(arguments[3])) { // this had to be incorporated due to 'modules' [numeric]
// MOVED 2025/07/17 - moved this into the loadtabs function
// // erase the value from its associated textbox & hide it
// document.getElementById('sGroups_ModuleMaker').value = '';
// document.getElementById('sGroups_ModuleMaker').style.display = 'none';
// // enable/disable the following field
if (sStatus == 'disable') {
// MOVED 2025/07/17 - moved this into the loadtabs function
// // hide the "New..." textbox and all associated icons
// var oTextbox = document.getElementById('sTabs_ModuleMaker');
// oTextbox.style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('edit')[0].style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
// enable the 'Actions' fields
// MOVED ABOVE 2025/06/20
// if (arguments[4] == 'tabs') { // NOTE: added this 'if' to triggered if 'case: tabs' was explicitly called (instead of 'waterfall'); also we need to do the opposite with the actions as opposed to the tabs
// ModuleMaker('AdjustForm',null,null,'enable','actions');
// document.getElementById('idActions_ModuleMaker').className = document.getElementById('idActions_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idActions_ModuleMaker').disabled = false;
// document.getElementById('ogEvents_ModuleMaker').style.display = 'none';
// if (document.getElementById('idTabs_ModuleMaker').selectedIndex < 2) {
//alert('tabs - loading actions');
// ModuleMaker('LoadActions'); }
// }
} else {
// disable the 'Actions' fields
// MOVED ABOVE 2025/06/20
// if (arguments[4] == 'tabs') { // NOTE: added this 'if' to triggered if 'case: tabs' was explicitly called (instead of 'waterfall'); also we need to do the opposite with the actions as opposed to the tabs
// ModuleMaker('AdjustForm',null,null,'disable','actions');
// document.getElementById('idActions_ModuleMaker').className += ' disabled';
// document.getElementById('idActions_ModuleMaker').disabled = true;
// }
sStatus = 'disable'; // indicate we need to disable everything below this object on the form in our "waterfall"
}
}
//if (oListbox.id == 'idTabs'+nIndex+'_ModuleMaker') {
//alert('debug check objects');
//return true;
//}
case "groups":
//alert('argument[4] |'+arguments[4]+'|');
var nIndex = isNaN(arguments[3]) ? '' : arguments[3];
if (oListbox.id == 'idGroups'+nIndex+'_ModuleMaker') { sStatus = 'enable'; } // this undoes the top-level assignment of this variable if we're manipulating the tabs
//alert('groups: arg[3],id,status |'+arguments[3]+'|'+'idGroups'+nIndex+'_ModuleMaker'+'|'+sStatus+'|');
// MOVED 2025/07/17 - moved this into the loadtabs function
// // enable/disable the following fields
// if (sStatus == 'disable') {
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').className += ' disabled';
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').disabled = true;
// } else {
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').className = document.getElementById('idGroups'+nIndex+'_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idGroups'+nIndex+'_ModuleMaker').disabled = false;
// }
// perform some additional actions if this isn't the primary 'modules' object
if (isNaN(arguments[3])) { // this had to be incorporated due to 'modules' [numeric]
// MOVED 2025/07/17 - moved this into the loadtabs function
// // return the 'objects' listbox to "Select..."
// document.getElementById('idObjects_ModuleMaker').selectedIndex = 0;
// document.getElementById('idObjects_ModuleMaker').options.length = isNaN(arguments[3]) ? 2 : 1;
// // erase the value from its associated textbox & hide it
// document.getElementById('sObjects_ModuleMaker').value = '';
// document.getElementById('sObjects_ModuleMaker').style.display = 'none';
// // enable/disable the following field
if (sStatus == 'disable') {
// MOVED 2025/07/17 - moved this into the loadtabs function
// // hide the "New..." textbox and all associated icons
// var oTextbox = document.getElementById('sGroups_ModuleMaker');
// oTextbox.style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('edit')[0].style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
// MOVED 2025/06/04
// // disabled the associated objects
// document.getElementById('idObjects_ModuleMaker').className += ' disabled';
// document.getElementById('idObjects_ModuleMaker').disabled = true;
} else {
// MOVED 2025/06/04
// // enabled the associated objects
// document.getElementById('idObjects_ModuleMaker').className = document.getElementById('idObjects_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idObjects_ModuleMaker').disabled = false;
sStatus = 'disable'; // indicate we need to disable everything below this object on the form in our "waterfall"
}
// MOVED 2025/07/17 - moved this into the loadtabs function
// // disable the 'Actions' fields if 'Groups' go back to 'Select...' or 'New'
// if (arguments[4] == 'groups' && document.getElementById('idGroups_ModuleMaker').selectedIndex < 2) { // NOTE: added this 'if' to triggered if 'case: tabs' was explicitly called (instead of 'waterfall'); also we need to do the opposite with the actions as opposed to the tabs
//alert('disable actions when changin groups');
// document.getElementById('idActions_ModuleMaker').className += ' disabled';
// document.getElementById('idActions_ModuleMaker').disabled = true;
// }
// if (arguments[4] == 'tabs') { // NOTE: this MUST come in the 'groups' section and not the 'tabs' due to objects being enabled and producing incorrect results
// if (document.getElementById('idTabs_ModuleMaker').selectedIndex < 2)
// { ModuleMaker('LoadActions'); }
// }
} else {
// ModuleMaker('LoadObjects',null,'idObjects3_ModuleMaker','3');
}
case "objects":
var nIndex = isNaN(arguments[3]) ? '' : arguments[3];
if (oListbox.id == 'idObjects'+nIndex+'_ModuleMaker') { sStatus = 'enable'; } // this undoes the top-level assignment of this variable if we're manipulating the tabs
else if (nIndex == 3 && document.getElementById('idGroups'+nIndex+'_ModuleMaker').selectedIndex == 0) { sStatus = 'disable'; }
//alert('objects: arg[3],id,status |'+arguments[3]+'|'+'idObjects'+nIndex+'_ModuleMaker'+'|'+sStatus+'|');
// MOVED 2025/07/17 - moved this into the loadtabs function
// // enable/disable the following fields
// if (sStatus == 'disable') {
// document.getElementById('idObjects'+nIndex+'_ModuleMaker').className += ' disabled';
// document.getElementById('idObjects'+nIndex+'_ModuleMaker').disabled = true;
// } else {
// document.getElementById('idObjects'+nIndex+'_ModuleMaker').className = document.getElementById('idObjects'+nIndex+'_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('idObjects'+nIndex+'_ModuleMaker').disabled = false;
// }
if (isNaN(arguments[3])) {
// MOVED 2025/07/17 - moved this into the loadtabs function
// // reset listbox values
// document.getElementById('sVisibility_ModuleMaker').selectedIndex = 0;
// document.getElementById('sType_ModuleMaker').selectedIndex = 0;
// document.getElementById('nParent_ModuleMaker').selectedIndex = 0;
// document.getElementById('sLanguage_ModuleMaker').selectedIndex = 0;
// document.getElementById('sDataType_ModuleMaker').selectedIndex = 0;
// document.getElementById('idParameters_ModuleMaker').length = 0;
// erase the value from its associated textboxes
// document.getElementById('sValue_ModuleMaker').value = '';
// document.getElementById('nMaxLength_ModuleMaker').value = '';
// document.getElementById('sValidate_ModuleMaker').value = '';
// REMOVED 2025/04/30
// document.getElementById('sClass_ModuleMaker').value = '';
// document.getElementById('sTag_ModuleMaker').value = '';
// document.getElementById('sPlaceholder_ModuleMaker').value = '';
// document.getElementById('sLabel_ModuleMaker').value = '';
// document.getElementById('sTooltip_ModuleMaker').value = '';
// document.getElementById('idLanguage_ModuleMaker').value = '+';
// document.getElementById('sParameters_ModuleMaker').value = '';
// document.getElementById('sDefault_ModuleMaker').value = '';
// document.getElementById('sLanguage_ModuleMaker').parentNode.getElementsByClassName('delete')[0].style.display = 'none';
//if (oListbox.selectedIndex < 2) { return true; }
if (oListbox.selectedIndex < 2) { sStatus = 'disable' }
// enable/disable the following fields
if (sStatus == 'disable') {
// MOVED 2025/07/17 - moved this into the loadtabs function
// // hide the "New..." textbox and all associated icons
// var oTextbox = document.getElementById('sObjects_ModuleMaker');
// if (oListbox.selectedIndex != 1) { // do NOT hide these if 'New...' is selected
// oTextbox.style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('save')[0].style.display = 'none';
// }
// oTextbox.parentNode.getElementsByClassName('delete')[0].style.display = 'none';
// oTextbox.parentNode.getElementsByClassName('edit')[0].style.display = 'none';
// // disable the associated objects
// document.getElementById('sVisibility_ModuleMaker').className += ' disabled';
// document.getElementById('sVisibility_ModuleMaker').disabled = true;
// document.getElementById('sType_ModuleMaker').className += ' disabled';
// document.getElementById('sType_ModuleMaker').disabled = true;
// document.getElementById('nParent_ModuleMaker').className += ' disabled';
// document.getElementById('nParent_ModuleMaker').disabled = true;
// document.getElementById('sLanguage_ModuleMaker').className += ' disabled';
// document.getElementById('sLanguage_ModuleMaker').disabled = true;
// document.getElementById('sValue_ModuleMaker').className += ' disabled';
// document.getElementById('sValue_ModuleMaker').disabled = true;
// document.getElementById('nMaxLength_ModuleMaker').className += ' disabled';
// document.getElementById('nMaxLength_ModuleMaker').disabled = true;
// document.getElementById('sValidate_ModuleMaker').className += ' disabled';
// document.getElementById('sValidate_ModuleMaker').disabled = true;
// REMOVED 2025/04/30
// document.getElementById('sClass_ModuleMaker').className += ' disabled';
// document.getElementById('sClass_ModuleMaker').disabled = true;
// document.getElementById('sTag_ModuleMaker').className += ' disabled';
// document.getElementById('sTag_ModuleMaker').disabled = true;
// document.getElementById('objSaveObject_ModuleMaker').className += ' disabled';
// document.getElementById('objSaveObject_ModuleMaker').disabled = true;
// document.getElementById('sLanguage_ModuleMaker').className += ' disabled';
// document.getElementById('sLanguage_ModuleMaker').disabled = true;
// document.getElementById('sPlaceholder_ModuleMaker').className += ' disabled';
// document.getElementById('sPlaceholder_ModuleMaker').disabled = true;
// document.getElementById('sLabel_ModuleMaker').className += ' disabled';
// document.getElementById('sLabel_ModuleMaker').disabled = true;
// document.getElementById('sTooltip_ModuleMaker').className += ' disabled';
// document.getElementById('sTooltip_ModuleMaker').disabled = true;
// document.getElementById('objSaveLanguage_ModuleMaker').className += ' disabled';
// document.getElementById('objSaveLanguage_ModuleMaker').disabled = true;
// if (arguments[4] == 'objects') { // NOTE: had to put in this 'if' since this would be triggered if 'case: tabs' above was originally called (which this cancelled)
// // disable the 'Actions' fields
// // ModuleMaker('AdjustForm',null,null,'disable','actions');
// document.getElementById('idActions_ModuleMaker').className += ' disabled';
// document.getElementById('idActions_ModuleMaker').disabled = true;
// }
} else {
// // enable the associated objects
// document.getElementById('sVisibility_ModuleMaker').className = document.getElementById('sVisibility_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sVisibility_ModuleMaker').disabled = false;
// document.getElementById('sType_ModuleMaker').className = document.getElementById('sType_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sType_ModuleMaker').disabled = false;
// document.getElementById('nParent_ModuleMaker').className = document.getElementById('nParent_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('nParent_ModuleMaker').disabled = false;
// document.getElementById('sLanguage_ModuleMaker').className = document.getElementById('sLanguage_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sLanguage_ModuleMaker').disabled = false;
// document.getElementById('sValue_ModuleMaker').className = document.getElementById('sValue_ModuleMaker').className.replace(/ disabled/g, '');
// document.getElementById('sValue_ModuleMaker').disabled = false;
// document.getElementById('nMaxLength_ModuleMaker').className = document.getElementById('nMaxLength_ModuleMaker').className.replace(/ disabled/g, '');