}\r
\r
// Now that we're connected, warn the user if they really want to quit\r
- // TODO: disable page refreshing or at least just f5\r
- // This brakes the socket.io connection currently :(\r
- /*\r
- window.onbeforeunload = function() {\r
- return "Are you sure you leave Kiwi IRC?";\r
- };\r
- */\r
+ kiwi.front.ui.preventRefresh();\r
},\r
/**\r
* Handles the connectFail event\r
\r
},\r
\r
+ preventRefresh: function () {\r
+ $(document).keydown(function (e) {\r
+ // meta + r || F5\r
+ if ((e.metaKey && e.which == 82) || e.which == 116) {\r
+ e.preventDefault();\r
+ e.stopPropagation();\r
+\r
+ // Reset IE keyCode\r
+ event.keyCode = 0;\r
+\r
+ return false;\r
+ }\r
+ });\r
+ },\r
+\r
/**\r
* Prompts user for a new nick\r
*/\r