icn3d 3.25.1 → 3.25.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icn3d.js +87 -59
- package/icn3d.min.js +2 -2
- package/icn3d.module.js +87 -59
- package/package.json +1 -1
package/icn3d.js
CHANGED
|
@@ -15291,7 +15291,7 @@ class SetHtml {
|
|
|
15291
15291
|
let matchedStrState = "Start of state file======\n";
|
|
15292
15292
|
let posState = imageStr.indexOf(matchedStrState);
|
|
15293
15293
|
if(pos == -1 && posState == -1) {
|
|
15294
|
-
var aaa = 1; //alert('Please load a PNG image saved by clicking "Save
|
|
15294
|
+
var aaa = 1; //alert('Please load a PNG image saved by clicking the menu "File > Save File > iCn3D PNG Image"...');
|
|
15295
15295
|
}
|
|
15296
15296
|
else if(pos != -1) {
|
|
15297
15297
|
let url = imageStr.substr(pos + matchedStr.length);
|
|
@@ -21921,7 +21921,7 @@ class Scene {
|
|
|
21921
21921
|
|
|
21922
21922
|
//This core function sets up the scene and display the structure according to the input
|
|
21923
21923
|
//options (shown above), which is a hash containing values for different keys.
|
|
21924
|
-
rebuildScene(options) { let ic = this.icn3d
|
|
21924
|
+
rebuildScene(options) { let ic = this.icn3d, me = ic.icn3dui;
|
|
21925
21925
|
if(options === undefined) options = ic.opts;
|
|
21926
21926
|
|
|
21927
21927
|
this.rebuildSceneBase(options);
|
|
@@ -21933,7 +21933,7 @@ class Scene {
|
|
|
21933
21933
|
// }
|
|
21934
21934
|
|
|
21935
21935
|
// if(!ic.bSetVrArButtons) { // call once
|
|
21936
|
-
|
|
21936
|
+
if(!me.cfg.imageonly) this.setVrArButtons();
|
|
21937
21937
|
// }
|
|
21938
21938
|
|
|
21939
21939
|
// if((ic.bVr || ic.bAr) && !ic.bSetVrAr) { // call once
|
|
@@ -42020,71 +42020,79 @@ class ShowSeq {
|
|
|
42020
42020
|
}
|
|
42021
42021
|
}
|
|
42022
42022
|
|
|
42023
|
-
|
|
42024
|
-
ic.residIgLoop[residueid] = 1;
|
|
42023
|
+
let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[residueid]);
|
|
42025
42024
|
|
|
42026
|
-
|
|
42027
|
-
|
|
42028
|
-
|
|
42029
|
-
|
|
42030
|
-
|
|
42031
|
-
|
|
42032
|
-
|
|
42033
|
-
else {
|
|
42034
|
-
//currStrand = strandArray[prevStrandCnt].strand;
|
|
42025
|
+
// skip non-protein residues
|
|
42026
|
+
if(!atom || !ic.proteins.hasOwnProperty(atom.serial)) {
|
|
42027
|
+
refnumLabel = undefined;
|
|
42028
|
+
}
|
|
42029
|
+
else {
|
|
42030
|
+
if(parseInt(currResi) < parseInt(strandArray[strandCnt].startResi)) {
|
|
42031
|
+
ic.residIgLoop[residueid] = 1;
|
|
42035
42032
|
|
|
42036
|
-
if(
|
|
42037
|
-
if(bStart
|
|
42038
|
-
currRefnum = strandArray[
|
|
42039
|
-
refnumLabelNoPostfix = strandArray[
|
|
42040
|
-
refnumLabel = refnumLabelNoPostfix + strandArray[
|
|
42041
|
-
}
|
|
42042
|
-
else {
|
|
42043
|
-
bStart = false;
|
|
42044
|
-
bNterminal = true;
|
|
42045
|
-
loopCnt = 0;
|
|
42046
|
-
}
|
|
42033
|
+
if(bNterminal) { // make it continuous to the 1st strand
|
|
42034
|
+
if(bStart) {
|
|
42035
|
+
currRefnum = strandArray[strandCnt].startRefnum - strandArray[strandCnt].loopResCnt + loopCnt;
|
|
42036
|
+
refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
|
|
42037
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
|
|
42038
|
+
}
|
|
42047
42039
|
}
|
|
42048
42040
|
else {
|
|
42049
|
-
|
|
42050
|
-
|
|
42051
|
-
|
|
42052
|
-
|
|
42053
|
-
|
|
42054
|
-
|
|
42055
|
-
|
|
42041
|
+
//currStrand = strandArray[prevStrandCnt].strand;
|
|
42042
|
+
|
|
42043
|
+
if(prevStrandCnt >= 0 && strandArray[prevStrandCnt].strand.substr(0, 1) == 'G') {
|
|
42044
|
+
if(bStart && ic.resid2refnum[residueid]) {
|
|
42045
|
+
currRefnum = strandArray[prevStrandCnt].endRefnum + loopCnt;
|
|
42046
|
+
refnumLabelNoPostfix = strandArray[prevStrandCnt].strand + currRefnum;
|
|
42047
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[prevStrandCnt].strandPostfix;
|
|
42048
|
+
}
|
|
42049
|
+
else {
|
|
42050
|
+
bStart = false;
|
|
42051
|
+
bNterminal = true;
|
|
42052
|
+
loopCnt = 0;
|
|
42053
|
+
}
|
|
42056
42054
|
}
|
|
42057
42055
|
else {
|
|
42058
|
-
|
|
42059
|
-
|
|
42060
|
-
|
|
42056
|
+
let len = strandArray[strandCnt].loopResCnt;
|
|
42057
|
+
let halfLen = parseInt(len / 2.0 + 0.5);
|
|
42058
|
+
|
|
42059
|
+
if(loopCnt <= halfLen) {
|
|
42060
|
+
currRefnum = strandArray[prevStrandCnt].endRefnum + loopCnt;
|
|
42061
|
+
refnumLabelNoPostfix = strandArray[prevStrandCnt].strand + currRefnum;
|
|
42062
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[prevStrandCnt].strandPostfix;
|
|
42063
|
+
}
|
|
42064
|
+
else {
|
|
42065
|
+
currRefnum = strandArray[strandCnt].startRefnum - len + loopCnt - 1;
|
|
42066
|
+
refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
|
|
42067
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
|
|
42068
|
+
}
|
|
42061
42069
|
}
|
|
42062
42070
|
}
|
|
42063
42071
|
}
|
|
42064
|
-
|
|
42065
|
-
|
|
42066
|
-
bNterminal = false;
|
|
42072
|
+
else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
|
|
42073
|
+
bNterminal = false;
|
|
42067
42074
|
|
|
42068
|
-
|
|
42069
|
-
|
|
42070
|
-
|
|
42075
|
+
if(currResi == strandArray[strandCnt].endResi) {
|
|
42076
|
+
++strandCnt; // next strand
|
|
42077
|
+
loopCnt = 0;
|
|
42071
42078
|
|
|
42072
|
-
|
|
42073
|
-
|
|
42079
|
+
if(!strandArray[strandCnt]) { // last strand
|
|
42080
|
+
--strandCnt;
|
|
42081
|
+
}
|
|
42074
42082
|
}
|
|
42075
42083
|
}
|
|
42076
|
-
|
|
42077
|
-
|
|
42078
|
-
ic.residIgLoop[residueid] = 1;
|
|
42084
|
+
else if(parseInt(currResi) > parseInt(strandArray[strandCnt].endResi)) {
|
|
42085
|
+
ic.residIgLoop[residueid] = 1;
|
|
42079
42086
|
|
|
42080
|
-
|
|
42081
|
-
|
|
42082
|
-
|
|
42083
|
-
|
|
42084
|
-
|
|
42085
|
-
|
|
42086
|
-
|
|
42087
|
-
|
|
42087
|
+
// C-terminal
|
|
42088
|
+
if(!ic.resid2refnum[residueid]) {
|
|
42089
|
+
break;
|
|
42090
|
+
}
|
|
42091
|
+
else {
|
|
42092
|
+
currRefnum = strandArray[strandCnt].endRefnum + loopCnt;
|
|
42093
|
+
refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
|
|
42094
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
|
|
42095
|
+
}
|
|
42088
42096
|
}
|
|
42089
42097
|
}
|
|
42090
42098
|
|
|
@@ -66307,7 +66315,7 @@ class SaveFile {
|
|
|
66307
66315
|
if(me.utilsCls.isIE()) {
|
|
66308
66316
|
blob = ic.renderer.domElement.msToBlob();
|
|
66309
66317
|
|
|
66310
|
-
if(bAddURL
|
|
66318
|
+
if(bAddURL) {
|
|
66311
66319
|
let reader = new FileReader();
|
|
66312
66320
|
reader.onload = function(e) {
|
|
66313
66321
|
let arrayBuffer = e.target.result; // or = reader.result;
|
|
@@ -66333,7 +66341,7 @@ class SaveFile {
|
|
|
66333
66341
|
}
|
|
66334
66342
|
else {
|
|
66335
66343
|
ic.renderer.domElement.toBlob(function(data) {
|
|
66336
|
-
if(bAddURL
|
|
66344
|
+
if(bAddURL) {
|
|
66337
66345
|
let reader = new FileReader();
|
|
66338
66346
|
reader.onload = function(e) {
|
|
66339
66347
|
let arrayBuffer = e.target.result; // or = reader.result;
|
|
@@ -66408,7 +66416,7 @@ class SaveFile {
|
|
|
66408
66416
|
url = url.replace(/imageonly=1/g, '');
|
|
66409
66417
|
|
|
66410
66418
|
let bTooLong =(url.length > 4000 || url.indexOf('http') !== 0) ? true : false;
|
|
66411
|
-
|
|
66419
|
+
/*
|
|
66412
66420
|
if(bTooLong || (ic.bInputfile && !ic.bInputUrlfile)) {
|
|
66413
66421
|
// $("#" + ic.pre + "viewer").html("<img src='" + imageUrl + "'/>");
|
|
66414
66422
|
$("#" + ic.pre + "mnlist").html("<img src='" + imageUrl + "'/>");
|
|
@@ -66418,11 +66426,31 @@ class SaveFile {
|
|
|
66418
66426
|
$("#" + ic.pre + "mnlist").html("<a href='" + url + "' target='_blank'><img src='" + imageUrl + "'/></a>");
|
|
66419
66427
|
}
|
|
66420
66428
|
|
|
66421
|
-
$("#" + ic.pre + "viewer").
|
|
66429
|
+
// $("#" + ic.pre + "viewer").width(width);
|
|
66430
|
+
// $("#" + ic.pre + "viewer").height(height);
|
|
66431
|
+
$("#" + ic.pre + "mnlist").width(width);
|
|
66432
|
+
$("#" + ic.pre + "mnlist").height(height);
|
|
66433
|
+
|
|
66422
66434
|
$("#" + ic.pre + "cmdlog").hide();
|
|
66423
66435
|
$("#" + ic.pre + "title").hide();
|
|
66436
|
+
|
|
66424
66437
|
//$("#" + ic.pre + "mnlist").hide();
|
|
66425
66438
|
$("#" + ic.pre + "canvas").hide(); // "load mmdbid ..." may cause problems if canvas was removed
|
|
66439
|
+
*/
|
|
66440
|
+
|
|
66441
|
+
if(bTooLong || (ic.bInputfile && !ic.bInputUrlfile)) {
|
|
66442
|
+
$("#" + ic.pre + "viewer").html("<img src='" + imageUrl + "'/>");
|
|
66443
|
+
}
|
|
66444
|
+
else {
|
|
66445
|
+
$("#" + ic.pre + "viewer").html("<a href='" + url + "' target='_blank'><img src='" + imageUrl + "'/></a>");
|
|
66446
|
+
}
|
|
66447
|
+
|
|
66448
|
+
$("#" + ic.pre + "viewer").width(width);
|
|
66449
|
+
$("#" + ic.pre + "viewer").height(height);
|
|
66450
|
+
|
|
66451
|
+
$("#" + ic.pre + "cmdlog").hide();
|
|
66452
|
+
$("#" + ic.pre + "title").hide();
|
|
66453
|
+
$("#" + ic.pre + "mnlist").hide();
|
|
66426
66454
|
|
|
66427
66455
|
if($("#" + ic.pre + "fullscreen").length > 0) $("#" + ic.pre + "fullscreen").hide();
|
|
66428
66456
|
|
|
@@ -67373,7 +67401,7 @@ class ShareLink {
|
|
|
67373
67401
|
if(key_value.length == 2) paraHash[key_value[0]] = key_value[1];
|
|
67374
67402
|
}
|
|
67375
67403
|
|
|
67376
|
-
if(me.cfg.
|
|
67404
|
+
if(me.cfg.idname && !paraHash[me.cfg.idname]) { // somehow it is not included
|
|
67377
67405
|
url += me.cfg.idname + '=' + me.cfg.idvalue + '&';
|
|
67378
67406
|
}
|
|
67379
67407
|
|