mirror of
https://github.com/molstar/molstar.git
synced 2026-06-07 07:04:22 +08:00
Compare commits
1 Commits
master
...
app-load-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba944769f5 |
@@ -22,6 +22,7 @@ Note that since we don't clearly distinguish between a public and private interf
|
||||
- Fix SSAO half/quarter resolution textures for multi-scale
|
||||
- Non-covalent interactions: water bridge support
|
||||
- Download Structure From AlphaFoldDB allows IDs with version suffix (version is ignored)
|
||||
- Add `loadUrl` method and GET params to Viewer app
|
||||
|
||||
## [v5.9.0] - 2026-05-03
|
||||
- Fix edge case when `PluginSpec.animations` is empty
|
||||
|
||||
@@ -14,7 +14,7 @@ import { MVSData } from '../../extensions/mvs/mvs-data';
|
||||
import { StringLike } from '../../mol-io/common/string-like';
|
||||
import { Structure, StructureElement } from '../../mol-model/structure';
|
||||
import { Volume } from '../../mol-model/volume';
|
||||
import { OpenFiles } from '../../mol-plugin-state/actions/file';
|
||||
import { DownloadFile, OpenFiles } from '../../mol-plugin-state/actions/file';
|
||||
import { DownloadStructure, PdbDownloadProvider } from '../../mol-plugin-state/actions/structure';
|
||||
import { DownloadDensity } from '../../mol-plugin-state/actions/volume';
|
||||
import { PresetTrajectoryHierarchy } from '../../mol-plugin-state/builder/structure/hierarchy-preset';
|
||||
@@ -523,6 +523,17 @@ export class Viewer {
|
||||
}
|
||||
}
|
||||
|
||||
loadUrl(url: string, format: string, isBinary = false) {
|
||||
return this.plugin.runTask(Task.create('Load URL', async taskCtx => {
|
||||
await this.plugin.state.data.applyAction(DownloadFile, {
|
||||
url: Asset.Url(url),
|
||||
format,
|
||||
isBinary,
|
||||
visuals: true
|
||||
}).runInContext(taskCtx);
|
||||
}));
|
||||
}
|
||||
|
||||
handleResize() {
|
||||
this.plugin.layout.events.updated.next(void 0);
|
||||
}
|
||||
|
||||
@@ -129,6 +129,11 @@
|
||||
var modelArchive = getParam('model-archive', '[^&]+').trim();
|
||||
if (modelArchive) viewer.loadModelArchive(modelArchive);
|
||||
|
||||
var url = getParam('url', '[^&]+').trim();
|
||||
var urlFormat = getParam('url-format', '[^&]+').trim() || undefined;
|
||||
var urlIsBinary = getParam('url-is-binary', '[^&]+').trim() === '1';
|
||||
if (url && urlFormat) viewer.loadUrl(url, urlFormat, urlIsBinary);
|
||||
|
||||
window.addEventListener('unload', () => {
|
||||
// to aid GC
|
||||
viewer.dispose();
|
||||
|
||||
Reference in New Issue
Block a user