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
a545296b
Commit
a545296b
authored
Apr 15, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved getFile, setFile and switchFile to new API
parent
0e7e1e5f
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
18 additions
and
20 deletions
+18
-20
app.js
src/app.js
+1
-1
contextView.js
src/app/editor/contextView.js
+1
-1
sourceHighlighter.js
src/app/editor/sourceHighlighter.js
+1
-1
file-explorer.js
src/app/files/file-explorer.js
+2
-2
fileManager.js
src/app/files/fileManager.js
+6
-7
tab-proxy.js
src/app/panels/tab-proxy.js
+2
-2
recorder.js
src/app/tabs/runTab/model/recorder.js
+1
-1
testTab.js
src/app/tabs/testTab/testTab.js
+1
-1
renderer.js
src/app/ui/renderer.js
+1
-1
tooltip.js
src/app/ui/tooltip.js
+0
-1
cmdInterpreterAPI.js
src/lib/cmdInterpreterAPI.js
+2
-2
No files found.
src/app.js
View file @
a545296b
...
@@ -419,7 +419,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -419,7 +419,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
if
(
error
)
console
.
error
(
error
)
if
(
error
)
console
.
error
(
error
)
if
(
Object
.
keys
(
filesList
).
length
===
0
)
{
if
(
Object
.
keys
(
filesList
).
length
===
0
)
{
for
(
let
file
in
examples
)
{
for
(
let
file
in
examples
)
{
fileManager
.
set
File
(
examples
[
file
].
name
,
examples
[
file
].
content
)
fileManager
.
write
File
(
examples
[
file
].
name
,
examples
[
file
].
content
)
}
}
}
}
})
})
...
...
src/app/editor/contextView.js
View file @
a545296b
...
@@ -112,7 +112,7 @@ class ContextView {
...
@@ -112,7 +112,7 @@ class ContextView {
if
(
provider
)
{
if
(
provider
)
{
provider
.
exists
(
filename
,
(
error
,
exist
)
=>
{
provider
.
exists
(
filename
,
(
error
,
exist
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
error
)
return
console
.
log
(
error
)
this
.
_deps
.
fileManager
.
switchFile
(
filename
)
this
.
_deps
.
fileManager
.
open
(
filename
)
jumpToLine
(
lineColumn
)
jumpToLine
(
lineColumn
)
})
})
}
}
...
...
src/app/editor/sourceHighlighter.js
View file @
a545296b
...
@@ -40,7 +40,7 @@ class SourceHighlighter {
...
@@ -40,7 +40,7 @@ class SourceHighlighter {
if
(
lineColumnPos
)
{
if
(
lineColumnPos
)
{
this
.
source
=
filePath
this
.
source
=
filePath
if
(
this
.
_deps
.
config
.
get
(
'currentFile'
)
!==
this
.
source
)
{
if
(
this
.
_deps
.
config
.
get
(
'currentFile'
)
!==
this
.
source
)
{
this
.
_deps
.
fileManager
.
switchFile
(
this
.
source
)
this
.
_deps
.
fileManager
.
open
(
this
.
source
)
}
}
const
css
=
csjs
`
const
css
=
csjs
`
...
...
src/app/files/file-explorer.js
View file @
a545296b
...
@@ -60,7 +60,7 @@ function fileExplorer (localRegistry, files, menuItems) {
...
@@ -60,7 +60,7 @@ function fileExplorer (localRegistry, files, menuItems) {
}
}
self
.
events
.
register
(
'focus'
,
function
(
path
)
{
self
.
events
.
register
(
'focus'
,
function
(
path
)
{
self
.
_deps
.
fileManager
.
switchFile
(
path
)
self
.
_deps
.
fileManager
.
open
(
path
)
})
})
self
.
_components
.
registry
.
put
({
api
:
self
,
name
:
`fileexplorer/
${
self
.
files
.
type
}
`
})
self
.
_components
.
registry
.
put
({
api
:
self
,
name
:
`fileexplorer/
${
self
.
files
.
type
}
`
})
...
@@ -584,7 +584,7 @@ fileExplorer.prototype.createNewFile = function (parentFolder = 'browser') {
...
@@ -584,7 +584,7 @@ fileExplorer.prototype.createNewFile = function (parentFolder = 'browser') {
if
(
!
self
.
files
.
set
(
newName
,
''
))
{
if
(
!
self
.
files
.
set
(
newName
,
''
))
{
tooltip
(
'Failed to create file '
+
newName
)
tooltip
(
'Failed to create file '
+
newName
)
}
else
{
}
else
{
self
.
_deps
.
fileManager
.
switchFile
(
newName
)
self
.
_deps
.
fileManager
.
open
(
newName
)
if
(
newName
.
includes
(
'_test.sol'
))
{
if
(
newName
.
includes
(
'_test.sol'
))
{
self
.
events
.
trigger
(
'newTestFileCreated'
,
[
newName
])
self
.
events
.
trigger
(
'newTestFileCreated'
,
[
newName
])
}
}
...
...
src/app/files/fileManager.js
View file @
a545296b
...
@@ -23,7 +23,7 @@ const profile = {
...
@@ -23,7 +23,7 @@ const profile = {
icon
:
'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4='
,
icon
:
'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB3aWR0aD0iMTc5MiIgaGVpZ2h0PSIxNzkyIiB2aWV3Qm94PSIwIDAgMTc5MiAxNzkyIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0xNjk2IDM4NHE0MCAwIDY4IDI4dDI4IDY4djEyMTZxMCA0MC0yOCA2OHQtNjggMjhoLTk2MHEtNDAgMC02OC0yOHQtMjgtNjh2LTI4OGgtNTQ0cS00MCAwLTY4LTI4dC0yOC02OHYtNjcycTAtNDAgMjAtODh0NDgtNzZsNDA4LTQwOHEyOC0yOCA3Ni00OHQ4OC0yMGg0MTZxNDAgMCA2OCAyOHQyOCA2OHYzMjhxNjgtNDAgMTI4LTQwaDQxNnptLTU0NCAyMTNsLTI5OSAyOTloMjk5di0yOTl6bS02NDAtMzg0bC0yOTkgMjk5aDI5OXYtMjk5em0xOTYgNjQ3bDMxNi0zMTZ2LTQxNmgtMzg0djQxNnEwIDQwLTI4IDY4dC02OCAyOGgtNDE2djY0MGg1MTJ2LTI1NnEwLTQwIDIwLTg4dDQ4LTc2em05NTYgODA0di0xMTUyaC0zODR2NDE2cTAgNDAtMjggNjh0LTY4IDI4aC00MTZ2NjQwaDg5NnoiLz48L3N2Zz4='
,
permission
:
true
,
permission
:
true
,
version
:
packageJson
.
version
,
version
:
packageJson
.
version
,
methods
:
[
'
setFile'
,
'switchFile'
,
'
file'
,
'exists'
,
'open'
,
'writeFile'
,
'readFile'
,
'copyFile'
,
'unlink'
,
'rename'
,
'readdir'
,
'rmdir'
],
methods
:
[
'file'
,
'exists'
,
'open'
,
'writeFile'
,
'readFile'
,
'copyFile'
,
'unlink'
,
'rename'
,
'readdir'
,
'rmdir'
],
kind
:
'file-system'
kind
:
'file-system'
}
}
...
@@ -76,7 +76,7 @@ class FileManager extends Plugin {
...
@@ -76,7 +76,7 @@ class FileManager extends Plugin {
}
}
/**
/**
* Emit error based on error code
* Emit
s
error based on error code
* @param {object} error error { code, message }
* @param {object} error error { code, message }
*/
*/
_handleError
(
error
)
{
_handleError
(
error
)
{
...
@@ -129,10 +129,9 @@ class FileManager extends Plugin {
...
@@ -129,10 +129,9 @@ class FileManager extends Plugin {
* @returns {boolean} true if path is a file.
* @returns {boolean} true if path is a file.
*/
*/
isFile
(
path
)
{
isFile
(
path
)
{
const
extension
=
path
.
split
(
'.'
).
pop
()
const
extension
=
path
.
split
(
'/'
).
pop
()
const
splitExtension
=
extension
.
split
(
'/'
)
return
extension
&&
extension
.
indexOf
(
'.'
)
>
-
1
return
!!
extension
&&
splitExtension
.
length
===
1
&&
splitExtension
[
0
]
===
extension
}
}
/**
/**
...
@@ -165,7 +164,7 @@ class FileManager extends Plugin {
...
@@ -165,7 +164,7 @@ class FileManager extends Plugin {
readFile
(
path
)
{
readFile
(
path
)
{
this
.
_handleExists
(
path
,
`Cannot read file
${
path
}
`
)
this
.
_handleExists
(
path
,
`Cannot read file
${
path
}
`
)
this
.
_handleIsFile
(
path
,
`Cannot read file
${
path
}
`
)
this
.
_handleIsFile
(
path
,
`Cannot read file
${
path
}
`
)
this
.
getFile
(
path
)
return
this
.
getFile
(
path
)
}
}
/**
/**
...
...
src/app/panels/tab-proxy.js
View file @
a545296b
...
@@ -34,7 +34,7 @@ export class TabProxy {
...
@@ -34,7 +34,7 @@ export class TabProxy {
return
return
}
}
this
.
addTab
(
file
,
''
,
()
=>
{
this
.
addTab
(
file
,
''
,
()
=>
{
this
.
fileManager
.
switchFile
(
file
)
this
.
fileManager
.
open
(
file
)
this
.
event
.
emit
(
'switchFile'
,
file
)
this
.
event
.
emit
(
'switchFile'
,
file
)
},
},
()
=>
{
()
=>
{
...
@@ -47,7 +47,7 @@ export class TabProxy {
...
@@ -47,7 +47,7 @@ export class TabProxy {
if
(
isFolder
)
return
if
(
isFolder
)
return
// should change the tab title too
// should change the tab title too
this
.
addTab
(
newName
,
''
,
()
=>
{
this
.
addTab
(
newName
,
''
,
()
=>
{
this
.
fileManager
.
switchFile
(
newName
)
this
.
fileManager
.
open
(
newName
)
this
.
event
.
emit
(
'switchFile'
,
newName
)
this
.
event
.
emit
(
'switchFile'
,
newName
)
},
},
()
=>
{
()
=>
{
...
...
src/app/tabs/runTab/model/recorder.js
View file @
a545296b
...
@@ -319,7 +319,7 @@ class Recorder {
...
@@ -319,7 +319,7 @@ class Recorder {
helper
.
createNonClashingName
(
newFile
,
fileProvider
,
(
error
,
newFile
)
=>
{
helper
.
createNonClashingName
(
newFile
,
fileProvider
,
(
error
,
newFile
)
=>
{
if
(
error
)
return
cb
(
'Failed to create file. '
+
newFile
+
' '
+
error
)
if
(
error
)
return
cb
(
'Failed to create file. '
+
newFile
+
' '
+
error
)
if
(
!
fileProvider
.
set
(
newFile
,
txJSON
))
return
cb
(
'Failed to create file '
+
newFile
)
if
(
!
fileProvider
.
set
(
newFile
,
txJSON
))
return
cb
(
'Failed to create file '
+
newFile
)
this
.
fileManager
.
switchFile
(
newFile
)
this
.
fileManager
.
open
(
newFile
)
})
})
})
})
}
}
...
...
src/app/tabs/testTab/testTab.js
View file @
a545296b
...
@@ -19,7 +19,7 @@ class TestTabLogic {
...
@@ -19,7 +19,7 @@ class TestTabLogic {
// This should be updated to pass complete path, if test file comes from different directory/path
// This should be updated to pass complete path, if test file comes from different directory/path
const
fileNameToImport
=
splittedFileName
[
splittedFileName
.
length
-
1
]
const
fileNameToImport
=
splittedFileName
[
splittedFileName
.
length
-
1
]
if
(
!
fileProvider
.
set
(
newFile
,
this
.
generateTestContractSample
(
fileNameToImport
)))
return
modalDialogCustom
.
alert
(
'Failed to create test file '
+
newFile
)
if
(
!
fileProvider
.
set
(
newFile
,
this
.
generateTestContractSample
(
fileNameToImport
)))
return
modalDialogCustom
.
alert
(
'Failed to create test file '
+
newFile
)
this
.
fileManager
.
switchFile
(
newFile
)
this
.
fileManager
.
open
(
newFile
)
})
})
}
}
...
...
src/app/ui/renderer.js
View file @
a545296b
...
@@ -41,7 +41,7 @@ Renderer.prototype._errorClick = function (errFile, errLine, errCol) {
...
@@ -41,7 +41,7 @@ Renderer.prototype._errorClick = function (errFile, errLine, errCol) {
if
(
provider
)
{
if
(
provider
)
{
provider
.
exists
(
errFile
,
(
error
,
exist
)
=>
{
provider
.
exists
(
errFile
,
(
error
,
exist
)
=>
{
if
(
error
)
return
console
.
log
(
error
)
if
(
error
)
return
console
.
log
(
error
)
self
.
_deps
.
fileManager
.
switchFile
(
errFile
)
self
.
_deps
.
fileManager
.
open
(
errFile
)
editor
.
gotoLine
(
errLine
,
errCol
)
editor
.
gotoLine
(
errLine
,
errCol
)
})
})
}
}
...
...
src/app/ui/tooltip.js
View file @
a545296b
...
@@ -34,7 +34,6 @@ class Toaster {
...
@@ -34,7 +34,6 @@ class Toaster {
}
}
render
(
tooltipText
,
actionElement
,
opts
)
{
render
(
tooltipText
,
actionElement
,
opts
)
{
console
.
log
(
'tooltipText: '
,
tooltipText
)
opts
=
defaultOptions
(
opts
)
opts
=
defaultOptions
(
opts
)
let
canShorten
=
true
let
canShorten
=
true
if
(
tooltipText
instanceof
Element
)
{
if
(
tooltipText
instanceof
Element
)
{
...
...
src/lib/cmdInterpreterAPI.js
View file @
a545296b
...
@@ -151,7 +151,7 @@ class CmdInterpreterAPI {
...
@@ -151,7 +151,7 @@ class CmdInterpreterAPI {
toolTip
(
`Unable to load
${
url
}
:
${
err
}
`
)
toolTip
(
`Unable to load
${
url
}
:
${
err
}
`
)
if
(
cb
)
cb
(
err
)
if
(
cb
)
cb
(
err
)
}
else
{
}
else
{
self
.
_deps
.
fileManager
.
set
File
(
type
+
'/'
+
cleanUrl
,
content
)
self
.
_deps
.
fileManager
.
write
File
(
type
+
'/'
+
cleanUrl
,
content
)
try
{
try
{
content
=
JSON
.
parse
(
content
)
content
=
JSON
.
parse
(
content
)
async
.
eachOfSeries
(
content
.
sources
,
(
value
,
file
,
callbackSource
)
=>
{
async
.
eachOfSeries
(
content
.
sources
,
(
value
,
file
,
callbackSource
)
=>
{
...
@@ -164,7 +164,7 @@ class CmdInterpreterAPI {
...
@@ -164,7 +164,7 @@ class CmdInterpreterAPI {
return
callbackSource
(
`Cannot retrieve the content of
${
url
}
:
${
error
}
`
)
return
callbackSource
(
`Cannot retrieve the content of
${
url
}
:
${
error
}
`
)
}
else
{
}
else
{
try
{
try
{
await
self
.
_deps
.
fileManager
.
set
File
(
type
+
'/'
+
cleanUrl
,
content
)
await
self
.
_deps
.
fileManager
.
write
File
(
type
+
'/'
+
cleanUrl
,
content
)
callbackSource
()
callbackSource
()
}
catch
(
e
)
{
}
catch
(
e
)
{
callbackSource
(
e
.
message
)
callbackSource
(
e
.
message
)
...
...
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