Add: Sources tool

This commit is contained in:
surunzi
2016-05-06 21:59:48 +08:00
parent a6fe4468b8
commit b7e64d0002
5 changed files with 66 additions and 0 deletions

40
src/Sources/Sources.es6 Normal file
View File

@@ -0,0 +1,40 @@
import Tool from '../DevTools/Tool.es6'
require('./Sources.scss');
export default class Sources extends Tool
{
constructor()
{
super();
this.name = 'sources';
this._data = {
type: ''
};
this._loadTpl();
}
init($el)
{
super.init($el);
this._render();
}
set(data)
{
this._data = data;
}
_loadTpl()
{
this._emptyTpl = require('./empty.hbs');
}
_render()
{
var data = this._data;
var tpl = this._emptyTpl;
this._$el.html(tpl(data));
}
}

18
src/Sources/Sources.scss Normal file
View File

@@ -0,0 +1,18 @@
@import "../variable";
.dev-tools { .tools {
.sources {
.empty {
width: 100%;
height: 100%;
.content {
position: absolute;
top: 50%;
left: 0;
width: 100%;
text-align: center;
transform: translate3d(0, -50%, 0);
}
}
}
} }

0
src/Sources/Sourees.hbs Normal file
View File

5
src/Sources/empty.hbs Normal file
View File

@@ -0,0 +1,5 @@
<div class="eruda-empty">
<div class="eruda-content">
Used for displaying html, javaScript, css and image.
</div>
</div>

View File

@@ -7,6 +7,7 @@ import Snippets from './Snippets/Snippets.es6'
import Resources from './Resources/Resources.es6'
import Info from './Info/Info.es6'
import Features from './Features/Features.es6'
import Sources from './Sources/Sources.es6'
import Settings from './Settings/Settings.es6'
import util from './lib/util'
import config from './lib/config.es6'
@@ -31,6 +32,7 @@ var consoleTool = new Console(),
snippets = new Snippets(),
resources = new Resources(),
info = new Info(),
sources = new Sources(),
features = new Features(),
settings = new Settings();
@@ -40,6 +42,7 @@ devTools.add(consoleTool)
.add(resources)
.add(info)
.add(snippets)
.add(sources)
.add(features)
.add(settings)
.showTool('console');