diff --git a/aurweb/asgi.py b/aurweb/asgi.py index 228b9a65..5f0ad01d 100644 --- a/aurweb/asgi.py +++ b/aurweb/asgi.py @@ -83,10 +83,7 @@ async def add_security_headers(request: Request, call_next: typing.Callable): # Add CSP header. nonce = request.user.nonce csp = "default-src 'self'; " - script_hosts = [ - "ajax.googleapis.com", - "cdn.jsdelivr.net" - ] + script_hosts = [] csp += f"script-src 'self' 'nonce-{nonce}' " + ' '.join(script_hosts) # It's fine if css is inlined. csp += "; style-src 'self' 'unsafe-inline'" diff --git a/templates/index.html b/templates/index.html index 8cd1cc78..f8745f33 100644 --- a/templates/index.html +++ b/templates/index.html @@ -93,4 +93,14 @@

+ + + + + + + {% endblock %} diff --git a/templates/partials/head.html b/templates/partials/head.html index 0351fd6e..9b438255 100644 --- a/templates/partials/head.html +++ b/templates/partials/head.html @@ -12,5 +12,8 @@ + + + AUR ({{ language }}) - {{ title | tr }} diff --git a/templates/partials/layout.html b/templates/partials/layout.html index 019ebff7..68637ed7 100644 --- a/templates/partials/layout.html +++ b/templates/partials/layout.html @@ -6,6 +6,5 @@ {% include 'partials/navbar.html' %} {% extends 'partials/body.html' %} - {% include 'partials/typeahead.html' %} diff --git a/templates/partials/typeahead.html b/templates/partials/typeahead.html deleted file mode 100644 index c218b8d1..00000000 --- a/templates/partials/typeahead.html +++ /dev/null @@ -1,30 +0,0 @@ - - - diff --git a/web/html/js/typeahead-home.js b/web/html/js/typeahead-home.js new file mode 100644 index 00000000..5af51c53 --- /dev/null +++ b/web/html/js/typeahead-home.js @@ -0,0 +1,6 @@ +document.addEventListener('DOMContentLoaded', function() { + const input = document.getElementById('pkgsearch-field'); + const form = document.getElementById('pkgsearch-form'); + const type = 'suggest'; + typeahead.init(type, input, form); +});