31:d0248d45562f
Anton Shestakov <av6@dwimlabs.net>, Mon, 21 Mar 2016 23:01:44 +0800
contacts: add avatars and fallback option (background color from hashed jid)

next change 34:a7e8ed799092
previous change 30:32d1f208206f

coffee/rivets.coffee

Permissions: -rw-r--r--

Other formats: Feeds:
rivets.adapters[':'] =
observe: (obj, keypath, callback) ->
obj.on('change:' + keypath, callback)
unobserve: (obj, keypath, callback) ->
obj.off('change:' + keypath, callback)
get: (obj, keypath) ->
obj.get(keypath)
set: (obj, keypath, value) ->
obj.set(keypath, value)
rivets.formatters['first-letter'] = (value) ->
if value? then value.charAt(0) else ' '
rivets.formatters['only'] = (value, allowed...) ->
if value in allowed then value else ''
rivets.formatters['eq'] = (a, b) ->
a is b
rivets.formatters['format-date'] = (value, format) ->
if value? then value.format(format) else ''
rivets.formatters['iso-date'] = (value) ->
if value? then value.toISOString() else ''
rivets.formatters['from-now'] = (value) ->
if value? then value.fromNow() else ''