From: court Date: Fri, 20 Aug 2010 15:37:48 +0000 (+0000) Subject: forgot to check in the main javascript file. sorry. X-Git-Tag: live~571 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/de421bfc33978f3d11fdbe247d6c34ff205e39eb forgot to check in the main javascript file. sorry. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@563 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index 677b365..487b1db 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -1057,13 +1057,24 @@ $(document).ready( function(){ }); function yourWorkWillBeLost(e) { - if(!e) e = window.event; - e.cancelBubble = true; - e.returnValue = 'If you leave your work will be lost.'; + if(browserTester('chrome')) { + return "You sure you want to leave? Your work will be lost."; + } else if(browserTester('safari')) { + return "You sure you want to leave? Your work will be lost."; + } else { + if(!e) e = window.event; + e.cancelBubble = true; + e.returnValue = 'If you leave your work will be lost.'; - if (e.stopPropagation) { - e.stopPropagation(); - e.preventDefault(); - } - return e; + if (e.stopPropagation) { + e.stopPropagation(); + e.preventDefault(); + } + return e; + } +} + +function browserTester(browserString) { + var test = navigator.userAgent; + return navigator.userAgent.toLowerCase().indexOf(browserString) > -1; } \ No newline at end of file