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
dcb29822
Commit
dcb29822
authored
Feb 18, 2021
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display icons based on file types
parent
2c1aed4e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
index.html
apps/remix-ide/src/index.html
+1
-0
helper.js
apps/remix-ide/src/lib/helper.js
+8
-1
file-explorer.tsx
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
+2
-1
No files found.
apps/remix-ide/src/index.html
View file @
dcb29822
...
@@ -106,5 +106,6 @@
...
@@ -106,5 +106,6 @@
}
}
</script>
</script>
<script
src=
"runtime.js"
type=
"module"
></script><script
src=
"polyfills.js"
type=
"module"
></script><script
src=
"vendor.js"
type=
"module"
></script>
<script
src=
"runtime.js"
type=
"module"
></script><script
src=
"polyfills.js"
type=
"module"
></script><script
src=
"vendor.js"
type=
"module"
></script>
<script
src=
"https://kit.fontawesome.com/41dd021e94.js"
crossorigin=
"anonymous"
></script>
</body>
</body>
</html>
</html>
apps/remix-ide/src/lib/helper.js
View file @
dcb29822
...
@@ -68,7 +68,14 @@ module.exports = {
...
@@ -68,7 +68,14 @@ module.exports = {
const
hexValue
=
hash
.
slice
(
2
,
hash
.
length
)
const
hexValue
=
hash
.
slice
(
2
,
hash
.
length
)
return
this
.
is0XPrefixed
(
hash
)
&&
/^
[
0-9a-fA-F
]{64}
$/
.
test
(
hexValue
)
return
this
.
is0XPrefixed
(
hash
)
&&
/^
[
0-9a-fA-F
]{64}
$/
.
test
(
hexValue
)
},
},
find
:
find
find
:
find
,
getPathIcon
(
path
)
{
return
path
.
endsWith
(
'.txt'
)
?
'far fa-file-alt'
:
file
.
path
.
endsWith
(
'.sol'
)
?
'fak fa-solidity-mono'
:
file
.
path
.
endsWith
(
'.js'
)
?
'fab fa-js'
:
file
.
path
.
endsWith
(
'.json'
)
?
'fas fa-brackets-curly'
:
'far fa-file'
}
}
}
function
findDeep
(
object
,
fn
,
found
=
{
break
:
false
,
value
:
undefined
})
{
function
findDeep
(
object
,
fn
,
found
=
{
break
:
false
,
value
:
undefined
})
{
...
...
libs/remix-ui/file-explorer/src/lib/file-explorer.tsx
View file @
dcb29822
...
@@ -901,6 +901,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -901,6 +901,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
?
'bg-secondary'
:
state
.
mouseOverElement
===
file
.
path
?
'bg-secondary'
:
state
.
mouseOverElement
===
file
.
path
?
'bg-light border'
:
(
state
.
focusContext
.
element
===
file
.
path
)
&&
(
state
.
focusEdit
.
element
!==
file
.
path
)
?
'bg-light border'
:
(
state
.
focusContext
.
element
===
file
.
path
)
&&
(
state
.
focusEdit
.
element
!==
file
.
path
)
?
'bg-light border'
:
''
?
'bg-light border'
:
''
const
icon
=
helper
.
getPathIcon
(
file
.
path
)
if
(
file
.
isDirectory
)
{
if
(
file
.
isDirectory
)
{
return
(
return
(
...
@@ -979,7 +980,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
...
@@ -979,7 +980,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
e
.
stopPropagation
()
e
.
stopPropagation
()
handleContextMenuFile
(
e
.
pageX
,
e
.
pageY
,
file
.
path
,
e
.
target
.
textContent
)
handleContextMenuFile
(
e
.
pageX
,
e
.
pageY
,
file
.
path
,
e
.
target
.
textContent
)
}
}
}
}
icon=
'far fa-file'
icon=
{
icon
}
labelClass=
{
labelClass
}
labelClass=
{
labelClass
}
onMouseOver=
{
(
e
)
=>
{
onMouseOver=
{
(
e
)
=>
{
e
.
stopPropagation
()
e
.
stopPropagation
()
...
...
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