From 9ceaec1378e12c60bee7c63be4918a1eb7fecb0d Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Mon, 16 Dec 2013 15:11:23 +0100 Subject: [PATCH 1/4] css cleanup --- css/main.css | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/css/main.css b/css/main.css index bac3ec7248..3a3f4f399c 100644 --- a/css/main.css +++ b/css/main.css @@ -92,11 +92,11 @@ html, body{ visibility:hidden; } -div.localuser { +.localuser { color: #087dba; } -div.remoteuser { +.remoteuser { color: #424242; } @@ -128,7 +128,7 @@ div.remoteuser { font-size: 14; } -div#spacer { +#spacer { height:5px; } @@ -140,17 +140,15 @@ div#spacer { display:none; } -div#header{ +#header{ display:block; - position:relative; - width:100%; height:39px; z-index: 1; text-align:center; background-color:#087dba; } -div#left { +#left { display:block; position: absolute; left: 0px; @@ -163,7 +161,7 @@ div#left { padding: 0; } -div#leftlogo { +#leftlogo { position:absolute; top: 5px; left: 15px; @@ -174,7 +172,7 @@ div#leftlogo { z-index:1; } -div#link { +#link { display:block; position:relative; height:39px; @@ -189,10 +187,9 @@ div#link { color: #FFFFFF; top: 0; padding: 10px 0px; - height: 19px; width: 39px; cursor: pointer; - font-size: 19px; + font-size: 11pt; text-align: center; text-shadow: 0px 1px 0px rgba(255,255,255,.3), 0px -1px 0px rgba(0,0,0,.7); } @@ -227,7 +224,7 @@ a.button:hover { background: -webkit-gradient(linear, 0 0, 0 100%, from(#087dba), to(#087dba), color-stop(50%, white)); } -div#right { +#right { display:block; position:absolute; right: 0px; @@ -239,7 +236,8 @@ div#right { width:100px; height:39px; } -div#rightlogo { + +#rightlogo { position:absolute; top: 6px; right: 15px; From a2916176cb490a4d07a5f8ce0ad954a1df827274 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Mon, 16 Dec 2013 18:25:25 +0100 Subject: [PATCH 2/4] undefined, not null --- muc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/muc.js b/muc.js index 4e26763637..df37cad43d 100644 --- a/muc.js +++ b/muc.js @@ -23,7 +23,7 @@ Strophe.addConnectionPlugin('emuc', { } var join = $pres({to: this.myroomjid }).c('x', {xmlns: 'http://jabber.org/protocol/muc'}); - if (password !== null) { + if (password !== undefined) { join.c('password').t(password); } this.connection.send(join); From 1b4273d222cacb44b1c05c7df4f074dc40682124 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Tue, 17 Dec 2013 14:10:47 +0100 Subject: [PATCH 3/4] prevent double join. fix affiliation typo --- muc.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/muc.js b/muc.js index df37cad43d..ccb55dfffc 100644 --- a/muc.js +++ b/muc.js @@ -7,6 +7,7 @@ Strophe.addConnectionPlugin('emuc', { roomjid: null, myroomjid: null, members: {}, + joined: false, isOwner: false, init: function (conn) { this.connection = conn; @@ -47,10 +48,14 @@ Strophe.addConnectionPlugin('emuc', { member.show = $(pres).find('>show').text(); member.status = $(pres).find('>status').text(); var tmp = $(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>item'); - member.affilication = tmp.attr('affiliation'); + member.affiliation = tmp.attr('affiliation'); member.role = tmp.attr('role'); if (from == this.myroomjid) { - $(document).trigger('joined.muc', [from, member]); + if (member.affiliation == 'owner') this.isOwner = true; + if (!this.joined) { + this.joined = true; + $(document).trigger('joined.muc', [from, member]); + } } else if (this.members[from] === undefined) { // new participant this.members[from] = member; From 795b1cc4ec4f0fa1c572f5595f00a4bf3735fa1e Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 19 Dec 2013 10:39:32 +0100 Subject: [PATCH 4/4] add logger --- estos_log.js | 23 +++++++++++++++++++++++ index.html | 1 + 2 files changed, 24 insertions(+) create mode 100644 estos_log.js diff --git a/estos_log.js b/estos_log.js new file mode 100644 index 0000000000..b7e049b4ad --- /dev/null +++ b/estos_log.js @@ -0,0 +1,23 @@ +Strophe.addConnectionPlugin('logger', { + // logs raw stanzas and makes them available for download as JSON + connection: null, + log: [], + init: function (conn) { + this.connection = conn; + this.connection.rawInput = this.log_incoming.bind(this);; + this.connection.rawOutput = this.log_outgoing.bind(this);; + }, + log_incoming: function (stanza) { + this.log.push([new Date().getTime(), 'incoming', stanza]); + }, + log_outgoing: function (stanza) { + this.log.push([new Date().getTime(), 'outgoing', stanza]); + }, + // my download button + dump: function (what, filename){ + what.download = filename || 'xmpplog.json'; + what.href = 'data:application/json;charset=utf-8,\n'; + what.href += encodeURIComponent(JSON.stringify(this.log, null, ' ')); + return true; + } +}); diff --git a/index.html b/index.html index 0c5f2dc7cd..6e34a230d7 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ +