pull/1021/head
yann300 4 years ago
parent 7cbd4be943
commit 08e3787fbf
  1. 40
      apps/remix-ide/src/app/ui/landing-page/landing-page.js

@ -298,24 +298,30 @@ export class LandingPage extends ViewPlugin {
} }
const downloadFiles = async () => { const downloadFiles = async () => {
const fileProviders = globalRegistry.get('fileproviders').api try {
const json = await fileProviders.browser.copyFolderToJson('/') 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 blob = new Blob([ JSON.stringify(json, null, '\t') ], { type: 'text/plain;charset=utf-8' }) const blob = new Blob([ JSON.stringify(json, null, '\t') ], { type: 'text/plain;charset=utf-8' })
const node = document.createElement('a') const blob = new Blob([ JSON.stringify(json, null, '\t') ], { type: 'text/plain;charset=utf-8' })
node.download = 'remix.json' const node = document.createElement('a')
node.rel = 'noopener' node.download = 'remix.json'
node.href = URL.createObjectURL(blob) node.rel = 'noopener'
setTimeout(function () { URL.revokeObjectURL(a.href) }, 4E4) // 40s node.href = URL.createObjectURL(blob)
setTimeout(function () { setTimeout(function () { URL.revokeObjectURL(a.href) }, 4E4) // 40s
try { setTimeout(function () {
node.dispatchEvent(new MouseEvent('click')) try {
} catch (e) { node.dispatchEvent(new MouseEvent('click'))
var evt = document.createEvent('MouseEvents') } catch (e) {
evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, var evt = document.createEvent('MouseEvents')
20, false, false, false, false, 0, null) evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80,
node.dispatchEvent(evt) 20, false, false, false, false, 0, null)
} node.dispatchEvent(evt)
}, 0) // 40s }
}, 0) // 40s
} catch (e) {
tooltip(e.message)
}
} }
const uploadFile = (target) => { const uploadFile = (target) => {

Loading…
Cancel
Save