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
085afff8
Commit
085afff8
authored
Nov 12, 2019
by
LianaHus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
used toasters/tooltips instead of modaldialogcustom.alert
parent
d9286f31
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
file-explorer.js
src/app/files/file-explorer.js
+9
-8
No files found.
src/app/files/file-explorer.js
View file @
085afff8
...
@@ -158,7 +158,6 @@ function fileExplorer (localRegistry, files, menuItems) {
...
@@ -158,7 +158,6 @@ function fileExplorer (localRegistry, files, menuItems) {
var
isFile
=
false
var
isFile
=
false
Object
.
keys
(
value
).
filter
(
function
keep
(
x
)
{
Object
.
keys
(
value
).
filter
(
function
keep
(
x
)
{
if
(
x
===
'/content'
)
isFile
=
true
if
(
x
===
'/content'
)
isFile
=
true
// if (x === '/readOnly') isReadOnly = true
if
(
x
[
0
]
!==
'/'
)
return
true
if
(
x
[
0
]
!==
'/'
)
return
true
}).
forEach
(
function
(
x
)
{
newValue
[
x
]
=
value
[
x
]
})
}).
forEach
(
function
(
x
)
{
newValue
[
x
]
=
value
[
x
]
})
return
{
return
{
...
@@ -230,8 +229,9 @@ function fileExplorer (localRegistry, files, menuItems) {
...
@@ -230,8 +229,9 @@ function fileExplorer (localRegistry, files, menuItems) {
if
(
self
.
files
.
isReadOnly
(
key
))
{
return
tooltip
(
'cannot delete folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
if
(
self
.
files
.
isReadOnly
(
key
))
{
return
tooltip
(
'cannot delete folder. '
+
self
.
files
.
type
+
' is a read only explorer'
)
}
modalDialogCustom
.
confirm
(
'Confirm to delete a folder'
,
'Are you sure you want to delete this folder?'
,
modalDialogCustom
.
confirm
(
'Confirm to delete a folder'
,
'Are you sure you want to delete this folder?'
,
()
=>
{
()
=>
{
if
(
!
files
.
remove
(
key
))
tooltip
(
`failed to remove
${
key
}
. Make sure the directory is empty before removing it.`
)
if
(
!
files
.
remove
(
key
))
{
else
{
tooltip
(
`failed to remove
${
key
}
. Make sure the directory is empty before removing it.`
)
}
else
{
self
.
updatePath
(
'browser'
)
self
.
updatePath
(
'browser'
)
}
}
},
()
=>
{})
},
()
=>
{})
...
@@ -587,11 +587,12 @@ fileExplorer.prototype.copyFiles = function () {
...
@@ -587,11 +587,12 @@ fileExplorer.prototype.copyFiles = function () {
fileExplorer
.
prototype
.
createNewFile
=
function
(
parentFolder
=
'browser'
)
{
fileExplorer
.
prototype
.
createNewFile
=
function
(
parentFolder
=
'browser'
)
{
let
self
=
this
let
self
=
this
modalDialogCustom
.
prompt
(
'Create new file'
,
'File Name (e.g Untitled.sol)'
,
'Untitled.sol'
,
(
input
)
=>
{
modalDialogCustom
.
prompt
(
'Create new file'
,
'File Name (e.g Untitled.sol)'
,
'Untitled.sol'
,
(
input
)
=>
{
if
(
input
===
''
)
input
=
'New file'
helper
.
createNonClashingName
(
parentFolder
+
'/'
+
input
,
self
.
files
,
(
error
,
newName
)
=>
{
helper
.
createNonClashingName
(
parentFolder
+
'/'
+
input
,
self
.
files
,
(
error
,
newName
)
=>
{
if
(
error
)
return
modalDialogCustom
.
alert
(
'Failed to create file '
+
newName
+
' '
+
error
)
if
(
error
)
return
tooltip
(
'Failed to create file '
+
newName
+
' '
+
error
)
if
(
!
self
.
files
.
set
(
newName
,
''
))
{
if
(
!
self
.
files
.
set
(
newName
,
''
))
{
modalDialogCustom
.
alert
(
'Failed to create file '
+
newName
)
tooltip
(
'Failed to create file '
+
newName
)
}
else
{
}
else
{
self
.
_deps
.
fileManager
.
switchFile
(
newName
)
self
.
_deps
.
fileManager
.
switchFile
(
newName
)
if
(
newName
.
includes
(
'_test.sol'
))
{
if
(
newName
.
includes
(
'_test.sol'
))
{
...
@@ -606,7 +607,7 @@ fileExplorer.prototype.createNewFolder = function (parentFolder) {
...
@@ -606,7 +607,7 @@ fileExplorer.prototype.createNewFolder = function (parentFolder) {
let
self
=
this
let
self
=
this
modalDialogCustom
.
prompt
(
'Create new folder'
,
''
,
'New folder'
,
(
input
)
=>
{
modalDialogCustom
.
prompt
(
'Create new folder'
,
''
,
'New folder'
,
(
input
)
=>
{
if
(
input
===
''
)
{
if
(
input
===
''
)
{
modalDialogCustom
.
alert
(
'Failed to create folder. The name can not be empty'
)
tooltip
(
'Failed to create folder. The name can not be empty'
)
return
false
return
false
}
}
...
@@ -615,11 +616,11 @@ fileExplorer.prototype.createNewFolder = function (parentFolder) {
...
@@ -615,11 +616,11 @@ fileExplorer.prototype.createNewFolder = function (parentFolder) {
newName
=
newName
+
'/'
newName
=
newName
+
'/'
self
.
files
.
exists
(
newName
,
(
error
,
exist
)
=>
{
self
.
files
.
exists
(
newName
,
(
error
,
exist
)
=>
{
if
(
error
)
return
modalDialogCustom
.
alert
(
'Unexpected error while creating folder: '
+
error
)
if
(
error
)
return
tooltip
(
'Unexpected error while creating folder: '
+
error
)
if
(
!
exist
)
{
if
(
!
exist
)
{
self
.
files
.
set
(
newName
,
''
)
self
.
files
.
set
(
newName
,
''
)
}
else
{
}
else
{
modalDialogCustom
.
alert
(
'Folder already exists.'
,
()
=>
{})
tooltip
(
'Folder already exists.'
,
()
=>
{})
}
}
})
})
},
null
,
true
)
},
null
,
true
)
...
...
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