[jitmeet-commits] master: Uses roomjid to distinguish the local participant in the chat. Defines etherpad button in the html instead of dynamically adding it through js. Disables chat icon scaling on new message (keeps the glow). (8f84261)

yana at jitsi.org yana at jitsi.org
Wed Feb 19 15:33:05 CET 2014


Repository : ssh://lists.jitsi.org/jitmeet

On branch  : master
Link       : https://github.com/jitsi/jitmeet/compare/26df93e5cd3976c9c01a8fc5ea6f7852ffddc5d4...8f84261169e6d27110b4d64f8ac7848b46526c83

>---------------------------------------------------------------

commit 8f84261169e6d27110b4d64f8ac7848b46526c83
Author: yanas <yana at jitsi.org>
Date:   Wed Feb 19 15:32:22 2014 +0100

    Uses roomjid to distinguish the local participant in the chat. Defines etherpad button in the html instead of dynamically adding it through js. Disables chat icon scaling on new message (keeps the glow).


>---------------------------------------------------------------

8f84261169e6d27110b4d64f8ac7848b46526c83
 app.js       |    1 -
 chat.js      |   11 ++++++-----
 css/main.css |    6 +++++-
 etherpad.js  |   28 +++++-----------------------
 index.html   |    4 ++++
 muc.js       |    5 +++--
 6 files changed, 23 insertions(+), 32 deletions(-)

diff --git a/app.js b/app.js
index b29fd2c..e259300 100644
--- a/app.js
+++ b/app.js
@@ -182,7 +182,6 @@ $(document).bind('remotestreamadded.jingle', function (event, data, sid) {
         container = document.createElement('span');
         container.className = 'videocontainer';
         remotes.appendChild(container);
-        console.log("PLAY USER JOINEDDDDDDDD");
         Util.playSoundNotification('userJoined');
     }
     var vid = document.createElement('video');
diff --git a/chat.js b/chat.js
index 11217bc..29ee5eb 100644
--- a/chat.js
+++ b/chat.js
@@ -61,10 +61,10 @@ var Chat = (function (my) {
     /**
      * Appends the given message to the chat conversation.
      */
-    my.updateChatConversation = function (nick, message) {
+    my.updateChatConversation = function (from, displayName, message) {
         var divClassName = '';
 
-        if (nickname == nick) {
+        if (connection.emuc.myroomjid == from) {
             divClassName = "localuser";
         }
         else {
@@ -81,7 +81,8 @@ var Chat = (function (my) {
         message = processReplacements(message);
 
         $('#chatconversation').append('<div class="' + divClassName + '"><b>'
-                                        + nick + ': </b>' + message + '</div>');
+                                        + displayName + ': </b>'
+                                        + message + '</div>');
         $('#chatconversation').animate(
                 { scrollTop: $('#chatconversation')[0].scrollHeight}, 1000);
     };
@@ -188,8 +189,8 @@ var Chat = (function (my) {
 
             unreadMsgElement.setAttribute(
                     'style',
-                    'top:' + Util.toInteger(topIndent)
-                     + '; left:' + Util.toInteger(leftIndent) +';');
+                    'top:' + topIndent
+                     + '; left:' + leftIndent +';');
         }
         else
             unreadMsgElement.innerHTML = '';
diff --git a/css/main.css b/css/main.css
index 71f37f3..0b3bda6 100644
--- a/css/main.css
+++ b/css/main.css
@@ -35,6 +35,10 @@ html, body{
     z-index: 0;
 }
 
+#etherpadButton {
+    display: none;
+}
+
 .videocontainer>span {
     display: none; /* enable when you want nicks to be shown */
     position: absolute;
@@ -261,7 +265,7 @@ html, body{
     -webkit-text-shadow: 0 0 10px #ffffff;
     -moz-text-shadow: 0 0 10px #ffffff;
     text-shadow: 0 0 10px #ffffff;
-    -webkit-transform: scale(1.1);
+    /* -webkit-transform: scale(1.1); */
 }
 
 a.button:hover {
diff --git a/etherpad.js b/etherpad.js
index de6d189..336cb41 100644
--- a/etherpad.js
+++ b/etherpad.js
@@ -22,9 +22,9 @@ var Etherpad = (function (my) {
             else
                 etherpadName = name;
 
-            createEtherpadButton();
+            enableEtherpadButton();
         }
-    }
+    };
 
     /**
      * Opens/hides the Etherpad.
@@ -77,27 +77,9 @@ var Etherpad = (function (my) {
     /**
      * Creates the Etherpad button and adds it to the toolbar.
      */
-    function createEtherpadButton() {
-        //<div class="header_button_separator"></div>
-        //<a class="button" onclick='Etherpad.openEtherpad("teeest");'>
-        //<i title="Open shared document" class="fa fa-file-text fa-lg"></i></a>
-        var separator = document.createElement('div');
-        separator.className = 'header_button_separator';
-
-        var button = document.createElement('a');
-        button.className = 'button';
-        button.setAttribute('onclick', 'Etherpad.toggleEtherpad(0);');
-        
-        var buttonImage = document.createElement('i');
-        buttonImage.setAttribute('title', 'Open shared document');
-        buttonImage.className = 'fa fa-file-text fa-lg';
-
-        button.appendChild(buttonImage);
-
-        var toolbar = document.getElementById('toolbar');
-        toolbar.insertBefore(button,
-                toolbar.childNodes[toolbar.childNodes.length - 4]);
-        toolbar.insertBefore(separator, button);
+    function enableEtherpadButton() {
+        if (!$('#etherpadButton').is(":visible"))
+            $('#etherpadButton').css({display:'inline-block'});
     }
 
     /**
diff --git a/index.html b/index.html
index 4174f40..d02da29 100644
--- a/index.html
+++ b/index.html
@@ -43,6 +43,10 @@
             </span>
             <div class="header_button_separator"></div>
             <a class="button" onclick='openPreziDialog();'><i title="Share prezi" class="fa fa-picture-o fa-lg"></i></a>
+            <span id="etherpadButton">
+                <div class="header_button_separator"></div>
+                <a class="button" onclick='Etherpad.toggleEtherpad(0);'><i title="Open shared document" class="fa fa-file-text fa-lg"></i></a>
+            </span>
             <div class="header_button_separator"></div>
             <a class="button" onclick='toggleFullScreen();'><i title="Enter / Exit Full Screen" class="fa fa-arrows-alt fa-lg"></i></a>
         </span>
diff --git a/muc.js b/muc.js
index da746c7..792f12f 100644
--- a/muc.js
+++ b/muc.js
@@ -139,11 +139,12 @@ Strophe.addConnectionPlugin('emuc', {
         var txt = $(msg).find('>body').text();
         // TODO: <subject/>
         // FIXME: this is a hack. but jingle on muc makes nickchanges hard
-        var nick = $(msg).find('>nick[xmlns="http://jabber.org/protocol/nick"]').text() || Strophe.getResourceFromJid(msg.getAttribute('from'));
+        var from = msg.getAttribute('from');
+        var nick = $(msg).find('>nick[xmlns="http://jabber.org/protocol/nick"]').text() || Strophe.getResourceFromJid(from);
         if (txt) {
             console.log('chat', nick, txt);
 
-            Chat.updateChatConversation(nick, txt);
+            Chat.updateChatConversation(from, nick, txt);
         }
         return true;
     },




More information about the commits mailing list