diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-08-26 08:32:42 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-08-26 08:32:42 +0200 |
commit | 6824e6bcf881c83091f844f55fcfed0c5f4de826 (patch) | |
tree | 8c3b6fdfa1b17c91caa5e6adff54ce38e02cdf41 /scripts/update-autocomplete | |
parent | 8360f1f3953be284f3f4ff51a6717cc8f4c00176 (diff) |
generate autocomplete list dynamically from installed IRIS module
Diffstat (limited to 'scripts/update-autocomplete')
-rwxr-xr-x | scripts/update-autocomplete | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/scripts/update-autocomplete b/scripts/update-autocomplete deleted file mode 100755 index 22aab91..0000000 --- a/scripts/update-autocomplete +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env perl -# Copyright (C) 2020 Birte Kristina Friesel -# -# SPDX-License-Identifier: CC0-1.0 - -use strict; -use warnings; -use 5.020; - -use JSON; -use File::Slurp qw(write_file); -use Travel::Status::DE::IRIS::Stations; - -my @station_names = map { $_->[1] } Travel::Status::DE::IRIS::Stations::get_stations(); - -my $station_json = JSON->new->utf8->encode([@station_names]); - -my $autocomplete = <<"EOF"; -\$(function() { - var stations = $station_json; - \$('input.station').autocomplete({ - delay: 0, - minLength: 3, - source: stations - }); -}); -EOF - -write_file("public/static/js/autocomplete.js", $autocomplete); |