'try multiple transports': true,\r
'connect timeout': 3000,\r
'max reconnection attempts': 7,\r
- 'reconnection delay': 2000\r
+ 'reconnection delay': 2000,\r
+ 'sync disconnect on unload': false\r
});\r
this.socket.on('connect_failed', function (reason) {\r
// TODO: When does this even actually get fired? I can't find a case! ~Darren\r
};\r
\r
\r
+\r
+ this.isConnected = function () {\r
+ return this.socket.socket.connected;\r
+ };\r
+\r
+\r
/*\r
Events:\r
msg\r
this.doLayout();\r
\r
$(document).keydown(this.setKeyFocus);\r
+\r
+ // Confirmation require to leave the page\r
+ window.onbeforeunload = function () {\r
+ if (kiwi.gateway.isConnected()) {\r
+ return 'This will close all KiwiIRC conversations. Are you sure you want to close this window?';\r
+ }\r
+ };\r
},\r
\r
\r