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
a7a48382
Commit
a7a48382
authored
Mar 09, 2017
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow only ipfs:/ or ipfs://
parent
4f0bed8e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
app.js
src/app.js
+2
-2
No files found.
src/app.js
View file @
a7a48382
...
@@ -532,7 +532,7 @@ var run = function () {
...
@@ -532,7 +532,7 @@ var run = function () {
function
handleIPFS
(
url
,
cb
)
{
function
handleIPFS
(
url
,
cb
)
{
// replace ipfs:// with /ipfs/
// replace ipfs:// with /ipfs/
url
=
url
.
replace
(
/^ipfs:
\/\/?
/
,
'
/
ipfs/'
)
url
=
url
.
replace
(
/^ipfs:
\/\/?
/
,
'ipfs/'
)
$
(
'#output'
).
append
(
$
(
'<div/>'
).
append
(
$
(
'<pre/>'
).
text
(
'Loading '
+
url
+
' ...'
)))
$
(
'#output'
).
append
(
$
(
'<div/>'
).
append
(
$
(
'<pre/>'
).
text
(
'Loading '
+
url
+
' ...'
)))
return
$
.
get
(
'https://gateway.ipfs.io/'
+
url
)
return
$
.
get
(
'https://gateway.ipfs.io/'
+
url
)
...
@@ -573,7 +573,7 @@ var run = function () {
...
@@ -573,7 +573,7 @@ var run = function () {
files
.
addReadOnly
(
url
,
content
)
files
.
addReadOnly
(
url
,
content
)
cb
(
null
,
content
)
cb
(
null
,
content
)
})
})
}
else
if
((
match
=
/^
(
\/?
ipfs:
?
\/\/?
.+
)
/
.
exec
(
url
)))
{
}
else
if
((
match
=
/^
(
ipfs:
\/\/?
.+
)
/
.
exec
(
url
)))
{
handleIPFS
(
match
[
1
],
function
(
err
,
content
)
{
handleIPFS
(
match
[
1
],
function
(
err
,
content
)
{
if
(
err
)
{
if
(
err
)
{
cb
(
'Unable to import "'
+
url
+
'": '
+
err
)
cb
(
'Unable to import "'
+
url
+
'": '
+
err
)
...
...
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