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
444d6808
Commit
444d6808
authored
Dec 09, 2019
by
LianaHus
Committed by
Liana Husikyan
Dec 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unregistered listeners
parent
137966a4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
15 deletions
+31
-15
file-explorer.js
src/app/files/file-explorer.js
+5
-7
fileManager.js
src/app/files/fileManager.js
+2
-2
compile-tab.js
src/app/tabs/compile-tab.js
+11
-0
compilerContainer.js
src/app/tabs/compileTab/compilerContainer.js
+10
-3
contextMenu.js
src/app/ui/contextMenu.js
+3
-3
No files found.
src/app/files/file-explorer.js
View file @
444d6808
...
...
@@ -209,19 +209,17 @@ function fileExplorer (localRegistry, files, menuItems) {
const
provider
=
self
.
_deps
.
fileManager
.
fileProviderOf
(
key
)
actions
[
'Create File'
]
=
()
=>
self
.
createNewFile
(
key
)
actions
[
'Create Folder'
]
=
()
=>
self
.
createNewFolder
(
key
)
// todo not fully implemented. Readd later when fixed
// https://github.com/ethereum/remix-ide/issues/2386
/* if (provider.isExternalFolder(key)) {
actions['Discard changes'] = () => {
// @todo(#2386) not fully implemented. Readd later when fixed
if
(
provider
.
isExternalFolder
(
key
))
{
/* actions['Discard changes'] = () => {
modalDialogCustom.confirm(
'Discard changes',
'Are you sure you want to discard all your changes?',
() => { self.files.discardChanges(key) },
() => {}
)
}
} else { */
if
(
!
provider
.
isExternalFolder
(
key
))
{
} */
}
else
{
const
folderPath
=
extractExternalFolder
(
key
)
actions
[
'Rename'
]
=
()
=>
{
if
(
self
.
files
.
isReadOnly
(
key
))
{
return
tooltip
(
'cannot rename folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
...
...
src/app/files/fileManager.js
View file @
444d6808
...
...
@@ -59,8 +59,8 @@ class FileManager extends Plugin {
}
fileChangedEvent
(
path
)
{
//
todo.
use only for discard changes function.
//this.syncEditor(path)
//
@todo(#2386)
use only for discard changes function.
//
this.syncEditor(path)
}
fileRenamedEvent
(
oldName
,
newName
,
isFolder
)
{
...
...
src/app/tabs/compile-tab.js
View file @
444d6808
...
...
@@ -457,6 +457,17 @@ class CompileTab extends ViewPlugin {
return
this
.
_view
.
el
}
onDeactivation
()
{
this
.
compilerContainer
.
deactivate
()
this
.
editor
.
event
.
unregister
(
'contentChanged'
)
this
.
compiler
.
event
.
unregister
(
'loadingCompiler'
)
this
.
compiler
.
event
.
unregister
(
'compilerLoaded'
)
this
.
compileTabLogic
.
event
.
off
(
'startingCompilation'
)
this
.
fileManager
.
events
.
off
(
'currentFileChanged'
)
this
.
fileManager
.
events
.
off
(
'noFileSelected'
)
this
.
compiler
.
event
.
unregister
(
'compilationFinished'
)
globalRegistry
.
get
(
'themeModule'
).
api
.
events
.
off
(
'themeChanged'
)
}
}
module
.
exports
=
CompileTab
src/app/tabs/compileTab/compilerContainer.js
View file @
444d6808
...
...
@@ -42,6 +42,9 @@ class CompilerContainer {
}
deactivate
()
{
// deactivate editor listeners
this
.
editor
.
event
.
unregister
(
'contentChanged'
)
this
.
editor
.
event
.
unregister
(
'sessionSwitched'
)
}
activate
()
{
...
...
@@ -50,8 +53,10 @@ class CompilerContainer {
}
listenToEvents
()
{
this
.
editor
.
event
.
register
(
'contentChanged'
,
this
.
scheduleCompilation
.
bind
(
this
))
this
.
editor
.
event
.
register
(
'sessionSwitched'
,
this
.
scheduleCompilation
.
bind
(
this
))
this
.
editor
.
event
.
register
(
'sessionSwitched'
,
()
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
this
.
scheduleCompilation
()
})
this
.
compileTabLogic
.
event
.
on
(
'startingCompilation'
,
()
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
...
...
@@ -73,6 +78,7 @@ class CompilerContainer {
this
.
editor
.
event
.
register
(
'contentChanged'
,
()
=>
{
if
(
!
this
.
_view
.
compileIcon
)
return
this
.
scheduleCompilation
.
bind
(
this
)
this
.
_view
.
compileIcon
.
classList
.
add
(
`
${
css
.
bouncingIcon
}
`
)
// @TODO: compileView tab
})
...
...
@@ -131,12 +137,13 @@ class CompilerContainer {
// Load solc compiler version according to pragma in contract file
_setCompilerVersionFromPragma
(
filename
)
{
if
(
!
this
.
data
.
allversions
)
return
this
.
compileTabLogic
.
fileManager
.
getFile
(
filename
).
then
(
data
=>
{
const
pragmaArr
=
data
.
match
(
/
(
pragma solidity
(
.+
?)
;
)
/g
)
if
(
pragmaArr
&&
pragmaArr
.
length
===
1
)
{
const
pragmaStr
=
pragmaArr
[
0
].
replace
(
'pragma solidity'
,
''
).
trim
()
const
pragma
=
pragmaStr
.
substring
(
0
,
pragmaStr
.
length
-
1
)
const
releasedVersions
=
(
this
.
data
.
allversions
)
?
this
.
data
.
allversions
.
filter
(
obj
=>
!
obj
.
prerelease
).
map
(
obj
=>
obj
.
version
)
:
[]
const
releasedVersions
=
this
.
data
.
allversions
.
filter
(
obj
=>
!
obj
.
prerelease
).
map
(
obj
=>
obj
.
version
)
const
allVersions
=
this
.
data
.
allversions
.
map
(
obj
=>
this
.
_retrieveVersion
(
obj
.
version
))
const
currentCompilerName
=
this
.
_retrieveVersion
(
this
.
_view
.
versionSelector
.
selectedOptions
[
0
].
label
)
// contains only numbers part, for example '0.4.22'
...
...
src/app/ui/contextMenu.js
View file @
444d6808
...
...
@@ -40,12 +40,12 @@ module.exports = (event, items) => {
window
.
removeEventListener
(
'click'
,
hide
)
}
var
menu
=
Object
.
keys
(
items
).
map
((
item
,
index
)
=>
{
var
current
=
yo
`<li id="menuitem
${
item
.
toLowerCase
()}
" class=
${
css
.
liitem
}
>
${
item
}
</li>`
const
menu
=
Object
.
keys
(
items
).
map
((
item
,
index
)
=>
{
const
current
=
yo
`<li id="menuitem
${
item
.
toLowerCase
()}
" class=
${
css
.
liitem
}
>
${
item
}
</li>`
current
.
onclick
=
()
=>
{
hide
(
null
,
true
);
items
[
item
]()
}
return
current
})
var
container
=
yo
`<div class="p-1
${
css
.
container
}
bg-light shadow border"><ul id='menuitems'>
${
menu
}
</ul></div>`
const
container
=
yo
`<div class="p-1
${
css
.
container
}
bg-light shadow border"><ul id='menuitems'>
${
menu
}
</ul></div>`
container
.
style
.
left
=
event
.
pageX
+
'px'
container
.
style
.
top
=
event
.
pageY
+
'px'
container
.
style
.
display
=
'block'
...
...
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