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
7cbd4be9
Commit
7cbd4be9
authored
Mar 24, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
download file system
parent
01c2781f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
landing-page.js
apps/remix-ide/src/app/ui/landing-page/landing-page.js
+25
-0
No files found.
apps/remix-ide/src/app/ui/landing-page/landing-page.js
View file @
7cbd4be9
...
...
@@ -297,6 +297,27 @@ export class LandingPage extends ViewPlugin {
this
.
call
(
'fileExplorers'
,
'createNewFile'
)
}
const
downloadFiles
=
async
()
=>
{
const
fileProviders
=
globalRegistry
.
get
(
'fileproviders'
).
api
const
json
=
await
fileProviders
.
browser
.
copyFolderToJson
(
'/'
)
const
blob
=
new
Blob
([
JSON
.
stringify
(
json
,
null
,
'
\
t'
)
],
{
type
:
'text/plain;charset=utf-8'
})
const
node
=
document
.
createElement
(
'a'
)
node
.
download
=
'remix.json'
node
.
rel
=
'noopener'
node
.
href
=
URL
.
createObjectURL
(
blob
)
setTimeout
(
function
()
{
URL
.
revokeObjectURL
(
a
.
href
)
},
4
E4
)
// 40s
setTimeout
(
function
()
{
try
{
node
.
dispatchEvent
(
new
MouseEvent
(
'click'
))
}
catch
(
e
)
{
var
evt
=
document
.
createEvent
(
'MouseEvents'
)
evt
.
initMouseEvent
(
'click'
,
true
,
true
,
window
,
0
,
0
,
0
,
80
,
20
,
false
,
false
,
false
,
false
,
0
,
null
)
node
.
dispatchEvent
(
evt
)
}
},
0
)
// 40s
}
const
uploadFile
=
(
target
)
=>
{
this
.
call
(
'fileExplorers'
,
'uploadFile'
,
target
)
}
...
...
@@ -413,6 +434,10 @@ export class LandingPage extends ViewPlugin {
<i class="
far
fa
-
hdd
"></i>
<span class="
ml
-
1
$
{
css
.
text
}
" onclick=
${()
=>
connectToLocalhost
()}
>Connect to Localhost</span>
</p>
<p class="mb-1">
<i class="mr-1 far fa-file"></i>
<span class="ml-1 mb-1
${
css
.
text
}
" onclick=
${()
=>
downloadFiles
()}
>Download all Files</span>
</p>
<p class="mt-3 mb-0"><label>IMPORT FROM:</label></p>
<div class="btn-group">
<button class="btn mr-1 btn-secondary" data-id="landingPageImportFromGistButton" onclick="
${()
=>
importFromGist
()}
">Gist</button>
...
...
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