-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from bioinformatics-ua/imp/zip
Capability to support web zip plugins
- Loading branch information
Showing
8 changed files
with
191 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# demo | ||
> demo | ||
This is a web UI menu plugin for Dicoogle. | ||
|
||
## Building | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
## Deploying | ||
|
||
Place `module.js` and `package.json` in a folder in the WebPlugins directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
module.exports = | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
|
||
/******/ // 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] = { | ||
/******/ exports: {}, | ||
/******/ id: moduleId, | ||
/******/ loaded: false | ||
/******/ }; | ||
|
||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | ||
|
||
/******/ // Flag the module as loaded | ||
/******/ module.loaded = 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; | ||
|
||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = ""; | ||
|
||
/******/ // Load entry module and return exports | ||
/******/ return __webpack_require__(0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ function(module, exports) { | ||
|
||
'use strict'; | ||
|
||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
|
||
/* global Dicoogle */ | ||
|
||
var MyPlugin = function () { | ||
function MyPlugin() { | ||
_classCallCheck(this, MyPlugin); | ||
} | ||
// TODO initialize plugin here | ||
|
||
/** | ||
* @param {DOMElement} parent | ||
* @param {DOMElement} slot | ||
*/ | ||
|
||
_createClass(MyPlugin, [{ | ||
key: 'render', | ||
value: function render(parent, slot) { | ||
// TODO mount a new web component here | ||
var div = document.createElement('div'); | ||
div.innerHTML = 'Hello, Dicoogle!'; | ||
parent.appendChild(div); | ||
} | ||
}]); | ||
|
||
return MyPlugin; | ||
}(); | ||
|
||
exports.default = MyPlugin; | ||
|
||
/***/ } | ||
/******/ ]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"name": "demo", | ||
"version": "0.1.0", | ||
"description": "demo", | ||
"files": [ | ||
"module.js" | ||
], | ||
"scripts": { | ||
"build": "webpack", | ||
"build-debug": "webpack --devtool inline-source-map", | ||
"prepublish": "npm run build" | ||
}, | ||
"author": "Luís A. Bastião Silva <[email protected]>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "bastiao/demo" | ||
}, | ||
"keywords": [ | ||
"dicoogle", | ||
"dicoogle-plugin" | ||
], | ||
"dicoogle": { | ||
"slot-id": "menu", | ||
"caption": "Webplugin-Sample", | ||
"module-file": "module.js" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.4.0", | ||
"babel-loader": "^6.2.1", | ||
"babel-preset-es2015": "^6.3.13", | ||
"webpack": "^1.12.11" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* global Dicoogle */ | ||
|
||
export default class MyPlugin { | ||
|
||
constructor() { | ||
// TODO initialize plugin here | ||
} | ||
|
||
/** | ||
* @param {DOMElement} parent | ||
* @param {DOMElement} slot | ||
*/ | ||
render(parent, slot) { | ||
// TODO mount a new web component here | ||
const div = document.createElement('div'); | ||
div.innerHTML = 'Hello, Dicoogle!'; | ||
parent.appendChild(div); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
entry: './src/index.js', | ||
output: { | ||
filename: 'module.js', | ||
libraryTarget: 'commonjs2' | ||
}, | ||
module: { | ||
loaders: [ | ||
{ | ||
test: /src\/.*\.js?$/, | ||
exclude: /node_modules/, | ||
loader: 'babel', | ||
query: { | ||
presets: ['es2015'] | ||
} | ||
} | ||
] | ||
}, | ||
externals: ['react', 'dicoogle-client', 'dicoole-webcore'] | ||
}; |