From de421bfc33978f3d11fdbe247d6c34ff205e39eb Mon Sep 17 00:00:00 2001 From: court Date: Fri, 20 Aug 2010 15:37:48 +0000 Subject: [PATCH] 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 --- forum/skins/default/media/js/osqa.main.js | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) 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 -- 2.39.5