Changeset 1402
- Timestamp:
- 02/16/11 12:24:09 (15 months ago)
- Location:
- HelpIM3/branches/chatgroups
- Files:
-
- 3 modified
-
HelpIM/chat/templates/SubChat.py (modified) (2 diffs)
-
htdocs/chat.js (modified) (2 diffs)
-
htdocs/groupchat_iroster.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
HelpIM3/branches/chatgroups/HelpIM/chat/templates/SubChat.py
r1397 r1402 67 67 <table border="0" width="100%" height="100%" cellspacing="0" cellpadding="8px"> 68 68 <tr> <!-- header --> 69 <td colspan= 2class="spaced" align="right">69 <td colspan="2" class="spaced" align="right"> 70 70 <table border="0" cellspacing="0" cellpadding="0" width="100%"> 71 71 <tr> … … 96 96 <td style="height: 100%; width: 132px;" class="spaced"> 97 97 <table width="100%" height="100%;" cellspacing="0" cellpadding="8px"> 98 <tr><td style="height: 100%; width: 120px;" id="roster_pane"> 99 <iframe src="/htdocs/groupchat_iroster.html" 100 id="groupchatIRoster" 101 name="groupchatIRoster" 102 scrolling="auto" 103 style="height:100%;width:120px;" 104 class="gcIframe" 105 frameborder="0"> 106 </iframe> 107 108 </td></tr> 109 <tr><td style="width: 120px;" valign="top" id="button_pane"> 110 <div id="rosterUserActionButtons"> 111 <button id="noneButton">kick</button> 112 <button id="participantButton">voice</button> 113 <button id="visitorButton">devoice</button> 114 </div> 115 <button id="visitorsButton">Devoice All</button> 116 <button id="participantsButton">Voice All</button> 117 118 </td></tr> 98 <tr><td style="height: 100%; width: 120px;" id="roster_pane"> 99 <iframe src="/htdocs/groupchat_iroster.html" 100 id="groupchatIRoster" 101 name="groupchatIRoster" 102 scrolling="auto" 103 style="height:100%;width:120px;" 104 class="gcIframe" 105 frameborder="0"> 106 </iframe> 107 </td></tr> 108 <tr><td style="width: 120px;" valign="top" id="button_pane"> 109 <div id="rosterUserActionButtons"> 110 <button id="noneButton">kick</button> 111 <button id="participantButton">voice</button> 112 <button id="visitorButton">devoice</button> 113 </div> 114 <button id="visitorsButton">Devoice All</button> 115 <button id="participantsButton">Voice All</button> 116 </td></tr> 119 117 </table> 120 118 </td> 121 119 </tr> 122 120 <tr> 123 <td colspan= 2class="spaced"><span id="emoticonBar"></span><span id="typingnotification" class="notification"></span>121 <td colspan="2" class="spaced"><span id="emoticonBar"></span><span id="typingnotification" class="notification"></span> 124 122 </td> 125 123 </tr> 126 <tr>124 <tr> 127 125 <td colspan="2" class="spaced"> 128 <textarea type="text" 129 id="msgbox" style="width:100%;" rows="4" tabindex="1" 130 onKeyPress="return msgboxKeyPressed(this,event);" 131 onKeyDown="return msgboxKeyDown(this,event);" 132 onFocus="storeCaret(this);" 133 onKeyUp="return msgboxKeyUp(this);" 134 onSelect="storeCaret(this);" 135 onClick="storeCaret(this);"></textarea> 126 <table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%"> 127 <tr> 128 <td id="send_to_label" nowrap="nowrap"></td> 129 <td width="100%"> 130 <textarea type="text" 131 id="msgbox" style="width:100%;" rows="4" tabindex="1" 132 onKeyPress="return msgboxKeyPressed(this,event);" 133 onKeyDown="return msgboxKeyDown(this,event);" 134 onFocus="storeCaret(this);" 135 onKeyUp="return msgboxKeyUp(this);" 136 onSelect="storeCaret(this);" 137 onClick="storeCaret(this);"></textarea> 138 </td> 139 </tr> 140 </table> 136 141 </td> 137 142 </tr> -
HelpIM3/branches/chatgroups/htdocs/chat.js
r1359 r1402 62 62 63 63 var aMessage = new JSJaCMessage(); 64 if (staffChat && frames['groupchatIRoster'].userSelected) { 64 if ((staffChat || srcW.CHATGROUP_CHAT) && 65 HIM.el.byId('send_to_label').innerHTML != '') { 65 66 to = frames['groupchatIRoster'].userSelected.getAttribute('username'); 66 67 var jid = roster.getFullJIDByNick(htmlFullEnc(to)); 68 var user = roster.getUserByJID(jid); 69 if (!roster.me.role == 'moderator' && !user.role == 'moderator') { 70 // not allowed to send to non moderator as non moderator 71 return false; 72 } 67 73 if (jid == null) { 68 74 putMsgHTML("No such nick"+": " + htmlFullEnc(to), new Date().toLocaleTimeString(), group); … … 108 114 109 115 function sendState(state) { 110 if (!staffChat) { // only send in one2one context 111 var aMessage = new JSJaCMessage(); 112 aMessage.setType('groupchat'); 113 aMessage.setTo(group); 114 aMessage.setState(state); 115 if (aMessage.getState()) // only send if valid state 116 srcW.con.send(aMessage); 116 if (!staffChat) { // only send in one2one context or chatgroup context 117 var oMsg = new JSJaCMessage(); 118 if (HIM.el.byId('send_to_label').innerHTML != '' && 119 frames['groupchatIRoster'].userSelected) { 120 // seems we're in priv msg mode - check if allowed sending 121 to = frames['groupchatIRoster'].userSelected.getAttribute('username'); 122 var jid = roster.getFullJIDByNick(htmlFullEnc(to)); 123 var user = roster.getUserByJID(jid); 124 if (!roster.me.role == 'moderator' && !user.role == 'moderator') { 125 // not allowed to send to non moderator as non moderator 126 return false; 127 } 128 oMsg.setType('chat'); 129 oMsg.setTo(jid); 130 } else { 131 oMsg.setType('groupchat'); 132 oMsg.setTo(group); 133 } 134 oMsg.setState(state); 135 if (oMsg.getState()) // only send if valid state 136 srcW.con.send(oMsg); 117 137 } 118 138 } -
HelpIM3/branches/chatgroups/htdocs/groupchat_iroster.html
r1357 r1402 53 53 firingobj = document.getElementById('rosterUser_'+nick); 54 54 } 55 parent.HIM.el.byId('send_to_label').innerHTML = ""; // reset 55 56 if (firingobj && (firingobj.className == 'rosterUserSelected' || 56 57 firingobj.className == 'rosterUser') && … … 60 61 userSelected = firingobj; 61 62 63 var user = parent.roster.getUserByJID(parent.roster.getFullJIDByNick(nick)); 64 65 if (parent.roster.me.role == 'moderator' || 66 user.role == 'moderator') { 67 parent.HIM.el.byId('send_to_label').innerHTML = "<span class='privMsg'>["+htmlEnc(nick)+"]</span> "; 68 } 62 69 63 70 if (parent.roster.me.role == 'moderator' && parent.srcW.CHATGROUP_CHAT) { 64 71 // show action buttons 65 var user = parent.roster.getUserByJID(66 parent.roster.getFullJIDByNick(nick));67 72 if (user && user.role != 'moderator') { 68 73 actionButtons.forEach(
