mirror of
https://github.com/liriliri/eruda.git
synced 2026-04-17 10:58:36 +08:00
Add: Sources tool
This commit is contained in:
40
src/Sources/Sources.es6
Normal file
40
src/Sources/Sources.es6
Normal 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
18
src/Sources/Sources.scss
Normal 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
0
src/Sources/Sourees.hbs
Normal file
5
src/Sources/empty.hbs
Normal file
5
src/Sources/empty.hbs
Normal file
@@ -0,0 +1,5 @@
|
||||
<div class="eruda-empty">
|
||||
<div class="eruda-content">
|
||||
Used for displaying html, javaScript, css and image.
|
||||
</div>
|
||||
</div>
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user