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
854e743b
Commit
854e743b
authored
May 03, 2019
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add example
parent
2f8253bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
landing-page.js
src/app/ui/landing-page/landing-page.js
+9
-5
No files found.
src/app/ui/landing-page/landing-page.js
View file @
854e743b
...
...
@@ -90,10 +90,13 @@ export class LandingPage extends BaseApi {
}
render
()
{
let
load
=
function
(
service
,
item
)
{
let
load
=
function
(
service
,
item
,
examples
)
{
let
compilerImport
=
new
CompilerImport
()
let
fileProviders
=
globalRegistry
.
get
(
'fileproviders'
).
api
modalDialogCustom
.
prompt
(
`Import from
${
service
}
`
,
'Enter the '
+
item
+
' you would like to load.'
,
null
,
(
target
)
=>
{
const
msg
=
yo
`<div><span>Enter the
${
item
}
you would like to load.</span>
<div>e.g
${
examples
.
map
((
url
)
=>
{
return
yo
`<div>
${
url
}
</div>`
})}
</div></div>`
modalDialogCustom
.
prompt
(
`Import from
${
service
}
`
,
msg
,
null
,
(
target
)
=>
{
if
(
target
!==
''
)
{
compilerImport
.
import
(
target
,
...
...
@@ -104,6 +107,7 @@ export class LandingPage extends BaseApi {
}
else
{
if
(
fileProviders
[
type
])
{
fileProviders
[
type
].
addReadOnly
(
cleanUrl
,
content
,
url
)
globalRegistry
.
get
(
'verticalicon'
).
api
.
select
(
'fileExplorers'
)
}
}
}
...
...
@@ -212,9 +216,9 @@ export class LandingPage extends BaseApi {
<
p
class
=
"mb-1"
>
Import
From
:
<
/p
>
<
div
class
=
"btn-group"
>
<
button
class
=
"btn btn-sm btn-secondary"
onclick
=
$
{()
=>
{
importFromGist
()
}}
>
Gist
<
/button
>
<
button
class
=
"btn btn-sm btn-secondary"
onclick
=
$
{()
=>
{
load
(
'Github'
,
'Github URL'
)
}}
>
Github
<
/button
>
<
button
class
=
"btn btn-sm btn-secondary"
onclick
=
$
{()
=>
{
load
(
'Swarm'
,
'bzz-raw URL'
)
}}
>
Swarm
<
/button
>
<
button
class
=
"btn btn-sm btn-secondary"
onclick
=
$
{()
=>
{
load
(
'Ipfs'
,
'ipfs URL'
)
}}
>
Ipfs
<
/button
>
<
button
class
=
"btn btn-sm btn-secondary"
onclick
=
$
{()
=>
{
load
(
'Github'
,
'Github URL'
,
[
'https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/crowdsale/Crowdsale.sol'
,
'https://github.com/OpenZeppelin/openzeppelin-solidity/blob/67bca857eedf99bf44a4b6a0fc5b5ed553135316/contracts/access/Roles.sol'
,
'github:OpenZeppelin/openzeppelin-solidity/contracts/ownership/Ownable.sol#v2.1.2'
]
)
}}
>
Github
<
/button
>
<
button
class
=
"btn btn-sm btn-secondary"
onclick
=
$
{()
=>
{
load
(
'Swarm'
,
'bzz-raw URL'
,
[
'bzz-raw://<swarm-hash>'
]
)
}}
>
Swarm
<
/button
>
<
button
class
=
"btn btn-sm btn-secondary"
onclick
=
$
{()
=>
{
load
(
'Ipfs'
,
'ipfs URL'
,
[
'ipfs://<ipfs-hash>'
]
)
}}
>
Ipfs
<
/button
>
<
/div><!-- end of btn-group --
>
<
/div><!-- end of div.file --
>
<
/div><!-- end of #col1 --
>
...
...
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