});\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