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
34ffbab2
Commit
34ffbab2
authored
Jan 12, 2021
by
LianaHus
Committed by
Liana Husikyan
Jan 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added documentation and deactivate to context menu of vertical icons bar
parent
67783eab
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
13 deletions
+34
-13
vertical-icons.js
apps/remix-ide/src/app/components/vertical-icons.js
+18
-7
contextMenu.js
apps/remix-ide/src/app/ui/contextMenu.js
+12
-2
remixAppManager.js
apps/remix-ide/src/remixAppManager.js
+4
-4
No files found.
apps/remix-ide/src/app/components/vertical-icons.js
View file @
34ffbab2
...
@@ -64,7 +64,7 @@ export class VerticalIcons extends Plugin {
...
@@ -64,7 +64,7 @@ export class VerticalIcons extends Plugin {
* Add an icon to the map
* Add an icon to the map
* @param {ModuleProfile} profile The profile of the module
* @param {ModuleProfile} profile The profile of the module
*/
*/
addIcon
({
kind
,
name
,
icon
,
displayName
,
tooltip
})
{
addIcon
({
kind
,
name
,
icon
,
displayName
,
tooltip
,
documentation
})
{
let
title
=
(
tooltip
||
displayName
||
name
)
let
title
=
(
tooltip
||
displayName
||
name
)
title
=
title
.
replace
(
/^
\w
/
,
c
=>
c
.
toUpperCase
())
title
=
title
.
replace
(
/^
\w
/
,
c
=>
c
.
toUpperCase
())
this
.
icons
[
name
]
=
yo
`
this
.
icons
[
name
]
=
yo
`
...
@@ -73,7 +73,7 @@ export class VerticalIcons extends Plugin {
...
@@ -73,7 +73,7 @@ export class VerticalIcons extends Plugin {
onclick="
${()
=>
{
this
.
toggle
(
name
)
}}
"
onclick="
${()
=>
{
this
.
toggle
(
name
)
}}
"
plugin="
$
{
name
}
"
plugin="
$
{
name
}
"
title="
${
title
}
"
title="
${
title
}
"
oncontextmenu="
${(
e
)
=>
this
.
itemContextMenu
(
e
,
name
)}
"
oncontextmenu="
${(
e
)
=>
this
.
itemContextMenu
(
e
,
name
,
documentation
)}
"
data-id="verticalIconsKind
${
name
}
">
data-id="verticalIconsKind
${
name
}
">
<img class="image" src="
${
icon
}
" alt="
${
name
}
" />
<img class="image" src="
${
icon
}
" alt="
${
name
}
" />
</div>`
</div>`
...
@@ -223,13 +223,24 @@ export class VerticalIcons extends Plugin {
...
@@ -223,13 +223,24 @@ export class VerticalIcons extends Plugin {
}
}
}
}
itemContextMenu
(
e
,
name
)
{
async
itemContextMenu
(
e
,
name
,
documentation
)
{
console
.
log
(
name
)
VERTICALMENU_HANDLE
&&
VERTICALMENU_HANDLE
.
hide
(
null
,
true
)
const
actions
=
{}
const
actions
=
{}
actions
[
'Deactivate'
]
=
()
=>
{
this
.
call
(
'manager'
,
'deactivatePlugin'
,
name
)
}
if
(
await
this
.
appManager
.
canDeactivatePlugin
(
profile
,
{
name
}))
{
VERTICALMENU_HANDLE
=
contextMenu
(
e
,
actions
)
actions
.
Deactivate
=
()
=>
{
// this.call('manager', 'deactivatePlugin', name)
this
.
appManager
.
deactivatePlugin
(
name
)
}
}
const
links
=
{}
if
(
documentation
)
{
links
.
Documentation
=
documentation
}
if
(
Object
.
keys
(
actions
).
length
||
Object
.
keys
(
links
).
length
)
{
VERTICALMENU_HANDLE
&&
VERTICALMENU_HANDLE
.
hide
(
null
,
true
)
VERTICALMENU_HANDLE
=
contextMenu
(
e
,
actions
,
links
)
}
e
.
preventDefault
()
e
.
preventDefault
()
e
.
stopPropagation
()
}
}
render
()
{
render
()
{
...
...
apps/remix-ide/src/app/ui/contextMenu.js
View file @
34ffbab2
...
@@ -30,7 +30,7 @@ var css = csjs`
...
@@ -30,7 +30,7 @@ var css = csjs`
}
}
`
`
module
.
exports
=
(
event
,
items
)
=>
{
module
.
exports
=
(
event
,
items
,
linkItems
)
=>
{
event
.
preventDefault
()
event
.
preventDefault
()
function
hide
(
event
,
force
)
{
function
hide
(
event
,
force
)
{
...
@@ -45,7 +45,17 @@ module.exports = (event, items) => {
...
@@ -45,7 +45,17 @@ module.exports = (event, items) => {
current
.
onclick
=
()
=>
{
hide
(
null
,
true
);
items
[
item
]()
}
current
.
onclick
=
()
=>
{
hide
(
null
,
true
);
items
[
item
]()
}
return
current
return
current
})
})
const
container
=
yo
`<div id="menuItemsContainer" class="p-1
${
css
.
container
}
bg-light shadow border"><ul id='menuitems'>
${
menu
}
</ul></div>`
const
menuForLinks
=
Object
.
keys
(
linkItems
).
map
((
item
,
index
)
=>
{
const
current
=
yo
`<li id="menuitem
${
item
.
toLowerCase
()}
" class=
${
css
.
liitem
}
><a href=
${
linkItems
[
item
]}
target="_blank">
${
item
}
</a></li>`
current
.
onclick
=
()
=>
{
hide
(
null
,
true
)
}
return
current
})
const
container
=
yo
`
<div id="menuItemsContainer" class="p-1
${
css
.
container
}
bg-light shadow border">
<ul id='menuitems'>
${
menu
}
${
menuForLinks
}
</ul>
</div>
`
container
.
style
.
left
=
event
.
pageX
+
'px'
container
.
style
.
left
=
event
.
pageX
+
'px'
container
.
style
.
top
=
event
.
pageY
+
'px'
container
.
style
.
top
=
event
.
pageY
+
'px'
...
...
apps/remix-ide/src/remixAppManager.js
View file @
34ffbab2
...
@@ -6,12 +6,12 @@ import QueryParams from './lib/query-params'
...
@@ -6,12 +6,12 @@ import QueryParams from './lib/query-params'
import
{
PermissionHandler
}
from
'./app/ui/persmission-handler'
import
{
PermissionHandler
}
from
'./app/ui/persmission-handler'
const
requiredModules
=
[
// services + layout views + system views
const
requiredModules
=
[
// services + layout views + system views
'manager'
,
'compilerArtefacts'
,
'compilerMetadata'
,
'contextualListener'
,
'editor'
,
'offsetToLineColumnConverter'
,
'network'
,
'theme'
,
'fileManager'
,
'contentImport'
,
'web3Provider'
,
'scriptRunner'
,
'fetchAndCompile'
,
'manager'
,
'compilerArtefacts'
,
'compilerMetadata'
,
'contextualListener'
,
'editor'
,
'offsetToLineColumnConverter'
,
'network'
,
'theme'
,
'
mainPanel'
,
'hiddenPanel'
,
'sidePanel'
,
'menuicons'
,
'fileExplorer
s'
,
'
fileManager'
,
'contentImport'
,
'web3Provider'
,
'scriptRunner'
,
'fetchAndCompile'
,
'mainPanel'
,
'hiddenPanel'
,
'sidePanel'
,
'menuicon
s'
,
'
terminal'
,
'settings'
,
'pluginManager'
,
'tabs
'
]
'
fileExplorers'
,
'terminal'
,
'settings'
,
'pluginManager'
,
'tabs'
,
'udapp
'
]
export
function
isNative
(
name
)
{
export
function
isNative
(
name
)
{
const
nativePlugins
=
[
'vyper'
,
'workshops'
,
'debugger'
,
'remixd'
]
const
nativePlugins
=
[
'vyper'
,
'workshops'
,
'debugger'
,
'remixd'
,
'menuicons'
]
return
nativePlugins
.
includes
(
name
)
||
requiredModules
.
includes
(
name
)
return
nativePlugins
.
includes
(
name
)
||
requiredModules
.
includes
(
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