mirror of
https://github.com/Mibew/tray.git
synced 2025-01-22 18:10:34 +03:00
Use playSound JS function instead of sound model
This commit is contained in:
parent
a4d12d7b65
commit
4f47218a13
@ -5,5 +5,5 @@
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection",initialize:function(){this.collection.on("multiple:add",this.messagesAdded,this);a.Objects.Models.messageForm.on("before:post",this.messagePost,this)},skipNextSound:!0,messagePost:function(){this.skipNextSound=!0},messagesAdded:function(){if(!this.skipNextSound&&a.Objects.Models.Controls.sound.get("enabled")){var b=a.Objects.Models.page.get("webimRoot");b&&a.Objects.Models.sound.play(b+
|
||||
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection",initialize:function(){this.collection.on("multiple:add",this.messagesAdded,this);a.Objects.Models.messageForm.on("before:post",this.messagePost,this)},skipNextSound:!0,messagePost:function(){this.skipNextSound=!0},messagesAdded:function(){if(!this.skipNextSound&&a.Objects.Models.Controls.sound.get("enabled")){var b=a.Objects.Models.page.get("webimRoot");b&&a.Utils.playSound(b+
|
||||
"/sounds/new_message.wav")}this.skipNextSound=!1}})})(Mibew);
|
||||
|
@ -5,4 +5,4 @@
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region",soundRegion:"#sound-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);
|
||||
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);
|
||||
|
@ -5,10 +5,10 @@
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var g=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var f=new a.Layouts.Chat;g.chatLayout=f;l.mainRegion.show(f);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
|
||||
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var f=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var g=new a.Layouts.Chat;f.chatLayout=g;l.mainRegion.show(g);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
|
||||
e.add(c.userName),c.sendMail=new a.Models.SendMailControl({weight:200,link:b.links.mail,windowParams:b.windowsParams.mail}),e.add(c.sendMail));d.user.get("isAgent")&&(c.redirect=new a.Models.RedirectControl({weight:200,link:b.links.redirect}),e.add(c.redirect),c.history=new a.Models.HistoryControl({weight:180,link:b.links.history,windowParams:b.windowsParams.history}),e.add(c.history));c.sound=new a.Models.SoundControl({weight:160});e.add(c.sound);c.refresh=new a.Models.RefreshControl({weight:140});
|
||||
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);g.Collections.controls=e;f.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});g.Collections.status=new a.Collections.Status([h.message,h.typing]);f.statusRegion.show(new a.Views.StatusCollection({collection:g.Collections.status}));
|
||||
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,f.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));g.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);f.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));f.messagesRegion.show(new a.Views.MessagesCollection({collection:g.Collections.messages}));d.sound=new a.Models.Sound;f.soundRegion.show(new a.Views.Sound({model:d.sound}));j.push(g.server.callFunctionsPeriodically(function(){var b=
|
||||
a.Objects.Models.thread,c=a.Objects.Models.user;return[{"function":"update",arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});
|
||||
k.addFinalizer(function(){a.Objects.chatLayout.close();for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.sound;delete a.Objects.Models.Controls;
|
||||
delete a.Objects.Models.Status;delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;delete a.Objects.Collections.status})})(Mibew);
|
||||
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);f.Collections.controls=e;g.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});f.Collections.status=new a.Collections.Status([h.message,h.typing]);g.statusRegion.show(new a.Views.StatusCollection({collection:f.Collections.status}));
|
||||
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,g.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));f.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);g.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));g.messagesRegion.show(new a.Views.MessagesCollection({collection:f.Collections.messages}));j.push(f.server.callFunctionsPeriodically(function(){var b=a.Objects.Models.thread,c=a.Objects.Models.user;return[{"function":"update",
|
||||
arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});k.addFinalizer(function(){a.Objects.chatLayout.close();
|
||||
for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.Controls;delete a.Objects.Models.Status;delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;
|
||||
delete a.Objects.Collections.status})})(Mibew);
|
||||
|
@ -291,7 +291,7 @@ this.model.submit()}})})(Mibew,Handlebars,_);
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection",initialize:function(){this.collection.on("multiple:add",this.messagesAdded,this);a.Objects.Models.messageForm.on("before:post",this.messagePost,this)},skipNextSound:!0,messagePost:function(){this.skipNextSound=!0},messagesAdded:function(){if(!this.skipNextSound&&a.Objects.Models.Controls.sound.get("enabled")){var b=a.Objects.Models.page.get("webimRoot");b&&a.Objects.Models.sound.play(b+
|
||||
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection",initialize:function(){this.collection.on("multiple:add",this.messagesAdded,this);a.Objects.Models.messageForm.on("before:post",this.messagePost,this)},skipNextSound:!0,messagePost:function(){this.skipNextSound=!0},messagesAdded:function(){if(!this.skipNextSound&&a.Objects.Models.Controls.sound.get("enabled")){var b=a.Objects.Models.page.get("webimRoot");b&&a.Utils.playSound(b+
|
||||
"/sounds/new_message.wav")}this.skipNextSound=!1}})})(Mibew);
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
@ -313,7 +313,7 @@ this.model.submit()}})})(Mibew,Handlebars,_);
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region",soundRegion:"#sound-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);
|
||||
(function(a,c){a.Layouts.Chat=c.Marionette.Layout.extend({template:Handlebars.templates.chat_layout,regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:a.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var b=a.Objects.Models;return{page:b.page.toJSON(),user:b.user.toJSON()}}})})(Mibew,Backbone);
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
@ -334,13 +334,13 @@ this.model.submit()}})})(Mibew,Handlebars,_);
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var g=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var f=new a.Layouts.Chat;g.chatLayout=f;l.mainRegion.show(f);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
|
||||
(function(a){a.Objects.Models.Controls={};a.Objects.Models.Status={};var j=[],l=a.Application,k=l.module("Chat",{startWithParent:!1});k.addInitializer(function(b){var f=a.Objects,d=a.Objects.Models,c=a.Objects.Models.Controls,h=a.Objects.Models.Status;b.page&&d.page.set(b.page);d.thread=new a.Models.Thread(b.thread);d.user=new a.Models.ChatUser(b.user);var g=new a.Layouts.Chat;f.chatLayout=g;l.mainRegion.show(g);var e=new a.Collections.Controls;d.user.get("isAgent")||(c.userName=new a.Models.UserNameControl({weight:220}),
|
||||
e.add(c.userName),c.sendMail=new a.Models.SendMailControl({weight:200,link:b.links.mail,windowParams:b.windowsParams.mail}),e.add(c.sendMail));d.user.get("isAgent")&&(c.redirect=new a.Models.RedirectControl({weight:200,link:b.links.redirect}),e.add(c.redirect),c.history=new a.Models.HistoryControl({weight:180,link:b.links.history,windowParams:b.windowsParams.history}),e.add(c.history));c.sound=new a.Models.SoundControl({weight:160});e.add(c.sound);c.refresh=new a.Models.RefreshControl({weight:140});
|
||||
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);g.Collections.controls=e;f.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});g.Collections.status=new a.Collections.Status([h.message,h.typing]);f.statusRegion.show(new a.Views.StatusCollection({collection:g.Collections.status}));
|
||||
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,f.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));g.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);f.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));f.messagesRegion.show(new a.Views.MessagesCollection({collection:g.Collections.messages}));d.sound=new a.Models.Sound;f.soundRegion.show(new a.Views.Sound({model:d.sound}));j.push(g.server.callFunctionsPeriodically(function(){var b=
|
||||
a.Objects.Models.thread,c=a.Objects.Models.user;return[{"function":"update",arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});
|
||||
k.addFinalizer(function(){a.Objects.chatLayout.close();for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.sound;delete a.Objects.Models.Controls;
|
||||
delete a.Objects.Models.Status;delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;delete a.Objects.Collections.status})})(Mibew);
|
||||
e.add(c.refresh);b.links.ssl&&(c.secureMode=new a.Models.SecureModeControl({weight:120,link:b.links.ssl}),e.add(c.secureMode));c.close=new a.Models.CloseControl({weight:100});e.add(c.close);f.Collections.controls=e;g.controlsRegion.show(new a.Views.ControlsCollection({collection:e}));h.message=new a.Models.StatusMessage({hideTimeout:5E3});h.typing=new a.Models.StatusTyping({hideTimeout:5E3});f.Collections.status=new a.Collections.Status([h.message,h.typing]);g.statusRegion.show(new a.Views.StatusCollection({collection:f.Collections.status}));
|
||||
d.user.get("isAgent")||(d.avatar=new a.Models.Avatar,g.avatarRegion.show(new a.Views.Avatar({model:d.avatar})));f.Collections.messages=new a.Collections.Messages;d.messageForm=new a.Models.MessageForm(b.messageForm);g.messageFormRegion.show(new a.Views.MessageForm({model:d.messageForm}));g.messagesRegion.show(new a.Views.MessagesCollection({collection:f.Collections.messages}));j.push(f.server.callFunctionsPeriodically(function(){var b=a.Objects.Models.thread,c=a.Objects.Models.user;return[{"function":"update",
|
||||
arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:b.get("id"),token:b.get("token"),lastId:b.get("lastId"),typed:c.get("typing"),user:!c.get("isAgent")}}]},function(b){b.errorCode?a.Objects.Models.Status.message.setMessage(b.errorMessage||"refresh failed"):(b.typing&&a.Objects.Models.Status.typing.show(),a.Objects.Models.user.set({canPost:b.canPost||!1}))}))});k.on("start",function(){a.Objects.server.restartUpdater()});k.addFinalizer(function(){a.Objects.chatLayout.close();
|
||||
for(var b=0;b<j.length;b++)a.Objects.server.stopCallFunctionsPeriodically(j[b]);"undefined"!=typeof a.Objects.Models.avatar&&a.Objects.Models.avatar.finalize();a.Objects.Collections.messages.finalize();delete a.Objects.chatLayout;delete a.Objects.Models.thread;delete a.Objects.Models.user;delete a.Objects.Models.page;delete a.Objects.Models.avatar;delete a.Objects.Models.messageForm;delete a.Objects.Models.Controls;delete a.Objects.Models.Status;delete a.Objects.Collections.messages;delete a.Objects.Collections.controls;
|
||||
delete a.Objects.Collections.status})})(Mibew);
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
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,c){a.Views.Sound=b.Marionette.ItemView.extend({template:c.templates.sound,className:"sound-player",modelEvents:{"sound:play":"render"}})})(Mibew,Backbone,Handlebars);
|
@ -1,8 +0,0 @@
|
||||
/*
|
||||
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.Sound=b.Model.extend({play:function(a){this.set({file:a});this.trigger("sound:play",this)}})})(Mibew,Backbone);
|
@ -5,4 +5,5 @@
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(b){b.Utils={};b.Utils.toUpperCaseFirst=function(a){return"string"!=typeof a?!1:""===a?a:a.substring(0,1).toUpperCase()+a.substring(1)};b.Utils.toDashFormat=function(a){if("string"!=typeof a)return!1;a=a.match(/((?:[A-Z]?[a-z]+)|(?:[A-Z][a-z]*))/g);for(var b=0;b<a.length;b++)a[b]=a[b].toLowerCase();return a.join("-")};b.Utils.checkEmail=function(a){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)}})(Mibew);
|
||||
(function(b,c){b.Utils={};b.Utils.toUpperCaseFirst=function(a){return"string"!=typeof a?!1:""===a?a:a.substring(0,1).toUpperCase()+a.substring(1)};b.Utils.toDashFormat=function(a){if("string"!=typeof a)return!1;a=a.match(/((?:[A-Z]?[a-z]+)|(?:[A-Z][a-z]*))/g);for(var b=0;b<a.length;b++)a[b]=a[b].toLowerCase();return a.join("-")};b.Utils.checkEmail=function(a){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)};
|
||||
b.Utils.playSound=function(a){c("body").append('<audio autoplay style="display: none;"><source src="'+a+'" type="audio/x-wav" /><embed src="'+a+'" type="audio/x-wav" hidden="true" autostart="true" loop="false" /></audio>')}})(Mibew,$);
|
||||
|
@ -4,11 +4,10 @@
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(){var h=Handlebars.template,m=Handlebars.templates=Handlebars.templates||{};m.default_control=h(function(a,b,c,l,g){this.compilerInfo=[2,">= 1.0.0-rc.3"];c=c||a.helpers;g=g||{};l=this.escapeExpression;a="<strong>";(c=c.title)?c=c.call(b,{hash:{},data:g}):(c=b.title,c="function"===typeof c?c.apply(b):c);return a+=l(c)+"</strong>"});m.sound=h(function(a,b,c,l,g){this.compilerInfo=[2,">= 1.0.0-rc.3"];c=c||a.helpers;g=g||{};var d=this.escapeExpression;return(a=c["if"].call(b,b.file,{hash:{},
|
||||
inverse:this.noop,fn:this.program(1,function(a,b){var k,f;k='\n<audio autoplay src="';(f=c.file)?f=f.call(a,{hash:{},data:b}):(f=a.file,f="function"===typeof f?f.apply(a):f);k+=d(f)+'">\n <embed src="';(f=c.file)?f=f.call(a,{hash:{},data:b}):(f=a.file,f="function"===typeof f?f.apply(a):f);return k+=d(f)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n'},g),data:g}))||0===a?a:""});m.message=h(function(a,b,c,l,g){this.compilerInfo=[2,">= 1.0.0-rc.3"];c=c||a.helpers;g=g||{};var d,j=this.escapeExpression,
|
||||
h=c.helperMissing;a={hash:{},data:g};a="<span>"+(j((d=c.formatTime,d?d.call(b,b.created,a):h.call(b,"formatTime",b.created,a)))+"</span>\n");if((d=c["if"].call(b,b.name,{hash:{},inverse:this.noop,fn:this.program(1,function(a,f){var b,e;b="<span class='n";(e=c.kindName)?e=e.call(a,{hash:{},data:f}):(e=a.kindName,e="function"===typeof e?e.apply(a):e);b+=j(e)+"'>";(e=c.name)?e=e.call(a,{hash:{},data:f}):(e=a.name,e="function"===typeof e?e.apply(a):e);return b+=j(e)+"</span>: "},g),data:g}))||0===d)a+=
|
||||
d;a+="\n<span class='m";(d=c.kindName)?d=d.call(b,{hash:{},data:g}):(d=b.kindName,d="function"===typeof d?d.apply(b):d);a+=j(d)+"'>";if((d=c["if"].call(b,b.allowFormatting,{hash:{},inverse:this.program(5,function(a,b){var d,e;e={hash:{},data:b};return j((d=c.apply,d?d.call(a,a.message,"urlReplace, nl2br",e):h.call(a,"apply",a.message,"urlReplace, nl2br",e)))},g),fn:this.program(3,function(a,b){var d,e;e={hash:{},data:b};return j((d=c.apply,d?d.call(a,a.message,"urlReplace, nl2br, allowTags",e):h.call(a,
|
||||
"apply",a.message,"urlReplace, nl2br, allowTags",e)))},g),data:g}))||0===d)a+=d;return a+="</span><br/>"})})();
|
||||
(function(){var k=Handlebars.template,l=Handlebars.templates=Handlebars.templates||{};l.default_control=k(function(a,b,e,h,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||a.helpers;f=f||{};h=this.escapeExpression;a="<strong>";(e=e.title)?e=e.call(b,{hash:{},data:f}):(e=b.title,e="function"===typeof e?e.apply(b):e);return a+=h(e)+"</strong>"});l.message=k(function(a,b,e,h,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||a.helpers;f=f||{};var c,g=this.escapeExpression,j=e.helperMissing;a={hash:{},data:f};
|
||||
a="<span>"+(g((c=e.formatTime,c?c.call(b,b.created,a):j.call(b,"formatTime",b.created,a)))+"</span>\n");if((c=e["if"].call(b,b.name,{hash:{},inverse:this.noop,fn:this.program(1,function(a,c){var b,d;b="<span class='n";(d=e.kindName)?d=d.call(a,{hash:{},data:c}):(d=a.kindName,d="function"===typeof d?d.apply(a):d);b+=g(d)+"'>";(d=e.name)?d=d.call(a,{hash:{},data:c}):(d=a.name,d="function"===typeof d?d.apply(a):d);return b+=g(d)+"</span>: "},f),data:f}))||0===c)a+=c;a+="\n<span class='m";(c=e.kindName)?
|
||||
c=c.call(b,{hash:{},data:f}):(c=b.kindName,c="function"===typeof c?c.apply(b):c);a+=g(c)+"'>";if((c=e["if"].call(b,b.allowFormatting,{hash:{},inverse:this.program(5,function(a,b){var c,d;d={hash:{},data:b};return g((c=e.apply,c?c.call(a,a.message,"urlReplace, nl2br",d):j.call(a,"apply",a.message,"urlReplace, nl2br",d)))},f),fn:this.program(3,function(a,c){var b,d;d={hash:{},data:c};return g((b=e.apply,b?b.call(a,a.message,"urlReplace, nl2br, allowTags",d):j.call(a,"apply",a.message,"urlReplace, nl2br, allowTags",
|
||||
d)))},f),data:f}))||0===c)a+=c;return a+="</span><br/>"})})();
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
@ -52,7 +51,8 @@ else try{this.sendRequests(this.buffer),this.buffer=[]}catch(c){this.options.onU
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(b){b.Utils={};b.Utils.toUpperCaseFirst=function(a){return"string"!=typeof a?!1:""===a?a:a.substring(0,1).toUpperCase()+a.substring(1)};b.Utils.toDashFormat=function(a){if("string"!=typeof a)return!1;a=a.match(/((?:[A-Z]?[a-z]+)|(?:[A-Z][a-z]*))/g);for(var b=0;b<a.length;b++)a[b]=a[b].toLowerCase();return a.join("-")};b.Utils.checkEmail=function(a){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)}})(Mibew);
|
||||
(function(b,c){b.Utils={};b.Utils.toUpperCaseFirst=function(a){return"string"!=typeof a?!1:""===a?a:a.substring(0,1).toUpperCase()+a.substring(1)};b.Utils.toDashFormat=function(a){if("string"!=typeof a)return!1;a=a.match(/((?:[A-Z]?[a-z]+)|(?:[A-Z][a-z]*))/g);for(var b=0;b<a.length;b++)a[b]=a[b].toLowerCase();return a.join("-")};b.Utils.checkEmail=function(a){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(a)};
|
||||
b.Utils.playSound=function(a){c("body").append('<audio autoplay style="display: none;"><source src="'+a+'" type="audio/x-wav" /><embed src="'+a+'" type="audio/x-wav" hidden="true" autostart="true" loop="false" /></audio>')}})(Mibew,$);
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
http://mibew.org
|
||||
@ -87,13 +87,6 @@ else try{this.sendRequests(this.buffer),this.buffer=[]}catch(c){this.options.onU
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a,b){a.Models.Sound=b.Model.extend({play:function(a){this.set({file:a});this.trigger("sound:play",this)}})})(Mibew,Backbone);
|
||||
/*
|
||||
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){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);
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
@ -131,13 +124,6 @@ this.$el.removeClass("active"+(a?"-"+a:""))},getDashedControlType:function(){"un
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a,b,c){a.Views.Sound=b.Marionette.ItemView.extend({template:c.templates.sound,className:"sound-player",modelEvents:{"sound:play":"render"}})})(Mibew,Backbone,Handlebars);
|
||||
/*
|
||||
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(d,a,f){var e=function(b,a,c){c=f.extend({model:b},c);return"function"!=typeof b.getModelType?new a(c):(b=b.getModelType())&&d.Views[b]?new d.Views[b](c):new a(c)};d.Views.CollectionBase=a.Marionette.CollectionView.extend({itemView:a.Marionette.ItemView,buildItemView:e});d.Views.CompositeBase=a.Marionette.CompositeView.extend({buildItemView:e})})(Mibew,Backbone,_);
|
||||
/*
|
||||
This file is part of Mibew Messenger project.
|
||||
|
@ -5,6 +5,6 @@
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a,h,j){var d=0,g=function(){d++;10==d&&(alert(a.Localization.get("pending.errors.network")),d=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region",soundRegion:"#sound-region"});b.addInitializer(function(f){var d=a.Objects,c=a.Objects.Models,e=a.Objects.Collections;d.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g},
|
||||
f.server));c.page=new a.Models.Page(f.page);c.agent=new a.Models.Agent(f.agent);e.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:e.threads}));f.page.showOnlineOperators&&(e.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:e.visitors})));c.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:c.statusPanel}));f.page.showOnlineOperators&&(e.agents=new a.Collections.Agents,
|
||||
b.agentsRegion.show(new a.Views.AgentsCollection({collection:e.agents})));c.sound=new a.Models.Sound;b.soundRegion.show(new a.Views.Sound({model:c.sound}));d.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:c.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_);
|
||||
(function(a,h,j){var c=0,g=function(){c++;10==c&&(alert(a.Localization.get("pending.errors.network")),c=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region"});b.addInitializer(function(e){var c=a.Objects,f=a.Objects.Models,d=a.Objects.Collections;c.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g},e.server));f.page=
|
||||
new a.Models.Page(e.page);f.agent=new a.Models.Agent(e.agent);d.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:d.threads}));e.page.showOnlineOperators&&(d.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:d.visitors})));f.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:f.statusPanel}));e.page.showOnlineOperators&&(d.agents=new a.Collections.Agents,b.agentsRegion.show(new a.Views.AgentsCollection({collection:d.agents})));
|
||||
c.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:f.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_);
|
||||
|
@ -7,6 +7,6 @@
|
||||
*/
|
||||
(function(d,h,j,k){d.Views.ThreadsCollection=h.Marionette.CompositeView.extend({template:j.templates.threads_collection,itemView:d.Views.QueuedThread,itemViewContainer:"#threads-container",emptyView:d.Views.NoThreads,className:"threads-collection",collectionEvents:{sort:"renderCollection","sort:field":"createSortField",add:"threadAdded"},itemViewOptions:function(a){return{tagName:d.Objects.Models.page.get("threadTag"),collection:a.get("controls")}},initialize:function(){window.setInterval(k.bind(this.updateTimers,
|
||||
this),2E3);this.on("itemview:before:render",this.updateStyles,this);this.on("render",this.updateTimers,this)},updateStyles:function(a){var b=this.collection,c=a.model,d=this;if(c.id){var e=this.getQueueCode(c),f=!1,g=!1,b=b.filter(function(a){return d.getQueueCode(a)==e});0<b.length&&(g=b[0].id==c.id,f=b[b.length-1].id==c.id);if(0<a.lastStyles.length){c=0;for(b=a.lastStyles.length;c<b;c++)a.$el.removeClass(a.lastStyles[c]);a.lastStyles=[]}c=(e!=this.QUEUE_BAN?"in":"")+this.queueCodeToString(e);a.lastStyles.push(c);
|
||||
g&&a.lastStyles.push(c+"-first");f&&a.lastStyles.push(c+"-last");c=0;for(b=a.lastStyles.length;c<b;c++)a.$el.addClass(a.lastStyles[c])}},updateTimers:function(){d.Utils.updateTimers(this.$el,".timesince")},createSortField:function(a,b){var c=this.getQueueCode(a)||"Z";b.field=c.toString()+"_"+a.get("waitingTime").toString()},threadAdded:function(){var a=d.Objects.Models.page.get("webimRoot");a&&d.Objects.Models.sound.play(a+"/sounds/new_user.wav");if(d.Objects.Models.page.get("showPopup"))this.once("render",
|
||||
g&&a.lastStyles.push(c+"-first");f&&a.lastStyles.push(c+"-last");c=0;for(b=a.lastStyles.length;c<b;c++)a.$el.addClass(a.lastStyles[c])}},updateTimers:function(){d.Utils.updateTimers(this.$el,".timesince")},createSortField:function(a,b){var c=this.getQueueCode(a)||"Z";b.field=c.toString()+"_"+a.get("waitingTime").toString()},threadAdded:function(){var a=d.Objects.Models.page.get("webimRoot");a&&d.Utils.playSound(a+"/sounds/new_user.wav");if(d.Objects.Models.page.get("showPopup"))this.once("render",
|
||||
function(){alert(d.Localization.get("pending.popup_notification"))})},getQueueCode:function(a){var b=a.get("state");return!1!=a.get("ban")&&b!=a.STATE_CHATTING?this.QUEUE_BAN:b==a.STATE_QUEUE||b==a.STATE_LOADING?this.QUEUE_WAITING:b==a.STATE_CLOSED||b==a.STATE_LEFT?this.QUEUE_CLOSED:b==a.STATE_WAITING?this.QUEUE_PRIO:b==a.STATE_CHATTING?this.QUEUE_CHATTING:!1},queueCodeToString:function(a){return a==this.QUEUE_PRIO?"prio":a==this.QUEUE_WAITING?"wait":a==this.QUEUE_CHATTING?"chat":a==this.QUEUE_BAN?
|
||||
"ban":a==this.QUEUE_CLOSED?"closed":""},QUEUE_PRIO:1,QUEUE_WAITING:2,QUEUE_CHATTING:3,QUEUE_BAN:4,QUEUE_CLOSED:5})})(Mibew,Backbone,Handlebars,_);
|
||||
|
@ -161,7 +161,7 @@ showTrack:function(){var b=this.model.id,c=a.Objects.Models.page;a.Popup.open(c.
|
||||
*/
|
||||
(function(d,h,j,k){d.Views.ThreadsCollection=h.Marionette.CompositeView.extend({template:j.templates.threads_collection,itemView:d.Views.QueuedThread,itemViewContainer:"#threads-container",emptyView:d.Views.NoThreads,className:"threads-collection",collectionEvents:{sort:"renderCollection","sort:field":"createSortField",add:"threadAdded"},itemViewOptions:function(a){return{tagName:d.Objects.Models.page.get("threadTag"),collection:a.get("controls")}},initialize:function(){window.setInterval(k.bind(this.updateTimers,
|
||||
this),2E3);this.on("itemview:before:render",this.updateStyles,this);this.on("render",this.updateTimers,this)},updateStyles:function(a){var b=this.collection,c=a.model,d=this;if(c.id){var e=this.getQueueCode(c),f=!1,g=!1,b=b.filter(function(a){return d.getQueueCode(a)==e});0<b.length&&(g=b[0].id==c.id,f=b[b.length-1].id==c.id);if(0<a.lastStyles.length){c=0;for(b=a.lastStyles.length;c<b;c++)a.$el.removeClass(a.lastStyles[c]);a.lastStyles=[]}c=(e!=this.QUEUE_BAN?"in":"")+this.queueCodeToString(e);a.lastStyles.push(c);
|
||||
g&&a.lastStyles.push(c+"-first");f&&a.lastStyles.push(c+"-last");c=0;for(b=a.lastStyles.length;c<b;c++)a.$el.addClass(a.lastStyles[c])}},updateTimers:function(){d.Utils.updateTimers(this.$el,".timesince")},createSortField:function(a,b){var c=this.getQueueCode(a)||"Z";b.field=c.toString()+"_"+a.get("waitingTime").toString()},threadAdded:function(){var a=d.Objects.Models.page.get("webimRoot");a&&d.Objects.Models.sound.play(a+"/sounds/new_user.wav");if(d.Objects.Models.page.get("showPopup"))this.once("render",
|
||||
g&&a.lastStyles.push(c+"-first");f&&a.lastStyles.push(c+"-last");c=0;for(b=a.lastStyles.length;c<b;c++)a.$el.addClass(a.lastStyles[c])}},updateTimers:function(){d.Utils.updateTimers(this.$el,".timesince")},createSortField:function(a,b){var c=this.getQueueCode(a)||"Z";b.field=c.toString()+"_"+a.get("waitingTime").toString()},threadAdded:function(){var a=d.Objects.Models.page.get("webimRoot");a&&d.Utils.playSound(a+"/sounds/new_user.wav");if(d.Objects.Models.page.get("showPopup"))this.once("render",
|
||||
function(){alert(d.Localization.get("pending.popup_notification"))})},getQueueCode:function(a){var b=a.get("state");return!1!=a.get("ban")&&b!=a.STATE_CHATTING?this.QUEUE_BAN:b==a.STATE_QUEUE||b==a.STATE_LOADING?this.QUEUE_WAITING:b==a.STATE_CLOSED||b==a.STATE_LEFT?this.QUEUE_CLOSED:b==a.STATE_WAITING?this.QUEUE_PRIO:b==a.STATE_CHATTING?this.QUEUE_CHATTING:!1},queueCodeToString:function(a){return a==this.QUEUE_PRIO?"prio":a==this.QUEUE_WAITING?"wait":a==this.QUEUE_CHATTING?"chat":a==this.QUEUE_BAN?
|
||||
"ban":a==this.QUEUE_CLOSED?"closed":""},QUEUE_PRIO:1,QUEUE_WAITING:2,QUEUE_CHATTING:3,QUEUE_BAN:4,QUEUE_CLOSED:5})})(Mibew,Backbone,Handlebars,_);
|
||||
/*
|
||||
@ -178,6 +178,6 @@ this)},updateTimers:function(){a.Utils.updateTimers(this.$el,".timesince")}})})(
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(a,h,j){var d=0,g=function(){d++;10==d&&(alert(a.Localization.get("pending.errors.network")),d=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region",soundRegion:"#sound-region"});b.addInitializer(function(f){var d=a.Objects,c=a.Objects.Models,e=a.Objects.Collections;d.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g},
|
||||
f.server));c.page=new a.Models.Page(f.page);c.agent=new a.Models.Agent(f.agent);e.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:e.threads}));f.page.showOnlineOperators&&(e.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:e.visitors})));c.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:c.statusPanel}));f.page.showOnlineOperators&&(e.agents=new a.Collections.Agents,
|
||||
b.agentsRegion.show(new a.Views.AgentsCollection({collection:e.agents})));c.sound=new a.Models.Sound;b.soundRegion.show(new a.Views.Sound({model:c.sound}));d.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:c.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_);
|
||||
(function(a,h,j){var c=0,g=function(){c++;10==c&&(alert(a.Localization.get("pending.errors.network")),c=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region"});b.addInitializer(function(e){var c=a.Objects,f=a.Objects.Models,d=a.Objects.Collections;c.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g},e.server));f.page=
|
||||
new a.Models.Page(e.page);f.agent=new a.Models.Agent(e.agent);d.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:d.threads}));e.page.showOnlineOperators&&(d.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:d.visitors})));f.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:f.statusPanel}));e.page.showOnlineOperators&&(d.agents=new a.Collections.Agents,b.agentsRegion.show(new a.Views.AgentsCollection({collection:d.agents})));
|
||||
c.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:f.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_);
|
||||
|
@ -64,7 +64,7 @@
|
||||
if (path) {
|
||||
path += '/sounds/new_message.wav';
|
||||
// Play sound
|
||||
Mibew.Objects.Models.sound.play(path);
|
||||
Mibew.Utils.playSound(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,7 @@
|
||||
regionType: Mibew.Regions.Messages
|
||||
},
|
||||
statusRegion: '#status-region',
|
||||
messageFormRegion: '#message-form-region',
|
||||
soundRegion: '#sound-region'
|
||||
messageFormRegion: '#message-form-region'
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -175,12 +175,6 @@
|
||||
}));
|
||||
|
||||
|
||||
// Initialize sounds
|
||||
models.sound = new Mibew.Models.Sound();
|
||||
layout.soundRegion.show(new Mibew.Views.Sound({
|
||||
model: models.sound
|
||||
}));
|
||||
|
||||
// TODO: May be move it somewhere else
|
||||
// Periodically call update function at the server side
|
||||
periodicallyCalled.push(
|
||||
@ -271,7 +265,6 @@
|
||||
delete Mibew.Objects.Models.page;
|
||||
delete Mibew.Objects.Models.avatar;
|
||||
delete Mibew.Objects.Models.messageForm;
|
||||
delete Mibew.Objects.Models.sound;
|
||||
delete Mibew.Objects.Models.Controls;
|
||||
delete Mibew.Objects.Models.Status;
|
||||
|
||||
|
@ -1,39 +0,0 @@
|
||||
/**
|
||||
* @preserve 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(Mibew, Backbone, Handlebars){
|
||||
|
||||
/**
|
||||
* @class Represents sound notification view
|
||||
*/
|
||||
Mibew.Views.Sound = Backbone.Marionette.ItemView.extend(
|
||||
/** @lends Mibew.Views.Sound.prototype */
|
||||
{
|
||||
/**
|
||||
* Template function
|
||||
* @type Function
|
||||
*/
|
||||
template: Handlebars.templates.sound,
|
||||
|
||||
/**
|
||||
* Class name for view's DOM element
|
||||
* @type String
|
||||
*/
|
||||
className: 'sound-player',
|
||||
|
||||
/**
|
||||
* Map model events to the view methods
|
||||
* @type Object
|
||||
*/
|
||||
modelEvents: {
|
||||
'sound:play': 'render'
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
})(Mibew, Backbone, Handlebars);
|
@ -1,29 +0,0 @@
|
||||
/**
|
||||
* @preserve 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(Mibew, Backbone) {
|
||||
|
||||
/**
|
||||
* @class Used for repesent sound notice
|
||||
*/
|
||||
Mibew.Models.Sound = Backbone.Model.extend(
|
||||
/** @lends Mibew.Models.Sound.prototype */
|
||||
{
|
||||
/**
|
||||
* Play sound file
|
||||
*
|
||||
* @param {String} filePath Path to file that should be played
|
||||
*/
|
||||
play: function(filePath) {
|
||||
this.set({file: filePath});
|
||||
this.trigger('sound:play', this);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
})(Mibew, Backbone);
|
@ -6,7 +6,7 @@
|
||||
* License: http://mibew.org/license.php
|
||||
*/
|
||||
|
||||
(function(Mibew){
|
||||
(function(Mibew, $){
|
||||
|
||||
/**
|
||||
* @namespace Holds utility functions
|
||||
@ -55,4 +55,16 @@
|
||||
return /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email);
|
||||
}
|
||||
|
||||
})(Mibew);
|
||||
/**
|
||||
* Play .wav sound file
|
||||
* @param {String} file File path
|
||||
*/
|
||||
Mibew.Utils.playSound = function (file) {
|
||||
var soundHTML = '<audio autoplay style="display: none;">' +
|
||||
'<source src="' + file + '" type="audio/x-wav" />' +
|
||||
'<embed src="' + file + '" type="audio/x-wav" hidden="true" autostart="true" loop="false" />' +
|
||||
'</audio>';
|
||||
$('body').append(soundHTML);
|
||||
}
|
||||
|
||||
})(Mibew, $);
|
@ -36,8 +36,7 @@
|
||||
agentsRegion: '#agents-region',
|
||||
statusPanelRegion: '#status-panel-region',
|
||||
threadsRegion: '#threads-region',
|
||||
visitorsRegion: '#visitors-region',
|
||||
soundRegion: '#sound-region'
|
||||
visitorsRegion: '#visitors-region'
|
||||
});
|
||||
|
||||
// Initialize application
|
||||
@ -92,12 +91,6 @@
|
||||
}));
|
||||
}
|
||||
|
||||
// Initialize sounds
|
||||
models.sound = new Mibew.Models.Sound();
|
||||
App.soundRegion.show(new Mibew.Views.Sound({
|
||||
model: models.sound
|
||||
}));
|
||||
|
||||
// Periodically call update function at the server side
|
||||
objs.server.callFunctionsPeriodically(
|
||||
function() {
|
||||
|
@ -159,7 +159,7 @@
|
||||
if (path) {
|
||||
path += '/sounds/new_user.wav';
|
||||
// Play sound
|
||||
Mibew.Objects.Models.sound.play(path);
|
||||
Mibew.Utils.playSound(path);
|
||||
}
|
||||
|
||||
// Show popup notification if need
|
||||
|
@ -4,8 +4,7 @@
|
||||
Copyright (c) 2005-2011 Mibew Messenger Community
|
||||
License: http://mibew.org/license.php
|
||||
*/
|
||||
(function(){var h=Handlebars.template,m=Handlebars.templates=Handlebars.templates||{};m.default_control=h(function(a,b,c,l,g){this.compilerInfo=[2,">= 1.0.0-rc.3"];c=c||a.helpers;g=g||{};l=this.escapeExpression;a="<strong>";(c=c.title)?c=c.call(b,{hash:{},data:g}):(c=b.title,c="function"===typeof c?c.apply(b):c);return a+=l(c)+"</strong>"});m.sound=h(function(a,b,c,l,g){this.compilerInfo=[2,">= 1.0.0-rc.3"];c=c||a.helpers;g=g||{};var d=this.escapeExpression;return(a=c["if"].call(b,b.file,{hash:{},
|
||||
inverse:this.noop,fn:this.program(1,function(a,b){var k,f;k='\n<audio autoplay src="';(f=c.file)?f=f.call(a,{hash:{},data:b}):(f=a.file,f="function"===typeof f?f.apply(a):f);k+=d(f)+'">\n <embed src="';(f=c.file)?f=f.call(a,{hash:{},data:b}):(f=a.file,f="function"===typeof f?f.apply(a):f);return k+=d(f)+'" hidden="true" autostart="true" loop="false" />\n</audio>\n'},g),data:g}))||0===a?a:""});m.message=h(function(a,b,c,l,g){this.compilerInfo=[2,">= 1.0.0-rc.3"];c=c||a.helpers;g=g||{};var d,j=this.escapeExpression,
|
||||
h=c.helperMissing;a={hash:{},data:g};a="<span>"+(j((d=c.formatTime,d?d.call(b,b.created,a):h.call(b,"formatTime",b.created,a)))+"</span>\n");if((d=c["if"].call(b,b.name,{hash:{},inverse:this.noop,fn:this.program(1,function(a,f){var b,e;b="<span class='n";(e=c.kindName)?e=e.call(a,{hash:{},data:f}):(e=a.kindName,e="function"===typeof e?e.apply(a):e);b+=j(e)+"'>";(e=c.name)?e=e.call(a,{hash:{},data:f}):(e=a.name,e="function"===typeof e?e.apply(a):e);return b+=j(e)+"</span>: "},g),data:g}))||0===d)a+=
|
||||
d;a+="\n<span class='m";(d=c.kindName)?d=d.call(b,{hash:{},data:g}):(d=b.kindName,d="function"===typeof d?d.apply(b):d);a+=j(d)+"'>";if((d=c["if"].call(b,b.allowFormatting,{hash:{},inverse:this.program(5,function(a,b){var d,e;e={hash:{},data:b};return j((d=c.apply,d?d.call(a,a.message,"urlReplace, nl2br",e):h.call(a,"apply",a.message,"urlReplace, nl2br",e)))},g),fn:this.program(3,function(a,b){var d,e;e={hash:{},data:b};return j((d=c.apply,d?d.call(a,a.message,"urlReplace, nl2br, allowTags",e):h.call(a,
|
||||
"apply",a.message,"urlReplace, nl2br, allowTags",e)))},g),data:g}))||0===d)a+=d;return a+="</span><br/>"})})();
|
||||
(function(){var k=Handlebars.template,l=Handlebars.templates=Handlebars.templates||{};l.default_control=k(function(a,b,e,h,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||a.helpers;f=f||{};h=this.escapeExpression;a="<strong>";(e=e.title)?e=e.call(b,{hash:{},data:f}):(e=b.title,e="function"===typeof e?e.apply(b):e);return a+=h(e)+"</strong>"});l.message=k(function(a,b,e,h,f){this.compilerInfo=[2,">= 1.0.0-rc.3"];e=e||a.helpers;f=f||{};var c,g=this.escapeExpression,j=e.helperMissing;a={hash:{},data:f};
|
||||
a="<span>"+(g((c=e.formatTime,c?c.call(b,b.created,a):j.call(b,"formatTime",b.created,a)))+"</span>\n");if((c=e["if"].call(b,b.name,{hash:{},inverse:this.noop,fn:this.program(1,function(a,c){var b,d;b="<span class='n";(d=e.kindName)?d=d.call(a,{hash:{},data:c}):(d=a.kindName,d="function"===typeof d?d.apply(a):d);b+=g(d)+"'>";(d=e.name)?d=d.call(a,{hash:{},data:c}):(d=a.name,d="function"===typeof d?d.apply(a):d);return b+=g(d)+"</span>: "},f),data:f}))||0===c)a+=c;a+="\n<span class='m";(c=e.kindName)?
|
||||
c=c.call(b,{hash:{},data:f}):(c=b.kindName,c="function"===typeof c?c.apply(b):c);a+=g(c)+"'>";if((c=e["if"].call(b,b.allowFormatting,{hash:{},inverse:this.program(5,function(a,b){var c,d;d={hash:{},data:b};return g((c=e.apply,c?c.call(a,a.message,"urlReplace, nl2br",d):j.call(a,"apply",a.message,"urlReplace, nl2br",d)))},f),fn:this.program(3,function(a,c){var b,d;d={hash:{},data:c};return g((b=e.apply,b?b.call(a,a.message,"urlReplace, nl2br, allowTags",d):j.call(a,"apply",a.message,"urlReplace, nl2br, allowTags",
|
||||
d)))},f),data:f}))||0===c)a+=c;return a+="</span><br/>"})})();
|
||||
|
@ -1,5 +0,0 @@
|
||||
{{#if file}}
|
||||
<audio autoplay src="{{file}}">
|
||||
<embed src="{{file}}" hidden="true" autostart="true" loop="false" />
|
||||
</audio>
|
||||
{{/if}}
|
@ -51,6 +51,3 @@
|
||||
|
||||
{{! Footer links}}
|
||||
<div id="footer">{{L10n "chat.window.poweredby"}} <a id="poweredByLink" href="http://mibew.org" title="Mibew Community" target="_blank">mibew.org</a></div>
|
||||
|
||||
{{! Hidden region for some sound element}}
|
||||
<div id="sound-region"></div>
|
@ -37,24 +37,24 @@ b)))+'</a>\n <div class="clear"> </div>\n</form>'});s.chat_layout=r(func
|
||||
a='\n<div id="top">\n <div id="logo">\n ';if((m=f["if"].call(e,(h=(h=e.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:t.program(6,function(a,g){var c,b,e;c="\n ";if((e=f["if"].call(a,(b=a.page,null==b||!1===b?b:b.webimHost),{hash:{},inverse:t.program(9,p,g),fn:t.program(7,l,g),data:g}))||0===e)c+=e;return c+"\n "},c),fn:t.program(1,function(a,g){var c,b,e;c="\n \n ";if((e=f.unless.call(a,(b=a.page,null==b||!1===
|
||||
b?b:b.webimHost),{hash:{},inverse:t.program(4,k,g),fn:t.program(2,j,g),data:g}))||0===e)c+=e;return c+"\n "},c),data:c}))||0===m)a+=m;a+='\n \n <div id="page-title">'+q((h=(h=e.page,null==h||!1===h?h:h.title),typeof h===n?h.apply(e):h))+'</div>\n <div class="clear"> </div>\n </div>\n</div>\n\n\n<div id="chat-header">\n <div class="bgc"><div class="bgl"><div class="bgr">\n \n <div id="controls-region"></div>\n </div></div></div>\n</div>\n\n\n<div id="chat">\n <div class="bgl"><div class="bgr"><div class="sdwbgc"><div class="sdwbgl"><div class="sdwbgr">\n ';
|
||||
if((m=f.unless.call(e,(h=e.user,null==h||!1===h?h:h.isAgent),{hash:{},inverse:t.noop,fn:t.program(11,function(){return'\n <div id="avatar-region"></div>\n '},c),data:c}))||0===m)a+=m;c={hash:{},data:c};return a=a+'\n \n <div id="messages-region"></div>\n \n <div id="status-region"></div>\n </div></div></div></div></div>\n</div>\n\n\n<div id="message-form-region"></div>\n\n\n<div id="footer">'+(q((h=f.L10n,h?h.call(e,"chat.window.poweredby",c):b.call(e,
|
||||
"L10n","chat.window.poweredby",c)))+' <a id="poweredByLink" href="http://mibew.org" title="Mibew Community" target="_blank">mibew.org</a></div>\n\n\n<div id="sound-region"></div>')});s.secure_mode_control=r(function(){this.compilerInfo=[2,">= 1.0.0-rc.3"];return'<div class="tpl-image" title="SSL"></div>'});s.sound_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j=f.helperMissing,k=this.escapeExpression;return(a=f["if"].call(e,e.enabled,{hash:{},inverse:this.program(3,
|
||||
function(a,b){var c,e;c={hash:{},data:b};return c='\n <div class="tpl-image sound-control-off" title="'+(k((e=f.L10n,e?e.call(a,"chat.window.toolbar.turn_on_sound",c):j.call(a,"L10n","chat.window.toolbar.turn_on_sound",c)))+'"></div>\n')},c),fn:this.program(1,function(a,c){var b,e;b={hash:{},data:c};return b='\n <div class="tpl-image sound-control-on" title="'+(k((e=f.L10n,e?e.call(a,"chat.window.toolbar.turn_off_sound",b):j.call(a,"L10n","chat.window.toolbar.turn_off_sound",b)))+'"></div>\n')},
|
||||
c),data:c}))||0===a?a:""});s.message=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=this.escapeExpression,l=f.helperMissing;a={hash:{},data:c};a="<span>"+(k((j=f.formatTime,j?j.call(e,e.created,a):l.call(e,"formatTime",e.created,a)))+"</span> \n");if((j=f["if"].call(e,e.name,{hash:{},inverse:this.noop,fn:this.program(1,function(a,b){var c,e;c="<span class='n";(e=f.kindName)?e=e.call(a,{hash:{},data:b}):(e=a.kindName,e="function"===typeof e?e.apply(a):e);
|
||||
c+=k(e)+"'>";(e=f.name)?e=e.call(a,{hash:{},data:b}):(e=a.name,e="function"===typeof e?e.apply(a):e);return c+=k(e)+"</span>: "},c),data:c}))||0===j)a+=j;a+="\n<span class='m";(j=f.kindName)?j=j.call(e,{hash:{},data:c}):(j=e.kindName,j="function"===typeof j?j.apply(e):j);a+=k(j)+"'>";if((j=f["if"].call(e,e.allowFormatting,{hash:{},inverse:this.program(5,function(a,c){var b,e;e={hash:{},data:c};return k((b=f.apply,b?b.call(a,a.message,"urlReplace, nl2br",e):l.call(a,"apply",a.message,"urlReplace, nl2br",
|
||||
e)))},c),fn:this.program(3,function(a,c){var b,e;e={hash:{},data:c};return k((b=f.apply,b?b.call(a,a.message,"urlReplace, nl2br, allowTags",e):l.call(a,"apply",a.message,"urlReplace, nl2br, allowTags",e)))},c),data:c}))||0===j)a+=j;return a+="</span><br/>"});s.message_form=r(function(a,e,f,b,c){function j(a,b){var d,g;d={hash:{},data:b};d='\n <select id="predefined" size="1" class="answer">\n <option>'+(h((g=f.L10n,g?g.call(a,"chat.window.predefined.select_answer",
|
||||
d):m.call(a,"L10n","chat.window.predefined.select_answer",d)))+"</option>\n ");if((g=f.each.call(a,a.predefinedAnswers,{hash:{},inverse:n.noop,fn:n.program(5,k,b),data:b}))||0===g)d+=g;return d+="\n </select>\n "}function k(a){var b;return a=""+("\n <option>"+h((b=a["short"],typeof b===p?b.apply(a):b))+"</option>\n ")}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var l,p="function",h=this.escapeExpression,m=
|
||||
f.helperMissing,n=this;a='<div id="message">\n';if((b=f["if"].call(e,(l=e.user,null==l||!1===l?l:l.canPost),{hash:{},inverse:n.noop,fn:n.program(1,function(){return'\n <div class="bgc"><div class="bgl"><div class="bgr">\n <textarea id="message-input" class="message" tabindex="0" rows="4" cols="10"></textarea>\n </div></div></div>\n'},c),data:c}))||0===b)a+=b;a+='\n</div>\n\n<div id="send">\n';if((b=f["if"].call(e,(l=e.user,null==l||!1===l?l:l.canPost),{hash:{},inverse:n.noop,fn:n.program(3,
|
||||
function(a,b){var d,g,c;d='\n <div id="postmessage">\n <div id="predefined-wrapper">\n ';if((c=f["if"].call(a,(g=a.user,null==g||!1===g?g:g.isAgent),{hash:{},inverse:n.noop,fn:n.program(4,j,b),data:b}))||0===c)d+=c;c={hash:{},data:b};d=d+'\n </div>\n <a href="javascript:void(0)" id="send-message" title="'+(h((g=f.L10n,g?g.call(a,"chat.window.send_message",c):m.call(a,"L10n","chat.window.send_message",c)))+'">');c={hash:{},data:b};return d+=h((g=f.L10n,g?g.call(a,
|
||||
"chat.window.send_message_short_and_shortcut",c):m.call(a,"L10n","chat.window.send_message_short_and_shortcut",c)))+"</a>\n </div>\n"},c),data:c}))||0===b)a+=b;return a+'\n</div>\n<div class="clear"></div>'});s.send_mail_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j;a=f.helperMissing;b=this.escapeExpression;c={hash:{},data:c};return e='<div class="tpl-image" title="'+(b((j=f.L10n,j?j.call(e,"chat.window.toolbar.mail_history",c):a.call(e,"L10n",
|
||||
"chat.window.toolbar.mail_history",c)))+'"></div>')});s.survey_layout=r(function(a,e,f,b,c){function j(a){var b;return a=""+('\n <img src="'+q((b=(b=(b=a.page,null==b||!1===b?b:b.company),null==b||!1===b?b:b.chatLogoURL),typeof b===n?b.apply(a):b))+'" alt=""/>\n ')}function k(a){var b;return a=""+("\n <a onclick=\"window.open('"+q((b=(b=a.page,null==b||!1===b?b:b.webimHost),typeof b===n?b.apply(a):b))+'\');return false;" href="'+q((b=(b=a.page,null==b||!1===
|
||||
b?b:b.webimHost),typeof b===n?b.apply(a):b))+'">\n <img src="'+q((b=(b=(b=a.page,null==b||!1===b?b:b.company),null==b||!1===b?b:b.chatLogoURL),typeof b===n?b.apply(a):b))+'" alt=""/>\n </a>\n ')}function l(a){var b;return a=""+("\n <a onclick=\"window.open('"+q((b=(b=a.page,null==b||!1===b?b:b.webimHost),typeof b===n?b.apply(a):b))+'\');return false;" href="'+q((b=(b=a.page,null==b||!1===b?b:b.webimHost),typeof b===n?b.apply(a):b))+'">\n <img src="'+
|
||||
q((b=(b=a.page,null==b||!1===b?b:b.tplRoot),typeof b===n?b.apply(a):b))+'/images/default-logo.gif" alt=""/>\n </a>\n ')}function p(a){var b;return a=""+('\n <img src="'+q((b=(b=a.page,null==b||!1===b?b:b.tplRoot),typeof b===n?b.apply(a):b))+'/images/default-logo.gif" alt=""/>\n ')}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var h,m,n="function",q=this.escapeExpression,r=this;b=f.helperMissing;a='\n<div id="top2">\n <div id="logo">\n ';
|
||||
if((m=f["if"].call(e,(h=(h=e.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:r.program(6,function(a,b){var c,e,h;c="\n ";if((h=f["if"].call(a,(e=a.page,null==e||!1===e?e:e.webimHost),{hash:{},inverse:r.program(9,p,b),fn:r.program(7,l,b),data:b}))||0===h)c+=h;return c+"\n "},c),fn:r.program(1,function(a,b){var c,e,h;c="\n \n ";if((h=f.unless.call(a,(e=a.page,null==e||!1===e?e:e.webimHost),{hash:{},inverse:r.program(4,k,b),
|
||||
fn:r.program(2,j,b),data:b}))||0===h)c+=h;return c+"\n "},c),data:c}))||0===m)a+=m;a+='\n \n <div id="page-title">'+q((h=(h=e.page,null==h||!1===h?h:h.title),typeof h===n?h.apply(e):h))+'</div>\n <div class="clear"> </div>\n </div>\n</div>\n\n\n<div id="headers">\n <div class="wndb"><div class="wndl"><div class="wndr"><div class="wndt"><div class="wndtl"><div class="wndtr"><div class="wndbl"><div class="wndbr">\n <div class="buttons">\n <a href="javascript:window.close();" title="';
|
||||
m={hash:{},data:c};a+=q((h=f.L10n,h?h.call(e,"leavemessage.close",m):b.call(e,"L10n","leavemessage.close",m)))+'"><img class="tpl-image iclosewin" src="'+q((h=(h=e.page,null==h||!1===h?h:h.webimRoot),typeof h===n?h.apply(e):h))+'/images/free.gif" alt="';m={hash:{},data:c};a+=q((h=f.L10n,h?h.call(e,"leavemessage.close",m):b.call(e,"L10n","leavemessage.close",m)))+'" /></a>\n </div>\n <div class="messagetxt">';m={hash:{},data:c};return a+=q((h=f.L10n,h?h.call(e,"presurvey.intro",m):b.call(e,
|
||||
"L10n","presurvey.intro",m)))+'</div>\n </div></div></div></div></div></div></div></div>\n</div>\n\n\n<div id="content-wrapper"></div>'});s.leave_message_description=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=f.helperMissing,l=this.escapeExpression;b={hash:{},data:c};a='<div class="buttons">\n <a href="javascript:window.close();" title="'+(l((j=f.L10n,j?j.call(e,"leavemessage.close",b):k.call(e,"L10n","leavemessage.close",b)))+'">\n <img class="tpl-image iclosewin" src="'+
|
||||
l((j=(j=e.page,null==j||!1===j?j:j.webimRoot),"function"===typeof j?j.apply(e):j))+'/images/free.gif" alt="');b={hash:{},data:c};a+=l((j=f.L10n,j?j.call(e,"leavemessage.close",b):k.call(e,"L10n","leavemessage.close",b)))+'" />\n </a>\n</div>\n<div class="messagetxt">';b={hash:{},data:c};return a+=l((j=f.L10n,j?j.call(e,"leavemessage.descr",b):k.call(e,"L10n","leavemessage.descr",b)))+"</div>"});s.refresh_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};
|
||||
var j;a=f.helperMissing;b=this.escapeExpression;c={hash:{},data:c};return e='<div class="tpl-image" title="'+(b((j=f.L10n,j?j.call(e,"chat.window.toolbar.refresh",c):a.call(e,"L10n","chat.window.toolbar.refresh",c)))+'"></div>')});s.redirect_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=f.helperMissing,l=this.escapeExpression;return(a=f["if"].call(e,(j=e.user,null==j||!1===j?j:j.canPost),{hash:{},inverse:this.noop,fn:this.program(1,function(a,b){var c,
|
||||
e;c={hash:{},data:b};return c='\n<div class="tpl-image" title="'+(l((e=f.L10n,e?e.call(a,"chat.window.toolbar.redirect_user",c):k.call(a,"L10n","chat.window.toolbar.redirect_user",c)))+'"></div>\n')},c),data:c}))||0===a?a:""});s.status=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};a=this.escapeExpression;(f=f.title)?f=f.call(e,{hash:{},data:c}):(f=e.title,f="function"===typeof f?f.apply(e):f);return a(f)});s.leave_message_sent_description=r(function(a,e,f,b,c){this.compilerInfo=
|
||||
[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=f.helperMissing,l=this.escapeExpression;b={hash:{},data:c};a='<div class="buttons">\n <a href="javascript:window.close();" title="'+(l((j=f.L10n,j?j.call(e,"chat.mailthread.sent.close",b):k.call(e,"L10n","chat.mailthread.sent.close",b)))+'">\n <img class="tpl-image iclosewin" src="'+l((j=(j=e.page,null==j||!1===j?j:j.webimRoot),"function"===typeof j?j.apply(e):j))+'/images/free.gif" alt="');b={hash:{},data:c};a+=l((j=f.L10n,j?j.call(e,
|
||||
"chat.mailthread.sent.close",b):k.call(e,"L10n","chat.mailthread.sent.close",b)))+'" />\n </a>\n</div>\n<div class="messagetxt">';b={hash:{},data:c};return a+=l((j=f.L10n,j?j.call(e,"leavemessage.sent.message",b):k.call(e,"L10n","leavemessage.sent.message",b)))+"</div>"})})();
|
||||
"L10n","chat.window.poweredby",c)))+' <a id="poweredByLink" href="http://mibew.org" title="Mibew Community" target="_blank">mibew.org</a></div>')});s.secure_mode_control=r(function(){this.compilerInfo=[2,">= 1.0.0-rc.3"];return'<div class="tpl-image" title="SSL"></div>'});s.sound_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j=f.helperMissing,k=this.escapeExpression;return(a=f["if"].call(e,e.enabled,{hash:{},inverse:this.program(3,function(a,b){var c,
|
||||
e;c={hash:{},data:b};return c='\n <div class="tpl-image sound-control-off" title="'+(k((e=f.L10n,e?e.call(a,"chat.window.toolbar.turn_on_sound",c):j.call(a,"L10n","chat.window.toolbar.turn_on_sound",c)))+'"></div>\n')},c),fn:this.program(1,function(a,c){var b,e;b={hash:{},data:c};return b='\n <div class="tpl-image sound-control-on" title="'+(k((e=f.L10n,e?e.call(a,"chat.window.toolbar.turn_off_sound",b):j.call(a,"L10n","chat.window.toolbar.turn_off_sound",b)))+'"></div>\n')},c),data:c}))||0===
|
||||
a?a:""});s.message=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=this.escapeExpression,l=f.helperMissing;a={hash:{},data:c};a="<span>"+(k((j=f.formatTime,j?j.call(e,e.created,a):l.call(e,"formatTime",e.created,a)))+"</span> \n");if((j=f["if"].call(e,e.name,{hash:{},inverse:this.noop,fn:this.program(1,function(a,b){var c,e;c="<span class='n";(e=f.kindName)?e=e.call(a,{hash:{},data:b}):(e=a.kindName,e="function"===typeof e?e.apply(a):e);c+=k(e)+"'>";(e=f.name)?
|
||||
e=e.call(a,{hash:{},data:b}):(e=a.name,e="function"===typeof e?e.apply(a):e);return c+=k(e)+"</span>: "},c),data:c}))||0===j)a+=j;a+="\n<span class='m";(j=f.kindName)?j=j.call(e,{hash:{},data:c}):(j=e.kindName,j="function"===typeof j?j.apply(e):j);a+=k(j)+"'>";if((j=f["if"].call(e,e.allowFormatting,{hash:{},inverse:this.program(5,function(a,c){var b,e;e={hash:{},data:c};return k((b=f.apply,b?b.call(a,a.message,"urlReplace, nl2br",e):l.call(a,"apply",a.message,"urlReplace, nl2br",e)))},c),fn:this.program(3,
|
||||
function(a,c){var b,e;e={hash:{},data:c};return k((b=f.apply,b?b.call(a,a.message,"urlReplace, nl2br, allowTags",e):l.call(a,"apply",a.message,"urlReplace, nl2br, allowTags",e)))},c),data:c}))||0===j)a+=j;return a+="</span><br/>"});s.message_form=r(function(a,e,f,b,c){function j(a,b){var d,g;d={hash:{},data:b};d='\n <select id="predefined" size="1" class="answer">\n <option>'+(h((g=f.L10n,g?g.call(a,"chat.window.predefined.select_answer",d):m.call(a,"L10n","chat.window.predefined.select_answer",
|
||||
d)))+"</option>\n ");if((g=f.each.call(a,a.predefinedAnswers,{hash:{},inverse:n.noop,fn:n.program(5,k,b),data:b}))||0===g)d+=g;return d+="\n </select>\n "}function k(a){var b;return a=""+("\n <option>"+h((b=a["short"],typeof b===p?b.apply(a):b))+"</option>\n ")}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var l,p="function",h=this.escapeExpression,m=f.helperMissing,n=this;a='<div id="message">\n';if((b=f["if"].call(e,
|
||||
(l=e.user,null==l||!1===l?l:l.canPost),{hash:{},inverse:n.noop,fn:n.program(1,function(){return'\n <div class="bgc"><div class="bgl"><div class="bgr">\n <textarea id="message-input" class="message" tabindex="0" rows="4" cols="10"></textarea>\n </div></div></div>\n'},c),data:c}))||0===b)a+=b;a+='\n</div>\n\n<div id="send">\n';if((b=f["if"].call(e,(l=e.user,null==l||!1===l?l:l.canPost),{hash:{},inverse:n.noop,fn:n.program(3,function(a,b){var d,g,c;d='\n <div id="postmessage">\n <div id="predefined-wrapper">\n ';
|
||||
if((c=f["if"].call(a,(g=a.user,null==g||!1===g?g:g.isAgent),{hash:{},inverse:n.noop,fn:n.program(4,j,b),data:b}))||0===c)d+=c;c={hash:{},data:b};d=d+'\n </div>\n <a href="javascript:void(0)" id="send-message" title="'+(h((g=f.L10n,g?g.call(a,"chat.window.send_message",c):m.call(a,"L10n","chat.window.send_message",c)))+'">');c={hash:{},data:b};return d+=h((g=f.L10n,g?g.call(a,"chat.window.send_message_short_and_shortcut",c):m.call(a,"L10n","chat.window.send_message_short_and_shortcut",
|
||||
c)))+"</a>\n </div>\n"},c),data:c}))||0===b)a+=b;return a+'\n</div>\n<div class="clear"></div>'});s.send_mail_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j;a=f.helperMissing;b=this.escapeExpression;c={hash:{},data:c};return e='<div class="tpl-image" title="'+(b((j=f.L10n,j?j.call(e,"chat.window.toolbar.mail_history",c):a.call(e,"L10n","chat.window.toolbar.mail_history",c)))+'"></div>')});s.survey_layout=r(function(a,e,f,b,c){function j(a){var b;
|
||||
return a=""+('\n <img src="'+q((b=(b=(b=a.page,null==b||!1===b?b:b.company),null==b||!1===b?b:b.chatLogoURL),typeof b===n?b.apply(a):b))+'" alt=""/>\n ')}function k(a){var b;return a=""+("\n <a onclick=\"window.open('"+q((b=(b=a.page,null==b||!1===b?b:b.webimHost),typeof b===n?b.apply(a):b))+'\');return false;" href="'+q((b=(b=a.page,null==b||!1===b?b:b.webimHost),typeof b===n?b.apply(a):b))+'">\n <img src="'+q((b=(b=(b=a.page,null==b||!1===
|
||||
b?b:b.company),null==b||!1===b?b:b.chatLogoURL),typeof b===n?b.apply(a):b))+'" alt=""/>\n </a>\n ')}function l(a){var b;return a=""+("\n <a onclick=\"window.open('"+q((b=(b=a.page,null==b||!1===b?b:b.webimHost),typeof b===n?b.apply(a):b))+'\');return false;" href="'+q((b=(b=a.page,null==b||!1===b?b:b.webimHost),typeof b===n?b.apply(a):b))+'">\n <img src="'+q((b=(b=a.page,null==b||!1===b?b:b.tplRoot),typeof b===n?b.apply(a):b))+'/images/default-logo.gif" alt=""/>\n </a>\n ')}
|
||||
function p(a){var b;return a=""+('\n <img src="'+q((b=(b=a.page,null==b||!1===b?b:b.tplRoot),typeof b===n?b.apply(a):b))+'/images/default-logo.gif" alt=""/>\n ')}this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var h,m,n="function",q=this.escapeExpression,r=this;b=f.helperMissing;a='\n<div id="top2">\n <div id="logo">\n ';if((m=f["if"].call(e,(h=(h=e.page,null==h||!1===h?h:h.company),null==h||!1===h?h:h.chatLogoURL),{hash:{},inverse:r.program(6,function(a,
|
||||
b){var c,e,h;c="\n ";if((h=f["if"].call(a,(e=a.page,null==e||!1===e?e:e.webimHost),{hash:{},inverse:r.program(9,p,b),fn:r.program(7,l,b),data:b}))||0===h)c+=h;return c+"\n "},c),fn:r.program(1,function(a,b){var c,e,h;c="\n \n ";if((h=f.unless.call(a,(e=a.page,null==e||!1===e?e:e.webimHost),{hash:{},inverse:r.program(4,k,b),fn:r.program(2,j,b),data:b}))||0===h)c+=h;return c+"\n "},c),data:c}))||0===m)a+=m;a+='\n \n <div id="page-title">'+
|
||||
q((h=(h=e.page,null==h||!1===h?h:h.title),typeof h===n?h.apply(e):h))+'</div>\n <div class="clear"> </div>\n </div>\n</div>\n\n\n<div id="headers">\n <div class="wndb"><div class="wndl"><div class="wndr"><div class="wndt"><div class="wndtl"><div class="wndtr"><div class="wndbl"><div class="wndbr">\n <div class="buttons">\n <a href="javascript:window.close();" title="';m={hash:{},data:c};a+=q((h=f.L10n,h?h.call(e,"leavemessage.close",m):b.call(e,"L10n","leavemessage.close",
|
||||
m)))+'"><img class="tpl-image iclosewin" src="'+q((h=(h=e.page,null==h||!1===h?h:h.webimRoot),typeof h===n?h.apply(e):h))+'/images/free.gif" alt="';m={hash:{},data:c};a+=q((h=f.L10n,h?h.call(e,"leavemessage.close",m):b.call(e,"L10n","leavemessage.close",m)))+'" /></a>\n </div>\n <div class="messagetxt">';m={hash:{},data:c};return a+=q((h=f.L10n,h?h.call(e,"presurvey.intro",m):b.call(e,"L10n","presurvey.intro",m)))+'</div>\n </div></div></div></div></div></div></div></div>\n</div>\n\n\n<div id="content-wrapper"></div>'});
|
||||
s.leave_message_description=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=f.helperMissing,l=this.escapeExpression;b={hash:{},data:c};a='<div class="buttons">\n <a href="javascript:window.close();" title="'+(l((j=f.L10n,j?j.call(e,"leavemessage.close",b):k.call(e,"L10n","leavemessage.close",b)))+'">\n <img class="tpl-image iclosewin" src="'+l((j=(j=e.page,null==j||!1===j?j:j.webimRoot),"function"===typeof j?j.apply(e):j))+'/images/free.gif" alt="');
|
||||
b={hash:{},data:c};a+=l((j=f.L10n,j?j.call(e,"leavemessage.close",b):k.call(e,"L10n","leavemessage.close",b)))+'" />\n </a>\n</div>\n<div class="messagetxt">';b={hash:{},data:c};return a+=l((j=f.L10n,j?j.call(e,"leavemessage.descr",b):k.call(e,"L10n","leavemessage.descr",b)))+"</div>"});s.refresh_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j;a=f.helperMissing;b=this.escapeExpression;c={hash:{},data:c};return e='<div class="tpl-image" title="'+
|
||||
(b((j=f.L10n,j?j.call(e,"chat.window.toolbar.refresh",c):a.call(e,"L10n","chat.window.toolbar.refresh",c)))+'"></div>')});s.redirect_control=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=f.helperMissing,l=this.escapeExpression;return(a=f["if"].call(e,(j=e.user,null==j||!1===j?j:j.canPost),{hash:{},inverse:this.noop,fn:this.program(1,function(a,b){var c,e;c={hash:{},data:b};return c='\n<div class="tpl-image" title="'+(l((e=f.L10n,e?e.call(a,"chat.window.toolbar.redirect_user",
|
||||
c):k.call(a,"L10n","chat.window.toolbar.redirect_user",c)))+'"></div>\n')},c),data:c}))||0===a?a:""});s.status=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};a=this.escapeExpression;(f=f.title)?f=f.call(e,{hash:{},data:c}):(f=e.title,f="function"===typeof f?f.apply(e):f);return a(f)});s.leave_message_sent_description=r(function(a,e,f,b,c){this.compilerInfo=[2,">= 1.0.0-rc.3"];f=f||a.helpers;c=c||{};var j,k=f.helperMissing,l=this.escapeExpression;b={hash:{},data:c};
|
||||
a='<div class="buttons">\n <a href="javascript:window.close();" title="'+(l((j=f.L10n,j?j.call(e,"chat.mailthread.sent.close",b):k.call(e,"L10n","chat.mailthread.sent.close",b)))+'">\n <img class="tpl-image iclosewin" src="'+l((j=(j=e.page,null==j||!1===j?j:j.webimRoot),"function"===typeof j?j.apply(e):j))+'/images/free.gif" alt="');b={hash:{},data:c};a+=l((j=f.L10n,j?j.call(e,"chat.mailthread.sent.close",b):k.call(e,"L10n","chat.mailthread.sent.close",b)))+'" />\n </a>\n</div>\n<div class="messagetxt">';
|
||||
b={hash:{},data:c};return a+=l((j=f.L10n,j?j.call(e,"leavemessage.sent.message",b):k.call(e,"L10n","leavemessage.sent.message",b)))+"</div>"})})();
|
||||
|
@ -153,7 +153,7 @@ function tpl_content() { global $page, $webimroot;
|
||||
|
||||
<div id="status-panel-region"></div>
|
||||
<div id="agents-region"></div>
|
||||
<div id="sound-region"></div>
|
||||
|
||||
<?php
|
||||
} /* content */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user