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
62749fb4
Unverified
Commit
62749fb4
authored
Aug 14, 2018
by
yann300
Committed by
GitHub
Aug 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1456 from ethereum/importUrlRawContent
Compiler Import (add raw url)
parents
5f9d8ef4
5205aed1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
9 deletions
+37
-9
config.yml
.circleci/config.yml
+4
-4
app.js
src/app.js
+2
-0
compiler-imports.js
src/app/compiler/compiler-imports.js
+16
-4
file-panel.js
src/app/panels/file-panel.js
+12
-0
config.js
src/config.js
+3
-1
No files found.
.circleci/config.yml
View file @
62749fb4
...
...
@@ -26,10 +26,10 @@ jobs:
-
checkout
-
restore_cache
:
keys
:
-
dep-bundle-1
7
-{{ checksum "package.json" }}
-
dep-bundle-1
8
-{{ checksum "package.json" }}
-
run
:
npm install
-
save_cache
:
key
:
dep-bundle-1
7
-{{ checksum "package.json" }}
key
:
dep-bundle-1
8
-{{ checksum "package.json" }}
paths
:
-
~/repo/node_modules
-
run
:
npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
...
...
@@ -46,10 +46,10 @@ jobs:
-
checkout
-
restore_cache
:
keys
:
-
dep-bundle-1
2
-{{ checksum "package.json" }}
-
dep-bundle-1
3
-{{ checksum "package.json" }}
-
run
:
npm install
-
save_cache
:
key
:
dep-bundle-1
2
-{{ checksum "package.json" }}
key
:
dep-bundle-1
3
-{{ checksum "package.json" }}
paths
:
-
~/repo/node_modules
-
run
:
npm run build_debugger
...
...
src/app.js
View file @
62749fb4
...
...
@@ -148,6 +148,8 @@ class App {
self
.
_components
.
filesProviders
[
'github'
]
=
new
BasicReadOnlyExplorer
(
'github'
)
self
.
_components
.
filesProviders
[
'gist'
]
=
new
NotPersistedExplorer
(
'gist'
)
self
.
_components
.
filesProviders
[
'ipfs'
]
=
new
BasicReadOnlyExplorer
(
'ipfs'
)
self
.
_components
.
filesProviders
[
'https'
]
=
new
BasicReadOnlyExplorer
(
'https'
)
self
.
_components
.
filesProviders
[
'http'
]
=
new
BasicReadOnlyExplorer
(
'http'
)
registry
.
put
({
api
:
self
.
_components
.
filesProviders
[
'localhost'
],
name
:
'fileproviders/localhost'
})
registry
.
put
({
api
:
self
.
_components
.
filesProviders
[
'swarm'
],
name
:
'fileproviders/swarm'
})
registry
.
put
({
api
:
self
.
_components
.
filesProviders
[
'github'
],
name
:
'fileproviders/github'
})
...
...
src/app/compiler/compiler-imports.js
View file @
62749fb4
...
...
@@ -40,10 +40,7 @@ module.exports = class CompilerImports {
return
request
.
get
(
{
url
:
'https://gateway.ipfs.io/'
+
url
,
headers
:
{
'User-Agent'
:
'Remix'
}
url
:
'https://gateway.ipfs.io/'
+
url
},
(
err
,
r
,
data
)
=>
{
if
(
err
)
{
...
...
@@ -53,9 +50,24 @@ module.exports = class CompilerImports {
})
}
handleHttpCall
(
url
,
cleanUrl
,
cb
)
{
return
request
.
get
(
{
url
},
(
err
,
r
,
data
)
=>
{
if
(
err
)
{
return
cb
(
err
||
'Unknown transport error'
)
}
cb
(
null
,
data
,
cleanUrl
)
})
}
handlers
()
{
return
[
{
type
:
'github'
,
match
:
/^
(
https
?
:
\/\/)?(
www.
)?
github.com
\/([^/]
*
\/[^/]
*
)\/(
.*
)
/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleGithubCall
(
match
[
3
],
match
[
4
],
cb
)
}
},
{
type
:
'http'
,
match
:
/^
(
http
?
:
\/\/?(
.*
))
$/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleHttpCall
(
match
[
1
],
match
[
2
],
cb
)
}
},
{
type
:
'https'
,
match
:
/^
(
https
?
:
\/\/?(
.*
))
$/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleHttpCall
(
match
[
1
],
match
[
2
],
cb
)
}
},
{
type
:
'swarm'
,
match
:
/^
(
bzz
[
ri
]?
:
\/\/?(
.*
))
$/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleSwarmImport
(
match
[
1
],
match
[
2
],
cb
)
}
},
{
type
:
'ipfs'
,
match
:
/^
(
ipfs:
\/\/?
.+
)
/
,
handler
:
(
match
,
cb
)
=>
{
this
.
handleIPFS
(
match
[
1
],
cb
)
}
}
]
...
...
src/app/panels/file-panel.js
View file @
62749fb4
...
...
@@ -58,6 +58,8 @@ function filepanel (localRegistry) {
var
githubExplorer
=
new
FileExplorer
(
self
.
_components
.
registry
,
self
.
_deps
.
fileProviders
[
'github'
])
var
gistExplorer
=
new
FileExplorer
(
self
.
_components
.
registry
,
self
.
_deps
.
fileProviders
[
'gist'
])
var
configExplorer
=
new
FileExplorer
(
self
.
_components
.
registry
,
self
.
_deps
.
fileProviders
[
'config'
])
var
httpExplorer
=
new
FileExplorer
(
self
.
_components
.
registry
,
self
.
_deps
.
fileProviders
[
'http'
])
var
httpsExplorer
=
new
FileExplorer
(
self
.
_components
.
registry
,
self
.
_deps
.
fileProviders
[
'https'
])
// ----------------- editor panel ----------------------
self
.
_compilerMetadata
=
new
CompilerMetadata
(
...
...
@@ -125,6 +127,8 @@ function filepanel (localRegistry) {
<div class="swarmexplorer
${
css
.
treeview
}
">
${
swarmExplorer
.
init
()}
</div>
<div class="githubexplorer
${
css
.
treeview
}
">
${
githubExplorer
.
init
()}
</div>
<div class="gistexplorer
${
css
.
treeview
}
">
${
gistExplorer
.
init
()}
</div>
<div class="httpexplorer
${
css
.
treeview
}
">
${
httpExplorer
.
init
()}
</div>
<div class="httpsexplorer
${
css
.
treeview
}
">
${
httpsExplorer
.
init
()}
</div>
</div>
</div>
${
dragbar
}
...
...
@@ -185,6 +189,14 @@ function filepanel (localRegistry) {
self
.
_deps
.
fileManager
.
switchFile
(
path
)
})
httpExplorer
.
events
.
register
(
'focus'
,
function
(
path
)
{
self
.
_deps
.
fileManager
.
switchFile
(
path
)
})
httpsExplorer
.
events
.
register
(
'focus'
,
function
(
path
)
{
self
.
_deps
.
fileManager
.
switchFile
(
path
)
})
self
.
render
=
function
render
()
{
return
element
}
function
uploadFile
(
event
)
{
...
...
src/config.js
View file @
62749fb4
...
...
@@ -41,7 +41,9 @@ function Config (storage) {
this
.
items
[
key
].
indexOf
(
'swarm/'
)
!==
0
&&
this
.
items
[
key
].
indexOf
(
'gist/'
)
!==
0
&&
this
.
items
[
key
].
indexOf
(
'github/'
)
!==
0
&&
this
.
items
[
key
].
indexOf
(
'ipfs/'
)
!==
0
)
{
this
.
items
[
key
].
indexOf
(
'ipfs/'
)
!==
0
&&
this
.
items
[
key
].
indexOf
(
'http/'
)
!==
0
&&
this
.
items
[
key
].
indexOf
(
'https/'
)
!==
0
)
{
this
.
items
[
key
]
=
'browser/'
+
this
.
items
[
key
]
}
}
...
...
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