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
4c95224b
Commit
4c95224b
authored
Apr 23, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make the `get` API of editor clearer
parent
20a01579
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
4 deletions
+24
-4
app.js
src/app.js
+3
-1
editor.js
src/app/editor/editor.js
+18
-2
file-explorer.js
src/app/files/file-explorer.js
+1
-1
fileManager.js
src/app/files/fileManager.js
+2
-0
No files found.
src/app.js
View file @
4c95224b
...
@@ -896,7 +896,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -896,7 +896,9 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
return
return
}
}
var
input
=
editor
.
get
(
currentFile
)
var
input
=
editor
.
get
(
currentFile
)
if
(
!
input
)
{
return
}
// if there's no change, don't do anything
// if there's no change, don't do anything
if
(
input
===
previousInput
)
{
if
(
input
===
previousInput
)
{
return
return
...
...
src/app/editor/editor.js
View file @
4c95224b
...
@@ -169,13 +169,29 @@ function Editor (opts = {}) {
...
@@ -169,13 +169,29 @@ function Editor (opts = {}) {
switchSession
(
path
)
switchSession
(
path
)
}
}
/**
* returns the content of the specified session @arg path
* if @arg path is not provided, the content of the current editing session is returned
*
* @param {String} path - path of th file in edition
* @return {String} content of the file referenced by @arg path
*/
this
.
get
=
function
(
path
)
{
this
.
get
=
function
(
path
)
{
if
(
currentSession
===
path
)
{
if
(
!
path
||
currentSession
===
path
)
{
return
editor
.
getValue
()
return
editor
.
getValue
()
}
else
if
(
sessions
[
path
])
{
sessions
[
path
].
getValue
()
}
}
}
}
this
.
current
=
function
(
path
)
{
/**
* returns the path of the currently editing file
* returns `undefined` if no session is being editer
*
* @param {String} path - path of th file in edition
* @return {String} content of the file referenced by @arg path
*/
this
.
current
=
function
()
{
if
(
editor
.
getSession
()
===
emptySession
)
{
if
(
editor
.
getSession
()
===
emptySession
)
{
return
return
}
}
...
...
src/app/files/file-explorer.js
View file @
4c95224b
...
@@ -28,7 +28,7 @@ function fileExplorer (appAPI, files) {
...
@@ -28,7 +28,7 @@ function fileExplorer (appAPI, files) {
}
}
this
.
files
.
event
.
register
(
'fileExternallyChanged'
,
(
path
,
file
)
=>
{
this
.
files
.
event
.
register
(
'fileExternallyChanged'
,
(
path
,
file
)
=>
{
if
(
appAPI
.
config
.
get
(
'currentFile'
)
===
path
&&
appAPI
.
currentContent
()
!==
file
.
content
)
{
if
(
appAPI
.
config
.
get
(
'currentFile'
)
===
path
&&
appAPI
.
currentContent
()
&&
appAPI
.
currentContent
()
!==
file
.
content
)
{
modalDialog
(
path
+
' changed'
,
remixdDialog
(),
modalDialog
(
path
+
' changed'
,
remixdDialog
(),
{
{
label
:
'Keep the content displayed in Remix'
,
label
:
'Keep the content displayed in Remix'
,
...
...
src/app/files/fileManager.js
View file @
4c95224b
...
@@ -174,6 +174,7 @@ class FileManager {
...
@@ -174,6 +174,7 @@ class FileManager {
var
currentFile
=
this
.
opt
.
config
.
get
(
'currentFile'
)
var
currentFile
=
this
.
opt
.
config
.
get
(
'currentFile'
)
if
(
currentFile
&&
this
.
opt
.
editor
.
current
())
{
if
(
currentFile
&&
this
.
opt
.
editor
.
current
())
{
var
input
=
this
.
opt
.
editor
.
get
(
currentFile
)
var
input
=
this
.
opt
.
editor
.
get
(
currentFile
)
if
(
input
)
{
var
provider
=
this
.
fileProviderOf
(
currentFile
)
var
provider
=
this
.
fileProviderOf
(
currentFile
)
if
(
provider
)
{
if
(
provider
)
{
provider
.
set
(
currentFile
,
input
)
provider
.
set
(
currentFile
,
input
)
...
@@ -182,6 +183,7 @@ class FileManager {
...
@@ -182,6 +183,7 @@ class FileManager {
}
}
}
}
}
}
}
}
}
module
.
exports
=
FileManager
module
.
exports
=
FileManager
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