icn3d 3.36.0 → 3.36.1

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 CHANGED
@@ -15459,6 +15459,9 @@ class Events {
15459
15459
  if(bPng) {
15460
15460
  let result = await me.htmlCls.setHtmlCls.loadPng(dataStr);
15461
15461
  dataStr = result.pdb;
15462
+
15463
+ if(!dataStr) return; // old iCn3D PNG with sharable link
15464
+
15462
15465
  if(!ic.statefileArray) ic.statefileArray = [];
15463
15466
  ic.statefileArray.push(result.statefile);
15464
15467
  }
@@ -19234,11 +19237,11 @@ class SetHtml {
19234
19237
  if(pos == -1 && posState == -1) {
19235
19238
  var aaa = 1; //alert('Please load a PNG image saved by clicking the menu "File > Save File > iCn3D PNG Image"...');
19236
19239
  }
19237
- // else if(!bReturn && pos != -1) { // no need to return pdb and state files
19238
- // let url = imageStr.substr(pos + matchedStr.length);
19239
- // me.htmlCls.clickMenuCls.setLogCmd('load iCn3D PNG image ' + $("#" + me.pre + "pngimage").val(), false);
19240
- // window.open(url, '_self');
19241
- // }
19240
+ else if(pos != -1) {
19241
+ let url = imageStr.substr(pos + matchedStr.length);
19242
+ me.htmlCls.clickMenuCls.setLogCmd('load iCn3D PNG image ' + $("#" + me.pre + "pngimage").val(), false);
19243
+ window.open(url, '_self');
19244
+ }
19242
19245
  else if(posState != -1) {
19243
19246
  let matchedStrData = "Start of data file======\n";
19244
19247
  let posData = imageStr.indexOf(matchedStrData);