소스 검색

Render URLs in the topic in the room details modal

JC Brand 7 년 전
부모
커밋
a67fa6d4e5
3개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 0 0
      dist/converse.js
  2. 3 0
      src/converse-muc-views.js
  3. 1 1
      src/templates/chatroom_details_modal.html

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
dist/converse.js


+ 3 - 0
src/converse-muc-views.js

@@ -8,6 +8,7 @@
     define([
         "converse-core",
         "utils/muc",
+        "xss",
         "templates/add_chatroom_modal.html",
         "templates/chatarea.html",
         "templates/chatroom.html",
@@ -35,6 +36,7 @@
 }(this, function (
     converse,
     muc_utils,
+    xss,
     tpl_add_chatroom_modal,
     tpl_chatarea,
     tpl_chatroom,
@@ -495,6 +497,7 @@
                         this.model.toJSON(), {
                             '_': _,
                             '__': __,
+                            'topic': u.addHyperlinks(xss.filterXSS(_.get(this.model.get('subject'), 'text'), {'whiteList': {}})),
                             'display_name': __('Groupchat info for %1$s', this.model.getDisplayName()),
                             'num_occupants': this.model.occupants.length
                         })

+ 1 - 1
src/templates/chatroom_details_modal.html

@@ -11,7 +11,7 @@
                     <p class="room-info"><strong>{{{o.__('Room address (JID)')}}}</strong>: {{{o.jid}}}</p>
                     <p class="room-info"><strong>{{{o.__('Description')}}}</strong>: {{{o.description}}}</p>
                     {[ if (o.subject) { ]}
-                        <p class="room-info"><strong>{{{o.__('Topic')}}}</strong>: {{{o._.get(o.subject, 'text')}}}</p>
+                    <p class="room-info"><strong>{{{o.__('Topic')}}}</strong>: {{o.topic}}</p> <!-- Sanitized in converse-muc-views. We want to render links. -->
                         <p class="room-info"><strong>{{{o.__('Topic author')}}}</strong>: {{{o._.get(o.subject, 'author')}}}</p>
                     {[ } ]}
                     <p class="room-info"><strong>{{{o.__('Online users')}}}</strong>: {{{o.num_occupants}}}</p>

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.