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
829194bd
Unverified
Commit
829194bd
authored
Jan 03, 2018
by
yann300
Committed by
GitHub
Jan 03, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #973 from ethereum/fixDeploySwarm
Fix deploy to swarm
parents
96eef934
1b341af0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
9 deletions
+24
-9
app.js
src/app.js
+2
-3
compiler-imports.js
src/app/compiler/compiler-imports.js
+7
-3
contractParser.js
src/app/contract/contractParser.js
+1
-1
basicReadOnlyExplorer.js
src/app/files/basicReadOnlyExplorer.js
+6
-1
fileManager.js
src/app/files/fileManager.js
+8
-1
No files found.
src/app.js
View file @
829194bd
...
...
@@ -201,10 +201,9 @@ function run () {
if
(
provider
&&
provider
.
exists
(
url
))
{
return
provider
.
get
(
url
,
cb
)
}
handleImports
.
import
(
url
,
(
error
,
content
,
cleanUrl
,
type
)
=>
{
handleImports
.
import
(
url
,
(
error
,
content
,
cleanUrl
,
type
,
url
)
=>
{
if
(
!
error
)
{
// FIXME: at some point we should invalidate the browser cache
filesProviders
[
type
].
addReadOnly
(
cleanUrl
,
content
)
filesProviders
[
type
].
addReadOnly
(
cleanUrl
,
content
,
url
)
cb
(
null
,
content
)
}
else
{
cb
(
error
)
...
...
src/app/compiler/compiler-imports.js
View file @
829194bd
...
...
@@ -39,12 +39,16 @@ module.exports = {
})
},
import
:
function
(
url
,
cb
)
{
var
handlers
=
[
handlers
:
function
(
)
{
return
[
{
type
:
'github'
,
match
:
/^
(
https
?
:
\/\/)?(
www.
)?
github.com
\/([^/]
*
\/[^/]
*
)\/(
.*
)
/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleGithubCall
(
match
[
3
],
match
[
4
],
cb
)
}
},
{
type
:
'swarm'
,
match
:
/^
(
bzz
[
ri
]?
:
\/\/?
.*
)
$/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleSwarmImport
(
match
[
1
],
cb
)
}
},
{
type
:
'ipfs'
,
match
:
/^
(
ipfs:
\/\/?
.+
)
/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleIPFS
(
match
[
1
],
cb
)
}
}
]
},
import
:
function
(
url
,
cb
)
{
var
handlers
=
this
.
handlers
()
var
found
=
false
handlers
.
forEach
(
function
(
handler
)
{
...
...
@@ -63,7 +67,7 @@ module.exports = {
return
}
cb
(
null
,
content
,
cleanUrl
,
handler
.
type
)
cb
(
null
,
content
,
cleanUrl
,
handler
.
type
,
url
)
})
}
})
...
...
src/app/contract/contractParser.js
View file @
829194bd
...
...
@@ -38,7 +38,7 @@ var getDetails = function (contractName, contract, source) {
detail
[
'Runtime Bytecode'
]
=
contract
.
evm
.
deployedBytecode
}
if
(
contract
.
assembly
!==
null
)
{
if
(
source
&&
contract
.
assembly
!==
null
)
{
detail
[
'Assembly'
]
=
formatAssemblyText
(
contract
.
evm
.
legacyAssembly
,
''
,
source
.
content
)
}
...
...
src/app/files/basicReadOnlyExplorer.js
View file @
829194bd
...
...
@@ -5,6 +5,7 @@ class BasicReadOnlyExplorer {
constructor
(
type
)
{
this
.
event
=
new
EventManager
()
this
.
files
=
{}
this
.
normalizedNames
=
{}
// contains the raw url associated with the displayed path
this
.
type
=
type
this
.
readonly
=
true
}
...
...
@@ -25,6 +26,9 @@ class BasicReadOnlyExplorer {
get
(
path
,
cb
)
{
var
content
=
this
.
files
[
path
]
if
(
!
content
)
{
content
=
this
.
files
[
this
.
type
+
'/'
+
this
.
normalizedNames
[
path
]]
}
if
(
cb
)
{
cb
(
null
,
content
)
}
...
...
@@ -37,12 +41,13 @@ class BasicReadOnlyExplorer {
return
true
}
addReadOnly
(
path
,
content
)
{
addReadOnly
(
path
,
content
,
rawPath
)
{
var
unprefixedPath
=
this
.
removePrefix
(
path
)
try
{
// lazy try to format JSON
content
=
JSON
.
stringify
(
JSON
.
parse
(
content
),
null
,
'
\
t'
)
}
catch
(
e
)
{}
this
.
files
[
this
.
type
+
'/'
+
unprefixedPath
]
=
content
this
.
normalizedNames
[
rawPath
]
=
path
this
.
event
.
trigger
(
'fileAdded'
,
[
this
.
type
+
'/'
+
unprefixedPath
,
true
])
return
true
}
...
...
src/app/files/fileManager.js
View file @
829194bd
...
...
@@ -4,6 +4,7 @@ var $ = require('jquery')
var
remixLib
=
require
(
'remix-lib'
)
var
yo
=
require
(
'yo-yo'
)
var
EventManager
=
remixLib
.
EventManager
var
imports
=
require
(
'../compiler/compiler-imports'
)
/*
attach to files event (removed renamed)
...
...
@@ -145,8 +146,14 @@ class FileManager {
fileProviderOf
(
file
)
{
var
provider
=
file
.
match
(
/
[^/]
*/
)
if
(
provider
!==
null
)
{
if
(
provider
!==
null
&&
this
.
opt
.
filesProviders
[
provider
[
0
]]
)
{
return
this
.
opt
.
filesProviders
[
provider
[
0
]]
}
else
{
for
(
var
handler
of
imports
.
handlers
())
{
if
(
handler
.
match
.
exec
(
file
))
{
return
this
.
opt
.
filesProviders
[
handler
.
type
]
}
}
}
return
null
}
...
...
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