diff --git a/.eslintignore b/.eslintignore index 6b00f86..043806b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ node_modules vendor -build \ No newline at end of file +build +dev/js/**/*.amd.js \ No newline at end of file diff --git a/build/css/main.css b/build/css/main.css index c2985d2..0c1c615 100644 --- a/build/css/main.css +++ b/build/css/main.css @@ -1 +1 @@ -/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-block}progress,sub,sup{vertical-align:baseline}html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects;color:#0c0}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;margin:0}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}.hidden,[hidden],template{display:none}body{margin:0;font:400 87.5%/1.57142857 Arial,sans-serif}a:hover{text-decoration:none}button,input,optgroup,select,textarea{line-height:1.57142857}.oe-description{color:grey;font-size:.85em;line-height:1.2}#oe-view{font-size:0;height:calc(100vh - 22px - 3px * 2 - 1px);line-height:0;margin-right:10px;width:100%}#oe-view.oe-droppable{outline:#000 dashed 1px;position:relative}#oe-view.oe-droppable:after{background-image:repeating-linear-gradient(45deg,transparent,transparent 10px,rgba(255,255,255,.5) 10px,rgba(255,255,255,.5) 20px);content:"";height:100%;left:0;position:absolute;top:0;width:100%}#oe-view.oe-droppable *,#oe-view.oe-droppable:after{pointer-events:none}#oe-view,#oe-view canvas{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#oe-view canvas{height:100%!important;width:100%!important}.oe-menu{background:#f0f0f0;border-bottom:1px solid #dadada;margin:0;padding:0}.app-busy .oe-menu:after{content:url(../img/loader.gif);cursor:wait;float:right;margin:6px 8px 0 0}.oe-menu>li{display:inline-block;list-style:none;margin:0;padding:0;position:relative}.oe-menu button[menu]{cursor:pointer;background:0 0;border:none;padding:3px 10px}.oe-menu button[menu]:hover{background:#e6e6e6}.oe-menu button[menu]:before{content:attr(value)}.oe-menu menu[type=popup]{background:#f0f0f0;border:1px solid #dadada;margin:0;padding:0;position:absolute;visibility:hidden;z-index:2}.oe-menu menu[type=popup].expanded{visibility:visible}.oe-menu menuitem{cursor:pointer;display:block;max-width:250px;overflow:hidden;padding:5px 7px;text-overflow:ellipsis;white-space:nowrap}.oe-potentials,.oe-store-list{list-style:none;overflow:auto}.oe-menu menuitem:hover{background:#e6e6e6}.oe-menu menuitem:before{content:attr(label)}.oe-menu menuitem[disabled]{color:#a0a0a0}.oe-menu menuitem[disabled]:hover{background:0 0}.oe-menu menuitem[disabled]:before{text-shadow:0 1px 0 #fff}.oe-menu hr{border:1px inset #fff;color:#fff}#oe-file{cursor:pointer;display:none;height:32px;left:0;max-width:175px;opacity:.01;position:absolute;top:28px;z-index:2}menu.expanded+#oe-file{display:inline}.oe-dialog{background:#fff;border:1px solid #0e0e0e;border-radius:5px;left:50%;margin-left:-250px;padding:0 15px;position:absolute;top:50px;width:500px;z-index:20}.oe-dialog:before{background:rgba(255,255,255,.8);content:"";height:100%;left:0;position:fixed;top:0;width:100%;z-index:-1}.oe-dialog-btns input{min-width:85px}.oe-dialog fieldset{border-color:#dadada;margin:1em 0}.oe-dialog-btns{text-align:right;border:none;padding:0}.oe-store-list{max-height:250px;min-height:20px;padding:0}.oe-store-list-loading{background:url(../../img/loader.gif) 50% 50% no-repeat}.oe-store-list>li{cursor:pointer;padding:.2em .5em}.oe-store-list h3{display:inline;font-size:1em;margin:0}.oe-store-list h3:after{color:#0c0;content:" …"}.oe-graph-form:before,.oe-store-list>.active h3:after{content:none}.oe-store-list p{color:transparent;display:inline;font-size:0;margin:0}.oe-store-list>.active{background:#e6e6e6}.oe-store-list>.active p{color:#999;font-size:.85em}.oe-save-form .oe-apply{margin-right:20px}.oe-graph-form{border-color:#dadada;border-radius:0 0 0 5px;border-width:0 0 1px 1px;left:auto;margin-left:0;right:0;top:29px;width:350px;z-index:1}.oe-cutoffs{border:1px solid #dadada;padding:0}.oe-cutoff{background:0 0;border:none;border-top:1px solid #dadada;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;display:block;padding:0;text-align:left;width:100%}.oe-cutoff:first-child{border-top:none}.oe-cutoff.active,.oe-cutoff:focus{background:#f5f5f5;outline:0}.oe-cutoff:before,.oe-potentials li:first-child>span{background:#f0f0f0}.oe-cutoff:before{border-right:1px solid #dadada;content:attr(data-pair);display:inline-block;margin-right:5px;min-width:75px;padding-left:5px}.oe-cutoff-slider{padding:0;width:100%}.oe-cutoff-exact,.oe-cutoff-max,.oe-cutoff-min{display:block;width:32%}.oe-cutoff-exact input,.oe-cutoff-max input,.oe-cutoff-min input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;width:100%}.oe-cutoff-min{float:left}.oe-cutoff-max{float:right}.oe-cutoff-exact{margin-left:auto;margin-right:auto}.oe-potentials{border:1px solid #dadada;border-collapse:collapse;display:table;margin:0;max-height:300px;padding:0;table-layout:fixed;width:100%}.oe-potentials li{display:table-row;margin:0;padding:0}.oe-potentials li>label,.oe-potentials li>span{border:1px solid #dadada;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;display:table-cell;padding:2px 5px;vertical-align:middle;width:28%}.oe-potentials li>label:first-child,.oe-potentials li>span:first-child{background:#f0f0f0;width:16%}.oe-potentials input{background:0 0;border:none;display:block;font-size:1em;height:1.5em;margin:0;padding:0;width:100%}.oe-appearance-colors input,.oe-appearance-colors label,.oe-appearance-colors select,.oe-translate label{display:inline-block;vertical-align:top}.oe-potentials .missed label{background:url(data:image/gif;base64,R0lGODlhBQAFAIAAAOPj4////yH5BAAAAAAALAAAAAAFAAUAAAIHRH6GodhZAAA7)}.oe-potentials sub{font-style:normal}.potential-filing label{color:#0c0;cursor:pointer;overflow:hidden;position:relative;text-decoration:underline}.potential-filing label:hover{text-decoration:none}.potential-filing label input{cursor:pointer;height:100%;left:0;opacity:.01;position:absolute;top:0;width:100%}.oe-transform-form{border-color:#dadada;border-radius:0 0 0 5px;border-width:0 0 1px 1px;left:auto;margin-left:0;right:0;top:29px;width:350px;z-index:1}.oe-transform-form:before{content:none}.oe-translate>legend:after{content:"\21A6"}.oe-translate input[type=text]{width:75px}.oe-translate input[type=button]{color:#c00;display:inline-block;font:400 22px/20px monospace;vertical-align:top}.oe-rotate>legend:after{content:"\21BB"}.oe-rotate input[data-axis="x"]{color:#a00}.oe-rotate input[data-axis="y"]{color:#0a0}.oe-rotate input[data-axis="z"]{color:#00a}.oe-rotate>legend:after,.oe-translate>legend:after{font:400 20px/1px monospace;margin:0 5px}.oe-evolve-params{background:url(data:image/gif;base64,R0lGODlhAQABAIAAANra2gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==) 50% 0 repeat-y;float:left;margin-bottom:1em;width:100%}.oe-evolve-params fieldset{border:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;float:right;margin:0;padding:0 0 0 25px;width:49.5%}.oe-evolve-params fieldset:first-child{float:left;padding:0 25px 0 0}.oe-evolve-params fieldset>p:first-child{margin-top:0}.oe-evolve-form .oe-dialog-btns{clear:both}.oe-appearance-form{margin-left:-150px;width:300px}.oe-appearance-colors label{margin-right:20px}.oe-report{background:#fff;border-color:#dadada;border-radius:0 0 0 5px;border-width:0 0 1px 1px;padding:0 15px;position:absolute;right:0;top:29px;z-index:1}#oe-report-progress{position:relative}#oe-report-progress:after{content:attr(value) "%";font-size:.8em;left:0;margin-left:5px;position:absolute;text-align:center;width:100%}#oe-report-data>dt{font-weight:700}#oe-report-data>dd{margin:0 0 .5em} \ No newline at end of file +/*! normalize.css v5.0.0 | MIT License | github.com/necolas/normalize.css */button,hr,input{overflow:visible}audio,canvas,progress,video{display:inline-block}progress,sub,sup{vertical-align:baseline}html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}h1{font-size:2em;margin:.67em 0}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects;color:#0c0}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;margin:0}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}.hidden,[hidden],template{display:none}body{margin:0;font:400 87.5%/1.57142857 Arial,sans-serif}a:hover{text-decoration:none}button,input,optgroup,select,textarea{line-height:1.57142857}.oe-description{color:grey;font-size:.85em;line-height:1.2}#oe-view{font-size:0;height:calc(100vh - 22px - 3px * 2 - 1px);line-height:0;margin-right:10px;width:100%}#oe-view.oe-droppable{outline:#000 dashed 1px;position:relative}#oe-view.oe-droppable:after{background-image:repeating-linear-gradient(45deg,transparent,transparent 10px,rgba(255,255,255,.5) 10px,rgba(255,255,255,.5) 20px);content:"";height:100%;left:0;position:absolute;top:0;width:100%}#oe-view.oe-droppable *,#oe-view.oe-droppable:after{pointer-events:none}#oe-view,#oe-view canvas{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#oe-view canvas{height:100%!important;width:100%!important}.oe-menu{background:#f0f0f0;border-bottom:1px solid #dadada;margin:0;padding:0}.app-busy .oe-menu:after{content:url(../img/loader.gif);cursor:wait;float:right;margin:6px 8px 0 0}.oe-menu>li{display:inline-block;list-style:none;margin:0;padding:0;position:relative}.oe-menu button[menu]{cursor:pointer;background:0 0;border:none;padding:3px 10px}.oe-menu button[menu]:hover{background:#e6e6e6}.oe-menu button[menu]:before{content:attr(value)}.oe-menu menu[type=popup]{background:#f0f0f0;border:1px solid #dadada;margin:0;padding:0;position:absolute;visibility:hidden;z-index:2}.oe-menu menu[type=popup].expanded{visibility:visible}.oe-menu menuitem{cursor:pointer;display:block;max-width:250px;overflow:hidden;padding:5px 7px;text-overflow:ellipsis;white-space:nowrap}.oe-potentials,.oe-store-list{list-style:none;overflow:auto}.oe-menu menuitem:hover{background:#e6e6e6}.oe-menu menuitem:before{content:attr(label)}.oe-menu menuitem[disabled]{color:#a0a0a0}.oe-menu menuitem[disabled]:hover{background:0 0}.oe-menu menuitem[disabled]:before{text-shadow:0 1px 0 #fff}.oe-menu hr{border:1px inset #fff;color:#fff}#oe-file{cursor:pointer;display:none;height:32px;left:0;max-width:175px;opacity:.01;position:absolute;top:28px;z-index:2}menu.expanded+#oe-file{display:inline}.oe-dialog{background:#fff;border:1px solid #0e0e0e;border-radius:5px;left:50%;margin-left:-250px;padding:0 15px;position:absolute;top:50px;width:500px;z-index:20}.oe-dialog:before{background:rgba(255,255,255,.8);content:"";height:100%;left:0;position:fixed;top:0;width:100%;z-index:-1}.oe-dialog-btns input{min-width:85px}.oe-dialog fieldset{border-color:#dadada;margin:1em 0}.oe-dialog-btns{text-align:right;border:none;padding:0}.oe-store-list{max-height:250px;min-height:20px;padding:0}.oe-store-list-loading{background:url(../../img/loader.gif) 50% 50% no-repeat}.oe-store-list>li{cursor:pointer;padding:.2em .5em}.oe-store-list h3{display:inline;font-size:1em;margin:0}.oe-store-list h3:after{color:#0c0;content:" …"}.oe-graph-form:before,.oe-store-list>.active h3:after{content:none}.oe-store-list p{color:transparent;display:inline;font-size:0;margin:0}.oe-store-list>.active{background:#e6e6e6}.oe-store-list>.active p{color:#999;font-size:.85em}.oe-save-form .oe-apply{margin-right:20px}.oe-graph-form{border-color:#dadada;border-radius:0 0 0 5px;border-width:0 0 1px 1px;left:auto;margin-left:0;right:0;top:29px;width:350px;z-index:1}.oe-cutoffs{border:1px solid #dadada;padding:0}.oe-cutoff{background:0 0;border:none;border-top:1px solid #dadada;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;display:block;padding:0;text-align:left;width:100%}.oe-cutoff:first-child{border-top:none}.oe-cutoff.active,.oe-cutoff:focus{background:#f5f5f5;outline:0}.oe-cutoff:before,.oe-potentials li:first-child>span{background:#f0f0f0}.oe-cutoff:before{border-right:1px solid #dadada;content:attr(data-pair);display:inline-block;margin-right:5px;min-width:75px;padding-left:5px}.oe-cutoff-slider{padding:0;width:100%}.oe-cutoff-exact,.oe-cutoff-max,.oe-cutoff-min{display:block;width:32%}.oe-cutoff-exact input,.oe-cutoff-max input,.oe-cutoff-min input{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;width:100%}.oe-cutoff-min{float:left}.oe-cutoff-max{float:right}.oe-cutoff-exact{margin-left:auto;margin-right:auto}.oe-potentials{border:1px solid #dadada;border-collapse:collapse;display:table;margin:0;max-height:300px;padding:0;table-layout:fixed;width:100%}.oe-potentials li{display:table-row;margin:0;padding:0}.oe-potentials li>label,.oe-potentials li>span{border:1px solid #dadada;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;display:table-cell;padding:2px 5px;vertical-align:middle;width:28%}.oe-potentials li>label:first-child,.oe-potentials li>span:first-child{background:#f0f0f0;width:16%}.oe-potentials input{background:0 0;border:none;display:block;font-size:1em;height:1.5em;margin:0;padding:0;width:100%}.oe-potentials .missed label{background:url(data:image/gif;base64,R0lGODlhBQAFAIAAAOPj4////yH5BAAAAAAALAAAAAAFAAUAAAIHRH6GodhZAAA7)}.oe-potentials sub{font-style:normal}.potential-filing label{color:#0c0;cursor:pointer;overflow:hidden;position:relative;text-decoration:underline}.potential-filing label:hover{text-decoration:none}.potential-filing label input{cursor:pointer;height:100%;left:0;opacity:.01;position:absolute;top:0;width:100%}.potential-filing a,.potential-filing label{display:inline-block;vertical-align:middle}.oe-appearance-colors input,.oe-appearance-colors label,.oe-appearance-colors select,.oe-translate label{display:inline-block;vertical-align:top}.oe-transform-form{border-color:#dadada;border-radius:0 0 0 5px;border-width:0 0 1px 1px;left:auto;margin-left:0;right:0;top:29px;width:350px;z-index:1}.oe-transform-form:before{content:none}.oe-translate>legend:after{content:"\21A6"}.oe-translate input[type=text]{width:75px}.oe-translate input[type=button]{color:#c00;display:inline-block;font:400 22px/20px monospace;vertical-align:top}.oe-rotate>legend:after{content:"\21BB"}.oe-rotate input[data-axis="x"]{color:#a00}.oe-rotate input[data-axis="y"]{color:#0a0}.oe-rotate input[data-axis="z"]{color:#00a}.oe-rotate>legend:after,.oe-translate>legend:after{font:400 20px/1px monospace;margin:0 5px}.oe-evolve-params{background:url(data:image/gif;base64,R0lGODlhAQABAIAAANra2gAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==) 50% 0 repeat-y;float:left;margin-bottom:1em;width:100%}.oe-evolve-params fieldset{border:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;float:right;margin:0;padding:0 0 0 25px;width:49.5%}.oe-evolve-params fieldset:first-child{float:left;padding:0 25px 0 0}.oe-evolve-params fieldset>p:first-child{margin-top:0}.oe-evolve-form .oe-dialog-btns{clear:both}.oe-appearance-form{margin-left:-150px;width:300px}.oe-appearance-colors label{margin-right:20px}.oe-report{background:#fff;border-color:#dadada;border-radius:0 0 0 5px;border-width:0 0 1px 1px;padding:0 15px;position:absolute;right:0;top:29px;z-index:1}#oe-report-progress{position:relative}#oe-report-progress:after{content:attr(value) "%";font-size:.8em;left:0;margin-left:5px;position:absolute;text-align:center;width:100%}#oe-report-data>dt{font-weight:700}#oe-report-data>dd{margin:0 0 .5em} \ No newline at end of file diff --git a/build/img/dot.gif b/build/img/dot.gif deleted file mode 100644 index 2799b45..0000000 Binary files a/build/img/dot.gif and /dev/null differ diff --git a/build/js/interface.amd.js b/build/js/interface.amd.js index 9b2f7f1..33c8fe8 100644 --- a/build/js/interface.amd.js +++ b/build/js/interface.amd.js @@ -890,7 +890,7 @@ define("file-processing.amd.js", ["exports", "./utils.amd.js", "./structure.amd. } }, parse(fileStr) { - let molRE = /\n\s*mol\s+(\d+)([\s\S]+)\n\s*endmol\s+\1/g, + let molRE = /\n\s*mol\s+(\d+)([\s\S]+)\n\s*endmol\s+\1\b/g, atmRE = /^atom\s+\d+\s+.+$/gm, result = { atoms: [], @@ -1186,7 +1186,7 @@ define("components/menu.amd.js", ["exports", "jquery", "../eventful.amd.js", ".. }, exec(file) { if (file) { - _fileProcessingAmd2.default.load(file); + _fileProcessingAmd2.default.load(file).then(() => _appAmd2.default.trigger("app:structure:loaded")); } } }); @@ -1429,34 +1429,34 @@ define("worker.amd.js", ["exports", "./observer.amd.js", "./app.amd.js"], functi function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {default: obj}; } - let calcWorker = new Worker("js/calc.js"); + let worker = new Worker("js/calc.js"); let blockingMethod = "ready"; _appAmd2.default.busy = true; - let worker = Object.assign(new _observerAmd2.default(), {invoke(method, data) { + let workerHelper = Object.assign(new _observerAmd2.default(), {invoke(method, data) { if (blockingMethod) { throw new Error(`Unable to run the method “${method}” as the blocking method “${blockingMethod}” is still running`); } blockingMethod = method; _appAmd2.default.busy = true; - calcWorker.postMessage({ + worker.postMessage({ method, data }); }}); - calcWorker.addEventListener("message", ({data: {method, + worker.addEventListener("message", ({data: {method, data} = {}}) => { if (method) { if (method === blockingMethod) { _appAmd2.default.busy = false; blockingMethod = null; } - worker.trigger(method, data); + workerHelper.trigger(method, data); } }); - calcWorker.addEventListener("error", (e) => { + worker.addEventListener("error", (e) => { throw e; }); - exports.default = worker; + exports.default = workerHelper; }); })(); @@ -1517,7 +1517,6 @@ define("structure.amd.js", ["exports", "./observer.amd.js", "./app.amd.js", "./u } this.trigger("updateStructure", rescanAtoms !== false); if (fromWorker !== true) { - _appAmd2.default.trigger("app:structure:loaded"); syncWorker(); } }, @@ -1948,7 +1947,7 @@ define("interface.amd.js", ["./structure.amd.js", "./app.amd.js", "./components/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {default: obj}; } - _structureAmd2.default.on("app:structure:loaded", () => { + _appAmd2.default.on("app:structure:loaded", () => { document.title = `${_structureAmd2.default.structure.name} - Open evolver`; }); _appAmd2.default.on("app:stateChange", (busy) => { diff --git a/dev/css/dialogs/potentials.less b/dev/css/dialogs/potentials.less index 1f605ae..23919a9 100644 --- a/dev/css/dialogs/potentials.less +++ b/dev/css/dialogs/potentials.less @@ -71,4 +71,9 @@ width:100%; } } + label, + a { + display:inline-block; + vertical-align:middle; + } } \ No newline at end of file diff --git a/dev/css/main.less b/dev/css/main.less index e79c594..303a2f0 100644 --- a/dev/css/main.less +++ b/dev/css/main.less @@ -1,6 +1,6 @@ @import (reference) "ui"; -@import (less) "../../vendor/normalize.css"; +@import (less) "../../node_modules/normalize.css/normalize.css"; body { font:normal percentage(unit((@root-font-size / 16))) ~"/" unit((@root-line-height / @root-font-size)) @base-font-family; diff --git a/dev/img/dot.gif b/dev/img/dot.gif deleted file mode 100644 index 2799b45..0000000 Binary files a/dev/img/dot.gif and /dev/null differ diff --git a/dev/js/components/menu.js b/dev/js/components/menu.js index fa5dc6a..e82c4aa 100644 --- a/dev/js/components/menu.js +++ b/dev/js/components/menu.js @@ -104,7 +104,7 @@ app.addAction("load", { }, exec(file) { if (file) { - fileAPI.load(file); + fileAPI.load(file).then(() => app.trigger("app:structure:loaded")); } } }); \ No newline at end of file diff --git a/dev/js/file-processing.js b/dev/js/file-processing.js index d6166d4..c53a5bb 100644 --- a/dev/js/file-processing.js +++ b/dev/js/file-processing.js @@ -27,7 +27,7 @@ formats.hin = { }, parse(fileStr) { - let molRE = /\n\s*mol\s+(\d+)([\s\S]+)\n\s*endmol\s+\1/g, + let molRE = /\n\s*mol\s+(\d+)([\s\S]+)\n\s*endmol\s+\1\b/g, atmRE = /^atom\s+\d+\s+.+$/gm, result = {atoms: [], bonds: []}, mol = molRE.exec(fileStr); diff --git a/dev/js/interface.js b/dev/js/interface.js index 4a74c61..88b6b7a 100644 --- a/dev/js/interface.js +++ b/dev/js/interface.js @@ -15,7 +15,7 @@ import "./components/menu.js"; import "./components/view.js"; -structure.on("app:structure:loaded", () => { +app.on("app:structure:loaded", () => { document.title = `${structure.structure.name} - Open evolver`; }); diff --git a/dev/js/structure.js b/dev/js/structure.js index 145eeaa..4228800 100644 --- a/dev/js/structure.js +++ b/dev/js/structure.js @@ -109,7 +109,6 @@ let structureUtils = Object.assign(new Observer(), { } this.trigger("updateStructure", rescanAtoms !== false); if (fromWorker !== true) { - app.trigger("app:structure:loaded"); syncWorker(); } }, diff --git a/dev/js/worker.js b/dev/js/worker.js index 9a650ce..9945f7f 100644 --- a/dev/js/worker.js +++ b/dev/js/worker.js @@ -1,31 +1,31 @@ import Observer from "./observer.js"; import app from "./app.js"; -let calcWorker = new Worker("js/calc.js"); +let worker = new Worker("js/calc.js"); let blockingMethod = "ready"; app.busy = true; // calc worker needs some initialization before it can be used -let worker = Object.assign(new Observer(), { +let workerHelper = Object.assign(new Observer(), { invoke(method, data) { if (blockingMethod) { throw new Error(`Unable to run the method “${method}” as the blocking method “${blockingMethod}” is still running`); } blockingMethod = method; app.busy = true; // note that every worker invocation turns the application into busy state - calcWorker.postMessage({method, data}); + worker.postMessage({method, data}); } }); -calcWorker.addEventListener("message", ({data: {method, data} = {}}) => { +worker.addEventListener("message", ({data: {method, data} = {}}) => { if (method) { if (method === blockingMethod) { app.busy = false; blockingMethod = null; } - worker.trigger(method, data); + workerHelper.trigger(method, data); } }); -calcWorker.addEventListener("error", e => {throw e;}); +worker.addEventListener("error", e => {throw e;}); -export default worker; \ No newline at end of file +export default workerHelper; \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 50e4e52..87cd39b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,8 +14,7 @@ gulp.task("dependencies", () => { let deps = [ "node_modules/jquery/dist/jquery.min.js", "node_modules/systemjs/dist/system.js", - "node_modules/three/build/three.min.js", - "node_modules/normalize.css/normalize.css" + "node_modules/three/build/three.min.js" ]; return gulp.src(deps).pipe(gulp.dest("vendor/")); }); diff --git a/package.json b/package.json index f60e6a1..168a55b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-evolver", - "version": "2.0.0", + "version": "2.0.1", "description": "Modeling quantum evolution at the nanoscale", "author": "Amphiluke", "scripts": { @@ -32,6 +32,6 @@ "lodash": "^4.17.2", "normalize.css": "^5.0.0", "systemjs": "^0.19.41", - "three": "^0.82.1" + "three": "^0.83.0" } }