/* This file is part of Mibew Messenger project. http://mibew.org Copyright (c) 2005-2011 Mibew Messenger Community License: http://mibew.org/license.php */ (function(){var k=Handlebars.template,l=Handlebars.templates=Handlebars.templates||{};l.agent=k(function(b,c,e,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{};var f=e.helperMissing,g=this.escapeExpression;b='';(a=e.name)?a=a.call(c,{hash:{},data:d}):(a=c.name,a="function"===typeof a?a.apply(c):a);b+=g(a);if((a=e.unless.call(c,c.isLast,{hash:{},inverse:this.noop,fn:this.program(9, function(){return","},d),data:d}))||0===a)b+=a;return b});l.no_threads=k(function(b,c,e,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{};var f;b=e.helperMissing;a=this.escapeExpression;d={hash:{},data:d};return c=''+(a((f=e.L10n,f?f.call(c,"clients.no_clients",d):b.call(c,"L10n","clients.no_clients",d)))+"")});l.no_visitors=k(function(b,c,e,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{};var f;b=e.helperMissing;a=this.escapeExpression; d={hash:{},data:d};return c=''+(a((f=e.L10n,f?f.call(c,"visitors.no_visitors",d):b.call(c,"L10n","visitors.no_visitors",d)))+"")});l.status_panel=k(function(b,c,e,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{};var f,g=e.helperMissing,h=this.escapeExpression;b='
';(a=e.message)?a=a.call(c,{hash:{},data:d}):(a=c.message,a="function"===typeof a?a.apply(c):a);b+=h(a);if((f=e["if"].call(c,(a=c.agent,null==a||!1===a?a:a.away), {hash:{},inverse:this.program(3,function(a,b){var c,d;d={hash:{},data:b};return h((c=e.L10n,c?c.call(a,"pending.status.online",d):g.call(a,"L10n","pending.status.online",d)))},d),fn:this.program(1,function(a,b){var c,d;d={hash:{},data:b};return h((c=e.L10n,c?c.call(a,"pending.status.away",d):g.call(a,"L10n","pending.status.away",d)))},d),data:d}))||0===f)b+=f;b+='
"});l.threads_collection=k(function(b,c,e,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{}; var f,g=e.helperMissing,h=this.escapeExpression;a={hash:{},data:d};b='\n\n\n \n \n \n \n \n \n \n \n\n\n\n\n\n
'+(h((f=e.L10n,f?f.call(c,"pending.table.head.name",a):g.call(c,"L10n","pending.table.head.name",a)))+"");a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"pending.table.head.actions",a):g.call(c,"L10n","pending.table.head.actions",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"pending.table.head.contactid",a):g.call(c,"L10n", "pending.table.head.contactid",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"pending.table.head.state",a):g.call(c,"L10n","pending.table.head.state",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"pending.table.head.operator",a):g.call(c,"L10n","pending.table.head.operator",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"pending.table.head.total",a):g.call(c,"L10n","pending.table.head.total",a)))+"";a={hash:{},data:d}; b+=h((f=e.L10n,f?f.call(c,"pending.table.head.waittime",a):g.call(c,"L10n","pending.table.head.waittime",a)))+"";a={hash:{},data:d};return b+=h((f=e.L10n,f?f.call(c,"pending.table.head.etc",a):g.call(c,"L10n","pending.table.head.etc",a)))+'
'});l.visitors_collection=k(function(b,c,e,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{};var f,g=e.helperMissing,h=this.escapeExpression;a={hash:{},data:d}; b='\n\n\n \n \n \n \n \n \n \n \n \n\n\n\n\n
'+(h((f=e.L10n,f?f.call(c,"visitors.table.head.name",a):g.call(c,"L10n","visitors.table.head.name",a)))+"");a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"visitors.table.head.actions",a):g.call(c,"L10n","visitors.table.head.actions",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"visitors.table.head.contactid",a):g.call(c,"L10n","visitors.table.head.contactid",a)))+""; a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"visitors.table.head.firsttimeonsite",a):g.call(c,"L10n","visitors.table.head.firsttimeonsite",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"visitors.table.head.lasttimeonsite",a):g.call(c,"L10n","visitors.table.head.lasttimeonsite",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"visitors.table.head.invited.by",a):g.call(c,"L10n","visitors.table.head.invited.by",a)))+"";a={hash:{},data:d};b+=h((f= e.L10n,f?f.call(c,"visitors.table.head.invitationtime",a):g.call(c,"L10n","visitors.table.head.invitationtime",a)))+"";a={hash:{},data:d};b+=h((f=e.L10n,f?f.call(c,"visitors.table.head.invitations",a):g.call(c,"L10n","visitors.table.head.invitations",a)))+"";a={hash:{},data:d};return b+=h((f=e.L10n,f?f.call(c,"visitors.table.head.etc",a):g.call(c,"L10n","visitors.table.head.etc",a)))+'
'});l.visitor= k(function(b,c,e,a,d){function f(){return"-"}this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{};var g,h=e.helperMissing,j=this.escapeExpression;b='\n ';if((a=e.unless.call(c,c.invitationInfo,{hash:{},inverse:this.program(3,function(a,b){var c;(c=e.userName)?c=c.call(a,{hash:{},data:b}):(c=a.userName,c="function"===typeof c?c.apply(a):c);return j(c)},d),fn:this.program(1,function(a,b){var c,d;c={hash:{},data:b};c='');(d=e.userName)?d=d.call(a,{hash:{},data:b}):(d=a.userName,d="function"===typeof d?d.apply(a):d);return c+=j(d)+""},d),data:d}))||0===a)b+=a;g={hash:{},data:d};b=b+'\n\n\n
\n
\n
\n
\n\n');if((a=e["if"].call(c,c.userIp,{hash:{},inverse:this.program(7,function(a,b){var c;(c=e.remote)?c=c.call(a,{hash:{},data:b}):(c=a.remote,c="function"===typeof c?c.apply(a):c);return j(c)},d),fn:this.program(5,function(a,c){var b,d;b='';(d=e.remote)?d=d.call(a,{hash:{},data:c}):(d=a.remote,d="function"===typeof d?d.apply(a): d);return b+=j(d)+""},d),data:d}))||0===a)b+=a;b+='\n\n\n';if((a=e["if"].call(c,c.invitationInfo,{hash:{},inverse:this.program(11, f,d),fn:this.program(9,function(a){var c;return j((c=(c=a.invitationInfo,null==c||!1===c?c:c.agentName),"function"===typeof c?c.apply(a):c))},d),data:d}))||0===a)b+=a;b+='\n';if((a=e["if"].call(c,c.invitationInfo,{hash:{},inverse:this.program(11,f,d),fn:this.program(13,function(a){var c;return a=""+('')},d),data:d}))||0===a)b+=a;b+='\n'; (a=e.invitations)?a=a.call(c,{hash:{},data:d}):(a=c.invitations,a="function"===typeof a?a.apply(c):a);b+=j(a)+" / ";(a=e.chats)?a=a.call(c,{hash:{},data:d}):(a=c.chats,a="function"===typeof a?a.apply(c):a);b+=j(a)+'\n';(a=e.userAgent)?a=a.call(c,{hash:{},data:d}):(a=c.userAgent,a="function"===typeof a?a.apply(c):a);return b+=j(a)+""});l.queued_thread=k(function(b,c,e,a,d){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||b.helpers;d=d||{};var f=e.helperMissing,g=this.escapeExpression; b='\n
';if((a= e["if"].call(c,c.ban,{hash:{},inverse:this.noop,fn:this.program(5,function(a,c){var b,d;b={hash:{},data:c};return b=""+(g((d=e.L10n,d?d.call(a,"chat.client.spam.prefix",b):f.call(a,"L10n","chat.client.spam.prefix",b)))+" ")},d),data:d}))||0===a)b+=a;(a=e.userName)?a=a.call(c,{hash:{},data:d}):(a=c.userName,a="function"===typeof a?a.apply(c):a);b+=g(a)+"
\n ";if((a=e["if"].call(c,c.firstMessage,{hash:{},inverse:this.noop,fn:this.program(7,function(a,c){var b,d;b='
';(d=e.firstMessagePreview)?d=d.call(a,{hash:{},data:c}):(d=a.firstMessagePreview,d="function"===typeof d?d.apply(a):d);return b+=g(d)+"
"},d),data:d}))||0===a)b+=a;b+='\n\n\n
\n ';if((a=e["if"].call(c,c.canOpen,{hash:{},inverse:this.noop,fn:this.program(9,function(a,c){var b,d;b={hash:{},data:c}; return b='\n
\n ')},d),data:d}))||0===a)b+=a;b+="\n ";if((a=e["if"].call(c,c.canView,{hash:{},inverse:this.noop,fn:this.program(11,function(a,c){var b,d;b={hash:{},data:c};return b='\n
\n ')},d),data:d}))||0===a)b+=a;b+="\n ";if((a=e["if"].call(c,c.tracked,{hash:{},inverse:this.noop,fn:this.program(13,function(a,c){var b,d;b={hash:{},data:c};return b='\n
\n ')},d),data:d}))||0===a)b+=a;b+="\n ";if((a=e["if"].call(c,c.canBan,{hash:{},inverse:this.noop, fn:this.program(15,function(a,c){var b,d;b={hash:{},data:c};return b='\n
\n ')},d),data:d}))||0===a)b+=a;b+='\n
\n
\n\n';if((a=e["if"].call(c,c.userIp,{hash:{},inverse:this.program(19,function(a,b){var c;(c=e.remote)?c=c.call(a,{hash:{},data:b}): (c=a.remote,c="function"===typeof c?c.apply(a):c);return g(c)},d),fn:this.program(17,function(a,c){var b,d;b='';(d=e.remote)?d=d.call(a,{hash:{},data:c}):(d=a.remote,d="function"===typeof d?d.apply(a):d);return b+=g(d)+""},d),data:d}))||0===a)b+=a;b+='\n';(a=e.stateDesc)?a=a.call(c,{hash:{},data:d}):(a=c.stateDesc,a="function"===typeof a?a.apply(c):a);b+=g(a)+'\n';(a=e.agentName)? a=a.call(c,{hash:{},data:d}):(a=c.agentName,a="function"===typeof a?a.apply(c):a);b+=g(a)+'\n\n';if((a=e.unless.call(c,c.chatting,{hash:{},inverse:this.program(23,function(){return"-"},d),fn:this.program(21,function(a,c){var b,d;b=''},d),data:d}))||0===a)b+=a;b+='\n';if((a=e["if"].call(c,c.ban,{hash:{},inverse:this.program(27,function(a,c){var b;(b=e.userAgent)?b=b.call(a,{hash:{},data:c}):(b=a.userAgent,b="function"===typeof b?b.apply(a):b);return g(b)},d),fn:this.program(25,function(a){var b;return g((b=(b=a.ban,null==b||!1===b?b:b.reason),"function"===typeof b?b.apply(a):b))},d),data:d}))||0=== a)b+=a;return b+""})})(); /* This file is part of Mibew Messenger project. http://mibew.org Copyright (c) 2005-2011 Mibew Messenger Community License: http://mibew.org/license.php */ (function(a,e){a.Regions={};a.Popup={};a.Popup.open=function(b,a,g){b=window.open(b,a,g);b.focus();b.opener=window};a.Utils.updateTimers=function(a,f){a.find(f).each(function(){var a=e(this).data("timestamp");if(a){var c=Math.round((new Date).getTime()/1E3)-a,a=c%60,b=Math.floor(c/60)%60,c=Math.floor(c/3600),d=[];0b?"0"+b:b);d.push(10>a?"0"+a:a);e(this).html(d.join(":"))}})}})(Mibew,jQuery); /* This file is part of Mibew Messenger project. http://mibew.org Copyright (c) 2005-2011 Mibew Messenger Community License: http://mibew.org/license.php */ MibewAPIUsersInteraction=function(){this.obligatoryArguments={"*":{agentId:null,"return":{},references:{}},result:{errorCode:0}};this.reservedFunctionNames=["result"]};MibewAPIUsersInteraction.prototype=new MibewAPIInteraction; /* This file is part of Mibew Messenger project. http://mibew.org Copyright (c) 2005-2011 Mibew Messenger Community License: http://mibew.org/license.php */ (function(a,b){a.Models.Agent=a.Models.User.extend({defaults:b.extend({},a.Models.User.prototype.defaults,{id:null,isAgent:!0,away:!1}),away:function(){this.setAvailability(!1)},available:function(){this.setAvailability(!0)},setAvailability:function(c){var b=this;a.Objects.server.callFunctions([{"function":c?"available":"away",arguments:{agentId:this.id,references:{},"return":{}}}],function(a){0==a.errorCode&&b.set({away:!c})},!0)}})})(Mibew,_); /* This file is part of Mibew Messenger project. http://mibew.org Copyright (c) 2005-2011 Mibew Messenger Community License: http://mibew.org/license.php */ (function(a,c){var b=[],f=a.Models.QueuedThread=a.Models.Thread.extend({defaults:c.extend({},a.Models.Thread.prototype.defaults,{controls:null,userName:"",userIp:"",remote:"",userAgent:"",agentName:"",canOpen:!1,canView:!1,canBan:!1,ban:!1,totalTime:0,waitingTime:0,firstMessage:null}),initialize:function(){for(var e=[],b=f.getControls(),d=0,c=b.length;d