Download:
child 28:1efbfe153b8f
parent 26:8d301732c5cc
27:f59d389adcc4
Anton Shestakov <av6@dwimlabs.net>, Mon, 21 Mar 2016 21:13:17 +0800
contacts: new ui element, contact list

11 файлов изменено, 321 вставок(+), 3 удалений(-) [+]
coffee/contacts.coffee file | annotate | diff | comparison | revisions
coffee/index.coffee file | annotate | diff | comparison | revisions
coffee/tram.coffee file | annotate | diff | comparison | revisions
css/tram-im.css file | annotate | diff | comparison | revisions
index.html file | annotate | diff | comparison | revisions
js/contacts.js file | annotate | diff | comparison | revisions
js/contacts.js.map file | annotate | diff | comparison | revisions
js/index.js file | annotate | diff | comparison | revisions
js/index.js.map file | annotate | diff | comparison | revisions
js/tram.js file | annotate | diff | comparison | revisions
js/tram.js.map file | annotate | diff | comparison | revisions
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/coffee/contacts.coffee Mon Mar 21 21:13:17 2016 +0800
@@ -0,0 +1,81 @@
+class Tram.Contact extends Backbone.Model
+ idAttribute: 'jid'
+ defaults:
+ presence: 'unavailable'
+
+ initialize: ->
+ @on 'add change:avatar', ->
+ avatar = @get 'avatar'
+ if avatar?.mime and avatar?.data
+ @set('d/avatar', "data:#{ avatar.mime };base64,#{ avatar.data }")
+ else
+ @unset('d/avatar')
+
+ @on 'add change:fullname change:nickname change:jid', ->
+ @set('d/handle', @get('fullname') or @get('nickname') or @get('jid'))
+
+ @on 'add change:show change:presence', ->
+ @set('d/pip', if @has('show') then @get('show') else @get('presence'))
+
+
+class Tram.Contacts extends Backbone.Collection
+ model: Tram.Contact
+
+ comparator: (model) ->
+ if model.get('presence') is 'unavailable'
+ return 1
+ else if model.get('type') is 'self'
+ return -1
+ else
+ return 0
+
+ initialize: ->
+ @on('change:presence change:type', @sort)
+
+
+class Tram.ContactView extends Backbone.View
+ tagName: 'li'
+ className: 'contact'
+ template: $('#contact-template').html()
+ colors: Tram.colors.presence
+
+ initialize: ->
+ @$el.attr('data-jid', @model.get('jid'))
+
+ @$el.html(@template)
+
+ @bind()
+
+ bind: ->
+
+ getPipStyle: ->
+ "background: #{ @colors[@model.get 'd/pip'] || @colors['default'] };"
+
+ render: ->
+ @rivet = rivets.bind(@el, model: @model, view: this)
+ @
+
+ remove: ->
+ @rivet.unbind()
+ super
+
+
+class Tram.ContactsApp extends Backbone.View
+ initialize: ->
+ @listenTo(@collection, 'add', @onAdd)
+ @listenTo(@collection, 'sort', @onSort)
+
+ onAdd: (model, collection) ->
+ mi = collection.indexOf model
+ model.view = new Tram.ContactView(model: model)
+ el = model.view.render().el
+ if mi is 0
+ @$el.prepend(el)
+ else
+ @$el.children().eq(mi - 1).after(el)
+
+ onSort: (collection, options) ->
+ if not options.add
+ collection.each (model) =>
+ model.view.$el.detach()
+ @$el.append(model.view.el)
--- a/coffee/index.coffee Mon Mar 21 20:21:40 2016 +0800
+++ b/coffee/index.coffee Mon Mar 21 21:13:17 2016 +0800
@@ -1,3 +1,5 @@
+window.contacts ?= new Tram.Contacts()
+window.contactsApp ?= new Tram.ContactsApp(el: $('[data-app="contacts"]'), collection: contacts)
window.messages ?= new Tram.Messages()
window.logApp ?= new Tram.LogApp(el: $('[data-app="log"]'), collection: messages)
--- a/coffee/tram.coffee Mon Mar 21 20:21:40 2016 +0800
+++ b/coffee/tram.coffee Mon Mar 21 21:13:17 2016 +0800
@@ -2,3 +2,11 @@
config:
host: location.host
domain: location.hostname
+
+ colors:
+ presence:
+ online: '#5cb85c'
+ away: '#f0ad4e'
+ xa: '#d9534f'
+ unavailable: '#777'
+ default: '#337ab7'
--- a/css/tram-im.css Mon Mar 21 20:21:40 2016 +0800
+++ b/css/tram-im.css Mon Mar 21 21:13:17 2016 +0800
@@ -31,3 +31,23 @@
.message > .column {
vertical-align: top;
}
+.avatar-column {
+ position: relative;
+}
+.status-pip {
+ position: absolute;
+ right: 0;
+ bottom: 0;
+ border-radius: 50%;
+ width: 11px;
+ height: 11px;
+}
+.contact-list {
+ margin-top: 15px;
+}
+li.contact {
+ padding: 5px;
+}
+li.contact > .column {
+ vertical-align: middle;
+}
--- a/index.html Mon Mar 21 20:21:40 2016 +0800
+++ b/index.html Mon Mar 21 21:13:17 2016 +0800
@@ -57,7 +57,16 @@
<i class="uk-icon-sign-out"></i>&nbsp;Log out
</button>
- <div class="log" data-app="log"></div>
+ <div data-app="calls"></div>
+
+ <div class="uk-grid">
+ <div class="uk-width-large-1-4 uk-width-medium-1-3 uk-width-small-1-2">
+ <ul class="uk-list uk-list-line contact-list" data-app="contacts"></ul>
+ </div>
+ <div class="uk-width-large-3-4 uk-width-medium-2-3 uk-width-small-1-2">
+ <div class="log" data-app="log"></div>
+ </div>
+ </div>
</div>
<script type="text/template" id="message-template">
@@ -70,10 +79,23 @@
<div rv-data-id="model:id" rv-class="model:cls" rv-text="model:text"></div>
</div>
</script>
+ <script type="text/template" id="contact-template">
+ <div class="column avatar-column">
+ <div class="status-pip" rv-title="model:d/pip" rv-style="view.getPipStyle < model:d/pip"></div>
+ </div>
+ <div class="column uk-width-1-1">
+ <div class="uk-text-bold" rv-text="model:d/handle"></div>
+ <div class="uk-text-nowrap">
+ <span rv-text="model:status"></span>
+ <span rv-hide="model:type | eq 'self'" rv-text="model:chatstate | only 'composing'"></span>
+ </div>
+ </div>
+ </script>
<script src='/js/tram.js'></script>
<script src='/js/rivets.js'></script>
<script src='/js/validation.js'></script>
<script src='/js/xmpp.js'></script>
+ <script src='/js/contacts.js'></script>
<script src='/js/messages.js'></script>
<script src='/config.js'></script>
<script src='/js/index.js'></script>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/js/contacts.js Mon Mar 21 21:13:17 2016 +0800
@@ -0,0 +1,155 @@
+// Generated by CoffeeScript 1.10.0
+(function() {
+ var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
+ hasProp = {}.hasOwnProperty;
+
+ Tram.Contact = (function(superClass) {
+ extend(Contact, superClass);
+
+ function Contact() {
+ return Contact.__super__.constructor.apply(this, arguments);
+ }
+
+ Contact.prototype.idAttribute = 'jid';
+
+ Contact.prototype.defaults = {
+ presence: 'unavailable'
+ };
+
+ Contact.prototype.initialize = function() {
+ this.on('add change:avatar', function() {
+ var avatar;
+ avatar = this.get('avatar');
+ if ((avatar != null ? avatar.mime : void 0) && (avatar != null ? avatar.data : void 0)) {
+ return this.set('d/avatar', "data:" + avatar.mime + ";base64," + avatar.data);
+ } else {
+ return this.unset('d/avatar');
+ }
+ });
+ this.on('add change:fullname change:nickname change:jid', function() {
+ return this.set('d/handle', this.get('fullname') || this.get('nickname') || this.get('jid'));
+ });
+ return this.on('add change:show change:presence', function() {
+ return this.set('d/pip', this.has('show') ? this.get('show') : this.get('presence'));
+ });
+ };
+
+ return Contact;
+
+ })(Backbone.Model);
+
+ Tram.Contacts = (function(superClass) {
+ extend(Contacts, superClass);
+
+ function Contacts() {
+ return Contacts.__super__.constructor.apply(this, arguments);
+ }
+
+ Contacts.prototype.model = Tram.Contact;
+
+ Contacts.prototype.comparator = function(model) {
+ if (model.get('presence') === 'unavailable') {
+ return 1;
+ } else if (model.get('type') === 'self') {
+ return -1;
+ } else {
+ return 0;
+ }
+ };
+
+ Contacts.prototype.initialize = function() {
+ return this.on('change:presence change:type', this.sort);
+ };
+
+ return Contacts;
+
+ })(Backbone.Collection);
+
+ Tram.ContactView = (function(superClass) {
+ extend(ContactView, superClass);
+
+ function ContactView() {
+ return ContactView.__super__.constructor.apply(this, arguments);
+ }
+
+ ContactView.prototype.tagName = 'li';
+
+ ContactView.prototype.className = 'contact';
+
+ ContactView.prototype.template = $('#contact-template').html();
+
+ ContactView.prototype.colors = Tram.colors.presence;
+
+ ContactView.prototype.initialize = function() {
+ this.$el.attr('data-jid', this.model.get('jid'));
+ this.$el.html(this.template);
+ return this.bind();
+ };
+
+ ContactView.prototype.bind = function() {};
+
+ ContactView.prototype.getPipStyle = function() {
+ return "background: " + (this.colors[this.model.get('d/pip')] || this.colors['default']) + ";";
+ };
+
+ ContactView.prototype.render = function() {
+ this.rivet = rivets.bind(this.el, {
+ model: this.model,
+ view: this
+ });
+ return this;
+ };
+
+ ContactView.prototype.remove = function() {
+ this.rivet.unbind();
+ return ContactView.__super__.remove.apply(this, arguments);
+ };
+
+ return ContactView;
+
+ })(Backbone.View);
+
+ Tram.ContactsApp = (function(superClass) {
+ extend(ContactsApp, superClass);
+
+ function ContactsApp() {
+ return ContactsApp.__super__.constructor.apply(this, arguments);
+ }
+
+ ContactsApp.prototype.initialize = function() {
+ this.listenTo(this.collection, 'add', this.onAdd);
+ return this.listenTo(this.collection, 'sort', this.onSort);
+ };
+
+ ContactsApp.prototype.onAdd = function(model, collection) {
+ var el, mi;
+ mi = collection.indexOf(model);
+ model.view = new Tram.ContactView({
+ model: model
+ });
+ el = model.view.render().el;
+ if (mi === 0) {
+ return this.$el.prepend(el);
+ } else {
+ return this.$el.children().eq(mi - 1).after(el);
+ }
+ };
+
+ ContactsApp.prototype.onSort = function(collection, options) {
+ if (!options.add) {
+ return collection.each((function(_this) {
+ return function(model) {
+ model.view.$el.detach();
+ return _this.$el.append(model.view.el);
+ };
+ })(this));
+ }
+ };
+
+ return ContactsApp;
+
+ })(Backbone.View);
+
+}).call(this);
+
+//# sourceMappingURL=contacts.js.map
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/js/contacts.js.map Mon Mar 21 21:13:17 2016 +0800
@@ -0,0 +1,10 @@
+{
+ "version": 3,
+ "file": "contacts.js",
+ "sourceRoot": "..",
+ "sources": [
+ "coffee/contacts.coffee"
+ ],
+ "names": [],
+ "mappings": ";AAAA;AAAA,MAAA;;;EAAM,IAAI,CAAC;;;;;;;sBACT,WAAA,GAAa;;sBACb,QAAA,GACE;MAAA,QAAA,EAAU,aAAV;;;sBAEF,UAAA,GAAY,SAAA;MACV,IAAC,CAAA,EAAD,CAAI,mBAAJ,EAAyB,SAAA;AACvB,YAAA;QAAA,MAA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;MACL,KAAK,CAAC,IAAN,GAAiB,IAAA,IAAI,CAAC,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;AA9DxC"
+}
\ No newline at end of file
--- a/js/index.js Mon Mar 21 20:21:40 2016 +0800
+++ b/js/index.js Mon Mar 21 21:13:17 2016 +0800
@@ -2,6 +2,17 @@
(function() {
var $form, getText, getVersion, onConnected;
+ if (window.contacts == null) {
+ window.contacts = new Tram.Contacts();
+ }
+
+ if (window.contactsApp == null) {
+ window.contactsApp = new Tram.ContactsApp({
+ el: $('[data-app="contacts"]'),
+ collection: contacts
+ });
+ }
+
if (window.messages == null) {
window.messages = new Tram.Messages();
}
--- a/js/index.js.map Mon Mar 21 20:21:40 2016 +0800
+++ b/js/index.js.map Mon Mar 21 21:13:17 2016 +0800
@@ -6,5 +6,5 @@
"coffee/index.coffee"
],
"names": [],
- "mappings": ";AAAA;AAAA,MAAA;;;IAAA,MAAM,CA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EAAH;aACE,CAAC,CAAC,OAAF,CAAU,CAAA,CAAE,WAAF,CAAc,CAAC,GAAf,CAAA,CAAoB,CAAC,IAArB,CAAA,CAAV,EAAuC,CAAA,CAAE,WAAF,CAAc,CAAC,GAAf,CAAA,CAAvC,EADF;;EAN+B,CAAjC;AA9FA"
}
\ No newline at end of file
--- a/js/tram.js Mon Mar 21 20:21:40 2016 +0800
+++ b/js/tram.js Mon Mar 21 21:13:17 2016 +0800
@@ -4,6 +4,15 @@
config: {
host: location.host,
domain: location.hostname
+ },
+ colors: {
+ presence: {
+ online: '#5cb85c',
+ away: '#f0ad4e',
+ xa: '#d9534f',
+ unavailable: '#777',
+ "default": '#337ab7'
+ }
}
};
--- a/js/tram.js.map Mon Mar 21 20:21:40 2016 +0800
+++ b/js/tram.js.map Mon Mar 21 21:13:17 2016 +0800
@@ -6,5 +6,5 @@
"coffee/tram.coffee"
],
"names": [],
- "mappings": ";AAAA;EAAA,MAAM,CAAC,IAAP,GACE;IAAA,MAAA,EACE;MAAA,IAAA,EAAM,QAAQ,CAAC,IAAf;MACA,MAAA,EAAQ,QAAQ,CAAC,QADjB;KADF;;AADF"
+ "mappings": ";AAAA;EAAA,MAAM,CAAC,IAAP,GACE;IAAA,MAAA,EACE;MAAA,IAAA,EAAM,QAAQ,CAAC,IAAf;MACA,MAAA,EAAQ,QAAQ,CAAC,QADjB;KADF;IAIA,MAAA,EACE;MAAA,QAAA,EACE;QAAA,MAAA,EAAQ,SAAR;QACA,IAAA,EAAM,SADN;QAEA,EAAA,EAAI,SAFJ;QAGA,WAAA,EAAa,MAHb;QAIA,SAAA,EAAS,SAJT;OADF;KALF;;AADF"
}
\ No newline at end of file