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
58df39d4
Commit
58df39d4
authored
Mar 01, 2019
by
Grandschtroumpf
Committed by
yann300
Mar 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User `events` and `EventEmitter` instead of `event` and `EventManager`
parent
8b2b0fcb
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
19 deletions
+15
-19
fileManager.js
src/app/files/fileManager.js
+5
-10
editor-panel.js
src/app/panels/editor-panel.js
+1
-1
tab-proxy.js
src/app/panels/tab-proxy.js
+4
-4
pluginManager.js
src/app/plugin/pluginManager.js
+1
-1
compile-tab.js
src/app/tabs/compile-tab.js
+2
-1
dropdownlogic.js
src/app/tabs/runTab/model/dropdownlogic.js
+1
-1
test-tab.js
src/app/tabs/test-tab.js
+1
-1
No files found.
src/app/files/fileManager.js
View file @
58df39d4
'use strict'
'use strict'
const
EventEmitter
=
require
(
'events'
)
const
EventEmitter
=
require
(
'events'
)
var
EventManager
=
require
(
'../../lib/events'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
globalRegistry
=
require
(
'../../global/registry'
)
var
CompilerImport
=
require
(
'../compiler/compiler-imports'
)
var
CompilerImport
=
require
(
'../compiler/compiler-imports'
)
...
@@ -13,7 +12,6 @@ var CompilerImport = require('../compiler/compiler-imports')
...
@@ -13,7 +12,6 @@ var CompilerImport = require('../compiler/compiler-imports')
class
FileManager
{
class
FileManager
{
constructor
(
localRegistry
)
{
constructor
(
localRegistry
)
{
this
.
openedFiles
=
{}
// list all opened files
this
.
openedFiles
=
{}
// list all opened files
this
.
event
=
new
EventManager
()
this
.
events
=
new
EventEmitter
()
this
.
events
=
new
EventEmitter
()
this
.
_components
=
{}
this
.
_components
=
{}
this
.
_components
.
compilerImport
=
new
CompilerImport
()
this
.
_components
.
compilerImport
=
new
CompilerImport
()
...
@@ -43,9 +41,6 @@ class FileManager {
...
@@ -43,9 +41,6 @@ class FileManager {
self
.
_deps
.
localhostExplorer
.
event
.
register
(
'errored'
,
(
event
)
=>
{
this
.
removeTabsOf
(
self
.
_deps
.
localhostExplorer
)
})
self
.
_deps
.
localhostExplorer
.
event
.
register
(
'errored'
,
(
event
)
=>
{
this
.
removeTabsOf
(
self
.
_deps
.
localhostExplorer
)
})
self
.
_deps
.
localhostExplorer
.
event
.
register
(
'closed'
,
(
event
)
=>
{
this
.
removeTabsOf
(
self
.
_deps
.
localhostExplorer
)
})
self
.
_deps
.
localhostExplorer
.
event
.
register
(
'closed'
,
(
event
)
=>
{
this
.
removeTabsOf
(
self
.
_deps
.
localhostExplorer
)
})
self
.
event
.
register
(
'currentFileChanged'
,
(
file
,
provider
)
=>
{
this
.
events
.
emit
(
'currentFileChanged'
,
file
)
})
}
}
profile
()
{
profile
()
{
...
@@ -84,7 +79,7 @@ class FileManager {
...
@@ -84,7 +79,7 @@ class FileManager {
this
.
switchFile
(
newFocus
)
this
.
switchFile
(
newFocus
)
}
}
}
}
this
.
event
.
trigger
(
'fileRenamed'
,
[
oldName
,
newName
]
)
this
.
event
s
.
emit
(
'fileRenamed'
,
oldName
,
newName
)
}
}
currentFileProvider
()
{
currentFileProvider
()
{
...
@@ -107,7 +102,7 @@ class FileManager {
...
@@ -107,7 +102,7 @@ class FileManager {
this
.
_deps
.
editor
.
displayEmptyReadOnlySession
()
this
.
_deps
.
editor
.
displayEmptyReadOnlySession
()
this
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
this
.
_deps
.
config
.
set
(
'currentFile'
,
''
)
}
}
this
.
event
.
trigger
(
'fileClosed'
,
[
name
]
)
this
.
event
s
.
emit
(
'fileClosed'
,
name
)
}
}
currentPath
()
{
currentPath
()
{
...
@@ -167,7 +162,7 @@ class FileManager {
...
@@ -167,7 +162,7 @@ class FileManager {
}
}
self
.
_deps
.
editor
.
discard
(
path
)
self
.
_deps
.
editor
.
discard
(
path
)
delete
this
.
openedFiles
[
path
]
delete
this
.
openedFiles
[
path
]
this
.
event
.
trigger
(
'fileRemoved'
,
[
path
]
)
this
.
event
s
.
emit
(
'fileRemoved'
,
path
)
this
.
switchFile
()
this
.
switchFile
()
}
}
...
@@ -182,7 +177,7 @@ class FileManager {
...
@@ -182,7 +177,7 @@ class FileManager {
if
(
fileList
.
length
)
{
if
(
fileList
.
length
)
{
_switchFile
(
browserProvider
.
type
+
'/'
+
fileList
[
0
])
_switchFile
(
browserProvider
.
type
+
'/'
+
fileList
[
0
])
}
else
{
}
else
{
self
.
event
.
trigger
(
'currentFileChanged'
,
[]
)
self
.
event
s
.
emit
(
'currentFileChanged'
)
self
.
_deps
.
editor
.
displayEmptyReadOnlySession
()
self
.
_deps
.
editor
.
displayEmptyReadOnlySession
()
}
}
})
})
...
@@ -200,7 +195,7 @@ class FileManager {
...
@@ -200,7 +195,7 @@ class FileManager {
}
else
{
}
else
{
self
.
_deps
.
editor
.
open
(
file
,
content
)
self
.
_deps
.
editor
.
open
(
file
,
content
)
}
}
self
.
event
.
trigger
(
'currentFileChanged'
,
[
file
,
self
.
fileProviderOf
(
file
)]
)
self
.
event
s
.
emit
(
'currentFileChanged'
,
file
)
}
}
})
})
}
}
...
...
src/app/panels/editor-panel.js
View file @
58df39d4
...
@@ -61,7 +61,7 @@ class EditorPanel {
...
@@ -61,7 +61,7 @@ class EditorPanel {
We listen here on event from the tab component to display / hide the editor and mainpanel
We listen here on event from the tab component to display / hide the editor and mainpanel
depending on the content that should be displayed
depending on the content that should be displayed
*/
*/
self
.
_deps
.
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
file
)
=>
{
self
.
_deps
.
fileManager
.
event
s
.
on
(
'currentFileChanged'
,
(
file
)
=>
{
// we check upstream for "fileChanged"
// we check upstream for "fileChanged"
self
.
_view
.
editor
.
style
.
display
=
'block'
self
.
_view
.
editor
.
style
.
display
=
'block'
self
.
_components
.
contextView
.
show
()
self
.
_components
.
contextView
.
show
()
...
...
src/app/panels/tab-proxy.js
View file @
58df39d4
...
@@ -15,15 +15,15 @@ export class TabProxy {
...
@@ -15,15 +15,15 @@ export class TabProxy {
this
.
_view
=
{}
this
.
_view
=
{}
this
.
_handlers
=
{}
this
.
_handlers
=
{}
fileManager
.
event
.
register
(
'fileRemoved'
,
(
name
)
=>
{
fileManager
.
event
s
.
on
(
'fileRemoved'
,
(
name
)
=>
{
this
.
removeTab
(
name
)
this
.
removeTab
(
name
)
})
})
fileManager
.
event
.
register
(
'fileClosed'
,
(
name
)
=>
{
fileManager
.
event
s
.
on
(
'fileClosed'
,
(
name
)
=>
{
this
.
removeTab
(
name
)
this
.
removeTab
(
name
)
})
})
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
file
)
=>
{
fileManager
.
event
s
.
on
(
'currentFileChanged'
,
(
file
)
=>
{
if
(
this
.
_handlers
[
file
])
{
if
(
this
.
_handlers
[
file
])
{
this
.
_view
.
filetabs
.
activateTab
(
file
)
this
.
_view
.
filetabs
.
activateTab
(
file
)
return
return
...
@@ -38,7 +38,7 @@ export class TabProxy {
...
@@ -38,7 +38,7 @@ export class TabProxy {
})
})
})
})
fileManager
.
event
.
register
(
'fileRenamed'
,
(
oldName
,
newName
)
=>
{
fileManager
.
event
s
.
on
(
'fileRenamed'
,
(
oldName
,
newName
)
=>
{
this
.
removeTab
(
oldName
)
this
.
removeTab
(
oldName
)
this
.
addTab
(
newName
,
()
=>
{
this
.
addTab
(
newName
,
()
=>
{
this
.
fileManager
.
switchFile
(
newName
)
this
.
fileManager
.
switchFile
(
newName
)
...
...
src/app/plugin/pluginManager.js
View file @
58df39d4
...
@@ -93,7 +93,7 @@ module.exports = class PluginManager {
...
@@ -93,7 +93,7 @@ module.exports = class PluginManager {
self
.
plugins
=
{}
self
.
plugins
=
{}
self
.
origins
=
{}
self
.
origins
=
{}
self
.
inFocus
self
.
inFocus
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
file
,
provider
)
=>
{
fileManager
.
event
s
.
on
(
'currentFileChanged'
,
(
file
)
=>
{
self
.
broadcast
(
JSON
.
stringify
({
self
.
broadcast
(
JSON
.
stringify
({
action
:
'notification'
,
action
:
'notification'
,
key
:
'editor'
,
key
:
'editor'
,
...
...
src/app/tabs/compile-tab.js
View file @
58df39d4
...
@@ -75,12 +75,13 @@ class CompileTab {
...
@@ -75,12 +75,13 @@ class CompileTab {
}
}
})
})
this
.
_deps
.
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
name
)
=>
{
this
.
_deps
.
fileManager
.
event
s
.
on
(
'currentFileChanged'
,
(
name
)
=>
{
this
.
compilerContainer
.
currentFile
=
name
this
.
compilerContainer
.
currentFile
=
name
})
})
this
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
this
.
compiler
.
event
.
register
(
'compilationFinished'
,
(
success
,
data
,
source
)
=>
{
if
(
success
)
{
if
(
success
)
{
// forwarding the event to the appManager infra
// forwarding the event to the appManager infra
console
.
log
(
source
.
target
,
source
,
this
.
data
.
selectedVersion
,
data
)
this
.
events
.
emit
(
'compilationFinished'
,
source
.
target
,
source
,
this
.
data
.
selectedVersion
,
data
)
this
.
events
.
emit
(
'compilationFinished'
,
source
.
target
,
source
,
this
.
data
.
selectedVersion
,
data
)
// Store the contracts
// Store the contracts
this
.
data
.
contractsDetails
=
{}
this
.
data
.
contractsDetails
=
{}
...
...
src/app/tabs/runTab/model/dropdownlogic.js
View file @
58df39d4
...
@@ -21,7 +21,7 @@ class DropdownLogic {
...
@@ -21,7 +21,7 @@ class DropdownLogic {
this
.
listenToCompilationEvents
()
this
.
listenToCompilationEvents
()
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
currentFile
)
=>
{
fileManager
.
event
s
.
on
(
'currentFileChanged'
,
(
currentFile
)
=>
{
this
.
event
.
trigger
(
'currentFileChanged'
,
[
currentFile
])
this
.
event
.
trigger
(
'currentFileChanged'
,
[
currentFile
])
})
})
}
}
...
...
src/app/tabs/test-tab.js
View file @
58df39d4
...
@@ -116,7 +116,7 @@ module.exports = class TestTab {
...
@@ -116,7 +116,7 @@ module.exports = class TestTab {
self
.
data
.
selectedTests
.
push
(
file
)
self
.
data
.
selectedTests
.
push
(
file
)
})
})
self
.
_deps
.
fileManager
.
event
.
register
(
'currentFileChanged'
,
(
file
,
provider
)
=>
{
self
.
_deps
.
fileManager
.
event
s
.
on
(
'currentFileChanged'
,
(
file
)
=>
{
getTests
(
self
,
(
error
,
tests
)
=>
{
getTests
(
self
,
(
error
,
tests
)
=>
{
if
(
error
)
return
tooltip
(
error
)
if
(
error
)
return
tooltip
(
error
)
self
.
data
.
allTests
=
tests
self
.
data
.
allTests
=
tests
...
...
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