Commit c735bc5d authored by jdurrant's avatar jdurrant

Updates to address new SharedArrayBuffer requirements.

parent 6bef33b7
Changes
=======
1.0.3
-----
* Due to a recent browser update, web servers hosting Webina must now send the
`Cross-Origin-Embedder-Policy: require-corp` and `Cross-Origin-Opener-Policy:
same-origin` headers.
* Updated `README.md` to explain the need for these new headers.
* The webina.zip file now includes a simple Python3 server that provides the
required headers, to facilitate testing on users' local machines.
* Starting with this version, we will no longer generate technical documentation
describing the Webina source code. Documentation describing basic usage,
compilation, etc. can be found in the `README.md` file.
1.0.2
-----
......
# Webina 1.0.2 #
# Webina 1.0.3 #
## Introduction ##
......@@ -257,15 +257,19 @@ these instructions:
2. Uncompress the file: `unzip webina.zip`
3. Change to the new `webina/` directory: `cd webina`
4. Start a local server.
* You can use `Node.js` and `npm`:
* `npm install -g http-server`
* `http-server`
* [With some
coding](https://curiousprog.com/2018/10/08/serving-webassembly-files-with-a-development-web-server/),
you can also use Python 2.7's built-in server:
* `python -m SimpleHTTPServer 8000`
5. Access the server from your web-browser (e.g., `http://localhost:8000/`,
`http://0.0.0.0:8000/`, etc.)
* Webina uses `SharedArrayBuffer` to leverage multiple processors, so your
server must send the [following
headers](https://developer.chrome.com/blog/enabling-shared-array-buffer/):
* `Cross-Origin-Embedder-Policy: require-corp`
* `Cross-Origin-Opener-Policy: same-origin`
* To simplify testing on users' local machines, the Webina download includes
a Python3 web-server script.
* The script is named `simple-server.py.txt` (with a `.txt` extension) for
security purposes, so first rename it to `simple-server.py`
* `mv simple-server.py.txt simple-server.py`
* Then run from the command line:
* `python3 simple-server.py`
5. Access the server from your web-browser.
Running Webina on other operating systems (e.g., Windows) should be similar.
......
This diff is collapsed.
{
"name": "webina",
"version": "1.0.2",
"version": "1.0.3",
"description": "",
"private": true,
"scripts": {
......@@ -20,7 +20,6 @@
"css-loader": "^3.5.1",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"file-loader": "^4.3.0",
"google-closure-compiler": "^20190929.0.0",
"html-webpack-plugin": "^3.2.0",
"jquery": "^3.4.1",
"mini-css-extract-plugin": "^0.8.2",
......@@ -43,6 +42,7 @@
"bootstrap": "^4.4.1",
"bootstrap-vue": "^2.11.0",
"file-saver": "^2.0.2",
"google-closure-compiler": "^20210601.0.0",
"popper.js": "^1.16.1",
"vue": "^2.6.11"
}
......
......@@ -39,7 +39,7 @@ let methodsFunctions = {
val: this.$store.state["crystalContentsExample"]
});
resolve();
resolve(undefined);
}, 100);
})
......
......@@ -155,7 +155,10 @@ let methodsFunctions = {
// console.log(this["type"], "Adding " + typeStr, pdb.length);
this[typeStr + "PdbOfLoaded"] = pdb;
this["viewer"].removeModel(this[typeStr + "Mol"]);
let prevModel = this[typeStr + "Mol"];
if (prevModel !== undefined) {
this["viewer"].removeModel(prevModel);
}
this["viewer"].resize();
this[typeStr + "Mol"] = this["viewer"].addModel(pdb, "pdb", {"keepH": true});
......@@ -562,68 +565,68 @@ let methodsFunctions = {
let watchFunctions = {
/**
* Watch when the receptorContents computed property.
* @param {string} oldReceptorContents The old value of the property.
* @param {string} newReceptorContents The new value of the property.
* @param {string} oldReceptorContents The old value of the property.
* @returns void
*/
"receptorContents": function (oldReceptorContents: string, newReceptorContents: string): void {
"receptorContents": function (newReceptorContents: string, oldReceptorContents: string): void {
// The purpose of this is to react when new receptorContents
// are added.
let duration: number = (newReceptorContents === "") ? 0 : 500;
let duration: number = (oldReceptorContents === "") ? 0 : 500;
this.modelAdded(duration);
// this.updateBox(); // So when invalid pdb loaded, can recover with valid pdb.
},
/**
* Watch when the ligandContents computed property.
* @param {string} oldLigandContents The old value of the property.
* @param {string} newLigandContents The new value of the property.
* @param {string} oldLigandContents The old value of the property.
* @returns void
*/
"ligandContents": function (oldLigandContents: string, newLigandContents: string): void {
"ligandContents": function (newLigandContents: string, oldLigandContents: string): void {
// The purpose of this is to react when new ligandContents are
// added.
let duration: number = (newLigandContents === "") ? 0 : 500;
let duration: number = (oldLigandContents === "") ? 0 : 500;
this.modelAdded(duration);
},
/**
* Watch when the dockedContents computed property.
* @param {string} oldDockedContents The old value of the property.
* @param {string} newDockedContents The new value of the property.
* @param {string} oldDockedContents The old value of the property.
* @returns void
*/
"dockedContents": function (oldDockedContents: string, newDockedContents: string): void {
"dockedContents": function (newDockedContents: string, oldDockedContents: string): void {
// The purpose of this is to react when new dockedContents are
// added.
let duration: number = (newDockedContents === "") ? 0 : 500;
let duration: number = (oldDockedContents === "") ? 0 : 500;
this.modelAdded(duration);
},
/**
* Watch when the crystalContents computed property.
* @param {string} oldCrystalContents The old value of the property.
* @param {string} newCrystalContents The new value of the property.
* @param {string} oldCrystalContents The old value of the property.
* @returns void
*/
"crystalContents": function (oldCrystalContents: string, newCrystalContents: string): void {
"crystalContents": function (newCrystalContents: string, oldCrystalContents: string): void {
// The purpose of this is to react when new dockedContents are
// added.
let duration: number = (newCrystalContents === "") ? 0 : 500;
let duration: number = (oldCrystalContents === "") ? 0 : 500;
this.modelAdded(duration);
},
/**
* Watch when the vinaParams computed property.
* @param {string} oldVinaParams The old value of the property.
* @param {string} newVinaParams The new value of the property.
* @param {string} oldVinaParams The old value of the property.
* @returns void
*/
vinaParams(oldVinaParams: string, newVinaParams: string): void {
vinaParams(newVinaParams: string, oldVinaParams: string): void {
// For updating the docking box...
if (this["type"] !== "receptor") {
return;
......
......@@ -67,6 +67,7 @@ export function curPath(): string {
}
return url;
}
/**
* Given a filename, replace its extension.
* @param {string} filename The original filename.
......
......@@ -2,4 +2,4 @@
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2020 Jacob D. Durrant.
export let VERSION = "1.0.2";
export let VERSION = "1.0.3";
......@@ -6,11 +6,10 @@
import * as UI from "./UI/UI";
import * as VueSetup from "./Vue/Setup";
import { VERSION } from "./Version";
declare var ga;
console.log("Webina Web App " + VERSION);
declare var ga;
VueSetup.setup();
UI.setup();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -44,13 +44,16 @@ ls app.*js | awk '{print "cat t > " $1 ".tmp; cat " $1 " >> " $1 ".tmp; mv " $1
rm t
cd -
# Copy simple python server.
cp ./utils/simple-server.py ./dist/simple-server.py.txt
# Also create a ZIP file of the dist directory, for convenient distribution.
mv dist webina
zip -r webina.zip webina
mv webina dist
# Build the docs while you're at it.
. utils/build/make_docs.sh
# . utils/build/make_docs.sh
# Let the user know that compilation is finished. Works only on macOS.
say "Beep"
rm -rf technical_docs
typedoc --out technical_docs --exclude "**/*.js" --ignoreCompilerErrors --mode modules --hideGenerator src
# typedoc --out technical_docs --exclude "**/*.js" --ignoreCompilerErrors --mode modules --hideGenerator src
# typedoc \
# --exclude "**/*.old" --exclude "**/*.js" --out technical_docs \
# --categorizeByGroup --hideGenerator --excludePrivate --excludeProtected --theme minimal \
# --sort alphabetical --plugin none \
# ../../src/index.ts
cd ../../src/
typedoc \
--exclude "**/*.old" --exclude "**/*.js" --out technical_docs \
--categorizeByGroup --hideGenerator --theme minimal \
--sort alphabetical --plugin none \
--moduleResolution node \
./
# --entryPoints ../../src/index.ts
# --entryPoints $(find ../../src/ -name "*.ts" | awk '{print $1}' | grep -v "\.old" | grep -v "\.d\.ts" | awk '{printf $1 " "}') \
# --readme ../../USAGE.md
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment