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
0713a146
Commit
0713a146
authored
Jan 30, 2018
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove compiler-imports back to browser-solidity (still too specific to browser-solidity)
parent
6514fe86
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
87 deletions
+0
-87
package.json
remix-solidity/package.json
+0
-2
compiler-imports.js
remix-solidity/src/compiler/compiler-imports.js
+0
-85
No files found.
remix-solidity/package.json
View file @
0713a146
...
...
@@ -23,8 +23,6 @@
"fast-async"
:
"^6.1.2"
,
"remix-core"
:
"latest"
,
"remix-lib"
:
"latest"
,
"js-base64"
:
"^2.1.9"
,
"swarmgw"
:
"^0.2.0"
,
"webworkify"
:
"^1.2.1"
,
"solc"
:
"^0.4.13"
,
"standard"
:
"^7.0.1"
,
...
...
remix-solidity/src/compiler/compiler-imports.js
deleted
100644 → 0
View file @
6514fe86
'use strict'
// TODO: can just use request or fetch instead
var
$
=
require
(
'jquery'
)
var
base64
=
require
(
'js-base64'
).
Base64
var
swarmgw
=
require
(
'swarmgw'
)
module
.
exports
=
{
handleGithubCall
:
function
(
root
,
path
,
cb
)
{
return
$
.
getJSON
(
'https://api.github.com/repos/'
+
root
+
'/contents/'
+
path
)
.
done
(
function
(
data
)
{
if
(
'content'
in
data
)
{
cb
(
null
,
base64
.
decode
(
data
.
content
),
root
+
'/'
+
path
)
}
else
{
cb
(
'Content not received'
)
}
})
.
fail
(
function
(
xhr
,
text
,
err
)
{
// NOTE: on some browsers, err equals to '' for certain errors (such as offline browser)
cb
(
err
||
'Unknown transport error'
)
})
},
handleSwarmImport
:
function
(
url
,
cb
)
{
swarmgw
.
get
(
url
,
function
(
err
,
content
)
{
cb
(
err
,
content
,
url
)
})
},
handleIPFS
:
function
(
url
,
cb
)
{
// replace ipfs:// with /ipfs/
url
=
url
.
replace
(
/^ipfs:
\/\/?
/
,
'ipfs/'
)
return
$
.
ajax
({
type
:
'GET'
,
url
:
'https://gateway.ipfs.io/'
+
url
})
.
done
(
function
(
data
)
{
cb
(
null
,
data
,
url
)
})
.
fail
(
function
(
xhr
,
text
,
err
)
{
// NOTE: on some browsers, err equals to '' for certain errors (such as offline browser)
cb
(
err
||
'Unknown transport error'
)
})
},
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
)
{
if
(
found
)
{
return
}
var
match
=
handler
.
match
.
exec
(
url
)
if
(
match
)
{
found
=
true
// TODO: this needs to be moved to the caller
$
(
'#output'
).
append
(
$
(
'<div/>'
).
append
(
$
(
'<pre/>'
).
text
(
'Loading '
+
url
+
' ...'
)))
handler
.
handler
(
match
,
function
(
err
,
content
,
cleanUrl
)
{
if
(
err
)
{
cb
(
'Unable to import "'
+
cleanUrl
+
'": '
+
err
)
return
}
cb
(
null
,
content
,
cleanUrl
,
handler
.
type
,
url
)
})
}
})
if
(
found
)
{
return
}
else
if
(
/^
[^
:
]
*:
\/\/
/
.
exec
(
url
))
{
cb
(
'Unable to import "'
+
url
+
'": Unsupported URL schema'
)
}
else
{
cb
(
'Unable to import "'
+
url
+
'": File not found'
)
}
}
}
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