Ver Fonte

wip, expose structure-viewer for npm install use

Alexander Rose há 5 anos atrás
pai
commit
79c78db6b9
3 ficheiros alterados com 20 adições e 3 exclusões
  1. 6 1
      package.json
  2. 11 0
      src/index.ts
  3. 3 2
      src/structure-viewer/index.html

+ 6 - 1
package.json

@@ -24,8 +24,13 @@
         "serve": "http-server -p 1335",
         "preversion": "npm run test",
         "postversion": "git push && git push --tags",
-        "prepublishOnly": "npm run test && npm run build"
+        "prepublishOnly": "npm run test && npm run build",
+        "prepare": "npm run build"
     },
+    "main": "build/src/index.js",
+    "files": [
+        "build/dist/"
+    ],
     "author": "RCSB PDB and Mol* Contributors",
     "license": "MIT",
     "devDependencies": {

+ 11 - 0
src/index.ts

@@ -0,0 +1,11 @@
+/**
+ * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
+ *
+ * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ */
+
+import * as path from 'path'
+
+export const getStructureViewerAbsoluteFSPath = function () {
+    return path.resolve(path.join(__dirname, '..', 'dist', 'structure-viewer'))
+}

+ 3 - 2
src/structure-viewer/index.html

@@ -25,8 +25,8 @@
 
             #menu {
                 position: absolute;
-                left: 100px;
-                top: 50px;
+                left: 5%;
+                top: 20px;
             }
 
             #menu > select {
@@ -57,6 +57,7 @@
             else if (url) viewer.loadUrl(url, assemblyId);
         </script>
         <div id="menu">
+            <h2> RCSB PDB Mol* Viewer - Test Page</h2>
             Examples
             <select id="examples" onchange="viewer.loadPdbId(this.value)">
                 <option value=''></option>