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