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
5418de85
Unverified
Commit
5418de85
authored
Sep 23, 2019
by
yann300
Committed by
GitHub
Sep 23, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2354 from ethereum/remixd_electron
ux friendly use of remixd inside electron
parents
2ee99e78
a4e24d22
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
app.js
src/app.js
+4
-0
remixd-handle.js
src/app/files/remixd-handle.js
+16
-11
remixAppManager.js
src/remixAppManager.js
+3
-0
No files found.
src/app.js
View file @
5418de85
...
@@ -346,4 +346,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
...
@@ -346,4 +346,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
}
}
})
})
}
}
if
(
isElectron
())
{
appManager
.
activate
([
'remixd'
])
}
}
}
src/app/files/remixd-handle.js
View file @
5418de85
import
isElectron
from
'is-electron'
import
{
Plugin
}
from
'@remixproject/engine'
import
{
Plugin
}
from
'@remixproject/engine'
import
*
as
packageJson
from
'../../../package.json'
import
*
as
packageJson
from
'../../../package.json'
var
yo
=
require
(
'yo-yo'
)
var
yo
=
require
(
'yo-yo'
)
...
@@ -55,17 +56,7 @@ export class RemixdHandle extends Plugin {
...
@@ -55,17 +56,7 @@ export class RemixdHandle extends Plugin {
* @param {String} txHash - hash of the transaction
* @param {String} txHash - hash of the transaction
*/
*/
connectToLocalhost
()
{
connectToLocalhost
()
{
if
(
this
.
locahostProvider
.
isConnected
())
{
let
connection
=
(
error
)
=>
{
this
.
locahostProvider
.
close
((
error
)
=>
{
if
(
error
)
console
.
log
(
error
)
})
}
else
{
modalDialog
(
'Connect to localhost'
,
remixdDialog
(),
{
label
:
'Connect'
,
fn
:
()
=>
{
this
.
locahostProvider
.
init
((
error
)
=>
{
if
(
error
)
{
if
(
error
)
{
console
.
log
(
error
)
console
.
log
(
error
)
modalDialogCustom
.
alert
(
modalDialogCustom
.
alert
(
...
@@ -76,7 +67,19 @@ export class RemixdHandle extends Plugin {
...
@@ -76,7 +67,19 @@ export class RemixdHandle extends Plugin {
}
else
{
}
else
{
this
.
fileSystemExplorer
.
ensureRoot
()
this
.
fileSystemExplorer
.
ensureRoot
()
}
}
}
if
(
this
.
locahostProvider
.
isConnected
())
{
this
.
locahostProvider
.
close
((
error
)
=>
{
if
(
error
)
console
.
log
(
error
)
})
})
}
else
if
(
!
isElectron
())
{
// warn the user only if he/she is in the browser context
modalDialog
(
'Connect to localhost'
,
remixdDialog
(),
{
label
:
'Connect'
,
fn
:
()
=>
{
this
.
locahostProvider
.
init
((
error
)
=>
connection
(
error
))
}
}
},
},
{
label
:
'Cancel'
,
{
label
:
'Cancel'
,
...
@@ -85,6 +88,8 @@ export class RemixdHandle extends Plugin {
...
@@ -85,6 +88,8 @@ export class RemixdHandle extends Plugin {
}
}
}
}
)
)
}
else
{
this
.
locahostProvider
.
init
((
error
)
=>
connection
(
error
))
}
}
}
}
}
}
...
...
src/remixAppManager.js
View file @
5418de85
...
@@ -19,11 +19,14 @@ export class RemixAppManager extends PluginEngine {
...
@@ -19,11 +19,14 @@ export class RemixAppManager extends PluginEngine {
constructor
(
plugins
)
{
constructor
(
plugins
)
{
super
(
plugins
,
settings
)
super
(
plugins
,
settings
)
this
.
event
=
new
EventEmitter
()
this
.
event
=
new
EventEmitter
()
this
.
donotAutoReload
=
[
'remixd'
]
// that would be a bad practice to force loading some plugins at page load.
this
.
registered
=
{}
this
.
registered
=
{}
}
}
onActivated
(
plugin
)
{
onActivated
(
plugin
)
{
if
(
!
this
.
donotAutoReload
.
includes
(
plugin
.
name
))
{
localStorage
.
setItem
(
'workspace'
,
JSON
.
stringify
(
this
.
actives
))
localStorage
.
setItem
(
'workspace'
,
JSON
.
stringify
(
this
.
actives
))
}
this
.
event
.
emit
(
'activate'
,
plugin
.
name
)
this
.
event
.
emit
(
'activate'
,
plugin
.
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