|
|
@ -1,28 +1,22 @@ |
|
|
|
var yo = require('yo-yo') |
|
|
|
var yo = require('yo-yo') |
|
|
|
var css = require('./styles/plugin-tab-styles') |
|
|
|
var css = require('./styles/plugin-tab-styles') |
|
|
|
|
|
|
|
|
|
|
|
var globalRegistry = require('../../global/registry') |
|
|
|
|
|
|
|
var EventManager = require('../../lib/events') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PluginTab { |
|
|
|
class PluginTab { |
|
|
|
|
|
|
|
|
|
|
|
constructor (json, localRegistry) { |
|
|
|
constructor (json) { |
|
|
|
this.event = new EventManager() |
|
|
|
this.el = null |
|
|
|
this._view = { el: null } |
|
|
|
|
|
|
|
this.data = { json } |
|
|
|
this.data = { json } |
|
|
|
this._components = {} |
|
|
|
|
|
|
|
this._components.registry = localRegistry || globalRegistry |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
render () { |
|
|
|
render () { |
|
|
|
if (this._view.el) return this._view.el |
|
|
|
if (this.el) return this.el |
|
|
|
|
|
|
|
|
|
|
|
this._view.el = yo` |
|
|
|
this.el = yo` |
|
|
|
<div class="${css.pluginTabView}" id="pluginView"> |
|
|
|
<div class="${css.pluginTabView}" id="pluginView"> |
|
|
|
<iframe class="${css.iframe}" src="${this.data.json.url}/index.html"></iframe> |
|
|
|
<iframe class="${css.iframe}" src="${this.data.json.url}/index.html"></iframe> |
|
|
|
</div>` |
|
|
|
</div>` |
|
|
|
|
|
|
|
|
|
|
|
return this._view.el |
|
|
|
return this.el |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|