Advertisement
Joeytje50

Untitled

Jul 30th, 2012
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. models.User = Backbone.Model.extend({
  2.     defaults: {
  3.         'name': '',
  4.         'since': '',
  5.         'statusMessage': '',
  6.         'statusState': STATUS_STATE_PRESENT,
  7.         'isModerator': false,
  8.         'isStaff': false,
  9.         'isCanGiveChatMode': false,
  10.         'avatarSrc': "http://placekitten.com/50/50",
  11.         'editCount': '?',
  12.         'isPrivate': false,
  13.         'active': false,
  14.         'privateRoomId': false
  15.     },
  16.     initialize: function(options){
  17.         attrs = this.attributes;
  18.         console.log(attrs, attrs.statusMessage)
  19.         if (attrs.statusMessage.length && attrs.statusMessage.split(' ')[0] == wgUserName.replace(' ','_') && attrs.name != wgUserName) {
  20.             console.log('running statusMessage functions:')
  21.             for (var i in onStatusMessage) {
  22.                 onStatusMessage[i](options)
  23.             }
  24.         }
  25.     },
  26.     isAway: function(){
  27.         return (this.get('statusState') == STATUS_STATE_AWAY);
  28.     }
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement