function submitClicked(e) {
- if(!is_chrome) {
+ if(!(browserTester('chrome') || browserTester('safari'))) {
$("input.submit")[0].disabled=true;
$("input.submit")[1].disabled=true;
}
}
function beforeUnload(e) {
- var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if($("textarea#editor")[0].value != answer) {
- 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);
});
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>
<span class="comments-chars-togo-msg">{% trans "characters needed" %}</span>\r
<span class="comments-chars-left-msg">{% trans "characters left" %}</span>\r
</span>\r
- <input type="submit" class="comment-submit" value="{% trans " comment" %}" onclick="window.removeEventListener('beforeunload', beforeUnload, true)" />\r
+ <input type="submit" class="comment-submit" value="{% trans " comment" %}" />\r
<input type="submit" class="comment-cancel" value="{% trans " cancel" %}" />\r
</div>\r
</div>\r
});\r
\r
function submitClicked(e) {\r
- if(!is_chrome)$("input.submit")[0].disabled=true;\r
+ if(!(browserTester('chrome') || browserTester('safari'))) {\r
+ $("input.submit")[0].disabled=true;\r
+ }\r
window.removeEventListener('beforeunload', beforeUnload, true);\r
}\r
\r
function beforeUnload(e) {\r
- var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;\r
\r
if($("textarea#editor")[0].value != "") {\r
- if(is_chrome) {\r
- return "Are you sure you want to leave? Your work will be lost.";\r
- } else {\r
- yourWorkWillBeLost(e);\r
- }\r
+ return yourWorkWillBeLost(e);\r
}\r
\r
var commentBoxes = $("textarea.commentBox");\r
for(var index = 0; index < commentBoxes.length; index++) {\r
if(commentBoxes[index].value != "") {\r
- if(is_chrome) {\r
- return "You sure you want to leave? Your work will be lost.";\r
- } else {\r
- yourWorkWillBeLost(e);\r
- }\r
+ return yourWorkWillBeLost(e);\r
}\r
}\r
}\r
});
function submitClicked(e) {
- if(!is_chrome) {
+ if(!(browserTester('chrome') || browserTester('safari'))) {
$("input.submit")[0].disabled=true;
$("input.submit")[1].disabled=true;
}
}
function beforeUnload(e) {
- var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
-
if($("input#id_title")[0].value != title || $("textarea#editor")[0].value != body || $("input#id_tags")[0].value != tag) {
- if(is_chrome) {
- return "You sure you want to leave? Your work will be lost.";
- } else {
- yourWorkWillBeLost(e);
- }
+ return yourWorkWillBeLost(e);
}
}
window.addEventListener('beforeunload', beforeUnload, true);