--- a/coffee/calls.coffee Tue May 24 12:34:08 2016 +0800
+++ b/coffee/calls.coffee Tue May 24 13:11:13 2016 +0800
class Tram.CallView extends Backbone.View
- className: 'video-block'
- template: $('#video-block-template').html()
+ templateEl: $($('#video-block-template').html())
'click [data-mute-cam]': -> @model.set('local/video/muted', true)
'click [data-unmute-cam]': -> @model.set('local/video/muted', false)
'click [data-unmute-audio]': -> @model.set('remote/audio/muted', false)
+ @setElement(@templateEl.clone())
@$local = @$('video.local')
@$remote = @$('video.remote')
--- a/coffee/contacts.coffee Tue May 24 12:34:08 2016 +0800
+++ b/coffee/contacts.coffee Tue May 24 13:11:13 2016 +0800
class Tram.AvatarView extends Backbone.View
- template: $('#avatar-template').html()
+ templateEl: $($('#avatar-template').html())
colors: Tram.colors.avatar
+ @setElement(@templateEl.clone())
ci = hash % @colors.length
"color: white; background: #{ @colors[ci] };"
@rivet = rivets.bind(@el, model: @model, view: this)
class Tram.ContactView extends Backbone.View
- template: $('#contact-template').html()
+ templateEl: $($('#contact-template').html())
'click [data-chat]': -> @model.trigger('action/chat')
'click [data-remove]': -> @model.trigger('action/remove')
- @$el.attr('data-jid', @model.get('jid'))
+ @setElement(@templateEl.clone())
@$avatarColumn = @$('.avatar-column')
- @listenTo(@model, 'change:active', @updateActive)
- @listenTo(@model, 'change:show', @setBorderColor)
@listenTo(@model, 'remove', @remove)
- @$el.toggleClass('active', @model.has('active') and @model.get('active'))
- @$el.css('border-left-color', @colors[@model.get('show')] || @colors['default'])
+ getBorderColor: (show) =>
+ "border-left-color: #{ @colors[show] || @colors['default'] };"
"background: #{ @colors[show] || @colors['default'] };"
@rivet = rivets.bind(@el, model: @model, view: this)
av = new Tram.AvatarView(model: @model)
@$avatarColumn.prepend(av.render().el)
--- a/coffee/messages.coffee Tue May 24 12:34:08 2016 +0800
+++ b/coffee/messages.coffee Tue May 24 13:11:13 2016 +0800
class Tram.MessageView extends Backbone.View
- template: $('#message-template').html()
+ templateEl: $($('#message-template').html())
- @$el.attr('data-id', @model.get('id'))
+ @setElement(@templateEl.clone())
@$avatarColumn = @$('.avatar-column')
class Tram.LogApp extends Backbone.View
+ templateEl: $($('#chat-template').html())
+ @setElement(@templateEl.clone())
+ @rivet = rivets.bind(@el, model: @model, view: @)
@listenTo(@collection, 'add', @onAdd)
onAdd: (model, collection) ->
view = new Tram.MessageView(model: model)
- @$el.children().eq(mi - 1).after(el)
+ @$log.children().eq(mi - 1).after(el)
- @$el.scrollTop() + @$el.height() == @$el.get(0).scrollHeight
+ @$log.scrollTop() + @$log.height() == @$log.get(0).scrollHeight
- @$el.scrollTop(@$el.get(0).scrollHeight)
+ @$log.scrollTop(@$log.get(0).scrollHeight)
--- a/index.html Tue May 24 12:34:08 2016 +0800
+++ b/index.html Tue May 24 13:11:13 2016 +0800
<script type="text/template" id="video-block-template">
+ <div class="video-block">
<video class="remote" rv-src="model:remote/stream/url" autoplay></video>
<video class="local" rv-src="model:local/stream/url" autoplay muted></video>
<div class="buttons uk-text-center">
<i class="uk-icon-volume-off"></i>
<script type="text/template" id="avatar-template">
<img class="avatar" rv-if="model:avatar/url" rv-src="model:avatar/url">
<div class="avatar" rv-unless="model:avatar/url" rv-style="model:bjid | dumb-hash | fn view.getColors">
{ model:d/handle | first-letter }
<script type="text/template" id="message-template">
+ <div class="message" rv-data-id="model:id">
<div class="splitter" rv-if="model:d/split"></div>
<div class="column avatar-column" rv-class-uk-invisible="model:d/fold"></div>
<div class="column text-column">
<div class="xhtml-body" rv-if="model:html" rv-html="model:html"></div>
<script type="text/template" id="contact-template">
+ <li class="contact" rv-class-active="model:active" rv-data-jid="model:jid" rv-style="model:show | fn view.getBorderColor">
<div class="column avatar-column">
<div class="status-pip" rv-title="model:show" rv-style="model:show | fn view.getPipColor"></div>
<i class="uk-icon-times"></i> Decline
+ <script type="text/template" id="chat-template">
+ <div class="log"></div>
<script src='/js/tram.js'></script>
<script src='/js/rivets.js'></script>
--- a/js/calls.js Tue May 24 12:34:08 2016 +0800
+++ b/js/calls.js Tue May 24 13:11:13 2016 +0800
return CallView.__super__.constructor.apply(this, arguments);
- CallView.prototype.tagName = 'div';
- CallView.prototype.className = 'video-block';
- CallView.prototype.template = $('#video-block-template').html();
+ CallView.prototype.templateEl = $($('#video-block-template').html());
CallView.prototype.events = {
'click [data-mute-cam]': function() {
CallView.prototype.initialize = function() {
- this.$el.html(this.template);
+ this.setElement(this.templateEl.clone());
this.$local = this.$('video.local');
this.$remote = this.$('video.remote');
--- a/js/calls.js.map Tue May 24 12:34:08 2016 +0800
+++ b/js/calls.js.map Tue May 24 13:11:13 2016 +0800
- "mappings": ";AAAA;AAAA,MAAA;;;EAAM,IAAI,CAAC;;;;;;;mBACT,WAAA,GAAa;;mBAEb,UAAA,GAAY,SAAA;MACV,IAAC,CAAA,EAAD,CAAI,qBAAJ,EAA2B,IAAC,CAAA,oBAA5B;aACA,IAAC,CAAA,EAAD,CAAI,sBAAJ,EAA4B,IAAC,CAAA,qBAA7B;IAFU;;mBAIZ,eAAA,GAAiB,SAAC,KAAD,EAAQ,KAAR;AACf,UAAA;MAAA,IAAG,IAAC,CAAA,GAAD,CAAK,KAAL,CAAH;QACE,GAAG,CAAC,eAAJ,CAAoB,IAAC,CAAA,GAAD,CAAK,KAAL,CAApB,EADF;;MAEA,MAAA,GAAS,IAAC,CAAA,GAAD,CAAK,KAAL;MACT,IAAG,MAAH;eACE,IAAC,CAAA,GAAD,CAAK,KAAL,EAAY,GAAG,CAAC,eAAJ,CAAoB,MAApB,CAAZ,EADF;OAAA,MAAA;eAGE,IAAC,CAAA,KAAD,CAAO,KAAP,EAHF;;IAJe;;mBASjB,oBAAA,GAAsB,SAAA;aACpB,IAAC,CAAA,eAAD,CAAiB,cAAjB,EAAiC,kBAAjC;IADoB;;mBAGtB,qBAAA,GAAuB,SAAA;aACrB,IAAC,CAAA,eAAD,CAAiB,eAAjB,EAAkC,mBAAlC;IADqB;;;;KAnBD,QAAQ,CAAC;;EAuB3B,IAAI,CAAC;;;;;;;oBACT,KA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return AvatarView.__super__.constructor.apply(this, arguments);
- AvatarView.prototype.tagName = 'div';
- AvatarView.prototype.className = 'vignette';
- AvatarView.prototype.template = $('#avatar-template').html();
+ AvatarView.prototype.templateEl = $($('#avatar-template').html());
AvatarView.prototype.colors = Tram.colors.avatar;
+ AvatarView.prototype.initialize = function() {
+ return this.setElement(this.templateEl.clone());
AvatarView.prototype.getColors = function(hash) {
ci = hash % this.colors.length;
AvatarView.prototype.render = function() {
- this.$el.html(this.template);
this.rivet = rivets.bind(this.el, {
this.getPipColor = bind(this.getPipColor, this);
+ this.getBorderColor = bind(this.getBorderColor, this);
return ContactView.__super__.constructor.apply(this, arguments);
- ContactView.prototype.tagName = 'li';
- ContactView.prototype.className = 'contact';
- ContactView.prototype.template = $('#contact-template').html();
+ ContactView.prototype.templateEl = $($('#contact-template').html());
ContactView.prototype.colors = Tram.colors.show;
ContactView.prototype.initialize = function() {
- this.$el.attr('data-jid', this.model.get('jid'));
- this.$el.html(this.template);
+ this.setElement(this.templateEl.clone());
this.$avatarColumn = this.$('.avatar-column');
ContactView.prototype.bind = function() {
- this.listenTo(this.model, 'change:active', this.updateActive);
- this.listenTo(this.model, 'change:show', this.setBorderColor);
return this.listenTo(this.model, 'remove', this.remove);
- ContactView.prototype.updateActive = function() {
- return this.$el.toggleClass('active', this.model.has('active') && this.model.get('active'));
- ContactView.prototype.setBorderColor = function() {
- return this.$el.css('border-left-color', this.colors[this.model.get('show')] || this.colors['default']);
+ ContactView.prototype.getBorderColor = function(show) {
+ return "border-left-color: " + (this.colors[show] || this.colors['default']) + ";";
ContactView.prototype.getPipColor = function(show) {
this.$avatarColumn.prepend(av.render().el);
--- a/js/contacts.js.map Tue May 24 12:34:08 2016 +0800
+++ b/js/contacts.js.map Tue May 24 13:11:13 2016 +0800
- "mappings": ";AAAA;AAAA,MAAA;;;;;EAAM,IAAI,CAAC;;;;;;;sBACT,WAAA,GAAa;;sBACb,YAAA,GAAc;;sBACd,iBAAA,GAAmB;;sBACnB,Q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AAC,WAAL,CAAiB;QAAA,KAAA,EAAO,KAAP;OAAjB;MACjB,EAAA,GAAK,KAAK,CAAC,IAAI,CAAC,MAAX,CAAA,CAAmB,CAAC;MACzB,IAAG,EAAA,KAAM,CAAT;eACE,IAAC,CAAA,GAAG,CAAC,OAAL,CAAa,EAAb,EADF;OAAA,MAAA;eAGE,IAAC,CAAA,GAAG,CAAC,QAAL,CAAA,CAAe,CAAC,EAAhB,CAAmB,EAAA,GAAK,CAAxB,CAA0B,CAAC,KAA3B,CAAiC,EAAjC,EAHF;;IAJK;;0BASP,MAAA,GAAQ,SAAC,UAAD,EAAa,OAAb;MACN,IAAG,CAAI,OAAO,CAAC,GAAf;eACE,UAAU,CAAC,IAAX,CAAgB,CAAA,SAAA,KAAA;iBAAA,SAAC,KAAD;YACd,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAf,CAAA;mBACA,KAAC,CAAA,GAAG,CAAC,MAAL,CAAY,KAAK,CAAC,IAAI,CAAC,EAAvB;UAFc;QAAA,CAAA,CAAA,CAAA,IAAA,CAAhB,EADF;;IADM;;;;KAdqB,QAAQ,CAAC;AA3IxC"
\ No newline at end of file
--- a/js/messages.js Tue May 24 12:34:08 2016 +0800
+++ b/js/messages.js Tue May 24 13:11:13 2016 +0800
return MessageView.__super__.constructor.apply(this, arguments);
- MessageView.prototype.tagName = 'div';
- MessageView.prototype.className = 'message';
- MessageView.prototype.template = $('#message-template').html();
+ MessageView.prototype.templateEl = $($('#message-template').html());
MessageView.prototype.initialize = function() {
- this.$el.attr('data-id', this.model.get('id'));
- this.$el.html(this.template);
+ this.setElement(this.templateEl.clone());
this.$avatarColumn = this.$('.avatar-column');
return LogApp.__super__.constructor.apply(this, arguments);
- LogApp.prototype.tagName = 'div';
- LogApp.prototype.className = 'log';
+ LogApp.prototype.templateEl = $($('#chat-template').html());
LogApp.prototype.initialize = function() {
+ this.setElement(this.templateEl.clone());
+ this.$log = this.$('.log');
+ this.rivet = rivets.bind(this.el, {
+ LogApp.prototype.bind = function() {
return this.listenTo(this.collection, 'add', this.onAdd);
- this.$el.children().eq(mi - 1).after(el);
+ this.$log.children().eq(mi - 1).after(el);
LogApp.prototype.bottomed = function() {
- return this.$el.scrollTop() + this.$el.height() === this.$el.get(0).scrollHeight;
+ return this.$log.scrollTop() + this.$log.height() === this.$log.get(0).scrollHeight;
LogApp.prototype.scroll = function() {
- return this.$el.scrollTop(this.$el.get(0).scrollHeight);
+ return this.$log.scrollTop(this.$log.get(0).scrollHeight);
+ LogApp.prototype.remove = function() {
+ return LogApp.__super__.remove.apply(this, arguments);
--- a/js/messages.js.map Tue May 24 12:34:08 2016 +0800
+++ b/js/messages.js.map Tue May 24 13:11:13 2016 +0800
- "mappings": ";AAAA;AAAA,MAAA;;;EAAM,IAAI,CAAC;;;;;;;sBACT,UAAA,GAAY,SAAA;aACV,IAAC,CAAA,EAAD,CAAI,kBAAJ,EAAwB,SAAA;QACtB,IAAG,IAAC,CAAA,GAAD,CAAK,OAAL,CAAH;iBACE,IAAC,CAAA,GAAD,CAAK,UAAL,EAAiB,MAAA,CAAO,IAAC,CAAA,GAAD,CAAK,OAAL,CAAP,CAAjB,EADF;SAAA,MAAA;iBAGE,IAAC,CAAA,KAAD,CAAO,UAAP,EAHF;;MADsB,CAAxB;IADU;;;;KADa,QAAQ,CAAC;;EAS9B,IAAI,CAAC;;;;;;;uBACT,KAAA,GAAO,IAAI,CAAC;;uBACZ,cAAA,GAAgB,EAAA,GAAK,EAAL,GAAU;;uBAC1B,aAAA,GAAe,EAAA,GAAK;;uBAEpB,UAAA,GAAY,SAAC,KAAD;aACV,KAAK,CAAC,GAAN,CAAU,OAAV,CAAkB,CAAC,OAAnB,CAAA;IADU;;uBAGZ,UAAA,GAAY,SAAA;aACV,IAAC,CAAA,EAAD,CAAI,KAAJ,EAAW,IAAC,CAAA,KAAZ;IADU;;uBAGZ,KAAA,GAAO,SAAC,KAAD;AACL,UAAA;MAAA,EAAA,GAAK,IAAC,CAAA,OAAD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