From 6442e032d802287e57771e0901ff9214ffe2de97 Mon Sep 17 00:00:00 2001 From: Pixelastic Date: Fri, 2 Nov 2018 11:59:51 +0100 Subject: [PATCH 1/3] Serve playground --- scripts/playground.html | 77 ++++++++++++++++++----------------------- scripts/serve | 4 +-- 2 files changed, 35 insertions(+), 46 deletions(-) diff --git a/scripts/playground.html b/scripts/playground.html index 948e8a31..cc8cf633 100644 --- a/scripts/playground.html +++ b/scripts/playground.html @@ -1,61 +1,50 @@ - - + + DocSearch playground - - - - - + + +
-
-

Search thanks to the assets served at http://127.0.0.1:8080/

-

Do not forget to hard refresh: cmd + maj + R

- +
+

Assets are served from http://127.0.0.1:8080/

+
+
+
+
-
- -
- -
-
-
-

2

- -
-
- -
- -
+
+
+
+
+
- - - - + - + diff --git a/scripts/serve b/scripts/serve index 15dc6477..fe939e63 100755 --- a/scripts/serve +++ b/scripts/serve @@ -3,9 +3,9 @@ yarn run build:css echo "Find all files at http://127.0.0.1:8080/"; -open scripts/playground.html parallelshell \ 'webpack --config webpack.serve.config.babel.js -w' \ 'onchange "./src/styles/*.scss" -- yarn run build:css' \ - 'live-server ./dist/cdn' \ + 'live-server --no-browser ./dist/cdn' \ + "${BROWSER} scripts/playground.html" From 89313450dc71d0a45cc3da16cf695849a9b51b07 Mon Sep 17 00:00:00 2001 From: Pixelastic Date: Mon, 5 Nov 2018 09:50:29 +0100 Subject: [PATCH 2/3] Disable links with handleSelected is defined --- scripts/playground.html | 13 +++--- scripts/test-watch | 1 + src/lib/DocSearch.js | 98 ++++++++++++++++++----------------------- src/lib/templates.js | 2 +- 4 files changed, 52 insertions(+), 62 deletions(-) diff --git a/scripts/playground.html b/scripts/playground.html index cc8cf633..72b6817c 100644 --- a/scripts/playground.html +++ b/scripts/playground.html @@ -15,12 +15,7 @@
- -
-
-
-
- +
@@ -30,11 +25,15 @@ docsearch({ apiKey: '25626fae796133dc1e734c6bcaaeac3c', indexName: 'docsearch', - inputSelector: '#q,#z', + inputSelector: '#q', + // handleSelected(input, event, suggestion) { + // console.info("You selected", suggestion); + // }, debug: true // Set debug to true if you want to inspect the dropdown });