Commit e81614b9 authored by lianahus's avatar lianahus

added modal to ask for download`

parent e6e02988
...@@ -7,6 +7,7 @@ const csjs = require('csjs-inject') ...@@ -7,6 +7,7 @@ const csjs = require('csjs-inject')
const globalRegistry = require('../../../global/registry') const globalRegistry = require('../../../global/registry')
const CompilerImport = require('../../compiler/compiler-imports') const CompilerImport = require('../../compiler/compiler-imports')
const modalDialogCustom = require('../modal-dialog-custom') const modalDialogCustom = require('../modal-dialog-custom')
const modalDialog = require('../modaldialog')
const tooltip = require('../tooltip') const tooltip = require('../tooltip')
const GistHandler = require('../../../lib/gist-handler') const GistHandler = require('../../../lib/gist-handler')
const QueryParams = require('../../../lib/query-params.js') const QueryParams = require('../../../lib/query-params.js')
...@@ -315,8 +316,7 @@ export class LandingPage extends ViewPlugin { ...@@ -315,8 +316,7 @@ export class LandingPage extends ViewPlugin {
node.dispatchEvent(new MouseEvent('click')) node.dispatchEvent(new MouseEvent('click'))
} catch (e) { } catch (e) {
var evt = document.createEvent('MouseEvents') var evt = document.createEvent('MouseEvents')
evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null)
20, false, false, false, false, 0, null)
node.dispatchEvent(evt) node.dispatchEvent(evt)
} }
}, 0) // 40s }, 0) // 40s
...@@ -387,6 +387,18 @@ export class LandingPage extends ViewPlugin { ...@@ -387,6 +387,18 @@ export class LandingPage extends ViewPlugin {
} }
const migrateWorkspace = async () => { const migrateWorkspace = async () => {
modalDialog(
'File system Migration',
yo`<span>'Do you want to save your files first?'</span>`,
{
label: 'Yes',
fn: async () => { await downloadFiles() }
},
{
label: 'No',
fn: () => {}
}
)
tooltip('migrating workspace...') tooltip('migrating workspace...')
try { try {
const workspaceName = await migrateToWorkspace(this.fileManager, this.filePanel) const workspaceName = await migrateToWorkspace(this.fileManager, this.filePanel)
...@@ -474,7 +486,7 @@ export class LandingPage extends ViewPlugin { ...@@ -474,7 +486,7 @@ export class LandingPage extends ViewPlugin {
${this.websiteIcon} ${this.websiteIcon}
<a class="${css.text}" target="__blank" href="https://remix-project.org">Featuring website</a> <a class="${css.text}" target="__blank" href="https://remix-project.org">Featuring website</a>
</p> </p>
<p> <p class="mb-1">
<i class="fab fa-ethereum ${css.image}"></i> <i class="fab fa-ethereum ${css.image}"></i>
<span class="${css.text}" onclick=${() => switchToPreviousVersion()}>Old experience</span> <span class="${css.text}" onclick=${() => switchToPreviousVersion()}>Old experience</span>
</p> </p>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment