Commit 1cf261c8 authored by Jacob Durrant's avatar Jacob Durrant

Updates to build process, favicon, error catching, etc.

parent e4f413a5
......@@ -2,3 +2,11 @@ node_modules
old_delme
.DS_Store
testing_openbabel
*.swp
TODO.md
rsync.sh
src/Webina/notes.txt
src/Webina/src/new/
src/Webina/src/orig/
src/example/small/
src/example/src/
......@@ -591,12 +591,16 @@ if (ENVIRONMENT_IS_PTHREAD) {} else {
if (WEBINA_Module["wasmMemory"]) {
wasmMemory = WEBINA_Module["wasmMemory"]
} else {
wasmMemory = new WebAssembly.Memory({
"initial": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"maximum": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"shared": true
});
WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer, "requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")
try {
wasmMemory = new WebAssembly.Memory({
"initial": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"maximum": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"shared": true
});
WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer, "requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")
} catch(error) {
WEBINA_Module["catchError"]({"message": "Problem using shared memory, likely because your browser does not have WebAssembly threads support. Please use a different browser, such as Google Chrome."});
}
}
}
if (wasmMemory) {
......
......@@ -47,7 +47,8 @@ function writeArrayToMemory(a,b){WEBINA_assert(0<=a.length,"writeArrayToMemory a
function updateGlobalBufferAndViews(a){buffer=a;WEBINA_Module.HEAP8=HEAP8=new Int8Array(a);WEBINA_Module.HEAP16=HEAP16=new Int16Array(a);WEBINA_Module.HEAP32=HEAP32=new Int32Array(a);WEBINA_Module.HEAPU8=HEAPU8=new Uint8Array(a);WEBINA_Module.HEAPU16=HEAPU16=new Uint16Array(a);WEBINA_Module.HEAPU32=HEAPU32=new Uint32Array(a);WEBINA_Module.HEAPF32=HEAPF32=new Float32Array(a);WEBINA_Module.HEAPF64=HEAPF64=new Float64Array(a)}
if(!ENVIRONMENT_IS_PTHREAD){var STACK_BASE=85136,STACK_MAX=5328016,DYNAMIC_BASE=5328016,DYNAMICTOP_PTR=84128;WEBINA_assert(0===STACK_BASE%16,"stack must start aligned");WEBINA_assert(0===DYNAMIC_BASE%16,"heap must start aligned")}var TOTAL_STACK=5242880;WEBINA_Module.TOTAL_STACK&&WEBINA_assert(TOTAL_STACK===WEBINA_Module.TOTAL_STACK,"the stack size can no longer be determined at runtime");var INITIAL_TOTAL_MEMORY=WEBINA_Module.TOTAL_MEMORY||1073741824;
Object.getOwnPropertyDescriptor(WEBINA_Module,"TOTAL_MEMORY")||Object.defineProperty(WEBINA_Module,"TOTAL_MEMORY",{configurable:!0,get:function(){abort("WEBINA_Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY")}});WEBINA_assert(INITIAL_TOTAL_MEMORY>=TOTAL_STACK,"TOTAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");
WEBINA_assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");ENVIRONMENT_IS_PTHREAD||(WEBINA_Module.wasmMemory?wasmMemory=WEBINA_Module.wasmMemory:(wasmMemory=new WebAssembly.Memory({initial:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,maximum:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,shared:!0}),WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer,"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")));
WEBINA_assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");
if(!ENVIRONMENT_IS_PTHREAD)if(WEBINA_Module.wasmMemory)wasmMemory=WEBINA_Module.wasmMemory;else try{wasmMemory=new WebAssembly.Memory({initial:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,maximum:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,shared:!0}),WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer,"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")}catch(a){WEBINA_Module.catchError({message:"Problem using shared memory, likely because your browser does not have WebAssembly threads support. Please use a different browser, such as Google Chrome."})}
wasmMemory&&(buffer=wasmMemory.buffer);INITIAL_TOTAL_MEMORY=buffer.byteLength;WEBINA_assert(0===INITIAL_TOTAL_MEMORY%WASM_PAGE_SIZE);updateGlobalBufferAndViews(buffer);ENVIRONMENT_IS_PTHREAD||(HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE);function writeStackCookie(){WEBINA_assert(0==(STACK_MAX&3));HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022;HEAP32[0]=1668509029}
function checkStackCookie(){var a=HEAPU32[(STACK_MAX>>2)-1],b=HEAPU32[(STACK_MAX>>2)-2];34821223==a&&2310721022==b||abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+b.toString(16)+" "+a.toString(16));1668509029!==HEAP32[0]&&abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}
function abortStackOverflow(a){abort("Stack overflow! Attempted to allocate "+a+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+a)+" bytes available!")}(function(){var a=new Int16Array(1),b=new Int8Array(a.buffer);a[0]=25459;if(115!==b[0]||99!==b[1])throw"Runtime error: expected the system to be little-endian!";})();
......
......@@ -5,7 +5,7 @@
<meta charset="utf-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Webina</title>
<link href="vendors.8515e710744a73af7365.1.css" rel="stylesheet"><link href="styles.8515e710744a73af7365.3.css" rel="stylesheet"></head>
<link rel="shortcut icon" href="favicon.ico"><link href="vendors.bd77c123eb479d460be1.1.css" rel="stylesheet"><link href="styles.bd77c123eb479d460be1.3.css" rel="stylesheet"></head>
<body>
<div id="app"></div>
......@@ -19,6 +19,6 @@
<script src="vue.min.js"></script>
<script src="vuex.min.js"></script>
<script src="bootstrap-vue.min.js"></script>
<script type="text/javascript" src="runtime.8515e710744a73af7365.js"></script><script type="text/javascript" src="vendors.8515e710744a73af7365.js"></script><script type="text/javascript" src="app.8515e710744a73af7365.js"></script><script type="text/javascript" src="styles.8515e710744a73af7365.js"></script><script type="text/javascript" src="styles.css.8515e710744a73af7365.js"></script></body>
<script type="text/javascript" src="runtime.bd77c123eb479d460be1.js"></script><script type="text/javascript" src="vendors.bd77c123eb479d460be1.js"></script><script type="text/javascript" src="app.bd77c123eb479d460be1.js"></script><script type="text/javascript" src="styles.bd77c123eb479d460be1.js"></script><script type="text/javascript" src="styles.css.bd77c123eb479d460be1.js"></script></body>
</html>
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ 0: 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // run deferred modules from other chunks
/******/ checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ([]);
\ No newline at end of file
(function(m){function p(a){for(var b=a[0],c=a[1],d=a[2],f,h,e=0,g=[];e<b.length;e++)h=b[e],Object.prototype.hasOwnProperty.call(k,h)&&k[h]&&g.push(k[h][0]),k[h]=0;for(f in c)Object.prototype.hasOwnProperty.call(c,f)&&(m[f]=c[f]);for(q&&q(a);g.length;)g.shift()();l.push.apply(l,d||[]);return r()}function r(){for(var a,b=0;b<l.length;b++){for(var n=l[b],d=!0,f=1;f<n.length;f++)0!==k[n[f]]&&(d=!1);d&&(l.splice(b--,1),a=c(c.s=n[0]))}return a}function c(a){if(e[a])return e[a].exports;var b=e[a]={i:a,l:!1,
exports:{}};m[a].call(b.exports,b,b.exports,c);b.l=!0;return b.exports}var e={},k={0:0},l=[];c.m=m;c.c=e;c.d=function(a,b,d){c.o(a,b)||Object.defineProperty(a,b,{enumerable:!0,get:d})};c.r=function(a){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"});Object.defineProperty(a,"__esModule",{value:!0})};c.t=function(a,b){b&1&&(a=c(a));if(b&8||b&4&&"object"===typeof a&&a&&a.__esModule)return a;var d=Object.create(null);c.r(d);Object.defineProperty(d,
"default",{enumerable:!0,value:a});if(b&2&&"string"!=typeof a)for(var e in a)c.d(d,e,function(b){return a[b]}.bind(null,e));return d};c.n=function(a){var b=a&&a.__esModule?function(){return a["default"]}:function(){return a};c.d(b,"a",b);return b};c.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};c.p="";var d=window.webpackJsonp=window.webpackJsonp||[],t=d.push.bind(d);d.push=p;d=d.slice();for(var g=0;g<d.length;g++)p(d[g]);var q=t;r()})([]);
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
/***/ 1:
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__("+eM2");
__webpack_require__("LdiE");
__webpack_require__("GwUf");
module.exports = __webpack_require__("8Lv4");
/***/ }),
/***/ "8Lv4":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ }),
/***/ "GwUf":
/***/ (function(module, exports, __webpack_require__) {
// extracted by mini-css-extract-plugin
/***/ })
}]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(b,c,a){a("+eM2");a("LdiE");a("GwUf");b.exports=a("8Lv4")},"8Lv4":function(b,c,a){},GwUf:function(b,c,a){}}]);
(function(){'use strict';(window.webpackJsonp=window.webpackJsonp||[]).push([[4],[],[[1,0,1,3]]]);}).call(this || window)
(function(){(window.webpackJsonp=window.webpackJsonp||[]).push([[4],[],[[1,0,1,3]]])}).call(this||window);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -2320,9 +2320,9 @@
"dev": true
},
"ws": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.1.2.tgz",
"integrity": "sha512-gftXq3XI81cJCgkUiAVixA0raD9IVmXqsylCrjRygw4+UOOGzPoxnQ6r/CnVL9i+mDncJo94tSkyrtuuQVBmrg==",
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-7.2.0.tgz",
"integrity": "sha512-+SqNqFbwTm/0DC18KYzIsMTnEWpLwJsiasW/O17la4iDRRIO9uaHbvKiAS3AHgTiuuWerK/brj4O6MYZkei9xg==",
"dev": true,
"requires": {
"async-limiter": "^1.0.0"
......@@ -3912,9 +3912,9 @@
"dev": true
},
"handlebars": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.1.tgz",
"integrity": "sha512-C29UoFzHe9yM61lOsIlCE5/mQVGrnIOrOq7maQl76L7tYPCgC1og0Ajt6uWnX4ZTxBPnjw+CUvawphwCfJgUnA==",
"version": "4.5.2",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.2.tgz",
"integrity": "sha512-29Zxv/cynYB7mkT1rVWQnV7mGX6v7H/miQ6dbEpYTKq5eJBN7PsRB+ViYJlcT6JINTSu4dVB9kOqEun78h6Exg==",
"dev": true,
"requires": {
"neo-async": "^2.6.0",
......
......@@ -6,7 +6,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build_old": "utils/build/before.sh; webpack --config ./utils/webpack.configs/webpack.prod.js; utils/build/after_build.sh",
"build": "export NODE_OPTIONS=--max_old_space_size=4096; webpack --config ./utils/webpack.configs/webpack.prod.js",
"build": "export NODE_OPTIONS=--max_old_space_size=4096; utils/build/before.sh; webpack --config ./utils/webpack.configs/webpack.prod.js; utils/build/after_build.sh",
"start": "utils/build/before.sh; webpack-dashboard -- webpack-dev-server --open --config ./utils/webpack.configs/webpack.dev.js"
},
"keywords": [],
......
......@@ -353,9 +353,9 @@ export function setup(): void {
"startOverTabDisabled": false
});
this.showWebinaError(errObj.message);
this.showWebinaError(errObj["message"]);
},
window.location.pathname.replace("index.html", "") + "Webina/"
Utils.curPath() + "Webina/"
)
});
});
......
import * as Store from "../Vue/Store";
import * as Utils from "../Utils";
declare var Vue;
......@@ -15,7 +16,7 @@ export function setup(): void {
</b-jumbotron>
</div>
<b-jumbotron class="jumbo" header="Webina" lead="AutoDock Vina Ported to WebAssembly">
<b-jumbotron class="jumbo" style="background-image:url(${Utils.curPath()}webina_logo.jpg);" header="Webina" lead="AutoDock Vina Ported to WebAssembly">
<p>Brought to you by the Durrant Lab.</p>
<b-button variant="primary" target="_blank" href="http://durrantlab.com">More Info</b-button>
</b-jumbotron>
......@@ -88,6 +89,15 @@ export function setup(): void {
"methods": {},
"mounted"() {
// Also add image to the jumbotron. Doing it here instead of in css
// because otherwise doesn't work when you put webina in a subdirectory.
// let t = jQuery(".jumbo");
// t.css("color", "red");
// console.log(t.css("color"))
// // debugger;
// jQuery(".jumbo").css("background-image", "webina_logo.jpg");
window["$store"] = this.$store; // For debugging
}
})
......
......@@ -34,3 +34,11 @@ export function isFirefox(): boolean {
// See https://stackoverflow.com/questions/7000190/detect-all-firefox-versions-in-js
return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
}
export function curPath(): string {
let url = window.location.pathname.replace("index.html", "");
if (url.slice(url.length - 1) !== "/") {
url = url + "/";
}
return url;
}
......@@ -18,6 +18,7 @@ import * as FormButton from "../UI/Forms/FormButton";
declare var Vue;
declare var Vuex;
declare var BootstrapVue;
declare var jQuery;
export function setup(): void {
Vue.use(BootstrapVue)
......
......@@ -591,12 +591,16 @@ if (ENVIRONMENT_IS_PTHREAD) {} else {
if (WEBINA_Module["wasmMemory"]) {
wasmMemory = WEBINA_Module["wasmMemory"]
} else {
wasmMemory = new WebAssembly.Memory({
"initial": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"maximum": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"shared": true
});
WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer, "requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")
try {
wasmMemory = new WebAssembly.Memory({
"initial": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"maximum": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"shared": true
});
WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer, "requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")
} catch(error) {
WEBINA_Module["catchError"]({"message": "Problem using shared memory, likely because your browser does not have WebAssembly threads support. Please use a different browser, such as Google Chrome."});
}
}
}
if (wasmMemory) {
......
......@@ -47,7 +47,8 @@ function writeArrayToMemory(a,b){WEBINA_assert(0<=a.length,"writeArrayToMemory a
function updateGlobalBufferAndViews(a){buffer=a;WEBINA_Module.HEAP8=HEAP8=new Int8Array(a);WEBINA_Module.HEAP16=HEAP16=new Int16Array(a);WEBINA_Module.HEAP32=HEAP32=new Int32Array(a);WEBINA_Module.HEAPU8=HEAPU8=new Uint8Array(a);WEBINA_Module.HEAPU16=HEAPU16=new Uint16Array(a);WEBINA_Module.HEAPU32=HEAPU32=new Uint32Array(a);WEBINA_Module.HEAPF32=HEAPF32=new Float32Array(a);WEBINA_Module.HEAPF64=HEAPF64=new Float64Array(a)}
if(!ENVIRONMENT_IS_PTHREAD){var STACK_BASE=85136,STACK_MAX=5328016,DYNAMIC_BASE=5328016,DYNAMICTOP_PTR=84128;WEBINA_assert(0===STACK_BASE%16,"stack must start aligned");WEBINA_assert(0===DYNAMIC_BASE%16,"heap must start aligned")}var TOTAL_STACK=5242880;WEBINA_Module.TOTAL_STACK&&WEBINA_assert(TOTAL_STACK===WEBINA_Module.TOTAL_STACK,"the stack size can no longer be determined at runtime");var INITIAL_TOTAL_MEMORY=WEBINA_Module.TOTAL_MEMORY||1073741824;
Object.getOwnPropertyDescriptor(WEBINA_Module,"TOTAL_MEMORY")||Object.defineProperty(WEBINA_Module,"TOTAL_MEMORY",{configurable:!0,get:function(){abort("WEBINA_Module.TOTAL_MEMORY has been replaced with plain INITIAL_TOTAL_MEMORY")}});WEBINA_assert(INITIAL_TOTAL_MEMORY>=TOTAL_STACK,"TOTAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");
WEBINA_assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");ENVIRONMENT_IS_PTHREAD||(WEBINA_Module.wasmMemory?wasmMemory=WEBINA_Module.wasmMemory:(wasmMemory=new WebAssembly.Memory({initial:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,maximum:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,shared:!0}),WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer,"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")));
WEBINA_assert("undefined"!==typeof Int32Array&&"undefined"!==typeof Float64Array&&void 0!==Int32Array.prototype.subarray&&void 0!==Int32Array.prototype.set,"JS engine does not provide full typed array support");
if(!ENVIRONMENT_IS_PTHREAD)if(WEBINA_Module.wasmMemory)wasmMemory=WEBINA_Module.wasmMemory;else try{wasmMemory=new WebAssembly.Memory({initial:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,maximum:INITIAL_TOTAL_MEMORY/WASM_PAGE_SIZE,shared:!0}),WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer,"requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")}catch(a){WEBINA_Module.catchError({message:"Problem using shared memory, likely because your browser does not have WebAssembly threads support. Please use a different browser, such as Google Chrome."})}
wasmMemory&&(buffer=wasmMemory.buffer);INITIAL_TOTAL_MEMORY=buffer.byteLength;WEBINA_assert(0===INITIAL_TOTAL_MEMORY%WASM_PAGE_SIZE);updateGlobalBufferAndViews(buffer);ENVIRONMENT_IS_PTHREAD||(HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE);function writeStackCookie(){WEBINA_assert(0==(STACK_MAX&3));HEAPU32[(STACK_MAX>>2)-1]=34821223;HEAPU32[(STACK_MAX>>2)-2]=2310721022;HEAP32[0]=1668509029}
function checkStackCookie(){var a=HEAPU32[(STACK_MAX>>2)-1],b=HEAPU32[(STACK_MAX>>2)-2];34821223==a&&2310721022==b||abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x02135467, but received 0x"+b.toString(16)+" "+a.toString(16));1668509029!==HEAP32[0]&&abort("Runtime error: The application has corrupted its heap memory area (address zero)!")}
function abortStackOverflow(a){abort("Stack overflow! Attempted to allocate "+a+" bytes on the stack, but stack has only "+(STACK_MAX-stackSave()+a)+" bytes available!")}(function(){var a=new Int16Array(1),b=new Int8Array(a.buffer);a[0]=25459;if(115!==b[0]||99!==b[1])throw"Runtime error: expected the system to be little-endian!";})();
......
......@@ -591,12 +591,16 @@ if (ENVIRONMENT_IS_PTHREAD) {} else {
if (WEBINA_Module["wasmMemory"]) {
wasmMemory = WEBINA_Module["wasmMemory"]
} else {
wasmMemory = new WebAssembly.Memory({
"initial": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"maximum": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"shared": true
});
WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer, "requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")
try {
wasmMemory = new WebAssembly.Memory({
"initial": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"maximum": INITIAL_TOTAL_MEMORY / WASM_PAGE_SIZE,
"shared": true
});
WEBINA_assert(wasmMemory.buffer instanceof SharedArrayBuffer, "requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag")
} catch(error) {
WEBINA_Module["catchError"]({"message": "Problem using shared memory, likely because your browser does not have WebAssembly threads support. Please use a different browser, such as Google Chrome."});
}
}
}
if (wasmMemory) {
......
......@@ -201,7 +201,6 @@ body.waiting, body.waiting * {
}
.jumbo {
background-image: url("webina_logo.jpg");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
......
# Must be run from the main directory.
# When using closure compiler, it creates empty files that aren't needed.
# Tricky because you need to make sure the service worker doesn't try to load
# them either.
cd dist/
ls -l | grep " 0 " | awk '{print $9}' | grep -v tmp > tmp
cat tmp | awk '{print "rm " $1}' | bash
cat $(ls precache-manifest*.js) | tr '\n' '`' > t
cat tmp | awk '{print "cat t | sed \"s/,| {| .url.: ." $1 ".| }//g\" > t2; mv t2 t"}' | bash
cat t | tr '`' '\n' > $(ls precache-manifest*.js)
rm t tmp
ls -l | grep " 0 " | awk '{print "rm " $9}' | bash
cd -
# Prevent 3Dmol.js from reporting back to the mother ship. I thought I could
# set this programmatically, but couldn't get it to work. Best just to modify
# the code to prevent it.
cd dist/
ls vendor* | awk '{print "cat " $1 " | sed \"s/.3Dmol.notrack/true/g\"" }' | bash > t; mv t $(ls vendor*.js)
grep -l "$3Dmol.notrack" *.js | awk '{print "cat " $1 " | sed \"s|\\$3Dmol.notrack|true|g\" > t; mv t " $1}' | bash
cd -
# You need to closure compile vendor..js too. Let's use js version for maximal
# compatibility.
echo "Check for errors above. Enter to start compiling vendor js and other js files..."
# read -p "Press enter to continue"
cd dist
node ../node_modules/google-closure-compiler/cli.js $(ls vendors*.js) > t
mv t $(ls vendors*.js)
node ../node_modules/google-closure-compiler/cli.js $(ls runtime*.js) > t
mv t $(ls runtime*.js)
node ../node_modules/google-closure-compiler/cli.js $(ls precache-manifest*.js) > t
mv t $(ls precache-manifest*.js)
node ../node_modules/google-closure-compiler/cli.js service-worker.js > t
mv t service-worker.js
cd -
# All babylon files should use jpg, not png. It downloads faster for phones.
# So note that transparent textures aren't allowed. Also, ImageMagik must be
# installed to make this part work.
cd dist
find environs/ -name "*.png" > t
cat t | awk '{print "basename " $1}' | bash > t2
cat t | awk '{print "dirname " $1}' | bash > t3
cat t2 | sed "s/.png$/.jpg/g" > t4
paste t t2 t3 t4 | awk '{print "convert -quality 0.85 " $1 " " $3 "/" $4}' | bash
paste t t2 t3 t4 | awk '{print "cat " $3 "/scene.babylon | sed \"s/" $2 "/" $4 "/g\" > tmp; mv tmp " $3 "/scene.babylon"}' | bash
cat t | awk '{print "rm " $1}' | bash
paste t t2 t3 t4 | sed "s/\/\//\//g" | awk '{print "cat precache-manifest.*.js | sed \"s|" $1 "|" $3 "/" $4 "|g\" > tmp; mv tmp $(ls precache-manifest.*.js | head -n 1 )"}' | bash
rm t t2 t3 t4
cd -
# There are a few files that might sneak in that are never part of the final
# build. Delete them now.
find dist -name "*.psd" -exec rm '{}' \;
find dist -name ".DS_Store" -exec rm '{}' \;
find dist -name "*.log" -exec rm '{}' \;
find dist -name "src.txt" -exec rm '{}' \;
find dist -name "old" -exec rm -r '{}' \;
find dist -name "tmp" -exec rm -r '{}' \;
# Remove files from precache-manifest*js file that do not exist.
cd dist
python ../utils/build/remove_entries_file_no_exist.py
ls vendors*js runtime*js styles*js | awk '{print "echo Compiling " $1 ";node ../node_modules/google-closure-compiler/cli.js " $1 " > t; mv t " $1}' | bash
cd -
# Also create a ZIP file of the dist directory, for convenient distribution.
mv dist proteinvr
zip -r proteinvr_web_app.zip proteinvr
mv proteinvr dist
mv dist webina
zip -r webina.zip webina
mv webina dist
# Let the user know that compilation is finished. Works only on macOS.
say "Beep"
......@@ -26,7 +26,7 @@ module.exports = merge(common, {
new HtmlWebpackPlugin({
title: 'Webina',
template: path.join(__dirname, '../../src/index.html'),
// favicon: ???
favicon: path.join(__dirname, '../../src/styles/favicon.ico'),
minify: true,
excludeAssets: [/vrmlWebWorker.*.js/]
}),
......@@ -57,16 +57,16 @@ module.exports = merge(common, {
// from: 'src/Webina/vina.worker.js',
// to: 'vina.worker.js'
// },
// {
// from: 'src/UI/webina_logo.jpg',
// to: 'webina_logo.jpg'
// },
{
from: 'src/styles/favicon.ico',
to: 'favicon.ico'
from: 'src/styles/webina_logo.jpg',
to: 'webina_logo.jpg'
},
// {
// from: 'src/styles/favicon.ico',
// to: 'favicon.ico'
// },
{
from: 'node_modules/vue/dist/vue.js', // min in prod
from: 'node_modules/vue/dist/vue.min.js', // min in prod
to: 'vue.min.js'
},
{
......@@ -96,8 +96,8 @@ module.exports = merge(common, {
],
module: {
rules: [{
test: /\.css$/,
use: [{
test: /\.css$/,
use: [{
loader: MiniCssExtractPlugin.loader,
options: {
// you can specify a publicPath here
......@@ -125,19 +125,40 @@ module.exports = merge(common, {
filename: "[name].[hash].js" // contenthash
},
optimization: {
// Below breaks webworker, because calls window from within it.
// Really, we need separrate compiles for webworker and main.
moduleIds: 'hashed',
splitChunks: {
chunks: 'all',
chunks: 'async',
minSize: 30000,
maxSize: 0,