summary refs log tree commit diff
path: root/syweb/webclient/room/room.html
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-11-17 10:21:51 +0000
committerMark Haines <mark.haines@matrix.org>2014-11-17 10:21:51 +0000
commit1d3ef8734cea9a1ce8befdf27db297ca70cfeee3 (patch)
tree12c7ac945749c68b81e3ae55c39dfd58ae824bf0 /syweb/webclient/room/room.html
parentMerge PDUs and Events into one object (diff)
parentMove getLastMessage to modelService. (diff)
downloadsynapse-1d3ef8734cea9a1ce8befdf27db297ca70cfeee3.tar.xz
Merge remote-tracking branch 'origin/develop' into merge_pdu_event_objects
Diffstat (limited to 'syweb/webclient/room/room.html')
-rw-r--r--syweb/webclient/room/room.html58
1 files changed, 36 insertions, 22 deletions
diff --git a/syweb/webclient/room/room.html b/syweb/webclient/room/room.html
index 955f5ff114..8baf9eda71 100644
--- a/syweb/webclient/room/room.html
+++ b/syweb/webclient/room/room.html
@@ -198,31 +198,45 @@
                             {{ msg.user_id }} changed their display name from {{ msg.prev_content.displayname }} to {{ msg.content.displayname }}
                         </span>
                         
-                        <span ng-show='msg.content.msgtype === "m.emote"'
-                              ng-class="msg.echo_msg_state"
-                              ng-bind-html="'* ' + (msg.__room_member.cnt.displayname || msg.user_id) + ' ' + msg.content.body | linky:'_blank'"
-                              />
-                        
-                        <span ng-show='msg.content.msgtype === "m.text"' 
-                              class="message"
-                              ng-class="containsBingWord(msg) && msg.user_id != state.user_id ? msg.echo_msg_state + ' messageBing' : msg.echo_msg_state"
-                              ng-bind-html="(msg.content.msgtype === 'm.text' && msg.type === 'm.room.message' && msg.content.format === 'org.matrix.custom.html') ? 
-                                                                                        (msg.content.formatted_body | unsanitizedLinky) :
-                                             (msg.content.msgtype === 'm.text' && msg.type === 'm.room.message') ? (msg.content.body | linky:'_blank') : '' "/>
+                        <span ng-show='msg.type === "m.room.message"' ng-switch='msg.content.msgtype'>
+                            <span ng-switch-when="m.emote"
+                                  ng-class="containsBingWord(msg) && msg.user_id != state.user_id ? msg.echo_msg_state + ' messageBing' : msg.echo_msg_state"
+                                  ng-bind-html="'* ' + (msg.__room_member.cnt.displayname || msg.user_id) + ' ' + msg.content.body | linky:'_blank'"
+                                  />
+
+                            <span ng-switch-when="m.text"
+                                  class="message"
+                                  ng-class="containsBingWord(msg) && msg.user_id != state.user_id ? msg.echo_msg_state + ' messageBing' : msg.echo_msg_state"
+                                  ng-bind-html="(msg.content.format === 'org.matrix.custom.html') ? (msg.content.formatted_body | unsanitizedLinky) : (msg.content.body | linky:'_blank') "/>
+
+                             <div ng-switch-when="m.image">
+                                 <div ng-hide='msg.content.thumbnail_url' ng-style="msg.content.body.h && { 'height' : (msg.content.body.h < 320) ? msg.content.body.h : 320}">
+                                     <img class="image" ng-src="{{ msg.content.url }}"/>
+                                 </div>
+                                 <div ng-show='msg.content.thumbnail_url' ng-style="{ 'height' : msg.content.thumbnail_info.h }">
+                                     <img class="image mouse-pointer" ng-src="{{ msg.content.thumbnail_url }}"
+                                          ng-click="$parent.$parent.fullScreenImageURL = msg.content.url; $event.stopPropagation();"/>
+                                 </div>
+                             </div>
+
+                            <span ng-switch-when="m.file" ng-class="msg.echo_msg_state">
+                                <a href="{{ msg.content.url}}" target="_blank">{{ msg.content.body }}</a>
+                                <div ng-show='msg.content.thumbnail_url' ng-style="{ 'height' : msg.content.thumbnail_info.h }">
+                                    <a href="{{ msg.content.url}}" target="_blank">
+                                        <img class="image mouse-pointer" ng-src="{{ msg.content.thumbnail_url }}"/>
+                                    </a>
+                                </div>
+                            </span>
+                                
+                            <span ng-switch-default
+                                ng-class="containsBingWord(msg) && msg.user_id != state.user_id ? msg.echo_msg_state + ' messageBing' : msg.echo_msg_state"
+                                ng-bind-html="msg.content.body | linky:'_blank'"
+                                />
+                        </span>
 
                         <span ng-show='msg.type === "m.call.invite" && msg.user_id == state.user_id'>Outgoing Call{{ isWebRTCSupported() ? '' : ' (But your browser does not support VoIP)' }}</span>
                         <span ng-show='msg.type === "m.call.invite" && msg.user_id != state.user_id'>Incoming Call{{ isWebRTCSupported() ? '' : ' (But your browser does not support VoIP)' }}</span>
 
-                        <div ng-show='msg.content.msgtype === "m.image"'>
-                            <div ng-hide='msg.content.thumbnail_url' ng-style="msg.content.body.h && { 'height' : (msg.content.body.h < 320) ? msg.content.body.h : 320}">
-                                <img class="image" ng-src="{{ msg.content.url }}"/>
-                            </div>
-                            <div ng-show='msg.content.thumbnail_url' ng-style="{ 'height' : msg.content.thumbnail_info.h }">
-                                <img class="image mouse-pointer" ng-src="{{ msg.content.thumbnail_url }}"
-                                     ng-click="$parent.fullScreenImageURL = msg.content.url; $event.stopPropagation();"/>
-                            </div>
-                        </div>
-
                         <span ng-if="'m.room.topic' === msg.type">
                             {{ msg.__room_member.cnt.displayname || msg.user_id }} changed the topic to: {{ msg.content.topic }}
                         </span>
@@ -250,7 +264,7 @@
 
     <div id="controlPanel">
         <div id="controls">
-            <button id="attachButton" m-file-input="imageFileToSend" class="extraControls" ng-disabled="state.permission_denied"></button>
+            <button id="attachButton" m-file-input="fileToSend" class="extraControls" ng-disabled="state.permission_denied"></button>
             <textarea id="mainInput" rows="1" ng-enter="send()"
                       ng-disabled="state.permission_denied"
                       ng-focus="true" autocomplete="off" tab-complete command-history="room_id"/>