From 95c31629b725257afb0bc083e33a8661dcbdc823 Mon Sep 17 00:00:00 2001 From: lilia Date: Sun, 27 Jul 2014 12:12:59 -1000 Subject: [PATCH] get frontend rendering with new markup/css --- index.html | 50 +++++++++++++++++++------ js/popup.js | 2 +- js/views/conversation_list_item_view.js | 8 ++-- js/views/conversation_list_view.js | 2 +- js/views/message_list_view.js | 4 +- js/views/message_view.js | 7 ++-- 6 files changed, 51 insertions(+), 22 deletions(-) diff --git a/index.html b/index.html index 989eb364..74bcd9d2 100644 --- a/index.html +++ b/index.html @@ -11,9 +11,8 @@ - - +

Signal

@@ -30,11 +29,11 @@ -
+
-
+
-
    -
  • -
    +
      +
    @@ -79,7 +77,35 @@
    - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/js/popup.js b/js/popup.js index f19d10a8..c4acb6fb 100644 --- a/js/popup.js +++ b/js/popup.js @@ -16,7 +16,7 @@ -new Whisper.ConversationListView({el: $('#contacts')}); +new Whisper.ConversationListView().$el.appendTo($('#gutter')); Whisper.Threads.fetch({reset: true}); textsecure.registerOnLoadFunction(function() { diff --git a/js/views/conversation_list_item_view.js b/js/views/conversation_list_item_view.js index adb977b3..27af1fc3 100644 --- a/js/views/conversation_list_item_view.js +++ b/js/views/conversation_list_item_view.js @@ -4,8 +4,8 @@ var Whisper = Whisper || {}; 'use strict'; Whisper.ConversationListItemView = Backbone.View.extend({ - tagName: 'li', - className: 'conversation', + tagName: 'div', + className: 'contact', events: { 'click': 'open', @@ -36,7 +36,9 @@ var Whisper = Whisper || {}; render: function() { this.$el.html( Mustache.render(this.template, { - name: this.model.get('name') + contact_name: this.model.get('name'), + last_message: this.model.get('lastMessage'), + last_message_timestamp: this.model.get('timestamp') }) ); diff --git a/js/views/conversation_list_view.js b/js/views/conversation_list_view.js index 5c6392ff..f3816688 100644 --- a/js/views/conversation_list_view.js +++ b/js/views/conversation_list_view.js @@ -4,7 +4,7 @@ var Whisper = Whisper || {}; 'use strict'; Whisper.ConversationListView = Whisper.ListView.extend({ - tagName: 'ul', + tagName: 'div', id: 'contacts', itemView: Whisper.ConversationListItemView, collection: Whisper.Threads, diff --git a/js/views/message_list_view.js b/js/views/message_list_view.js index f7d7c984..1325c1fc 100644 --- a/js/views/message_list_view.js +++ b/js/views/message_list_view.js @@ -5,11 +5,11 @@ var Whisper = Whisper || {}; Whisper.MessageListView = Whisper.ListView.extend({ tagName: 'ul', - className: 'messages', + className: 'discussion', itemView: Whisper.MessageView, render: function() { - $('#main .message-container').html('').append(this.el); + $('#discussion').html('').append(this.el); } }); })(); diff --git a/js/views/message_view.js b/js/views/message_view.js index d8699531..c798badf 100644 --- a/js/views/message_view.js +++ b/js/views/message_view.js @@ -5,7 +5,7 @@ var Whisper = Whisper || {}; Whisper.MessageView = Backbone.View.extend({ tagName: "li", - className: "message", + className: "entry", initialize: function() { this.$el.addClass(this.model.get('type')); @@ -21,9 +21,10 @@ var Whisper = Whisper || {}; render: function() { this.$el.html( Mustache.render(this.template, { - body: this.model.get('body'), + message: this.model.get('body'), date: this.formatTimestamp(), - attachments: this.model.get('attachments') + attachments: this.model.get('attachments'), + bubble_class: this.model.get('type') === 'outgoing' ? 'sent' : 'incoming' }) );