<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Prompt on closing message windowr</title> 
  <pubDate>Sun, 05 Apr 2026 02:35:01 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/4271</link> 
  <atom:link rel="self" type="application/rss+xml" title="Prompt on closing message windowr" href="https://bugs.horde.org/ticket/4271/rss" /> 
  <description>Prompt on closing message windowr</description> 
 
   
   
  <item> 
   <title>It happens to all of us- the accidental close of a compose w</title> 
   <description>It happens to all of us- the accidental close of a compose window by clicking the wrong one, pressing the key combination to the wrong window, or so on.  People put a lot of work into messages.



This simple addition prevents that:



imp/templates/compose/compose.js



I added this just above the &#039;function confirmCancel()&#039; at the top of the file within the script tags.  In theory, it could go anywhere.

------------

window.onbeforeunload = bunload;

function bunload(){

        dontleave=&quot;Are you sure you want to close this window?  Closing this window will discard any unsaved changes.&quot;;

        return dontleave;

}

-------------



This will prompt the user upon closure.  I have tested this on FireFox and Internet Explorer.



A small addition, but an important one.</description> 
   <pubDate>Wed, 09 Aug 2006 02:33:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4271#t22828</link> 
  </item> 
   
  <item> 
   <title>I had forgotten to turn that off upon clicking the submit, d</title> 
   <description>I had forgotten to turn that off upon clicking the submit, draft, and cancel button.  It resulted in a prompt on submit/draft and two prompts on cancel.



That should be fixed in this new patch.  see this patch for a properly working copy.  It disabled it just prior to the submission success and only if the cancel prompt is accepted.



-M</description> 
   <pubDate>Wed, 09 Aug 2006 02:48:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4271#t22829</link> 
  </item> 
   
  <item> 
   <title>Implemented, with translations, in HEAD. Thanks!</title> 
   <description>Implemented, with translations, in HEAD. Thanks!</description> 
   <pubDate>Wed, 09 Aug 2006 22:18:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4271#t22883</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
