From c6f614f61be6ccc28ee5e1add075d2e4159b0baf Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 12 Apr 2019 12:43:11 +0200 Subject: [PATCH] add import from gist, github, swarm, ipfs --- src/app/ui/landing-page/landing-page.js | 12 ++++++++++-- src/app/ui/modal-dialog-custom.js | 2 +- src/lib/gist-handler.js | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/app/ui/landing-page/landing-page.js b/src/app/ui/landing-page/landing-page.js index 57822cfda1..2d5c6fc95a 100644 --- a/src/app/ui/landing-page/landing-page.js +++ b/src/app/ui/landing-page/landing-page.js @@ -189,6 +189,10 @@ export class LandingPage extends BaseApi { this.appManager.ensureActivated('remixd') } let importFromExternal = () => { load('URL') } + let importFromGist = () => { + let app = globalRegistry.get('app').api + app.loadFromGist({gist: ''}) + } let container = yo`
Remix logo
@@ -227,8 +231,12 @@ export class LandingPage extends BaseApi {

{ connectToLocalhost() }}>Connect to Localhost

-

Import From external source

-
+

Import From:

+ + + + +
diff --git a/src/app/ui/modal-dialog-custom.js b/src/app/ui/modal-dialog-custom.js index f793a892f6..16803b32ab 100644 --- a/src/app/ui/modal-dialog-custom.js +++ b/src/app/ui/modal-dialog-custom.js @@ -66,7 +66,7 @@ module.exports = { function prompt (title, text, hidden, inputValue, ok, cancel, focus) { if (!inputValue) inputValue = '' var type = hidden ? 'password' : 'text' - var input = yo`` + var input = yo`` modal(title, yo`
${text}
${input}
`, { fn: () => { if (typeof ok === 'function') ok(document.getElementById('prompt_text').value) } diff --git a/src/lib/gist-handler.js b/src/lib/gist-handler.js index b66db8ef22..f99001b1ff 100644 --- a/src/lib/gist-handler.js +++ b/src/lib/gist-handler.js @@ -12,7 +12,7 @@ function GistHandler (_window) { var gistId if (params['gist'] === '') { loadingFromGist = true - modalDialogCustom.prompt(null, 'Enter the URL or ID of the Gist you would like to load.', null, (target) => { + modalDialogCustom.prompt(null, 'Enter the ID of the Gist you would like to load.', null, (target) => { if (target !== '') { gistId = getGistId(target) if (gistId) {