select-search: naar scripts/, uitvoer naast de bron, URLs naar ua-userscripts

De build schreef naar dist/. In deze repo is het installeerbare bestand altijd
scripts/<naam>/<naam>.user.js, zodat elke installatielink af te leiden valt zonder
in de repo te kijken. @version naar 1.1.0 zodat bestaande installaties die via de
doorverwijzing in de oude repo binnenkomen, hierna nog een stap omhoog doen.
De installatie-uitleg staat voortaan een niveau hoger in de hoofd-README.
This commit is contained in:
Glenn Goossens
2026-08-29 13:35:43 +02:00
parent 702f8b876f
commit 07d4039480
7 changed files with 24 additions and 71 deletions
-3
View File
@@ -1,3 +0,0 @@
.DS_Store
*.swp
*.swo
-21
View File
@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2026 glgoose
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+6 -27
View File
@@ -6,26 +6,8 @@ letters, dus "Poule" vinden in "Restaurant Poule & Poulette B.V." lukt niet. Met
Het originele `<select>` blijft de bron van waarheid en wordt enkel verborgen. Het formulier
verstuurt dus exact hetzelfde als voorheen.
## Installeren
1. Installeer Tampermonkey voor je browser:
| Browser | Extensie | Extra stap |
|---|---|---|
| Firefox | [installeren](https://addons.mozilla.org/firefox/addon/tampermonkey/) | geen |
| Chrome | [installeren](https://chromewebstore.google.com/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo) | zie stap 2 |
| Edge | [installeren](https://microsoftedge.microsoft.com/addons/detail/tampermonkey/iikmkjmpaadaobahmlepeloendndfphd) | zie stap 2 |
2. Alleen Chrome en Edge: ga naar `chrome://extensions` of `edge://extensions`, klik bij
Tampermonkey op *Details* en zet **Allow user scripts** aan. Zonder dat draait geen enkel
userscript.
3. Open de
[installatielink](https://raw.githubusercontent.com/glgoose/select-search/main/dist/select-search.user.js)
en klik op installeren.
Beheert je werkgever je browser, dan zijn extensies mogelijk beperkt tot een goedgekeurde lijst.
Vraag het na bij IT. Kan het niet, gebruik dan de [bookmarklet](#bookmarklet).
[**Installeren**](https://raw.githubusercontent.com/glgoose/ua-userscripts/main/scripts/select-search/select-search.user.js)
· gebeurt er niets, zie de [installatie-uitleg](../../README.md).
## Gebruik
@@ -48,9 +30,10 @@ Klik een dropdown aan en typ.
## Bookmarklet
Alternatief zonder extensie. Werkt overal, maar je klikt hem zelf aan per pagina.
Alternatief zonder extensie, voor wie geen extensies mag installeren. Werkt overal, maar je klikt
hem zelf aan per pagina.
1. Kopieer de inhoud van [`dist/bookmarklet.txt`](dist/bookmarklet.txt).
1. Kopieer de inhoud van [`bookmarklet.txt`](bookmarklet.txt).
2. Maak een bladwijzer met naam `Zoek in dropdown` en die tekst als URL.
3. Klik hem aan op de pagina met de dropdown. Nog eens klikken doet een herscan.
@@ -62,13 +45,9 @@ route.
`src/select-search.js` bevat de volledige logica, zonder dependencies.
```sh
./build.sh # genereert dist/ (userscript + bookmarklet)
./build.sh # genereert select-search.user.js en bookmarklet.txt
python3 -m http.server 8731 # open http://localhost:8731/test/fixture.html
```
Hoog bij elke wijziging `@version` op in `src/userscript-header.txt`, anders krijgt niemand de
update binnen.
## Licentie
MIT
+6 -8
View File
@@ -6,7 +6,7 @@ set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
src="$here/src/select-search.js"
hdr="$here/src/userscript-header.txt"
dist="$here/dist"
out="$here"
for f in "$src" "$hdr"; do
if [ ! -f "$f" ]; then
@@ -25,13 +25,11 @@ if grep -q 'MATCH_PLACEHOLDER' "$hdr"; then
exit 1
fi
mkdir -p "$dist"
# 1. Userscript = metadatablok + ongewijzigde core.
cat "$hdr" "$src" > "$dist/select-search.user.js"
cat "$hdr" "$src" > "$out/select-search.user.js"
# 2. Bookmarklet = core, URL-encoded achter javascript:.
python3 - "$src" "$dist/bookmarklet.txt" <<'PY'
python3 - "$src" "$out/bookmarklet.txt" <<'PY'
import io, sys, urllib.parse
src, out = sys.argv[1], sys.argv[2]
@@ -58,9 +56,9 @@ print('bookmarklet: %d tekens' % len(url))
PY
if command -v pbcopy >/dev/null 2>&1; then
pbcopy < "$dist/bookmarklet.txt"
pbcopy < "$out/bookmarklet.txt"
echo "bookmarklet gekopieerd naar het klembord"
fi
echo "geschreven: $dist/select-search.user.js"
echo "geschreven: $dist/bookmarklet.txt"
echo "geschreven: $out/select-search.user.js"
echo "geschreven: $out/bookmarklet.txt"
@@ -1,14 +1,14 @@
// ==UserScript==
// @name Doorzoekbare dropdowns (select-search)
// @namespace https://github.com/glgoose/select-search
// @version 1.0.0
// @namespace https://github.com/glgoose/ua-userscripts
// @version 1.1.0
// @description Geeft elke <select> met veel opties een zoekveld met substring-zoeken.
// @author glgoose
// @license MIT
// @homepageURL https://github.com/glgoose/select-search
// @supportURL https://github.com/glgoose/select-search/issues
// @downloadURL https://raw.githubusercontent.com/glgoose/select-search/main/dist/select-search.user.js
// @updateURL https://raw.githubusercontent.com/glgoose/select-search/main/dist/select-search.user.js
// @homepageURL https://github.com/glgoose/ua-userscripts/tree/main/scripts/select-search
// @supportURL https://github.com/glgoose/ua-userscripts/issues
// @downloadURL https://raw.githubusercontent.com/glgoose/ua-userscripts/main/scripts/select-search/select-search.user.js
// @updateURL https://raw.githubusercontent.com/glgoose/ua-userscripts/main/scripts/select-search/select-search.user.js
// @match https://bipp.biotechpartner.be/web/*
// @run-at document-idle
// @grant none
@@ -1,14 +1,14 @@
// ==UserScript==
// @name Doorzoekbare dropdowns (select-search)
// @namespace https://github.com/glgoose/select-search
// @version 1.0.0
// @namespace https://github.com/glgoose/ua-userscripts
// @version 1.1.0
// @description Geeft elke <select> met veel opties een zoekveld met substring-zoeken.
// @author glgoose
// @license MIT
// @homepageURL https://github.com/glgoose/select-search
// @supportURL https://github.com/glgoose/select-search/issues
// @downloadURL https://raw.githubusercontent.com/glgoose/select-search/main/dist/select-search.user.js
// @updateURL https://raw.githubusercontent.com/glgoose/select-search/main/dist/select-search.user.js
// @homepageURL https://github.com/glgoose/ua-userscripts/tree/main/scripts/select-search
// @supportURL https://github.com/glgoose/ua-userscripts/issues
// @downloadURL https://raw.githubusercontent.com/glgoose/ua-userscripts/main/scripts/select-search/select-search.user.js
// @updateURL https://raw.githubusercontent.com/glgoose/ua-userscripts/main/scripts/select-search/select-search.user.js
// @match https://bipp.biotechpartner.be/web/*
// @run-at document-idle
// @grant none