From 491145ad3f59d0e0c017aaddbcbce235f3269c3c Mon Sep 17 00:00:00 2001 From: Mikey Oz Date: Tue, 3 May 2022 15:30:35 -0700 Subject: [PATCH] implement paste handling --- app/client.imba | 6 ++++++ package.json | 2 +- sw.imba | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/client.imba b/app/client.imba index 2b8bd24..b05e6fd 100644 --- a/app/client.imba +++ b/app/client.imba @@ -94,6 +94,11 @@ tag app def handle_click_export download_json_file JSON.stringify(state.links) + def handle_paste e + return if state.query.length > 0 + global.setTimeout(&, 0) do + window.location.href = 'https://www.google.com/search?q=' + state.query.trim! + def render @@ -145,6 +150,7 @@ tag app @hotkey('shift+return').capture=handle_shift_return @hotkey('esc').capture=$input..blur @input=handle_input + @paste=handle_paste > <.links> for obj in state.scored_links diff --git a/package.json b/package.json index 2c8da8d..d305744 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fuzzyhome", - "version": "0.0.6", + "version": "0.0.7", "scripts": { "start": "imba run -SMH --baseurl . -w server.imba", "build-app": "imba build -SMH --baseurl . server.imba", diff --git a/sw.imba b/sw.imba index 78832c5..c5011fb 100644 --- a/sw.imba +++ b/sw.imba @@ -1,7 +1,7 @@ let p = console.log const app_prefix = "fuzzyhome_cache" -const version = "0.0.6" +const version = "0.0.7" const cache_name = "{app_prefix}-{version}"