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
7bf15f39
Commit
7bf15f39
authored
Feb 15, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix renaming/removal
parent
3b611d07
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
app.js
src/app.js
+14
-7
files.js
src/app/files.js
+1
-1
storage.js
src/app/storage.js
+1
-1
No files found.
src/app.js
View file @
7bf15f39
...
@@ -281,6 +281,7 @@ var run = function () {
...
@@ -281,6 +281,7 @@ var run = function () {
if
(
!
files
.
rename
(
originalName
,
newName
))
{
if
(
!
files
.
rename
(
originalName
,
newName
))
{
alert
(
'Error while renaming file'
)
alert
(
'Error while renaming file'
)
}
else
{
}
else
{
currentFile
=
null
switchToFile
(
newName
)
switchToFile
(
newName
)
editor
.
discard
(
originalName
)
editor
.
discard
(
originalName
)
}
}
...
@@ -301,6 +302,7 @@ var run = function () {
...
@@ -301,6 +302,7 @@ var run = function () {
if
(
!
files
.
remove
(
name
))
{
if
(
!
files
.
remove
(
name
))
{
alert
(
'Error while removing file'
)
alert
(
'Error while removing file'
)
}
else
{
}
else
{
currentFile
=
null
switchToNextFile
()
switchToNextFile
()
editor
.
discard
(
name
)
editor
.
discard
(
name
)
}
}
...
@@ -666,16 +668,18 @@ var run = function () {
...
@@ -666,16 +668,18 @@ var run = function () {
function
runCompiler
()
{
function
runCompiler
()
{
var
files
=
{}
var
files
=
{}
var
target
=
currentFile
if
(
currentFile
)
{
var
target
=
currentFile
files
[
target
]
=
editor
.
get
(
currentFile
)
files
[
target
]
=
editor
.
get
(
currentFile
)
compiler
.
compile
(
files
,
target
)
compiler
.
compile
(
files
,
target
)
}
}
}
function
editorSyncFile
()
{
function
editorSyncFile
()
{
var
input
=
editor
.
get
(
currentFile
)
if
(
currentFile
)
{
files
.
set
(
currentFile
,
input
)
var
input
=
editor
.
get
(
currentFile
)
files
.
set
(
currentFile
,
input
)
}
}
}
var
previousInput
=
''
var
previousInput
=
''
...
@@ -683,6 +687,9 @@ var run = function () {
...
@@ -683,6 +687,9 @@ var run = function () {
var
saveTimeout
=
null
var
saveTimeout
=
null
function
editorOnChange
()
{
function
editorOnChange
()
{
if
(
!
currentFile
)
{
return
}
var
input
=
editor
.
get
(
currentFile
)
var
input
=
editor
.
get
(
currentFile
)
// if there's no change, don't do anything
// if there's no change, don't do anything
...
...
src/app/files.js
View file @
7bf15f39
...
@@ -58,7 +58,7 @@ function Files (storage) {
...
@@ -58,7 +58,7 @@ function Files (storage) {
}
}
this
.
isReadOnly
=
function
(
path
)
{
this
.
isReadOnly
=
function
(
path
)
{
return
!!
readonly
[
path
]
return
readonly
[
path
]
!==
undefined
}
}
this
.
remove
=
function
(
path
)
{
this
.
remove
=
function
(
path
)
{
...
...
src/app/storage.js
View file @
7bf15f39
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
function
Storage
()
{
function
Storage
()
{
this
.
exists
=
function
(
name
)
{
this
.
exists
=
function
(
name
)
{
return
!!
this
.
get
(
name
)
return
this
.
get
(
name
)
!==
null
}
}
this
.
get
=
function
(
name
)
{
this
.
get
=
function
(
name
)
{
...
...
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