]> git.openstreetmap.org Git - osqa.git/commitdiff
forgot to check in the main javascript file. sorry.
authorcourt <court@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 20 Aug 2010 15:37:48 +0000 (15:37 +0000)
committercourt <court@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Fri, 20 Aug 2010 15:37:48 +0000 (15:37 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@563 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/js/osqa.main.js

index 677b365e044bf36dc7e04b11e98033720834e8b6..487b1dbe0a0a8ea152aa67cb1f3e71deabd15e9c 100644 (file)
@@ -1057,13 +1057,24 @@ $(document).ready( function(){
 });\r
 \r
 function yourWorkWillBeLost(e) {\r
-       if(!e) e = window.event;\r
-       e.cancelBubble = true;\r
-       e.returnValue = 'If you leave your work will be lost.';\r
+    if(browserTester('chrome')) {\r
+        return "You sure you want to leave?  Your work will be lost.";\r
+    } else if(browserTester('safari')) {\r
+        return "You sure you want to leave?  Your work will be lost.";\r
+    } else {\r
+        if(!e) e = window.event;\r
+        e.cancelBubble = true;\r
+        e.returnValue = 'If you leave your work will be lost.';\r
 \r
-       if (e.stopPropagation) {\r
-               e.stopPropagation();\r
-               e.preventDefault();\r
-       }\r
-    return e;\r
+        if (e.stopPropagation) {\r
+            e.stopPropagation();\r
+            e.preventDefault();\r
+        }\r
+        return e;\r
+    }\r
+}\r
+\r
+function browserTester(browserString) {\r
+    var test = navigator.userAgent;\r
+    return navigator.userAgent.toLowerCase().indexOf(browserString) > -1;\r
 }
\ No newline at end of file