diff --git a/src/messenger/webim/js/compiled/default/models/thread.js b/src/messenger/webim/js/compiled/default/models/thread.js index 18b24242..39f88cbd 100644 --- a/src/messenger/webim/js/compiled/default/models/thread.js +++ b/src/messenger/webim/js/compiled/default/models/thread.js @@ -5,4 +5,4 @@ Copyright (c) 2005-2011 Mibew Messenger Community License: http://mibew.org/license.php */ -(function(a){a.Models.Thread=a.Models.Base.extend({defaults:{id:0,token:0,lastId:0}})})(Mibew); +(function(a){a.Models.Thread=a.Models.Base.extend({defaults:{id:0,token:0,lastId:0,state:null},STATE_QUEUE:0,STATE_WAITING:1,STATE_CHATTING:2,STATE_CLOSED:3,STATE_LOADING:4,STATE_LEFT:5})})(Mibew); diff --git a/src/messenger/webim/js/compiled/default_app.js b/src/messenger/webim/js/compiled/default_app.js index d691e199..1bbf9bc4 100644 --- a/src/messenger/webim/js/compiled/default_app.js +++ b/src/messenger/webim/js/compiled/default_app.js @@ -20,7 +20,7 @@ b.Server.prototype.registerFunction=function(a,b){a in this.functions||(this.fun (function(a){a.Models.Control=a.Models.Base.extend({defaults:{title:"",weight:0}})})(Mibew); (function(a,b){a.Models.Page=b.Model.extend()})(Mibew,Backbone); (function(a,b){a.Models.Sound=b.Model.extend({play:function(a){this.set({file:a});this.trigger("sound:play",this)}})})(Mibew,Backbone); -(function(a){a.Models.Thread=a.Models.Base.extend({defaults:{id:0,token:0,lastId:0}})})(Mibew); +(function(a){a.Models.Thread=a.Models.Base.extend({defaults:{id:0,token:0,lastId:0,state:null},STATE_QUEUE:0,STATE_WAITING:1,STATE_CHATTING:2,STATE_CLOSED:3,STATE_LOADING:4,STATE_LEFT:5})})(Mibew); (function(a){a.Models.User=a.Models.Base.extend({defaults:{isAgent:!1,name:""}})})(Mibew); (function(a,b){a.Collections.Controls=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone); (function(b,c,d){b.Views.Control=c.Marionette.ItemView.extend({template:d.templates.default_control,modelEvents:{change:"render"},events:{mouseover:"mouseOver",mouseleave:"mouseLeave"},attributes:function(){var a=[];a.push("control");this.className&&(a.push(this.className),this.className="");var b=this.getDashedControlType();b&&a.push(b);return{"class":a.join(" ")}},mouseOver:function(){var a=this.getDashedControlType();this.$el.addClass("active"+(a?"-"+a:""))},mouseLeave:function(){var a=this.getDashedControlType(); diff --git a/src/messenger/webim/js/source/default/models/thread.js b/src/messenger/webim/js/source/default/models/thread.js index cb914fb3..4ff5e55b 100644 --- a/src/messenger/webim/js/source/default/models/thread.js +++ b/src/messenger/webim/js/source/default/models/thread.js @@ -9,7 +9,7 @@ (function(Mibew){ /** * Create an instance of thread - * @constructor + * @class */ Mibew.Models.Thread = Mibew.Models.Base.extend( /** @lends Mibew.Models.Thread.prototype */ @@ -36,8 +36,43 @@ * Last message id received by the thread * @type Number */ - lastId: 0 - } + lastId: 0, + + /** + * Thread's state + * @type Number + */ + state: null + }, + + /** Thread state constants */ + + /** + * User in the users queue + */ + STATE_QUEUE: 0, + /** + * User waiting for operator + */ + STATE_WAITING: 1, + /** + * Conversation in progress + */ + STATE_CHATTING: 2, + /** + * Thread closed + */ + STATE_CLOSED: 3, + /** + * Thread just created + */ + STATE_LOADING: 4, + /** + * User left message without starting a conversation + */ + STATE_LEFT: 5 + + /** End of thread state constants */ } ); })(Mibew); \ No newline at end of file