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
ea30e7f9
Commit
ea30e7f9
authored
Apr 11, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove ediorContent && currentFile
parent
eea2aad6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
19 deletions
+21
-19
app.js
src/app.js
+3
-8
editor.js
src/app/editor/editor.js
+13
-6
run-tab.js
src/app/tabs/run-tab.js
+5
-5
No files found.
src/app.js
View file @
ea30e7f9
...
@@ -698,7 +698,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -698,7 +698,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
// ---------------- Righthand-panel --------------------
// ---------------- Righthand-panel --------------------
var
rhpAPI
=
{
var
rhpAPI
=
{
config
:
config
,
setEditorSize
(
delta
)
{
setEditorSize
(
delta
)
{
$
(
'#righthand-panel'
).
css
(
'width'
,
delta
)
$
(
'#righthand-panel'
).
css
(
'width'
,
delta
)
self
.
_view
.
centerpanel
.
style
.
right
=
delta
+
'px'
self
.
_view
.
centerpanel
.
style
.
right
=
delta
+
'px'
...
@@ -708,12 +707,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -708,12 +707,6 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
getSource
:
(
fileName
)
=>
{
getSource
:
(
fileName
)
=>
{
return
compiler
.
getSource
(
fileName
)
return
compiler
.
getSource
(
fileName
)
},
},
editorContent
:
()
=>
{
return
editor
.
get
(
editor
.
current
())
},
currentFile
:
()
=>
{
return
config
.
get
(
'currentFile'
)
},
visitContracts
:
(
cb
)
=>
{
visitContracts
:
(
cb
)
=>
{
compiler
.
visitContracts
(
cb
)
compiler
.
visitContracts
(
cb
)
},
},
...
@@ -772,7 +765,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -772,7 +765,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
udapp
:
udapp
,
udapp
:
udapp
,
udappUI
:
udappUI
,
udappUI
:
udappUI
,
compiler
:
compiler
,
compiler
:
compiler
,
renderer
:
renderer
renderer
:
renderer
,
editor
:
editor
,
config
:
config
}
}
self
.
_components
.
righthandpanel
=
new
RighthandPanel
(
rhpAPI
,
rhpEvents
,
rhpOpts
)
self
.
_components
.
righthandpanel
=
new
RighthandPanel
(
rhpAPI
,
rhpEvents
,
rhpOpts
)
...
...
src/app/editor/editor.js
View file @
ea30e7f9
...
@@ -170,17 +170,25 @@ function Editor (opts = {}) {
...
@@ -170,17 +170,25 @@ function Editor (opts = {}) {
}
}
/**
/**
* returns the content of the specified session @arg path
* returns the content of the current session
* if @arg path is not provided, the content of the current editing session is returned
*
* @return {String} content of the file referenced by @arg path
*/
this
.
currentContent
=
function
()
{
return
this
.
get
(
this
.
current
())
}
/**
* returns the content of the session targeted by @arg path
* if @arg path is null, the content of the current session is returned
*
*
* @param {String} path - path of th file in edition
* @return {String} content of the file referenced by @arg path
* @return {String} content of the file referenced by @arg path
*/
*/
this
.
get
=
function
(
path
)
{
this
.
get
=
function
(
path
)
{
if
(
!
path
||
currentSession
===
path
)
{
if
(
!
path
||
currentSession
===
path
)
{
return
editor
.
getValue
()
return
editor
.
getValue
()
}
else
if
(
sessions
[
path
])
{
}
else
if
(
sessions
[
path
])
{
sessions
[
path
].
getValue
()
return
sessions
[
path
].
getValue
()
}
}
}
}
...
@@ -188,8 +196,7 @@ function Editor (opts = {}) {
...
@@ -188,8 +196,7 @@ function Editor (opts = {}) {
* returns the path of the currently editing file
* returns the path of the currently editing file
* returns `undefined` if no session is being editer
* returns `undefined` if no session is being editer
*
*
* @param {String} path - path of th file in edition
* @return {String} path of the current session
* @return {String} content of the file referenced by @arg path
*/
*/
this
.
current
=
function
()
{
this
.
current
=
function
()
{
if
(
editor
.
getSession
()
===
emptySession
)
{
if
(
editor
.
getSession
()
===
emptySession
)
{
...
...
src/app/tabs/run-tab.js
View file @
ea30e7f9
...
@@ -240,7 +240,7 @@ function makeRecorder (appAPI, appEvents, opts, self) {
...
@@ -240,7 +240,7 @@ function makeRecorder (appAPI, appEvents, opts, self) {
update account address in scenario.json
update account address in scenario.json
popup if scenario.json not open - "Open a file with transactions you want to replay and click play again"
popup if scenario.json not open - "Open a file with transactions you want to replay and click play again"
*/
*/
var
currentFile
=
appAPI
.
config
.
get
(
'currentFile'
)
var
currentFile
=
opts
.
config
.
get
(
'currentFile'
)
appAPI
.
fileProviderOf
(
currentFile
).
get
(
currentFile
,
(
error
,
json
)
=>
{
appAPI
.
fileProviderOf
(
currentFile
).
get
(
currentFile
,
(
error
,
json
)
=>
{
if
(
error
)
{
if
(
error
)
{
modalDialogCustom
.
alert
(
'Invalid Scenario File '
+
error
)
modalDialogCustom
.
alert
(
'Invalid Scenario File '
+
error
)
...
@@ -319,7 +319,7 @@ function contractDropdown (events, appAPI, appEvents, opts, self) {
...
@@ -319,7 +319,7 @@ function contractDropdown (events, appAPI, appEvents, opts, self) {
${
createPanel
}
${
createPanel
}
<div class="
${
css
.
button
}
">
<div class="
${
css
.
button
}
">
${
atAddressButtonInput
}
${
atAddressButtonInput
}
<div class="
${
css
.
atAddress
}
" onclick=
${
function
()
{
loadFromAddress
(
appAPI
)
}
}>Acc
ess</div>
<div class="
${
css
.
atAddress
}
" onclick=
${
function
()
{
loadFromAddress
(
opts
.
editor
,
opts
.
config
)
}
}>At Addr
ess</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -384,7 +384,7 @@ function contractDropdown (events, appAPI, appEvents, opts, self) {
...
@@ -384,7 +384,7 @@ function contractDropdown (events, appAPI, appEvents, opts, self) {
}
}
// ACCESS DEPLOYED INSTANCE
// ACCESS DEPLOYED INSTANCE
function
loadFromAddress
(
appAPI
)
{
function
loadFromAddress
(
editor
,
config
)
{
var
noInstancesText
=
self
.
_view
.
noInstancesText
var
noInstancesText
=
self
.
_view
.
noInstancesText
if
(
noInstancesText
.
parentNode
)
{
noInstancesText
.
parentNode
.
removeChild
(
noInstancesText
)
}
if
(
noInstancesText
.
parentNode
)
{
noInstancesText
.
parentNode
.
removeChild
(
noInstancesText
)
}
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
var
contractNames
=
document
.
querySelector
(
`.
${
css
.
contractNames
.
classNames
[
0
]}
`
)
...
@@ -395,11 +395,11 @@ function contractDropdown (events, appAPI, appEvents, opts, self) {
...
@@ -395,11 +395,11 @@ function contractDropdown (events, appAPI, appEvents, opts, self) {
if
(
/
[
a-f
]
/
.
test
(
address
)
&&
/
[
A-F
]
/
.
test
(
address
)
&&
!
ethJSUtil
.
isValidChecksumAddress
(
address
))
{
if
(
/
[
a-f
]
/
.
test
(
address
)
&&
/
[
A-F
]
/
.
test
(
address
)
&&
!
ethJSUtil
.
isValidChecksumAddress
(
address
))
{
return
modalDialogCustom
.
alert
(
'Invalid checksum address.'
)
return
modalDialogCustom
.
alert
(
'Invalid checksum address.'
)
}
}
if
(
/.
(
.abi
)
$/
.
exec
(
appAPI
.
currentFile
(
)))
{
if
(
/.
(
.abi
)
$/
.
exec
(
config
.
get
(
'currentFile'
)))
{
modalDialogCustom
.
confirm
(
null
,
'Do you really want to interact with '
+
address
+
' using the current ABI definition ?'
,
()
=>
{
modalDialogCustom
.
confirm
(
null
,
'Do you really want to interact with '
+
address
+
' using the current ABI definition ?'
,
()
=>
{
var
abi
var
abi
try
{
try
{
abi
=
JSON
.
parse
(
appAPI
.
editor
Content
())
abi
=
JSON
.
parse
(
editor
.
current
Content
())
}
catch
(
e
)
{
}
catch
(
e
)
{
return
modalDialogCustom
.
alert
(
'Failed to parse the current file as JSON ABI.'
)
return
modalDialogCustom
.
alert
(
'Failed to parse the current file as JSON ABI.'
)
}
}
...
...
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