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.module.js
CHANGED
|
@@ -16192,7 +16192,7 @@ class SetHtml {
|
|
|
16192
16192
|
let matchedStrState = "Start of state file======\n";
|
|
16193
16193
|
let posState = imageStr.indexOf(matchedStrState);
|
|
16194
16194
|
if(pos == -1 && posState == -1) {
|
|
16195
|
-
alert('Please load a PNG image saved by clicking "Save
|
|
16195
|
+
alert('Please load a PNG image saved by clicking the menu "File > Save File > iCn3D PNG Image"...');
|
|
16196
16196
|
}
|
|
16197
16197
|
else if(pos != -1) {
|
|
16198
16198
|
let url = imageStr.substr(pos + matchedStr.length);
|
|
@@ -22822,7 +22822,7 @@ class Scene {
|
|
|
22822
22822
|
|
|
22823
22823
|
//This core function sets up the scene and display the structure according to the input
|
|
22824
22824
|
//options (shown above), which is a hash containing values for different keys.
|
|
22825
|
-
rebuildScene(options) { let ic = this.icn3d
|
|
22825
|
+
rebuildScene(options) { let ic = this.icn3d, me = ic.icn3dui;
|
|
22826
22826
|
if(options === undefined) options = ic.opts;
|
|
22827
22827
|
|
|
22828
22828
|
this.rebuildSceneBase(options);
|
|
@@ -22834,7 +22834,7 @@ class Scene {
|
|
|
22834
22834
|
// }
|
|
22835
22835
|
|
|
22836
22836
|
// if(!ic.bSetVrArButtons) { // call once
|
|
22837
|
-
|
|
22837
|
+
if(!me.cfg.imageonly) this.setVrArButtons();
|
|
22838
22838
|
// }
|
|
22839
22839
|
|
|
22840
22840
|
// if((ic.bVr || ic.bAr) && !ic.bSetVrAr) { // call once
|
|
@@ -42921,71 +42921,79 @@ class ShowSeq {
|
|
|
42921
42921
|
}
|
|
42922
42922
|
}
|
|
42923
42923
|
|
|
42924
|
-
|
|
42925
|
-
ic.residIgLoop[residueid] = 1;
|
|
42924
|
+
let atom = ic.firstAtomObjCls.getFirstAtomObj(ic.residues[residueid]);
|
|
42926
42925
|
|
|
42927
|
-
|
|
42928
|
-
|
|
42929
|
-
|
|
42930
|
-
|
|
42931
|
-
|
|
42932
|
-
|
|
42933
|
-
|
|
42934
|
-
else {
|
|
42935
|
-
//currStrand = strandArray[prevStrandCnt].strand;
|
|
42926
|
+
// skip non-protein residues
|
|
42927
|
+
if(!atom || !ic.proteins.hasOwnProperty(atom.serial)) {
|
|
42928
|
+
refnumLabel = undefined;
|
|
42929
|
+
}
|
|
42930
|
+
else {
|
|
42931
|
+
if(parseInt(currResi) < parseInt(strandArray[strandCnt].startResi)) {
|
|
42932
|
+
ic.residIgLoop[residueid] = 1;
|
|
42936
42933
|
|
|
42937
|
-
if(
|
|
42938
|
-
if(bStart
|
|
42939
|
-
currRefnum = strandArray[
|
|
42940
|
-
refnumLabelNoPostfix = strandArray[
|
|
42941
|
-
refnumLabel = refnumLabelNoPostfix + strandArray[
|
|
42942
|
-
}
|
|
42943
|
-
else {
|
|
42944
|
-
bStart = false;
|
|
42945
|
-
bNterminal = true;
|
|
42946
|
-
loopCnt = 0;
|
|
42947
|
-
}
|
|
42934
|
+
if(bNterminal) { // make it continuous to the 1st strand
|
|
42935
|
+
if(bStart) {
|
|
42936
|
+
currRefnum = strandArray[strandCnt].startRefnum - strandArray[strandCnt].loopResCnt + loopCnt;
|
|
42937
|
+
refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
|
|
42938
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
|
|
42939
|
+
}
|
|
42948
42940
|
}
|
|
42949
42941
|
else {
|
|
42950
|
-
|
|
42951
|
-
|
|
42952
|
-
|
|
42953
|
-
|
|
42954
|
-
|
|
42955
|
-
|
|
42956
|
-
|
|
42942
|
+
//currStrand = strandArray[prevStrandCnt].strand;
|
|
42943
|
+
|
|
42944
|
+
if(prevStrandCnt >= 0 && strandArray[prevStrandCnt].strand.substr(0, 1) == 'G') {
|
|
42945
|
+
if(bStart && ic.resid2refnum[residueid]) {
|
|
42946
|
+
currRefnum = strandArray[prevStrandCnt].endRefnum + loopCnt;
|
|
42947
|
+
refnumLabelNoPostfix = strandArray[prevStrandCnt].strand + currRefnum;
|
|
42948
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[prevStrandCnt].strandPostfix;
|
|
42949
|
+
}
|
|
42950
|
+
else {
|
|
42951
|
+
bStart = false;
|
|
42952
|
+
bNterminal = true;
|
|
42953
|
+
loopCnt = 0;
|
|
42954
|
+
}
|
|
42957
42955
|
}
|
|
42958
42956
|
else {
|
|
42959
|
-
|
|
42960
|
-
|
|
42961
|
-
|
|
42957
|
+
let len = strandArray[strandCnt].loopResCnt;
|
|
42958
|
+
let halfLen = parseInt(len / 2.0 + 0.5);
|
|
42959
|
+
|
|
42960
|
+
if(loopCnt <= halfLen) {
|
|
42961
|
+
currRefnum = strandArray[prevStrandCnt].endRefnum + loopCnt;
|
|
42962
|
+
refnumLabelNoPostfix = strandArray[prevStrandCnt].strand + currRefnum;
|
|
42963
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[prevStrandCnt].strandPostfix;
|
|
42964
|
+
}
|
|
42965
|
+
else {
|
|
42966
|
+
currRefnum = strandArray[strandCnt].startRefnum - len + loopCnt - 1;
|
|
42967
|
+
refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
|
|
42968
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
|
|
42969
|
+
}
|
|
42962
42970
|
}
|
|
42963
42971
|
}
|
|
42964
42972
|
}
|
|
42965
|
-
|
|
42966
|
-
|
|
42967
|
-
bNterminal = false;
|
|
42973
|
+
else if(parseInt(currResi) >= parseInt(strandArray[strandCnt].startResi) && parseInt(currResi) <= parseInt(strandArray[strandCnt].endResi)) {
|
|
42974
|
+
bNterminal = false;
|
|
42968
42975
|
|
|
42969
|
-
|
|
42970
|
-
|
|
42971
|
-
|
|
42976
|
+
if(currResi == strandArray[strandCnt].endResi) {
|
|
42977
|
+
++strandCnt; // next strand
|
|
42978
|
+
loopCnt = 0;
|
|
42972
42979
|
|
|
42973
|
-
|
|
42974
|
-
|
|
42980
|
+
if(!strandArray[strandCnt]) { // last strand
|
|
42981
|
+
--strandCnt;
|
|
42982
|
+
}
|
|
42975
42983
|
}
|
|
42976
42984
|
}
|
|
42977
|
-
|
|
42978
|
-
|
|
42979
|
-
ic.residIgLoop[residueid] = 1;
|
|
42985
|
+
else if(parseInt(currResi) > parseInt(strandArray[strandCnt].endResi)) {
|
|
42986
|
+
ic.residIgLoop[residueid] = 1;
|
|
42980
42987
|
|
|
42981
|
-
|
|
42982
|
-
|
|
42983
|
-
|
|
42984
|
-
|
|
42985
|
-
|
|
42986
|
-
|
|
42987
|
-
|
|
42988
|
-
|
|
42988
|
+
// C-terminal
|
|
42989
|
+
if(!ic.resid2refnum[residueid]) {
|
|
42990
|
+
break;
|
|
42991
|
+
}
|
|
42992
|
+
else {
|
|
42993
|
+
currRefnum = strandArray[strandCnt].endRefnum + loopCnt;
|
|
42994
|
+
refnumLabelNoPostfix = strandArray[strandCnt].strand + currRefnum;
|
|
42995
|
+
refnumLabel = refnumLabelNoPostfix + strandArray[strandCnt].strandPostfix;
|
|
42996
|
+
}
|
|
42989
42997
|
}
|
|
42990
42998
|
}
|
|
42991
42999
|
|
|
@@ -67208,7 +67216,7 @@ class SaveFile {
|
|
|
67208
67216
|
if(me.utilsCls.isIE()) {
|
|
67209
67217
|
blob = ic.renderer.domElement.msToBlob();
|
|
67210
67218
|
|
|
67211
|
-
if(bAddURL
|
|
67219
|
+
if(bAddURL) {
|
|
67212
67220
|
let reader = new FileReader();
|
|
67213
67221
|
reader.onload = function(e) {
|
|
67214
67222
|
let arrayBuffer = e.target.result; // or = reader.result;
|
|
@@ -67234,7 +67242,7 @@ class SaveFile {
|
|
|
67234
67242
|
}
|
|
67235
67243
|
else {
|
|
67236
67244
|
ic.renderer.domElement.toBlob(function(data) {
|
|
67237
|
-
if(bAddURL
|
|
67245
|
+
if(bAddURL) {
|
|
67238
67246
|
let reader = new FileReader();
|
|
67239
67247
|
reader.onload = function(e) {
|
|
67240
67248
|
let arrayBuffer = e.target.result; // or = reader.result;
|
|
@@ -67309,7 +67317,7 @@ class SaveFile {
|
|
|
67309
67317
|
url = url.replace(/imageonly=1/g, '');
|
|
67310
67318
|
|
|
67311
67319
|
let bTooLong =(url.length > 4000 || url.indexOf('http') !== 0) ? true : false;
|
|
67312
|
-
|
|
67320
|
+
/*
|
|
67313
67321
|
if(bTooLong || (ic.bInputfile && !ic.bInputUrlfile)) {
|
|
67314
67322
|
// $("#" + ic.pre + "viewer").html("<img src='" + imageUrl + "'/>");
|
|
67315
67323
|
$("#" + ic.pre + "mnlist").html("<img src='" + imageUrl + "'/>");
|
|
@@ -67319,11 +67327,31 @@ class SaveFile {
|
|
|
67319
67327
|
$("#" + ic.pre + "mnlist").html("<a href='" + url + "' target='_blank'><img src='" + imageUrl + "'/></a>");
|
|
67320
67328
|
}
|
|
67321
67329
|
|
|
67322
|
-
$("#" + ic.pre + "viewer").
|
|
67330
|
+
// $("#" + ic.pre + "viewer").width(width);
|
|
67331
|
+
// $("#" + ic.pre + "viewer").height(height);
|
|
67332
|
+
$("#" + ic.pre + "mnlist").width(width);
|
|
67333
|
+
$("#" + ic.pre + "mnlist").height(height);
|
|
67334
|
+
|
|
67323
67335
|
$("#" + ic.pre + "cmdlog").hide();
|
|
67324
67336
|
$("#" + ic.pre + "title").hide();
|
|
67337
|
+
|
|
67325
67338
|
//$("#" + ic.pre + "mnlist").hide();
|
|
67326
67339
|
$("#" + ic.pre + "canvas").hide(); // "load mmdbid ..." may cause problems if canvas was removed
|
|
67340
|
+
*/
|
|
67341
|
+
|
|
67342
|
+
if(bTooLong || (ic.bInputfile && !ic.bInputUrlfile)) {
|
|
67343
|
+
$("#" + ic.pre + "viewer").html("<img src='" + imageUrl + "'/>");
|
|
67344
|
+
}
|
|
67345
|
+
else {
|
|
67346
|
+
$("#" + ic.pre + "viewer").html("<a href='" + url + "' target='_blank'><img src='" + imageUrl + "'/></a>");
|
|
67347
|
+
}
|
|
67348
|
+
|
|
67349
|
+
$("#" + ic.pre + "viewer").width(width);
|
|
67350
|
+
$("#" + ic.pre + "viewer").height(height);
|
|
67351
|
+
|
|
67352
|
+
$("#" + ic.pre + "cmdlog").hide();
|
|
67353
|
+
$("#" + ic.pre + "title").hide();
|
|
67354
|
+
$("#" + ic.pre + "mnlist").hide();
|
|
67327
67355
|
|
|
67328
67356
|
if($("#" + ic.pre + "fullscreen").length > 0) $("#" + ic.pre + "fullscreen").hide();
|
|
67329
67357
|
|
|
@@ -68274,7 +68302,7 @@ class ShareLink {
|
|
|
68274
68302
|
if(key_value.length == 2) paraHash[key_value[0]] = key_value[1];
|
|
68275
68303
|
}
|
|
68276
68304
|
|
|
68277
|
-
if(me.cfg.
|
|
68305
|
+
if(me.cfg.idname && !paraHash[me.cfg.idname]) { // somehow it is not included
|
|
68278
68306
|
url += me.cfg.idname + '=' + me.cfg.idvalue + '&';
|
|
68279
68307
|
}
|
|
68280
68308
|
|