Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
e1ff449b
Unverified
Commit
e1ff449b
authored
Jun 11, 2018
by
yann300
Committed by
GitHub
Jun 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1350 from ethereum/test-tab
Test tab
parents
00a94809
afb18496
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
24 deletions
+29
-24
test-tab.js
src/app/tabs/test-tab.js
+29
-24
No files found.
src/app/tabs/test-tab.js
View file @
e1ff449b
...
@@ -3,14 +3,36 @@ var async = require('async')
...
@@ -3,14 +3,36 @@ var async = require('async')
var
css
=
require
(
'./styles/test-tab-styles'
)
var
css
=
require
(
'./styles/test-tab-styles'
)
var
remixTests
=
require
(
'remix-tests'
)
var
remixTests
=
require
(
'remix-tests'
)
function
append
(
container
,
txt
)
{
module
.
exports
=
class
TestTab
{
let
child
=
yo
`<div>
${
txt
}
</div>`
constructor
(
api
=
{},
events
=
{},
opts
=
{})
{
container
.
appendChild
(
child
)
const
self
=
this
}
self
.
_opts
=
opts
self
.
_api
=
api
self
.
_events
=
events
self
.
_view
=
{
el
:
null
}
self
.
_components
=
{}
self
.
data
=
{}
function
testTabView
(
api
)
{
self
.
_view
.
el
=
self
.
render
()
events
.
app
.
register
(
'tabChanged'
,
tabName
=>
{
if
(
tabName
!==
'test'
)
return
yo
.
update
(
self
.
_view
.
el
,
self
.
render
())
self
.
_view
.
el
.
style
.
display
=
'block'
})
return
{
render
()
{
return
self
.
_view
.
el
}
}
}
render
()
{
const
self
=
this
const
api
=
self
.
_api
var
container
=
yo
`<div class="tests" id="tests"></div>`
var
container
=
yo
`<div class="tests" id="tests"></div>`
function
append
(
container
,
txt
)
{
let
child
=
yo
`<div>
${
txt
}
</div>`
container
.
appendChild
(
child
)
}
let
testCallback
=
function
(
result
)
{
let
testCallback
=
function
(
result
)
{
if
(
result
.
type
===
'contract'
)
{
if
(
result
.
type
===
'contract'
)
{
append
(
container
,
'
\
n '
+
result
.
value
)
append
(
container
,
'
\
n '
+
result
.
value
)
...
@@ -72,7 +94,7 @@ function testTabView (api) {
...
@@ -72,7 +94,7 @@ function testTabView (api) {
})
})
}
}
return
yo
`
var
el
=
yo
`
<div class="
${
css
.
testTabView
}
"id="testView">
<div class="
${
css
.
testTabView
}
"id="testView">
<div>
<div>
<div class="
${
css
.
infoBox
}
">
<div class="
${
css
.
infoBox
}
">
...
@@ -84,23 +106,6 @@ function testTabView (api) {
...
@@ -84,23 +106,6 @@ function testTabView (api) {
</div>
</div>
</div>
</div>
`
`
}
return
el
function
testTab
(
api
=
{},
events
=
{},
opts
=
{})
{
let
el
=
testTabView
(
api
)
let
gitterIsLoaded
=
false
events
.
app
.
register
(
'tabChanged'
,
(
tabName
)
=>
{
if
(
tabName
!==
'test'
||
gitterIsLoaded
)
{
return
}
}
yo
.
update
(
el
,
testTabView
(
api
))
el
.
style
.
display
=
'block'
gitterIsLoaded
=
true
})
return
{
render
()
{
return
el
}
}
}
}
module
.
exports
=
testTab
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment