From 3cd1748e378f0cfa34f208abddd03fa1798b5364 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sat, 13 Nov 2010 00:19:26 +0100 Subject: [PATCH] Add a disconnect button * Disconnect button added * updated strophe.js version --- index.html | 1 + js/main.js | 18 +++++++++++------- js/strophejs | 2 +- style.css | 10 +++++++--- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/index.html b/index.html index 2beef88..71297ad 100644 --- a/index.html +++ b/index.html @@ -31,6 +31,7 @@
+
diff --git a/js/main.js b/js/main.js index e6e88fb..9588826 100644 --- a/js/main.js +++ b/js/main.js @@ -242,6 +242,16 @@ function doLogin(aForm) { } } +function doDisconnect(aForm) { + if (connection) { + connection.send($pres({to: room, type: 'unavailable'}).tree()); + connection.flush(); + connection.disconnect(); + connection = null; + } + return false; +} + var dragElement = null; var mouseX = 0; var mouseY = 0; @@ -268,13 +278,7 @@ function stopDrag(eve) { dragElement = null; } -window.onunload = window.onbeforeunload = function() { - if (connection) { - connection.send($pres({to: room, type: 'unavailable'}).tree()); - connection.disconnect(); - connection = null; - } -}; +window.onunload = window.onbeforeunload = doDisconnect; window.onmousemove = doDrag; diff --git a/js/strophejs b/js/strophejs index 6d7b886..119805c 160000 --- a/js/strophejs +++ b/js/strophejs @@ -1 +1 @@ -Subproject commit 6d7b8863f0f36f73c0b65686956437d26bd93c01 +Subproject commit 119805c4163344fb1147131d6b9bc65702616c34 diff --git a/style.css b/style.css index 32b7afc..5414813 100644 --- a/style.css +++ b/style.css @@ -61,18 +61,22 @@ html, body { padding-right: 0px; margin-left: 0px; margin-right: 0px; - position: absolute; - right: 0px; } #text { - width: 89%; + width: 80%; padding-left: 0px; padding-right: 0px; margin-left: 0px; margin-right: 0px; } +#disc_submit { + width: 7%; + position: absolute; + right: 0px +} + .msg { margin: 2px; } -- 2.39.5