From 07a509a862c114470e1ea525172824159b70787b Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Thu, 11 Dec 2014 23:42:22 +0100 Subject: [PATCH] Only confirm exit in public mode --- client/js/shout.js | 16 +++++++++------- client/themes/example.css | 3 +-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/js/shout.js b/client/js/shout.js index afc2db56..0b78dd20 100644 --- a/client/js/shout.js +++ b/client/js/shout.js @@ -313,7 +313,7 @@ $(function() { break; } }); - + socket.on("topic", function(data) { $("#chan-" + data.chan).find(".header .topic").html(data.topic); }); @@ -480,13 +480,13 @@ $(function() { .find(".chat") .sticky() .end(); - + var title = "Shout"; if (chan.data("title")) { title = chan.data("title") + " — " + title; } document.title = title; - + if (self.hasClass("chan")) { var nick = self .closest(".network") @@ -695,7 +695,7 @@ $(function() { event, values ); }); - + forms.on("input", ".nick", function() { var nick = $(this).val(); forms.find(".username").val(nick); @@ -775,9 +775,11 @@ $(function() { } function confirmExit() { - window.onbeforeunload = function() { - return "Are you sure you want to navigate away from this page?"; - }; + if ($("body").hasClass("public")) { + window.onbeforeunload = function() { + return "Are you sure you want to navigate away from this page?"; + }; + } } function refresh() { diff --git a/client/themes/example.css b/client/themes/example.css index af2dd604..3fe55b72 100644 --- a/client/themes/example.css +++ b/client/themes/example.css @@ -1,6 +1,5 @@ /** - * This is just an example theme and does not - * contain anything. + * This is just an empty theme. */ body {