-
Notifications
You must be signed in to change notification settings - Fork 43
/
setMenu.js
2036 lines (1606 loc) · 104 KB
/
setMenu.js
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
/**
* @author Jiyao Wang <wangjiy@ncbi.nlm.nih.gov> / https://github.com/ncbi/icn3d
*/
class SetMenu {
constructor(icn3dui) {
this.icn3dui = icn3dui;
//this.sh = this.icn3dui.htmlCls.setHtmlCls;
}
// simplify the calls of the following functions from setHtmlCls
getLink(id, text, bSimpleMenu, selType) { let me = this.icn3dui;
return me.htmlCls.setHtmlCls.getLink(id, text, bSimpleMenu, selType);
}
getMenuText(id, text, classname, bSimpleMenu, selType) { let me = this.icn3dui;
return me.htmlCls.setHtmlCls.getMenuText(id, text, classname, bSimpleMenu, selType);
}
getMenuUrl(id, url, text, bSimpleMenu, selType) { let me = this.icn3dui;
return me.htmlCls.setHtmlCls.getMenuUrl(id, url, text, bSimpleMenu, selType);
}
getMenuSep() { let me = this.icn3dui;
return me.htmlCls.setHtmlCls.getMenuSep();
}
getLinkWrapper(id, text, wrapper, bSimpleMenu, selType, bHide) { let me = this.icn3dui, ic = me.icn3d;
return me.htmlCls.setHtmlCls.getLinkWrapper(id, text, wrapper, bSimpleMenu, selType, bHide);
}
getLinkWrapper2(id, text, wrapper, bSimpleMenu, selType) { let me = this.icn3dui, ic = me.icn3d;
return me.htmlCls.setHtmlCls.getLinkWrapper2(id, text, wrapper, bSimpleMenu, selType);
}
getRadio(radioid, id, text, bChecked, bSimpleMenu, selType) { let me = this.icn3dui;
return me.htmlCls.setHtmlCls.getRadio(radioid, id, text, bChecked, bSimpleMenu, selType);
}
getRadClr(radioid, id, text, color, bChecked, bSimpleMenu, selType) { let me = this.icn3dui;
return me.htmlCls.setHtmlCls.getRadioColor(radioid, id, text, color, bChecked, bSimpleMenu, selType);
}
resetMenu(mode) { let me = this.icn3dui;
if(!mode || mode == 'simple') {
me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
me.htmlCls.clickMenuCls.applyShownMenus();
}
else if(mode == 'all') {
me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.allMenus);
me.htmlCls.clickMenuCls.applyShownMenus();
}
else if(mode == 'custom') {
me.htmlCls.dialogCls.openDlg('dl_menupref', 'Select Menus');
me.htmlCls.clickMenuCls.getHiddenMenusFromCache();
me.htmlCls.clickMenuCls.displayShownMenus();
}
}
setMenuMode(bMobile) { let me = this.icn3dui;
let spaceCss = (bMobile) ? "; padding-left:6px; background-color:#eee" : "; margin:3px; background-color:white";
let spaceCss2 = (bMobile) ? "; font-size:14px!important" : "";
let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
let html = '<div class="icn3d-text" style="color:#f8b84e; font-weight:bold' + spaceCss + '">';
html += '<select name="menumode" id="' + me.pre + 'menumode" class="icn3d-text" style="color:#f8b84e; font-weight:bold; border:0px' + spaceCss2 + '">';
html += (mode == 'simple' || !mode) ? '<option value="simple" selected>Simple</option>' : '<option value="simple">Simple</option>';
html += (mode == 'all') ? '<option value="all" selected>All</option>' : '<option value="all">All</option>';
html += (mode == 'custom') ? '<option value="custom" selected>Custom</option>' : '<option value="custom">Custom</option>';
html += '</select>';
if(bMobile) {
html += '<br><span style="font-size:12px"> Menus</span>';
}
else {
html += ' Menus';
}
html += '</div>';
return html;
}
//Set the HTML code for the menus shown at the top of the viewer.
setTopMenusHtml(id, str1, str2) { let me = this.icn3dui;
if(me.bNode) return '';
let titleColor =(me.htmlCls.opts['background'] == 'black') ? me.htmlCls.GREYD : 'black';
let html = "";
html += "<div style='position:relative;'>";
html += me.htmlCls.divStr + "popup' class='icn3d-text icn3d-popup'></div>";
html += this.setReplayHtml();
html += "<!--https://forum.jquery.com/topic/looking-for-a-jquery-horizontal-menu-bar-->";
html += me.htmlCls.divStr + "mnlist' style='position:absolute; z-index:999; float:left; display:table-row; margin-top: -2px;'>";
html += "<table border='0' cellpadding='0' cellspacing='0' width='100'><tr>";
let tdStr = '<td valign="top">';
// html += tdStr + this.setMenuMode() + '</td>';
html += tdStr + this.setMenu1() + '</td>';
html += tdStr + this.setMenu2() + '</td>';
html += tdStr + this.setMenu2b() + '</td>';
html += tdStr + this.setMenu3() + '</td>';
html += tdStr + this.setMenu4() + '</td>';
html += tdStr + this.setMenu5() + '</td>';
//html += tdStr + this.setMenu5b() + '</td>';
html += tdStr + this.setMenu6() + '</td>';
// reset the menus at the end of the menus
// let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
// this.resetMenu(mode);
// me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
html += tdStr + "<div style='position:relative; margin-left:6px;'>" + str1;
html += "<div class='icn3d-commandTitle' style='min-width:40px; margin-top: 3px; white-space: nowrap;'>" + str2;
html += tdStr + '<div class="icn3d-commandTitle" style="white-space:nowrap; margin-top:10px; border-left:solid 1px #888888"><span id="' + me.pre + 'selection_expand" class="icn3d-expand icn3d-link" style="display:block;" title="Expand">' + me.htmlCls.space2 + 'Toolbar <span class="ui-icon ui-icon-plus" style="width:15px"></span>' + me.htmlCls.space2 + '</span><span id="' + me.pre + 'selection_shrink" class="icn3d-shrink icn3d-link" style="display:none;" title="Shrink">' + me.htmlCls.space2 + 'Toolbar <span class="ui-icon ui-icon-minus" style="width:15px"></span>' + me.htmlCls.space2 + '</span></div></td>';
html += tdStr + '<div class="icn3d-commandTitle" style="white-space:nowrap; margin-top:8px; border-left:solid 1px #888888">' + me.htmlCls.space2 + '<input type="text" id="' + me.pre + 'search_seq" size="10" placeholder="one-letter seq."> <button style="white-space:nowrap;" id="' + me.pre + 'search_seq_button">Search</button> <a style="text-decoration: none;" href="' + me.htmlCls.baseUrl + 'icn3d/icn3d.html#selectb" target="_blank" title="Specification tips">?</a></div></td>';
html += "</tr>";
html += "</table>";
html += "</div>";
html += this.setTools();
// show title at the top left corner
html += me.htmlCls.divStr + "title' class='icn3d-commandTitle' style='font-size:1.2em; font-weight:normal; position:absolute; z-index:1; float:left; display:table-row; margin: 85px 0px 0px 5px; color:" + titleColor + "; width:" + me.htmlCls.WIDTH + "px'></div>";
html += me.htmlCls.divStr + "viewer' style='position:relative; width:100%; height:100%; background-color: " + me.htmlCls.GREYD + ";'>";
// deprecated, use the dialog dl_legend instead
//html += me.htmlCls.divStr + "legend' class='icn3d-text icn3d-legend'></div>";
html += me.htmlCls.divStr + "mnLogSection'>";
html += "<div style='height: " + me.htmlCls.MENU_HEIGHT + "px;'></div>";
// html += "<div style='height: " + me.htmlCls.MENU_HEIGHT + "px;'></div>";
html += " </div>";
if(me.cfg.mmtfid === undefined) {
//var tmpStr =(ic.realHeight < 300) ? 'top:100px; font-size: 1.2em;' : 'top:180px; font-size: 1.8em;';
let tmpStr = 'top:180px; font-size: 1.8em;';
html += me.htmlCls.divStr + "wait' style='position:absolute; left:50px; " + tmpStr + " color: #444444;'>Loading data...</div>";
}
html += "<canvas id='" + me.pre + "canvas' style='width:100%; height: 100%; background-color: #FFF;'>Your browser does not support WebGL.</canvas>";
// separate for the log box
if(me.cfg.showcommand === undefined || me.cfg.showcommand) {
html += this.setLogWindow();
}
html += "</div>";
html += "</div>";
html += me.htmlCls.setDialogCls.setDialogs();
html += me.htmlCls.setDialogCls.setCustomDialogs();
$( "#" + id).html(html);
// mn display
$("accordion").accordion({ collapsible: true, active: false, heightStyle: "content"});
$("accordion div").removeClass("ui-accordion-content ui-corner-all ui-corner-bottom ui-widget-content");
$(".icn3d-mn-item").menu({position: { my: "left top", at: "right top" }});
$(".icn3d-mn-item").hover(function(){},function(){$("accordion").accordion( "option", "active", "none");});
$("#" + me.pre + "accordion1").hover( function(){ $("#" + me.pre + "accordion1 div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion1 div").css("display", "none"); } );
$("#" + me.pre + "accordion2").hover( function(){ $("#" + me.pre + "accordion2 div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion2 div").css("display", "none"); } );
$("#" + me.pre + "accordion2b").hover( function(){ $("#" + me.pre + "accordion2b div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion2b div").css("display", "none"); } );
$("#" + me.pre + "accordion3").hover( function(){ $("#" + me.pre + "accordion3 div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion3 div").css("display", "none"); } );
$("#" + me.pre + "accordion4").hover( function(){ $("#" + me.pre + "accordion4 div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion4 div").css("display", "none"); } );
$("#" + me.pre + "accordion5").hover( function(){ $("#" + me.pre + "accordion5 div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion5 div").css("display", "none"); } );
$("#" + me.pre + "accordion6").hover( function(){ $("#" + me.pre + "accordion6 div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion6 div").css("display", "none"); } );
}
setTopMenusHtmlMobile(id, str1, str2) { let me = this.icn3dui;
if(me.bNode) return '';
let titleColor =(me.htmlCls.opts['background'] == 'black') ? me.htmlCls.GREYD : 'black';
let html = "";
html += "<div style='position:relative;'>";
html += me.htmlCls.divStr + "popup' class='icn3d-text icn3d-popup'></div>";
html += this.setReplayHtml();
if(!me.utilsCls.isMobile()) {
let marginLeft = me.htmlCls.WIDTH - 40 + 5;
html += me.htmlCls.buttonStr + "fullscreen' style='position:absolute; z-index:1999; display:block; padding:0px; margin: 12px 0px 0px " + marginLeft + "px; width:30px; height:34px; border-radius:4px; border:none; background-color:#f6f6f6;' title='Full screen'>";
html += "<svg fill='#1c94c4' viewBox='0 0 24 24' width='24' height='24'>";
html += "<path d='M0 0h24v24H0z' fill='none'></path>";
html += "<path d='M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z'></path>";
html += "</svg>";
html += "</button>";
}
html += "<!--https://forum.jquery.com/topic/looking-for-a-jquery-horizontal-menu-bar-->";
html += me.htmlCls.divStr + "mnlist' style='position:absolute; z-index:999; float:left; display:block; margin: 5px 0px 0px 5px;'>";
//html += "<div class='icn3d-menu'>";
html += "<div>";
html += "<accordion id='" + me.pre + "accordion0' class='icn3d-accordion'>";
if(me.cfg.notebook) {
html += "<h3 style='width:20px; height:24px; position:relative; padding: 0'><span style='position:absolute; left:3px; top:4px;'>☰</span></h3>";
}
else {
html += "<h3 style='width:30px; height:34px; position:relative; padding: 0; margin-top:7px!important; background-color:#f6f6f6;'><span style='position:absolute; left:7px; top:8px;'>☰</span></h3>";
}
html += "<div>";
// html += '<li>' + this.setMenuMode(true);
let liStr = "<li><span class='icn3d-menu-color'";
html += "<ul class='icn3d-mn-item'>";
html += liStr + ">File</span>";
html += this.setMenu1_base();
html += liStr + ">Select</span>";
html += this.setMenu2_base();
html += liStr + ">View</span>";
html += this.setMenu2b_base();
html += liStr + " id='" + me.pre + "style'>Style</span>";
html += this.setMenu3_base();
html += liStr + " id='" + me.pre + "color'>Color</span>";
html += this.setMenu4_base();
html += liStr + ">Analysis</span>";
html += this.setMenu5_base();
html += liStr + ">Help</span>";
html += this.setMenu6_base();
// reset the menus at the end of the menus
// let mode = me.htmlCls.setHtmlCls.getCookie('menumode');
// this.resetMenu(mode);
// me.htmlCls.shownMenus = me.hashUtilsCls.cloneHash(me.htmlCls.simpleMenus);
html += "<li><div style='position:relative; margin-top:-6px;'>" + str1;
html += "<div class='icn3d-commandTitle' style='margin-top: 3px; white-space: nowrap;'>" + str2;
//if(me.cfg.align !== undefined) {
html += "<li><span id='" + me.pre + "alternate2' class='icn3d-menu-color' title='Alternate the structures'>Alternate</span>";
//}
html += "</ul>";
html += "</div>";
html += "</accordion>";
html += "</div>";
html += "</div>";
//html += me.htmlCls.setMenuCls.setTools();
// show title at the top left corner
html += me.htmlCls.divStr + "title' class='icn3d-commandTitle' style='font-size:1.2em; font-weight:normal; position:absolute; z-index:1; float:left; display:block; margin: 12px 0px 0px 40px; color:" + titleColor + "; width:" +(me.htmlCls.WIDTH - 40).toString() + "px'></div>";
html += me.htmlCls.divStr + "viewer' style='position:relative; width:100%; height:100%; background-color: " + me.htmlCls.GREYD + ";'>";
// don't show legend in mobile
//html += me.htmlCls.divStr + "legend' class='icn3d-text icn3d-legend'></div>";
html += me.htmlCls.divStr + "mnLogSection'>";
html += "<div style='height: " + me.htmlCls.MENU_HEIGHT + "px;'></div>";
html += "</div>";
if(me.cfg.mmtfid === undefined) {
//var tmpStr =(ic.realHeight < 300) ? 'top:100px; font-size: 1.2em;' : 'top:180px; font-size: 1.8em;';
let tmpStr = 'top:180px; font-size: 1.8em;';
html += me.htmlCls.divStr + "wait' style='position:absolute; left:50px; " + tmpStr + " color: #444444;'>Loading data...</div>";
}
html += "<canvas id='" + me.pre + "canvas' style='width:100%; height: 100%; background-color: #FFF;'>Your browser does not support WebGL.</canvas>";
// separate for the log box
if(me.cfg.showcommand === undefined || me.cfg.showcommand) {
html += this.setLogWindow();
}
html += "</div>";
html += "</div>";
html += me.htmlCls.setDialogCls.setDialogs();
html += me.htmlCls.setDialogCls.setCustomDialogs();
$( "#" + id).html(html);
// mn display
$("accordion").accordion({ collapsible: true, active: false, heightStyle: "content"});
$("accordion div").removeClass("ui-accordion-content ui-corner-all ui-corner-bottom ui-widget-content");
$(".icn3d-mn-item").menu({position: { my: "left top", at: "right top" }});
$(".icn3d-mn-item").hover(function(){},function(){$("accordion").accordion( "option", "active", "none");});
$("#" + me.pre + "accordion0").hover( function(){ $("#" + me.pre + "accordion0 div").css("display", "block"); }, function(){ $("#" + me.pre + "accordion0 div").css("display", "none"); } );
}
setReplayHtml(id) { let me = this.icn3dui;
if(me.bNode) return '';
let html = '';
html += me.htmlCls.divStr + "replay' style='display:none; position:absolute; z-index:9999; top:" + parseInt(me.htmlCls.HEIGHT - 100).toString() + "px; left:20px;'>";
html += "<div title='Click to replay one step'><svg style='cursor:pointer;' fill='#f8b84e' viewBox='0 0 60 60' width='40' height='40'>";
html += '<circle style="fill:#f8b84e;" cx="29" cy="29" r="29"/>';
html += '<g>';
html += '<polygon style="fill:#FFFFFF;" points="44,29 22,44 22,29.273 22,14"/>';
html += '<path style="fill:#FFFFFF;" d="M22,45c-0.16,0-0.321-0.038-0.467-0.116C21.205,44.711,21,44.371,21,44V14c0-0.371,0.205-0.711,0.533-0.884c0.328-0.174,0.724-0.15,1.031,0.058l22,15C44.836,28.36,45,28.669,45,29s-0.164,0.64-0.437,0.826l-22,15C22.394,44.941,22.197,45,22,45z M23,15.893v26.215L42.225,29L23,15.893z"/>';
html += '</g>';
html += "</svg></div>";
html += me.htmlCls.divStr + "replay_menu' style='background-color:#DDDDDD; padding:3px; font-weight:bold;'></div>";
html += me.htmlCls.divStr + "replay_cmd' style='background-color:#DDDDDD; padding:3px; max-width:250px'></div>";
html += "</div>";
return html;
}
//Set the HTML code for the tools section. It includes several buttons, and is the second line at the top of the viewer.
setTools() { let me = this.icn3dui;
if(me.bNode) return '';
let html = "";
html += me.htmlCls.divStr + "selection' style='display:none;'><div style='position:absolute; z-index:555; float:left; display:table-row; margin: 32px 0px 0px 0px;'>";
//html += "<table style='margin-top: 3px; width:100px;'>";
html += "<table style='margin-top: 3px; width:770px; background-color:#EEE;'>";
html += this.setTools_base();
// add custom buttons here
// ...
html += "</table>";
html += "</div></div>";
return html;
}
setButton(buttonStyle, id, title, text, color) { let me = this.icn3dui;
if(me.bNode) return '';
color =(color !== undefined) ? 'color:' + color : '';
let bkgdColor = me.utilsCls.isMobile() ? ' background-color:#DDDDDD;' : '';
return "<div style='margin:3px 0px 0px 10px;'><button style='-webkit-appearance:" + buttonStyle + "; height:36px;" + bkgdColor + "' id='" + me.pre + id + "'><span style='white-space:nowrap;" + color + "' class='icn3d-commandTitle' title='" + title + "'>" + text + "</span></button></div>";
}
setIcon(iconType, id, title, iconStyle, url, bText, bHighlight) { let me = this.icn3dui;
if(me.bNode) return '';
let color = (bHighlight) ? 'color:#f8b84e; ' : 'color:#1c94c4; ';
let bkgdColor = ' background-color:#EEE; ';
let cssCursor = (iconType == 'text') ? '' : 'cursor:pointer;';
//let iconHtml = '<i id="' + me.pre + id + '" class="fa fa-' + iconStyle + '" title="' + title + '" style="font-size:20px; ' + color + bkgdColor + cssCursor + cssBorder + '"></i>';
let iconHtml;
if(bText) {
iconHtml = '<div id="' + me.pre + id + '" title="' + title + '" style="font-family: Arial, Helvetica, sans-serif; font-size:16px; width:16px; height:16px;' + color + bkgdColor + cssCursor + '">' + iconStyle + '</div>';
}
else {
iconHtml = '<i id="' + me.pre + id + '" class="las la-' + iconStyle + '" title="' + title + '" style="width:16px; height:16px;' + color + bkgdColor + cssCursor + '"></i>';
}
if(iconType == 'link') {
return '<a href="' + url + '" target="_blank">' + iconHtml + '</a>';
}
else {
return iconHtml;
}
}
setTools_base() { let me = this.icn3dui;
if(me.bNode) return '';
// second row
let html = "<tr valign='center'>";
let iconType = 'regular';
let tdStr = "<td valign='top' align='center'>";
let tdStrBorder = "<td valign='top' align='center' style='border-left: solid 1px #888888'>";
// line-awesome: https://icons8.com/line-awesome
// File menu
html += tdStr + this.setIcon(iconType, 'tool_mmdbafid', 'Input PDB/MMDB/AlphaFold IDs', 'id', undefined, true) + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_pdbfile', 'Input PDB Files (appendable)', 'file-alt') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_sharelink', 'Get Share Link', 'link') + "</td>";
html += tdStr + this.setIcon(iconType, 'saveimage', 'Save iCn3D PNG Image', 'camera') + "</td>";
// Select menu
html += tdStrBorder + this.setIcon(iconType, 'tool_definedsets', 'Defined Sets', 'object-group') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_aroundsphere', 'Select by Distance', 'dot-circle') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_saveselection', 'Save Selection as a Set', 'save') + "</td>";
html += tdStr + this.setIcon(iconType, 'toggleHighlight', 'Toggle Highlight', 'highlighter') + "</td>";
// View menu
html += tdStrBorder + this.setIcon(iconType, 'show_selected', 'View Selection', 'eye') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_selectedcenter', 'Zoom in Selection', 'search-plus') + "</td>";
html += tdStr + this.setIcon(iconType, 'alternate', "Alternate the Structures by keying the letter 'a'", 'a', undefined, true, true) + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_resetOrientation', 'Reset Orientation', 'undo-alt') + "</td>";
// Style menu
html += tdStrBorder + this.setIcon(iconType, 'tool_proteinsRibbon', 'Style Ribbon for proteins', 'dna') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_proteinsSphere', 'Style Sphere for proteins', 'volleyball-ball') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_surfaceVDW', 'Show Van der Waals Surface', 'cloud') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_bkgd', 'Toggle Background Color', 'adjust') + "</td>";
// Color menu
html += tdStrBorder + this.setIcon(iconType, 'tool_clrRainbowChain', 'Color Rainbow for Chains', 'rainbow') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_clrSSGreen', 'Color by Secondary Structures', 'ring') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_clrChain', 'Color by Chains', 'layer-group') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_clrAtom', 'Color by Atoms', 'atom') + "</td>";
// Analysis menu
html += tdStrBorder + this.setIcon(iconType, 'tool_selectannotations', 'Sequences & Annotations', 'grip-lines') + "</td>";
html += tdStr + this.setIcon(iconType, 'hbondsYes', 'Interactions', 'users') + "</td>";
html += tdStr + this.setIcon(iconType, 'tool_delphi', 'DelPhi Potentials', 'cloud-meatball') + "</td>";
html += tdStr + this.setIcon(iconType, 'removeLabels', 'Remove Labels', 'remove-format') + "</td>";
// Help menu
html += tdStrBorder + this.setIcon('link', 'tool-gallery', 'Gallery', 'image', 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#gallery') + "</td>";
html += tdStr + this.setIcon('link', 'tool-video', 'Videos', 'file-video', 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#videos') + "</td>";
html += tdStr + this.setIcon('link', 'tool-github', 'iCn3D GitHub', 'code', 'https://github.com/ncbi/icn3d') + "</td>";
html += tdStr + this.setIcon('link', 'tool-hints', 'Transform Hints', 'info-circle', 'https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#useicn3d') + "</td>";
html += "</tr>";
return html;
}
setTheme(color) { let me = this.icn3dui;
if(me.bNode) return '';
let borderColor, bkgdColor, bkgdImg, iconImg, activeTabColor;
me.htmlCls.themecolor = color;
if(color == 'orange') {
borderColor = '#e78f08';
bkgdColor = '#f6a828';
bkgdImg = 'ui-bg_gloss-wave_35_f6a828_500x100.png';
iconImg = 'ui-icons_ef8c08_256x240.png';
activeTabColor = '#eb8f00';
}
else if(color == 'black') {
borderColor = '#333333';
bkgdColor = '#333333';
bkgdImg = 'ui-bg_gloss-wave_25_333333_500x100.png';
iconImg = 'ui-icons_222222_256x240.png';
activeTabColor = '#222222';
}
else if(color == 'blue') {
borderColor = '#4297d7';
bkgdColor = '#5c9ccc';
bkgdImg = 'ui-bg_gloss-wave_55_5c9ccc_500x100.png';
iconImg = 'ui-icons_228ef1_256x240.png';
activeTabColor = '#444';
}
$('.ui-widget-header').css({
'border': '1px solid ' + borderColor,
'background': bkgdColor + ' url("https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/' + bkgdImg + '") 50% 50% repeat-x',
'color':'#fff',
'font-weight':'bold'
});
$('.ui-button .ui-icon').css({
'background-image': 'url(https://www.ncbi.nlm.nih.gov/Structure/icn3d/lib/images/' + iconImg + ')'
});
$('.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited').css({
'color': activeTabColor,
'text-decoration': 'none'
});
}
//Set the textarea for the log output.
setLogWindow(bUpdate, bCmdWindowInput) { let me = this.icn3dui;
if(me.bNode) return '';
let bCmdWindow, html = "";
// check command window
let value = me.htmlCls.setHtmlCls.getCookie('cmdwindow');
if(value != '') {
bCmdWindow = (bCmdWindowInput !== undefined) ? bCmdWindowInput : parseInt(value);
if(bCmdWindow == 1) { // default 0
me.htmlCls.LOG_HEIGHT = 180; //65;
me.htmlCls.CMD_HEIGHT = 0.8*me.htmlCls.LOG_HEIGHT;
if(!bUpdate) html += me.htmlCls.divStr + "cmdlog' style='float:left; margin-top: 5px; width: 100%;'>";
html += "<textarea id='" + me.pre + "logtext' rows='2' style='width: 100%; height: " + me.htmlCls.CMD_HEIGHT + "px; margin: auto; padding: 5px; box-sizing: border-box; border: 4px inset orange; background-color: " + me.htmlCls.GREYD + ";'></textarea>";
}
else {
me.htmlCls.LOG_HEIGHT = 65;
me.htmlCls.CMD_HEIGHT = 0.8*me.htmlCls.LOG_HEIGHT;
if(!bUpdate) html += me.htmlCls.divStr + "cmdlog' style='float:left; margin-top: 5px; width: 100%;'>";
html += "<textarea id='" + me.pre + "logtext' rows='2' style='width: 100%; height: " + me.htmlCls.CMD_HEIGHT + "px; padding: 0px; border: 0px; background-color: " + me.htmlCls.GREYD + ";'></textarea>";
}
}
else {
bCmdWindow = 0;
me.htmlCls.LOG_HEIGHT = 65;
me.htmlCls.CMD_HEIGHT = 0.8*me.htmlCls.LOG_HEIGHT;
if(!bUpdate) html += me.htmlCls.divStr + "cmdlog' style='float:left; margin-top: 5px; width: 100%;'>";
html += "<textarea id='" + me.pre + "logtext' rows='2' style='width: 100%; height: " + me.htmlCls.CMD_HEIGHT + "px; padding: 0px; border: 0px; background-color: " + me.htmlCls.GREYD + ";'></textarea>";
}
if(!bUpdate) html += "</div>";
if(bUpdate) {
me.htmlCls.clickMenuCls.setLogCmd('set cmdwindow ' + bCmdWindow, true);
$("#" + me.pre + "cmdlog").html(html);
}
return html;
}
//Set the menu "File" at the top of the viewer.
setMenu1() { let me = this.icn3dui;
if(me.bNode) return '';
let html = "";
html += "<div class='icn3d-menu'>";
html += "<accordion id='" + me.pre + "accordion1' class='icn3d-accordion'>";
html += "<h3>File</h3>";
html += "<div>";
html += this.setMenu1_base();
html += "</div>";
html += "</accordion>";
html += "</div>";
return html;
}
setMenu1_base() { let me = this.icn3dui;
if(me.bNode) return '';
let html = "";
html += "<ul class='icn3d-mn-item'>";
html += this.getMenuText('mn1_searchgrooup', 'Search Structure ' + me.htmlCls.wifiStr, undefined, 1, 1);
html += "<ul>";
html += this.getMenuUrl('mn1_searchstru', 'https://www.ncbi.nlm.nih.gov/structure', 'PDB Structures ' + me.htmlCls.wifiStr, 1, 2);
html += this.getLink('mn1_proteinname', 'AlphaFold Structures ' + me.htmlCls.wifiStr, 1, 2);
html += this.getMenuUrl('mn1_afdatabase', 'https://alphafold.ebi.ac.uk', 'AlphaFold UniProt Database ' + me.htmlCls.wifiStr, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn1_searchsimilar', 'Search Similar' + me.htmlCls.wifiStr, undefined, undefined, 1);
html += "<ul>";
html += this.getLink('mn1_vastplus', 'NCBI VAST+ (PDB Complex)' + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_vast', 'NCBI VAST (PDB Chain)' + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_foldseek', 'Foldseek (PDB & AlphaFold)' + me.htmlCls.wifiStr, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn1_retrievebyid', 'Retrieve by ID', undefined, 1, 1);
html += "<ul>";
html += this.getLink('mn1_mmdbafid', 'PDB/MMDB/AlphaFold IDs' + me.htmlCls.wifiStr, 1, 2);
html += this.getLink('mn1_mmdbid', 'NCBI MMDB ID (annotation) ' + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_mmtfid', 'RCSB BCIF/MMTF ID (fast) ' + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_pdbid', 'RCSB PDB ID ' + me.htmlCls.wifiStr, undefined, 2);
html += this.getMenuText('mn1_afwrap', 'AlphaFold Structures', undefined, undefined, 2);
html += "<ul>";
html += this.getLink('mn1_afid', 'UniProt ID ' + me.htmlCls.wifiStr, undefined, 3);
html += this.getLink('mn1_refseqid', 'NCBI Protein Accession ' + me.htmlCls.wifiStr, undefined, 3);
html += "</ul>";
html += this.getLink('mn1_opmid', 'OPM PDB ID ' + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_mmcifid', 'RCSB mmCIF ID ' + me.htmlCls.wifiStr, undefined, 2);
//html += this.getLink('mn1_gi', 'NCBI gi ' + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_cid', 'PubChem CID/Name/InchI ' + me.htmlCls.wifiStr, 1, 2);
html += this.getLink('mn1_smiles', 'Chemical SMILES ', undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn1_openfile', 'Open File', undefined, 1, 1);
html += "<ul>";
// html += this.getLink('mn1_pdbfile', 'PDB File');
// html += this.getLink('mn1_pdbfile_app', 'PDB File (append)');
html += this.getLink('mn1_pdbfile_app', 'PDB Files (appendable)', 1, 2);
html += this.getLink('mn1_mmciffile', 'mmCIF Files (appendable)', undefined, 2);
html += this.getLink('mn1_mol2file', 'Mol2 File', undefined, 2);
html += this.getLink('mn1_sdffile', 'SDF File', undefined, 2);
html += this.getLink('mn1_xyzfile', 'XYZ File', undefined, 2);
html += this.getLink('mn1_afmapfile', 'AlphaFold PAE File', undefined, 2);
html += this.getLink('mn1_urlfile', 'URL(CORS) ' + me.htmlCls.wifiStr, undefined, 2);
html += this.getMenuSep();
html += this.getLink('mn1_pngimage', 'iCn3D PNG (appendable)', 1, 2);
html += this.getLink('mn1_state', 'State/Script File', undefined, 2);
html += this.getLink('mn1_fixedversion', 'Share Link in Archived Ver. ' + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_selection', 'Selection File', undefined, 2);
html += this.getLink("mn1_collection", "Collection File", undefined, 2);
html += this.getMenuSep();
html += this.getMenuText('mn1_dsn6wrap', 'Electron Density', undefined, undefined, 2);
html += "<ul>";
html += this.getLink('mn1_dsn6', 'Local File', undefined, 3);
html += this.getLink('mn1_dsn6url', 'URL(CORS) ' + me.htmlCls.wifiStr, undefined, 3);
html += "</ul>";
html += "<li><br/></li>";
html += "</ul>";
html += "</li>";
//html += this.getMenuText('mn1_fold', 'AlphaFold/ESM', undefined, undefined, 1);
html += this.getMenuText('mn1_fold', 'Predict by Seq.', undefined, undefined, 1);
html += "<ul>";
html += this.getLink('mn1_esmfold', 'ESMFold', undefined, 2);
//html += this.getMenuUrl('mn1_esmfold_link', "https://colab.research.google.com/github/sokrypton/ColabFold/blob/main/ESMFold.ipynb", "ESMFold via ColabFold" + me.htmlCls.wifiStr, undefined, 2);
html += this.getLink('mn1_alphafold', 'AlphaFold2 via ColabFold' + me.htmlCls.wifiStr, undefined, 2);
html += "</ul>";
html += this.getMenuText('mn1_alignwrap', 'Align', undefined, 1, 1);
html += "<ul>";
html += this.getMenuText('mn1_chainalignwrap', 'Multiple Chains', undefined, 1, 2);
html += "<ul>";
html += this.getRadio('mn1_chainalignRad', 'mn1_chainalign', 'by Structure Alignment ' + me.htmlCls.wifiStr, undefined, 1, 3);
html += this.getRadio('mn1_chainalignRad', 'mn1_chainalign2', 'by Sequence Alignment ' + me.htmlCls.wifiStr, undefined, 1, 3);
html += this.getRadio('mn1_chainalignRad', 'mn1_chainalign3', 'Residue by Residue', undefined, undefined, 3);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn1_aligntwostru', 'Protein Complexes', undefined, undefined, 2);
html += "<ul>";
html += this.getLink('mn1_align', 'Two PDB Structures ' + me.htmlCls.wifiStr, undefined, 3);
html += this.getLink('mn1_alignaf', 'Two AlphaFold Structures ' + me.htmlCls.wifiStr, undefined, 3);
html += "</ul>";
html += this.getLink('mn1_blast_rep_id', 'Sequence to Structure', undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn2_realignWrap', 'Realign Selection', undefined, undefined, 1);
html += "<ul>";
html += this.getMenuText('mn2_chainrealignwrap', 'Multiple Chains', undefined, undefined, 2);
html += "<ul>";
html += this.getRadio('mn2_realign', 'mn2_realignonstruct', 'by Structure Alignment ' + me.htmlCls.wifiStr, undefined, undefined, 3);
html += this.getRadio('mn2_realign', 'mn2_realignonseqalign', 'by Sequence Alignment ' + me.htmlCls.wifiStr, undefined, undefined, 3);
html += this.getRadio('mn2_realign', 'mn2_realignresbyres', 'Residue by Residue', undefined, undefined, 3);
html += "</ul>";
html += this.getLink('mn2_realigntwostru', 'Protein Complexes', undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn1_3dpprint', '3D Printing', undefined, 1, 1);
html += "<ul>";
if(me.cfg.cid === undefined) {
html += this.getLink('mn1_exportVrmlStab', 'WRL/VRML(Color, W/ Stab.)', 1, 2);
html += this.getLink('mn1_exportStlStab', 'STL(W/ Stabilizers)', 1, 2);
html += this.getMenuSep();
html += this.getLink('mn1_exportVrml', 'WRL/VRML(Color)', undefined, 2);
html += this.getLink('mn1_exportStl', 'STL', undefined, 2);
html += this.getMenuSep();
html += this.getLink('mn1_stabilizerYes', 'Add All Stabilizers', undefined, 2);
html += this.getLink('mn1_stabilizerNo', 'Remove All Stabilizers', undefined, 2);
html += this.getMenuSep();
html += this.getLink('mn1_stabilizerOne', 'Add One Stabilizer', undefined, 2);
html += this.getLink('mn1_stabilizerRmOne', 'Remove One Stabilizer', undefined, 2);
html += this.getMenuSep();
html += this.getLink('mn1_thicknessSet', 'Set Thickness', undefined, 2);
}
else {
html += this.getLink('mn1_exportVrml', 'VRML(Color)', 1, 2);
html += this.getLink('mn1_exportStl', 'STL', 1, 2);
}
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn1_savefile', 'Save File', undefined, 1, 1);
html += "<ul>";
html += this.getMenuText('mn1_savepngimage', 'iCn3D PNG Image', undefined, 1, 2);
html += "<ul>";
html += this.getLink('mn1_exportCanvas', 'Original Size & HTML', 1, 3);
html += this.getLink('mn1_exportCanvas1', 'Original Size', undefined, 3);
html += this.getLink('mn1_exportCanvas2', '2X Large', undefined, 3);
html += this.getLink('mn1_exportCanvas4', '4X Large', undefined, 3);
html += this.getLink('mn1_exportCanvas8', '8X Large', undefined, 3);
html += "</ul>";
html += "</li>";
html += this.getLink('mn1_exportState', 'State File', undefined, 2);
html += this.getLink('mn1_exportSelections', 'Selection File', undefined, 2);
html += this.getLink('mn1_exportSelDetails', 'Selection Details', undefined, 2);
html += this.getLink('mn1_exportCounts', 'Residue Counts', undefined, 2);
html += this.getLink('mn1_exportPdbRes', 'PDB', 1, 2);
html += this.getLink('profixpdb', 'PDB with Missing Atoms', undefined, 2);
// the quality is not good to add hydrogen
//html += this.getLink('profixpdbh', 'PDB with Hydrogens', undefined, 2);
if(me.cfg.cid === undefined) {
html += this.getLink('mn1_exportSecondary', 'Secondary Structure', undefined, 2);
}
html += this.getMenuText('m1_exportrefnum', 'Reference Numbers', undefined, undefined, 2);
html += "<ul>";
html += this.getLink('mn1_exportIgstrand', 'Ig Strand', undefined, 3);
html += this.getLink('mn1_exportKabat', 'Kabat', undefined, 3);
html += this.getLink('mn1_exportImgt', 'IMGT', undefined, 3);
html += "</ul>";
html += "<li><br/></li>";
html += "</ul>";
html += "</li>";
html += this.getLink('mn1_sharelink', 'Share Link ' + me.htmlCls.wifiStr, 1, 1);
html += this.getLink('mn1_replayon', 'Replay Each Step', undefined, 1);
html += this.getMenuSep();
html += this.getMenuText('mn1_menuwrap', 'Customize Menus', undefined, 1, 1);
html += "<ul>";
html += this.getLink('mn1_menuall', 'All Menus', 1, 2);
html += this.getLink('mn1_menusimple', 'Simple Menus', 1, 2);
html += this.getMenuSep();
html += this.getLink('mn1_menupref', 'Preferences', 1, 2);
html += this.getLink('mn1_menuloadpref', 'Load Preferences', 1, 2);
html += "</ul>";
html += "</li>";
html += "<li><br/></li>";
html += "</ul>";
return html;
}
//Set the menu "Select" at the top of the viewer.
setMenu2() { let me = this.icn3dui;
if(me.bNode) return '';
let html = "";
html += "<div class='icn3d-menu'>";
html += "<accordion id='" + me.pre + "accordion2' class='icn3d-accordion'>";
html += "<h3>Select</h3>";
html += "<div>";
html += this.setMenu2_base();
html += "</div>";
html += "</accordion>";
html += "</div>";
return html;
}
setMenu2_base() { let me = this.icn3dui;
if(me.bNode) return '';
let html = "";
html += "<ul class='icn3d-mn-item'>";
html += this.getLink('mn2_definedsets', 'Defined Sets', 1, 1);
html += this.getLink('mn2_selectall', 'All', undefined, 1);
html += this.getLink('mn2_selectdisplayed', 'Displayed Set', undefined, 1);
html += this.getLink('mn2_aroundsphere', 'by Distance', 1, 1);
html += this.getMenuText('mn2_selbyprop', 'by Property', undefined, undefined, 1);
html += "<ul>";
html += this.getLink('mn2_propPos', 'Positive', undefined, 2);
html += this.getLink('mn2_propNeg', 'Negative', undefined, 2);
html += this.getLink('mn2_propHydro', 'Hydrophobic', undefined, 2);
html += this.getLink('mn2_propPolar', 'Polar', undefined, 2);
html += this.getLink('mn2_propBfactor', 'B-factor/pLDDT', undefined, 2);
html += this.getLink('mn2_propSolAcc', 'Solvent Accessibility', undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getLink('mn2_selectcomplement', 'Inverse', undefined, 1);
html += this.getLink('mn2_selectmainchains', 'Main Chains', undefined, 1);
html += this.getLink('mn2_selectsidechains', 'Side Chains', undefined, 1);
html += this.getLink('mn2_selectmainsidechains', 'Main & Side Chains', undefined, 1);
html += this.getLink('mn2_command', 'Advanced', undefined, 1);
if(me.cfg.cid === undefined) {
html += this.getMenuText('mn2_selon3d', 'Select on 3D', undefined, 1, 1);
html += "<ul>";
html += "<li>\"Alt\"+Click: start selection</li>";
html += "<li>\"Ctrl\"+Click: union selection</li>";
html += "<li>\"Shift\"+Click: range Selection</li>";
html += this.getMenuSep();
html += this.getRadio('mn2_pk', 'mn2_pkChain', 'Chain', undefined, 1, 2);
if(me.cfg.mmdbid !== undefined || me.cfg.gi !== undefined) {
html += this.getRadio('mn2_pk', 'mn2_pkDomain', '3D Domain', undefined, undefined, 2);
}
html += this.getRadio('mn2_pk', 'mn2_pkStrand', 'Strand/Helix', undefined, undefined, 2);
html += this.getRadio('mn2_pk', 'mn2_pkResidue', 'Residue', true, 1, 2);
html += this.getRadio('mn2_pk', 'mn2_pkYes', 'Atom', undefined, 1, 2);
html += this.getRadio('mn2_pk', 'mn2_pkNo', 'None', undefined, undefined, 2);
html += "</ul>";
html += "</li>";
}
else {
if(me.utilsCls.isMobile()) {
html += "<li><span>Touch to pick</span></li>";
}
else {
html += "<li><span>Picking with<br>\"Alt\" + Click</span></li>";
}
}
html += this.getMenuSep();
html += this.getLink('mn2_saveselection', 'Save Selection', 1, 1);
html += this.getLink('clearall', 'Clear Selection', undefined, 1);
html += this.getLink('mn2_saveresidue', 'Save Res. in Sel.', 1, 1);
html += this.getMenuSep();
html += this.getMenuText('mn2_hlcolor', 'Highlight Color', undefined, undefined, 1);
html += "<ul>";
html += this.getRadio('mn2_hl_clr', 'mn2_hl_clrYellow', 'Yellow', true, undefined, 2);
html += this.getRadio('mn2_hl_clr', 'mn2_hl_clrGreen', 'Green', undefined, undefined, 2);
html += this.getRadio('mn2_hl_clr', 'mn2_hl_clrRed', 'Red', undefined, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn2_hlstyle', 'Highlight Style', undefined, undefined, 1);
html += "<ul>";
html += this.getRadio('mn2_hl_style', 'mn2_hl_styleOutline', 'Outline', true, undefined, 2);
html += this.getRadio('mn2_hl_style', 'mn2_hl_styleObject', '3D Objects', undefined, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getLink('toggleHighlight2', 'Toggle Highlight', 1, 1);
html += "<li><br/></li>";
html += "</ul>";
return html;
}
setMenu2b() { let me = this.icn3dui;
if(me.bNode) return '';
let html = "";
html += "<div class='icn3d-menu'>";
html += "<accordion id='" + me.pre + "accordion2b' class='icn3d-accordion'>";
html += "<h3>View</h3>";
html += "<div>";
html += this.setMenu2b_base();
html += "</div>";
html += "</accordion>";
html += "</div>";
return html;
}
setMenu2b_base() { let me = this.icn3dui;
if(me.bNode) return '';
let html = "";
html += "<ul class='icn3d-mn-item'>";
html += this.getLink('mn2_show_selected', 'View Selection', 1, 1);
html += this.getLink('mn2_hide_selected', 'Hide Selection', 1, 1);
html += this.getLink('mn2_selectedcenter', 'Zoom in Selection', 1, 1);
//html += this.getLink('mn6_center', 'Center Selection', undefined, 1);
html += this.getLink('mn6_center', 'Center Selection', 1, 1);
html += this.getLink('mn2_fullstru', 'View Full Structure');
html += this.getLinkWrapper('mn2_alternate', 'Alternate(Key "a")', 'mn2_alternateWrap', undefined, 1)
if(me.cfg.opmid !== undefined) {
html += this.getLinkWrapper('togglemem', 'Toggle Membrane', 'togglememli', undefined, 1)
}
//else if(me.cfg.mmdbafid !== undefined || me.cfg.afid !== undefined) {
else if(me.cfg.cid === undefined) {
// hide by default
html += this.getLinkWrapper('togglemem', 'Toggle Membrane', 'togglememli', undefined, 1, true)
}
if(me.cfg.opmid !== undefined) {
html += this.getLinkWrapper('adjustmem', 'Adjust Membrane', 'adjustmemli', undefined, 1)
html += this.getLinkWrapper('selectplane', 'Select between<br>Two X-Y Planes</span>', 'selectplaneli', undefined, 1)
}
html += this.getMenuSep();
let liStr = "<li><a href='";
html += this.getMenuText('mn2_vrarhints', 'VR & AR Hints', undefined, 1, 1);
html += "<ul>";
html += this.getMenuUrl("vrhint", me.htmlCls.baseUrl + "icn3d/icn3d.html#vr", "VR: VR Headsets", 1, 2);
html += this.getMenuUrl("arhint", me.htmlCls.baseUrl + "icn3d/icn3d.html#ar", "AR: Chrome in Android", 1, 2);
html += "</ul>";
html += "</li>";
html += this.getLink('mn6_sidebyside', 'Side by Side', 1, 1);
html += this.getMenuText('mn2_rotate', 'Rotate', undefined, 1, 1);
html += "<ul>";
html += this.getMenuText('mn2_rotate90', 'Rotate 90°', undefined, undefined, 2);
html += "<ul>";
html += this.getRadio('mn6_rotate90', 'mn6_rotatex', 'rotate x', undefined, undefined, 2);
html += this.getRadio('mn6_rotate90', 'mn6_rotatey', 'rotate y', undefined, undefined, 2);
html += this.getRadio('mn6_rotate90', 'mn6_rotatez', 'rotate z', undefined, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn2_rotateauto', 'Auto Rotation', undefined, 1, 2);
html += "<ul>";
html += this.getRadio('mn6_rotate', 'mn6_rotateleft', 'Rotate Left', undefined, 1, 3);
html += this.getRadio('mn6_rotate', 'mn6_rotateright', 'Rotate Right', undefined, 1, 3);
html += this.getRadio('mn6_rotate', 'mn6_rotateup', 'Rotate Up', undefined, 1, 3);
html += this.getRadio('mn6_rotate', 'mn6_rotatedown', 'Rotate Down', undefined, 1, 3);
html += "</ul>";
html += "</li>";
html += "</ul>";
html += "</li>";
html += this.getLink('mn2_translate', 'Translate XYZ', undefined, 1);
html += this.getLink('mn2_matrix', 'Rotate with Matrix', undefined, 1);
html += this.getMenuText('mn2_camera', 'Camera', undefined, undefined, 1);
html += "<ul>";
html += this.getRadio('mn6_camera', 'mn6_cameraPers', 'Perspective', true, undefined, 2);
html += this.getRadio('mn6_camera', 'mn6_cameraOrth', 'Orthographic', undefined, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn2_fog', 'Fog for Selection', undefined, undefined, 1);
html += "<ul>";
html += this.getRadio('mn6_showfog', 'mn6_showfogYes', 'On', undefined, undefined, 2);
html += this.getRadio('mn6_showfog', 'mn6_showfogNo', 'Off', true, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn2_slab', 'Slab for Selection', undefined, undefined, 1);
html += "<ul>";
html += this.getRadio('mn6_showslab', 'mn6_showslabYes', 'On', undefined, undefined, 2);
html += this.getRadio('mn6_showslab', 'mn6_showslabNo', 'Off', true, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuText('mn2_axes', 'XYZ-axes', undefined, undefined, 1);
html += "<ul>";
html += this.getRadio('mn6_showaxis', 'mn6_showaxisYes', 'Original', undefined, undefined, 2);
html += this.getRadio('mn6_showaxis', 'mn6_showaxisSel', 'Prin. Axes on Sel.', undefined, undefined, 2);
html += this.getRadio('mn6_showaxis', 'mn6_showaxisNo', 'Hide', true, undefined, 2);
html += "</ul>";
html += "</li>";
html += this.getMenuSep();