]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/ask.html
should now be working for chrome/safari/firefox. still need to fix markdown display...
[osqa.git] / forum / skins / default / templates / ask.html
index 9549d29aa7d54e1eb0d9e1da85c4cf55bcf70da4..7b34ba4c9743a0e17574225c1b2eb8b02791edd1 100644 (file)
         });
 
         function submitClicked(e) {
-            if(!is_chrome)$("input.submit")[0].disabled=true;
+            if(!(browserTester('chrome') || browserTester('safari'))) {
+                $("input.submit")[0].disabled=true;
+            }
             window.removeEventListener('beforeunload', beforeUnload, true);
         }
 
         function beforeUnload(e) {
             if($("input#id_title")[0].value != "" || $("textarea#editor")[0].value != "" || $("input#id_tags")[0].value != "") {
-                if(is_chrome) {
-                    return "Are you sure you want to leave?  Your work will be lost.";
-                } else {
-                    yourWorkWillBeLost(e);
-                }
+                return yourWorkWillBeLost(e);
             }
         }
         window.addEventListener('beforeunload', beforeUnload, true);
 
-        var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
         var related_questions_url = "{% url related_questions %}";
         </script>
         <script src="{% media "/media/js/osqa.ask.js" %}" type="text/javascript"></script>