You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by ar...@apache.org on 2026/04/23 08:49:29 UTC

(tooling-trusted-releases) branch main updated: Add missing JS

This is an automated email from the ASF dual-hosted git repository.

alitheg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new 12dfbfd1 Add missing JS
12dfbfd1 is described below

commit 12dfbfd12d4da65794782063e6ad5a518eed0f85
Author: Alastair McFarlane <ar...@apache.org>
AuthorDate: Thu Apr 23 09:49:17 2026 +0100

    Add missing JS
---
 atr/static/js/src/form-confirm.js | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/atr/static/js/src/form-confirm.js b/atr/static/js/src/form-confirm.js
new file mode 100644
index 00000000..78b26a4c
--- /dev/null
+++ b/atr/static/js/src/form-confirm.js
@@ -0,0 +1,28 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+document.addEventListener("DOMContentLoaded", () => {
+	for (const form of document.querySelectorAll("form[data-confirm]")) {
+		form.addEventListener("submit", (event) => {
+			if (!window.confirm(form.dataset.confirm)) {
+				event.preventDefault();
+			}
+		});
+	}
+});


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org