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
5f677f62
Commit
5f677f62
authored
Feb 08, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
short overview of API
parent
a766ae85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
file-panel.js
src/app/panels/file-panel.js
+18
-0
No files found.
src/app/panels/file-panel.js
View file @
5f677f62
...
@@ -311,6 +311,7 @@ function filepanel (appAPI, filesProvider) {
...
@@ -311,6 +311,7 @@ function filepanel (appAPI, filesProvider) {
// return all the files, except the temporary/readonly ones..
// return all the files, except the temporary/readonly ones..
function
packageFiles
(
files
,
callback
)
{
function
packageFiles
(
files
,
callback
)
{
var
ret
=
{}
var
ret
=
{}
// @TODO remove use of `list()`
var
filtered
=
Object
.
keys
(
files
.
list
()).
filter
(
function
(
path
)
{
if
(
!
files
.
isReadOnly
(
path
))
{
return
path
}
})
var
filtered
=
Object
.
keys
(
files
.
list
()).
filter
(
function
(
path
)
{
if
(
!
files
.
isReadOnly
(
path
))
{
return
path
}
})
async
.
eachSeries
(
filtered
,
function
(
path
,
cb
)
{
async
.
eachSeries
(
filtered
,
function
(
path
,
cb
)
{
ret
[
path
.
replace
(
files
.
type
+
'/'
,
''
)]
=
{
content
:
files
.
get
(
path
)
}
ret
[
path
.
replace
(
files
.
type
+
'/'
,
''
)]
=
{
content
:
files
.
get
(
path
)
}
...
@@ -320,4 +321,21 @@ function packageFiles (files, callback) {
...
@@ -320,4 +321,21 @@ function packageFiles (files, callback) {
})
})
}
}
/*
Overview of APIs:
* fileManager: @args fileProviders (browser, shared-folder, swarm, github, etc ...) & config & editor
- listen on browser & localhost file provider (`fileRenamed` & `fileRemoved`)
- update the tabs, switchFile
- trigger `currentFileChanged`
- set the current file in the config
* fileProvider: currently browser, swarm, localhost, github, gist
- link to backend
- provide properties `type`, `readonly`
- provide API `resolveDirectory`, `remove`, `exists`, `rename`, `get`, `set`
- trigger `fileExternallyChanged`, `fileRemoved`, `fileRenamed`, `fileRenamedError`, `fileAdded`
* file-explorer: treeview @args fileProvider
- listen on events triggered by fileProvider
- call fileProvider API
*/
module
.
exports
=
filepanel
module
.
exports
=
filepanel
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