about summary refs log tree commit diff
path: root/app/javascript/packs
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2020-12-10 09:40:09 +0100
committerClaire <claire.github-309c@sitedethib.com>2020-12-10 09:41:49 +0100
commit7782e4dc0d9db4835c0f57232da9f8676c97d562 (patch)
treef1f1376074bd3ab6aa42624eabfd8d57a30f9c6b /app/javascript/packs
parentb27d11dd3320cb005561f0bb1b81baecea8a7c43 (diff)
parent49eb4d4ddf61e25c5aaab89aa630ddd3c7f3c23d (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/about_controller.rb`:
  Minor conflict caused by glitch-soc's theming system.
  Ported upstream changes.
Diffstat (limited to 'app/javascript/packs')
-rw-r--r--app/javascript/packs/public.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js
index 3f6700195..2166d8df0 100644
--- a/app/javascript/packs/public.js
+++ b/app/javascript/packs/public.js
@@ -155,6 +155,17 @@ function main() {
       target.style.display = 'block';
     }
   });
+
+  // Empty the honeypot fields in JS in case something like an extension
+  // automatically filled them.
+  delegate(document, '#registration_new_user,#new_user', 'submit', () => {
+    ['user_website', 'user_confirm_password', 'registration_user_website', 'registration_user_confirm_password'].forEach(id => {
+      const field = document.getElementById(id);
+      if (field) {
+        field.value = '';
+      }
+    });
+  });
 }
 
 loadPolyfills()