Skip to content

Instantly share code, notes, and snippets.

@psqq
Last active November 3, 2020 06:19
Show Gist options
  • Select an option

  • Save psqq/5c9b1d4bf6b5cc3469fde370d73fafb8 to your computer and use it in GitHub Desktop.

Select an option

Save psqq/5c9b1d4bf6b5cc3469fde370d73fafb8 to your computer and use it in GitHub Desktop.

Revisions

  1. psqq revised this gist Nov 3, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -2,5 +2,5 @@
    # Running

    ```
    deno run -A --unstable https://gist.github.com/psqq/5c9b1d4bf6b5cc3469fde370d73fafb8/raw/1c340cffe64e3b39c17cd2f2b9611f7a00fb766f/main.ts
    deno run -A --unstable https://gist.github.com/psqq/5c9b1d4bf6b5cc3469fde370d73fafb8/raw/29bbb3f19e9ba2f8b8e630ef1224d360281b8c9a/main.ts
    ```
  2. psqq revised this gist Nov 3, 2020. 1 changed file with 15 additions and 5 deletions.
    20 changes: 15 additions & 5 deletions main.ts
    Original file line number Diff line number Diff line change
    @@ -2,12 +2,21 @@
    import { WebView } from "https://deno.land/x/webview/mod.ts";
    // Creating an HTML page
    let html = `
    <html>
    <body>
    <h1>Hello World!</h1>
    </body>
    </html>
    <html>
    <body>
    <input type="text"/>
    Result: "<span></span>".
    <script>
    document.querySelector('input').addEventListener('keyup', function(e) {
    var s = e.target.value;
    var res = s.toLowerCase().split(' ').join('-');
    document.querySelector('span').innerText = res;
    });
    </script>
    </body>
    </html>
    `;

    // Creating and configuring the webview
    const webview = new WebView({
    title: "Deno Webview Example",
    @@ -18,5 +27,6 @@ const webview = new WebView({
    debug: true,
    frameless: false
    });

    // Running the webview
    webview.run();
  3. psqq revised this gist Nov 3, 2020. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@

    # Running

    ```
    deno run -A --unstable https://gist.github.com/psqq/5c9b1d4bf6b5cc3469fde370d73fafb8/raw/1c340cffe64e3b39c17cd2f2b9611f7a00fb766f/main.ts
    ```
  4. psqq created this gist Nov 3, 2020.
    22 changes: 22 additions & 0 deletions main.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    // Importing the webview library
    import { WebView } from "https://deno.land/x/webview/mod.ts";
    // Creating an HTML page
    let html = `
    <html>
    <body>
    <h1>Hello World!</h1>
    </body>
    </html>
    `;
    // Creating and configuring the webview
    const webview = new WebView({
    title: "Deno Webview Example",
    url: "data:text/html," + html,
    width: 800,
    height: 600,
    resizable: true,
    debug: true,
    frameless: false
    });
    // Running the webview
    webview.run();