Skip to content

Commit

Permalink
SAK-28099; fix chat for morpheus
Browse files Browse the repository at this point in the history
git-svn-id: https://source.sakaiproject.org/svn/chat/trunk@315622 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
clhedrick committed Nov 21, 2014
1 parent 7e72913 commit 16aef9c
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 14 deletions.
64 changes: 63 additions & 1 deletion chat/chat-tool/tool/src/webapp/css/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,73 @@
width: 80%;
}
.chat-block,.chat-select-date {
display: block;

}
.chatList {
width:93%
}
LABEL.chat-date-label {
width: 10em;
text-align: right;
display: inline-block;
padding-right: 1em;
}

#chatList, .chatList, .presenceList {
list-style: none;
}
#chatList li, .chatList li{
text-indent: -3em;
line-height: 1.2em;
}
.chat-block label {
display: inline;
}
.chat-block select {
display: inline-block;
margin-left: 0.5em;
margin-right: 0.5em;
}
h3 {
padding-top: 0px;
}
/* for presence list. I'm using .information to get color and
style consistent with overall design, but have to undo some
padding and margin */
.chatListHeadWrapper {
padding:0px !important;
margin:0px !important;
margin-bottom:0.25em !important;
margin-left:0.5em !important;
}
#chatPresenceWrapper{
background-image:none;
display:inline-block;
clear: none;
float:right;
width:16%;
padding:0px !important;
margin:0px !important;
padding-top:0.5em !important;
}
#chatPresenceWrapper:before {
content:none;
}
#chatListWrapper {
display:inline-block;
float:left;
clear:none;
}
iframe {
height: calc(20em);
}
h3.chatListHeadWrapper{
font-size: 100% !important;
}
@media screen and (max-width: 1000px) {
#chatPresenceWrapper {
display:none;
}
}


44 changes: 36 additions & 8 deletions chat/chat-tool/tool/src/webapp/js/chatscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,48 @@ function updateShownText() {

//Library to ajaxify the Chatroom message submit action
$(document).ready(function() {

updateShownText();

//resize horizontal chat area to get rid of horizontal scrollbar in IE
if($.browser.msie){
$(".chatList").width('93%');
}
// the iframe has a src of roomUsers.
// in frameless situation that will be added to /portal/site ...
// but the tool will only recognize /portal/tool. Do the mapping
var iframesrc = $('#Presence').attr('src');
var urlpath = location.pathname;
var frameless = false;
if (urlpath.indexOf('/portal/site') == 0) {
var i = urlpath.indexOf('/tool/');
if (i >= 0) {
var j = urlpath.indexOf('/', i+6);
if (j >= 0) {
frameless = true;
urlpath = '/portal' + urlpath.substring(i, j+1) + iframesrc;
$('#Presence').attr('src', urlpath);
}
}
}

// fix up the delete links. They use /sakai.chat ... That won't work. without the leading /
// it works.
if (frameless) {
$('.chatList a').each(function(index) {
$(this).attr('onclick', $(this).attr('onclick').replace("'/sakai.chat.deleteMessage.helper","'sakai.chat.deleteMessage.helper"));
});

if (deleteUrl.indexOf('/sakai.chat.deleteMessage.helper') == 0)
deleteUrl = deleteUrl.substring(1);
}

//resize horizontal chat area to get rid of horizontal scrollbar in IE

var options = {
//RESTful submit URL
url_submit: '/direct/chat-message/new',
control_key: 13,
dom_button_submit_raw: document.getElementById("controlPanel:submit"),
dom_button_submit: $(document.getElementById("controlPanel:submit")),
dom_button_reset: $(document.getElementById("controlPanel:reset")),
dom_textarea: $(document.getElementById("controlPanel:message")),
dom_button_submit_raw: document.getElementById("topForm:controlPanel:submit"),
dom_button_submit: $(document.getElementById("topForm:controlPanel:submit")),
dom_button_reset: $(document.getElementById("topForm:controlPanel:reset")),
dom_textarea: $(document.getElementById("topForm:controlPanel:message")),
channelId: document.getElementById("topForm:chatidhidden").value,
enterKeyCheck:''
};
Expand Down
7 changes: 3 additions & 4 deletions chat/chat-tool/tool/src/webapp/jsp/room.jsp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<f:view>
<sakai:stylesheet contextBase="/sakai-chat-tool" path="/css/chat.css" />

<sakai:view title="#{msgs['custom.chatroom']}">
<sakai:stylesheet contextBase="/sakai-chat-tool" path="/css/chat.css" />
<script type="text/javascript">
focus_path = ["controlPanel:message"];
doubleDeep = true;
Expand Down Expand Up @@ -67,7 +67,7 @@ var chat2_messageCountTemplate = "<h:outputText value="#{ChatTool.messagesShownT
<%@ include file="roomMonitor.jspf" %>
</div>
</div>
<div id="chatPresenceWrapper">
<div id="chatPresenceWrapper" class="information">
<h3 class="chatListHeadWrapper">
<h:outputText value="#{msgs.lay_user}" />
</h3>
Expand All @@ -79,13 +79,11 @@ var chat2_messageCountTemplate = "<h:outputText value="#{ChatTool.messagesShownT
frameborder="0"
marginwidth="0"
marginheight="0"
scrolling="no"
align="right"
class="wcwmenu"
src="roomUsers?channel=<h:outputText value="#{ChatTool.currentChatChannelId}" />">
</iframe>
</div>
</h:form>
<f:subview id="controlPanel" rendered="#{ChatTool.canPost}">
<div>
<h:outputLabel for="message" value="#{msgs['control.lab']}" style="clear:both;display:block;" />
Expand All @@ -102,6 +100,7 @@ var chat2_messageCountTemplate = "<h:outputText value="#{ChatTool.messagesShownT
</p>
</div>
</f:subview>
</h:form>
<t:div styleClass="messageInformation chat-post-warning" rendered="#{!ChatTool.canPost && ChatTool.datesRestricted}">
<h:outputText value="#{msgs.custom_date_restricted}" />
<h:outputText value="#{ChatTool.datesMessage}" />
Expand Down
3 changes: 2 additions & 1 deletion chat/chat-tool/tool/src/webapp/jsp/roomUsers.jsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<f:view>
<sakai:view title="">
<sakai:stylesheet contextBase="/sakai-chat-tool" path="/css/chatpresence.css" />

<ul class="presenceList">
<c:forEach items="${ChatTool.usersInCurrentChannel}" var="user">
Expand All @@ -8,4 +9,4 @@
</ul>

</sakai:view>
</f:view>
</f:view>

0 comments on commit 16aef9c

Please sign in to comment.