From nobody Thu Mar 28 21:07:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1556795899; cv=none; d=zoho.com; s=zohoarc; b=agth1M5PRVV4q4JMvXmNeOkHWDf7+jRnc/qDdt+h+qpX8Mnf0kmn0Su18B+zAhkAWDED8VC+LxkseC3JDXDKXJ4Ofj2gGagUv7hfeI3h8Q9TKZLTlv7/7Q1FIfJzceODc31/wgG12l/HlDL5Yf2btjlmiSoxNObn3OM+5368QGM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556795899; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Hza8FccwKduaRbdr/iigt/I+yIrUT1Kr94vsaWM/ujU=; b=BV280pKHzKbA8HjvVGj9SbW7xuDfC4mdfjjaa3Mskg1bZZm0AykaehQHMFu8/0JSSyFK+R+LOWk8EhcxpEmYMeroShIC+PxmycHmDoRB7vAEMXoN81EUK9t352IVUfmf0ig7i4bHYK+BkQdfzKDPMOW4gqlHmQddLKb3KVfsemM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1556795899390698.3483954465424; Thu, 2 May 2019 04:18:19 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 192E188313; Thu, 2 May 2019 11:18:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F4288A28C; Thu, 2 May 2019 11:18:18 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0492341F3E; Thu, 2 May 2019 11:18:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x42BIGh8008985 for ; Thu, 2 May 2019 07:18:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5DBA7174B1; Thu, 2 May 2019 11:18:16 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 58C1C39C1 for ; Thu, 2 May 2019 11:18:16 +0000 (UTC) Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1BA25F79C for ; Thu, 2 May 2019 11:18:15 +0000 (UTC) Received: by mail-oi1-f173.google.com with SMTP id t184so1284696oie.11 for ; Thu, 02 May 2019 04:18:15 -0700 (PDT) Received: from localhost.localdomain ([198.59.53.9]) by smtp.gmail.com with ESMTPSA id o1sm19095697otj.11.2019.05.02.04.18.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 May 2019 04:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5klaiIwM+e1Q4RHFiKiohlmL+fObc/yqIQrrkq16Kak=; b=R9dIttQztN/UTJHY3Zsxd9zaSb08KlL0x31jsVOvq6rr9AKTehE6KKGlmMjBxUeTaA PCDLC5258++MWnhJ7mwyjdvderdzIEuhuZ+n57bvWWdilaaPBcNXbEM/sCECgQy0swJH SIxWEBH7DjyrM2MjmErFSFgf41cloJDxnMNx5uw14zXlb6uo6xUYsWehife9sdvk3yUN 8ZNLk5Uw/3MKIZ6mN2hBaji5QJtX5OkfEe1aeRUjTy1hPrQYETJbKhvopXlF+X0XIaAt CplIeZ482FQeSxdHpyhUJEkzmQfcKmOUBFpf9te4Ujw2GBDLbuAIL3O/t90OVj9Nw4hd 0Jgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5klaiIwM+e1Q4RHFiKiohlmL+fObc/yqIQrrkq16Kak=; b=QLuncfoV0AQgZ3WHe2OCj22rQ87IJR1w2cRKddIYWz/d1AKF7OIuJGbFEcnwehSX1m JWpRyVW80AVToo4p9P0axn2KIKt4rAYpaCGiboX2u/6Y+1Ys1c75DidpzxB0lhxLrXmu vMHu8vhBvYMNR2UGngNZTTHzi4zoCR9NNFg5HOX/qXIVRTNywiBKkjb7/Tjgzwpvg0Vy fKcE09oMwNmlW50dQv4K6Bhots5VKBgPHL1fA/83zXI59n77WR5L7pjDqzo5o2LhHVVq 7qHqADZAYY5glHZw700zkZpQ0hFHYtN+81zdgChYxQFGxN1DftoKIOYY35UPS7Nz5zJh 7ogg== X-Gm-Message-State: APjAAAVlUg7d4y6Ue5TRabE2CpGVMcL3Ghlx30ZKAO6wUjNO/ZS8cKNr sfWkECgAGT2e8srSGUob/lFz3Ims+as= X-Google-Smtp-Source: APXvYqwdMAhlPYunfXLBZiAh08ecC2ROh4tZKrK3ApSRm4i09EHbtqbrj4MRq2turtbzgqegMryrqg== X-Received: by 2002:aca:f189:: with SMTP id p131mr1840371oih.89.1556795894930; Thu, 02 May 2019 04:18:14 -0700 (PDT) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Thu, 2 May 2019 05:17:58 -0600 Message-Id: <20190502111804.15843-12-pbonzini@redhat.com> In-Reply-To: <20190502111804.15843-1-pbonzini@redhat.com> References: <20190502111804.15843-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 02 May 2019 11:18:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 02 May 2019 11:18:15 +0000 (UTC) for IP:'209.85.167.173' DOMAIN:'mail-oi1-f173.google.com' HELO:'mail-oi1-f173.google.com' FROM:'paolo.bonzini@gmail.com' RCPT:'' X-RedHat-Spam-Score: 0.126 (DKIM_SIGNED, DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.167.173 mail-oi1-f173.google.com 209.85.167.173 mail-oi1-f173.google.com X-RedHat-Possible-Forgery: Paolo Bonzini X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH 11/17] mods: ask for confirmation after the user has added an item X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 02 May 2019 11:18:18 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" --- static/js/config-editor.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/static/js/config-editor.js b/static/js/config-editor.js index c0f326f..562077d 100644 --- a/static/js/config-editor.js +++ b/static/js/config-editor.js @@ -2,6 +2,16 @@ function current_project() { return $('h2').text(); } =20 +function confirm_leaving_page(enable) { + if (enable) { + window.onbeforeunload =3D function() { + return "You have modified the configuration but have not saved= it yet."; + }; + } else { + window.onbeforeunload =3D null; + } +} + function save_done(btn, succeeded, error) { $(btn).text("Save"); $(btn).removeClass("disabled"); @@ -9,6 +19,7 @@ function save_done(btn, succeeded, error) { if (succeeded) { info.addClass("alert-success"); info.html("Saved"); + confirm_leaving_page(false); } else { info.addClass("alert-danger"); info.html("Error: " + error); @@ -101,6 +112,7 @@ function map_add_item(btn) { }); nt.find(".panel-collapse").collapse("show"); container.find("> .items").append(nt); + confirm_leaving_page(true); } =20 function map_delete_item(btn) { --=20 2.21.0 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel