diff --git a/src/messenger/webim/js/compiled/chat/handlebars_helpers.js b/src/messenger/webim/js/compiled/chat/handlebars_helpers.js
deleted file mode 100644
index d8f076db..00000000
--- a/src/messenger/webim/js/compiled/chat/handlebars_helpers.js
+++ /dev/null
@@ -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(b){b.registerHelper("allowTags",function(a){a=a.replace(/<(span|strong)>(.*?)<\/\1>/g,"<$1>$2$1>");a=a.replace(/<span class="(.*?)">(.*?)<\/span>/g,'$2');return new b.SafeString(a)})})(Handlebars);
diff --git a/src/messenger/webim/js/compiled/chat_app.js b/src/messenger/webim/js/compiled/chat_app.js
index 6c6c0419..c27de600 100644
--- a/src/messenger/webim/js/compiled/chat_app.js
+++ b/src/messenger/webim/js/compiled/chat_app.js
@@ -5,8 +5,7 @@
License: http://mibew.org/license.php
*/
(function(a){a.Regions={};a.Objects.Models.Controls={};a.Objects.Models.Status={}})(Mibew);
-;(function(b){b.registerHelper("allowTags",function(a){a=a.replace(/<(span|strong)>(.*?)<\/\1>/g,"<$1>$2$1>");a=a.replace(/<span class="(.*?)">(.*?)<\/span>/g,'$2');return new b.SafeString(a)})})(Handlebars);
-MibewAPIChatInteraction=function(){this.obligatoryArguments={"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}};this.reservedFunctionNames=["result"]};MibewAPIChatInteraction.prototype=new MibewAPIInteraction;
+;MibewAPIChatInteraction=function(){this.obligatoryArguments={"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}};this.reservedFunctionNames=["result"]};MibewAPIChatInteraction.prototype=new MibewAPIInteraction;
(function(b,c){b.Models.Status=b.Models.Base.extend({defaults:{visible:!0,weight:0,hideTimeout:4E3,title:""},initialize:function(){this.hideTimer=null},autoHide:function(a){a=a||this.get("hideTimeout");this.hideTimer&&clearTimeout(this.hideTimer);this.hideTimer=setTimeout(c.bind(function(){this.set({visible:!1})},this),a)}})})(Mibew,_);
(function(a,b){a.Models.Avatar=a.Models.Base.extend({defaults:{imageLink:!1},initialize:function(){a.Objects.server.registerFunction("setupAvatar",b.bind(this.apiSetupAvatar,this))},apiSetupAvatar:function(a){a.imageLink&&this.set({imageLink:a.imageLink})}})})(Mibew,_);
(function(a,b){a.Models.ChatUser=a.Models.User.extend({defaults:b.extend({},a.Models.User.prototype.defaults,{canPost:!0,typing:!1,canChangeName:!1,dafaultName:!0})})})(Mibew,_);
@@ -18,7 +17,6 @@ MibewAPIChatInteraction=function(){this.obligatoryArguments={"*":{threadId:null,
(function(a,b){a.Models.SendMailControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{link:!1}),getModelType:function(){return"SendMailControl"}})})(Mibew,_);
(function(a,b){a.Models.SoundControl=a.Models.Control.extend({defaults:b.extend({},a.Models.Control.prototype.defaults,{enabled:!0}),getModelType:function(){return"SoundControl"}})})(Mibew,_);
(function(b){b.Models.UserNameControl=b.Models.Control.extend({getModelType:function(){return"UserNameControl"},changeName:function(a){var c=b.Objects.Models.user,d=b.Objects.Models.thread,e=c.get("name");a&&e!=a&&(b.Objects.server.callFunctions([{"function":"rename",arguments:{references:{},"return":{},threadId:d.get("id"),token:d.get("token"),name:a}}],function(a){a.errorCode&&(b.Objects.Models.Status.message.setMessage(a.errorMessage||"Cannot rename"),c.set({name:e}))},!0),c.set({name:a}))}})})(Mibew);
-(function(a){a.Models.Message=a.Models.Base.extend({defaults:{message:""},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6,KIND_AVATAR:7})})(Mibew);
(function(a){a.Models.MessageForm=a.Models.Base.extend({defaults:{predefinedAnswers:[],ignoreCtrl:!1},postMessage:function(e){var b=a.Objects.Models.thread,c=a.Objects.Models.user;if(c.get("canPost")){this.trigger("before:post",this);var d=this;a.Objects.server.callFunctions([{"function":"post",arguments:{references:{},"return":{},message:e,threadId:b.get("id"),token:b.get("token"),user:!c.get("isAgent")}}],function(){d.trigger("after:post",d)},!0)}}})})(Mibew);
(function(a,b){a.Models.StatusMessage=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{message:"",visible:!1}),getModelType:function(){return"StatusMessage"},setMessage:function(a){this.set({message:a,visible:!0});this.autoHide()}})})(Mibew,_);
(function(a,b){a.Models.StatusTyping=a.Models.Status.extend({defaults:b.extend({},a.Models.Status.prototype.defaults,{visible:!1,hideTimeout:2E3}),getModelType:function(){return"StatusTyping"},show:function(){this.set({visible:!0});this.autoHide()}})})(Mibew,_);
@@ -38,8 +36,6 @@ window.location.href=b.replace(/\&\;/g,"&")+(c?"&style="+c:"")}}})})(Mibew,Ha
(function(a,b,c){a.Views.SoundControl=a.Views.Control.extend({template:b.templates.sound_control,events:c.extend({},a.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.set({enabled:!this.model.get("enabled")})}})})(Mibew,Handlebars,_);
(function(b,c,d){b.Views.UserNameControl=b.Views.Control.extend({template:c.templates.user_name_control,events:d.extend({},b.Views.Control.prototype.events,{"click .user-name-control-set":"changeName","click .user-name-control-change":"showNameInput","keydown #user-name-control-input":"inputKeyDown"}),ui:{nameInput:"#user-name-control-input"},initialize:function(){b.Objects.Models.user.on("change:name",this.hideNameInput,this);this.nameInput=b.Objects.Models.user.get("defaultName")},serializeData:function(){var a=
this.model.toJSON();a.user=b.Objects.Models.user.toJSON();a.nameInput=this.nameInput;return a},inputKeyDown:function(a){a=a.which;(13==a||10==a)&&this.changeName()},hideNameInput:function(){this.nameInput=!1;this.render()},showNameInput:function(){this.nameInput=!0;this.render()},changeName:function(){var a=this.ui.nameInput.val();this.model.changeName(a)}})})(Mibew,Handlebars,_);
-(function(c,d,e){var f={"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
-"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
(function(b,d,e){b.Views.MessageForm=d.Marionette.ItemView.extend({template:e.templates.message_form,events:{"click #send-message":"postMessage","keydown #message-input":"messageKeyDown","keyup #message-input":"checkUserTyping","change #message-input":"checkUserTyping","change #predefined":"selectPredefinedAnswer","focus #message-input":"setFocus","blur #message-input":"dropFocus"},modelEvents:{change:"render"},ui:{message:"#message-input",send:"#send-message",predefinedAnswer:"#predefined"},initialize:function(){b.Objects.Models.user.on("change:canPost",
this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},postMessage:function(){var a=this.ui.message.val();""!=a&&(this.disableInput(),this.model.postMessage(a));b.Objects.Collections.messages.on("multiple:add",this.postMessageComplete,this)},messageKeyDown:function(a){var c=a.which;a=a.ctrlKey;(13==c&&(a||this.model.get("ignoreCtrl"))||10==c)&&this.postMessage()},enableInput:function(){this.ui.message.removeAttr("disabled")},disableInput:function(){this.ui.message.attr("disabled",
"disabled")},clearInput:function(){this.ui.message.val("").change()},postMessageComplete:function(){this.clearInput();this.enableInput();this.focused&&this.ui.focus();b.Objects.Collections.messages.off("multiple:add",this.postMessageComplete,this)},selectPredefinedAnswer:function(){var a=this.ui.message,c=this.ui.predefinedAnswer,b=c.get(0).selectedIndex;b&&(a.val(this.model.get("predefinedAnswers")[b-1].full).change(),a.focus(),c.get(0).selectedIndex=0)},checkUserTyping:function(){var a=b.Objects.Models.user,
diff --git a/src/messenger/webim/js/compiled/default/handlebars_helpers.js b/src/messenger/webim/js/compiled/default/handlebars_helpers.js
index bbf9b4f7..e76f364b 100644
--- a/src/messenger/webim/js/compiled/default/handlebars_helpers.js
+++ b/src/messenger/webim/js/compiled/default/handlebars_helpers.js
@@ -5,5 +5,6 @@
Copyright (c) 2005-2011 Mibew Messenger Community
License: http://mibew.org/license.php
*/
-(function(e,a){a.registerHelper("apply",function(c,b){var f=c,e=/^[0-9A-z_]+$/;b=b.split(/\s*,\s*/);for(var d in b)if(b.hasOwnProperty(d)&&e.test(b[d])){if("function"!=typeof a.helpers[b[d]])throw Error("Unregistered helper '"+b[d]+"'!");f=a.helpers[b[d]](f).toString()}return new a.SafeString(f)});a.registerHelper("formatTime",function(c){var b=new Date(1E3*c);c=b.getHours().toString();var a=b.getMinutes().toString(),b=b.getSeconds().toString();return(10>c?"0"+c:c)+":"+(10>a?"0"+a:a)+":"+(10>b?"0"+
-b:b)});a.registerHelper("urlReplace",function(c){return new a.SafeString(c.replace(/((?:https?|ftp):\/\/\S*)/g,'$1'))});a.registerHelper("nl2br",function(c){return new a.SafeString(c.replace(/\n/g,"
"))});a.registerHelper("L10n",function(a){return e.Localization.get(a)||""})})(Mibew,Handlebars);
+(function(e,b){b.registerHelper("apply",function(a,c){var f=a,e=/^[0-9A-z_]+$/;c=c.split(/\s*,\s*/);for(var d in c)if(c.hasOwnProperty(d)&&e.test(c[d])){if("function"!=typeof b.helpers[c[d]])throw Error("Unregistered helper '"+c[d]+"'!");f=b.helpers[c[d]](f).toString()}return new b.SafeString(f)});b.registerHelper("allowTags",function(a){a=a.replace(/<(span|strong)>(.*?)<\/\1>/g,"<$1>$2$1>");a=a.replace(/<span class="(.*?)">(.*?)<\/span>/g,'$2');
+return new b.SafeString(a)});b.registerHelper("formatTime",function(a){var c=new Date(1E3*a);a=c.getHours().toString();var b=c.getMinutes().toString(),c=c.getSeconds().toString();return(10>a?"0"+a:a)+":"+(10>b?"0"+b:b)+":"+(10>c?"0"+c:c)});b.registerHelper("urlReplace",function(a){return new b.SafeString(a.replace(/((?:https?|ftp):\/\/\S*)/g,'$1'))});b.registerHelper("nl2br",function(a){return new b.SafeString(a.replace(/\n/g,"
"))});b.registerHelper("L10n",function(a){return e.Localization.get(a)||
+""})})(Mibew,Handlebars);
diff --git a/src/messenger/webim/js/compiled/chat/model_views/messages/message.js b/src/messenger/webim/js/compiled/default/model_views/message.js
similarity index 100%
rename from src/messenger/webim/js/compiled/chat/model_views/messages/message.js
rename to src/messenger/webim/js/compiled/default/model_views/message.js
diff --git a/src/messenger/webim/js/compiled/chat/models/messages/message.js b/src/messenger/webim/js/compiled/default/models/message.js
similarity index 100%
rename from src/messenger/webim/js/compiled/chat/models/messages/message.js
rename to src/messenger/webim/js/compiled/default/models/message.js
diff --git a/src/messenger/webim/js/compiled/default_app.js b/src/messenger/webim/js/compiled/default_app.js
index 1cfb27eb..3ae2afc5 100644
--- a/src/messenger/webim/js/compiled/default_app.js
+++ b/src/messenger/webim/js/compiled/default_app.js
@@ -5,8 +5,9 @@
License: http://mibew.org/license.php
*/
var Mibew={};(function(a,b){b.Marionette.TemplateCache.prototype.compileTemplate=function(a){return Handlebars.compile(a)};a.Models={};a.Collections={};a.Views={};a.Objects={};a.Objects.Models={};a.Objects.Collections={}})(Mibew,Backbone);
-(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""})})();(function(e,a){a.registerHelper("apply",function(c,b){var f=c,e=/^[0-9A-z_]+$/;b=b.split(/\s*,\s*/);for(var d in b)if(b.hasOwnProperty(d)&&e.test(b[d])){if("function"!=typeof a.helpers[b[d]])throw Error("Unregistered helper '"+b[d]+"'!");f=a.helpers[b[d]](f).toString()}return new a.SafeString(f)});a.registerHelper("formatTime",function(c){var b=new Date(1E3*c);c=b.getHours().toString();var a=b.getMinutes().toString(),b=b.getSeconds().toString();return(10>c?"0"+c:c)+":"+(10>a?"0"+a:a)+":"+(10>b?"0"+
-b:b)});a.registerHelper("urlReplace",function(c){return new a.SafeString(c.replace(/((?:https?|ftp):\/\/\S*)/g,'$1'))});a.registerHelper("nl2br",function(c){return new a.SafeString(c.replace(/\n/g,"
"))});a.registerHelper("L10n",function(a){return e.Localization.get(a)||""})})(Mibew,Handlebars);
+(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+": ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="
",f})})();(function(e,b){b.registerHelper("apply",function(a,c){var f=a,e=/^[0-9A-z_]+$/;c=c.split(/\s*,\s*/);for(var d in c)if(c.hasOwnProperty(d)&&e.test(c[d])){if("function"!=typeof b.helpers[c[d]])throw Error("Unregistered helper '"+c[d]+"'!");f=b.helpers[c[d]](f).toString()}return new b.SafeString(f)});b.registerHelper("allowTags",function(a){a=a.replace(/<(span|strong)>(.*?)<\/\1>/g,"<$1>$2$1>");a=a.replace(/<span class="(.*?)">(.*?)<\/span>/g,'$2');
+return new b.SafeString(a)});b.registerHelper("formatTime",function(a){var c=new Date(1E3*a);a=c.getHours().toString();var b=c.getMinutes().toString(),c=c.getSeconds().toString();return(10>a?"0"+a:a)+":"+(10>b?"0"+b:b)+":"+(10>c?"0"+c:c)});b.registerHelper("urlReplace",function(a){return new b.SafeString(a.replace(/((?:https?|ftp):\/\/\S*)/g,'$1'))});b.registerHelper("nl2br",function(a){return new b.SafeString(a.replace(/\n/g,"
"))});b.registerHelper("L10n",function(a){return e.Localization.get(a)||
+""})})(Mibew,Handlebars);
(function(b,d){b.Localization={};var c={};b.Localization.get=function(a){return!c.hasOwnProperty(a)?!1:c[a]};b.Localization.set=function(a){d.extend(c,a)}})(Mibew,_);
(function(b,f,g,c){b.Server=function(a){this.updateTimer=null;this.options=c.extend({url:"",requestsFrequency:2,reconnectPause:1,onTimeout:function(){},onTransportError:function(){},onCallError:function(){},onUpdateError:function(){},onResponseError:function(){}},a);this.callbacks={};this.callPeriodically=[];this.ajaxRequest=null;this.buffer=[];this.functions={};this.mibewAPI=new f(new this.options.interactionType)};b.Server.prototype.callFunctions=function(a,e,b){try{if(!(a instanceof Array))throw Error("The first arguments must be an array");
for(var d in a)a.hasOwnProperty(d)&&this.mibewAPI.checkFunction(a[d],!1);var c=this.generateToken();this.callbacks[c]=e;this.buffer.push({token:c,functions:a});b&&this.update()}catch(f){return this.options.onCallError(f),!1}return!0};b.Server.prototype.callFunctionsPeriodically=function(a,e){this.callPeriodically.push({functionsListBuilder:a,callbackFunction:e})};b.Server.prototype.generateToken=function(){var a;do a="wnd"+(new Date).getTime().toString()+Math.round(50*Math.random()).toString();while(a in
@@ -18,6 +19,7 @@ b.Server.prototype.registerFunction=function(a,b){a in this.functions||(this.fun
(function(c){c.Utils={};c.Utils.toUpperCaseFirst=function(a){return"string"!=typeof a?!1:""===a?a:a.substring(0,1).toUpperCase()+a.substring(1)};c.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":">","&":"&",'"':""","'":"'","`":"`"},g=/[&<>'"`]/g;c.Views.Message=d.Marionette.ItemView.extend({template:e.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var a=this.model.toJSON(),b=this.model.get("kind");a.allowFormatting=b!=this.model.KIND_USER&&b!=this.model.KIND_AGENT;a.kindName=this.kindToString(b);a.message=this.escapeString(a.message);return a},kindToString:function(a){return a==this.model.KIND_USER?
+"user":a==this.model.KIND_AGENT?"agent":a==this.model.KIND_FOR_AGENT?"hidden":a==this.model.KIND_INFO?"inf":a==this.model.KIND_CONN?"conn":a==this.model.KIND_EVENTS?"event":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
(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);
(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,_);
(function(a){a.Views.ControlsCollection=a.Views.CollectionBase.extend({itemView:a.Views.Control,className:"controls-collection"})})(Mibew);
diff --git a/src/messenger/webim/js/source/chat/handlebars_helpers.js b/src/messenger/webim/js/source/chat/handlebars_helpers.js
deleted file mode 100644
index 2c1f7821..00000000
--- a/src/messenger/webim/js/source/chat/handlebars_helpers.js
+++ /dev/null
@@ -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(Handlebars){
-
- /**
- * Register 'allowTags' Handlebars helper.
- *
- * This helper unescape HTML entities for allowed (span and strong) tags.
- */
- Handlebars.registerHelper('allowTags', function(text) {
- var result = text;
- result = result.replace(
- /<(span|strong)>(.*?)<\/\1>/g,
- '<$1>$2$1>'
- );
- result = result.replace(
- /<span class="(.*?)">(.*?)<\/span>/g,
- '$2'
- );
- return new Handlebars.SafeString(result);
- });
-
-})(Handlebars);
\ No newline at end of file
diff --git a/src/messenger/webim/js/source/default/handlebars_helpers.js b/src/messenger/webim/js/source/default/handlebars_helpers.js
index 9f2cf5b4..95b47222 100644
--- a/src/messenger/webim/js/source/default/handlebars_helpers.js
+++ b/src/messenger/webim/js/source/default/handlebars_helpers.js
@@ -40,6 +40,24 @@
return new Handlebars.SafeString(result);
});
+ /**
+ * Register 'allowTags' Handlebars helper.
+ *
+ * This helper unescape HTML entities for allowed (span and strong) tags.
+ */
+ Handlebars.registerHelper('allowTags', function(text) {
+ var result = text;
+ result = result.replace(
+ /<(span|strong)>(.*?)<\/\1>/g,
+ '<$1>$2$1>'
+ );
+ result = result.replace(
+ /<span class="(.*?)">(.*?)<\/span>/g,
+ '$2'
+ );
+ return new Handlebars.SafeString(result);
+ });
+
/**
* Register 'formatTime' Handlebars helper.
*
diff --git a/src/messenger/webim/js/source/chat/model_views/messages/message.js b/src/messenger/webim/js/source/default/model_views/message.js
similarity index 100%
rename from src/messenger/webim/js/source/chat/model_views/messages/message.js
rename to src/messenger/webim/js/source/default/model_views/message.js
diff --git a/src/messenger/webim/js/source/chat/models/messages/message.js b/src/messenger/webim/js/source/default/models/message.js
similarity index 100%
rename from src/messenger/webim/js/source/chat/models/messages/message.js
rename to src/messenger/webim/js/source/default/models/message.js
diff --git a/src/messenger/webim/js/templates/compiled/default_app.tpl.js b/src/messenger/webim/js/templates/compiled/default_app.tpl.js
index 30edb7ea..02e79fe7 100644
--- a/src/messenger/webim/js/templates/compiled/default_app.tpl.js
+++ b/src/messenger/webim/js/templates/compiled/default_app.tpl.js
@@ -1 +1 @@
-(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""})})()
\ No newline at end of file
+(function(){var a=Handlebars.template,b=Handlebars.templates=Handlebars.templates||{};b.default_control=a(function(a,b,c,d,e){c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression;return f+="",h=c.title,h?g=h.call(b,{hash:{}}):(g=b.title,g=typeof g===i?g():g),f+=j(g)+"",f}),b.sound=a(function(a,b,c,d,e){function j(a,b){var d="",e,f;return d+='\n\n',d}c=c||a.helpers;var f,g="function",h=this.escapeExpression,i=this;return f=b.file,f=c["if"].call(b,f,{hash:{},inverse:i.noop,fn:i.program(1,j,e)}),f||f===0?f:""}),b.message=a(function(a,b,c,d,e){function m(a,b){var d="",e,f;return d+="",f=c.name,f?e=f.call(a,{hash:{}}):(e=a.name,e=typeof e===i?e():e),d+=j(e)+": ",d}function n(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br, allowTags",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br, allowTags",{hash:{}}),j(d)}function o(a,b){var d,e;return d=a.message,e=c.apply,d=e?e.call(a,d,"urlReplace, nl2br",{hash:{}}):k.call(a,"apply",d,"urlReplace, nl2br",{hash:{}}),j(d)}c=c||a.helpers;var f="",g,h,i="function",j=this.escapeExpression,k=c.helperMissing,l=this;f+="",g=b.created,h=c.formatTime,g=h?h.call(b,g,{hash:{}}):k.call(b,"formatTime",g,{hash:{}}),f+=j(g)+"\n",g=b.name,g=c["if"].call(b,g,{hash:{},inverse:l.noop,fn:l.program(1,m,e)});if(g||g===0)f+=g;f+="\n",g=b.allowFormatting,g=c["if"].call(b,g,{hash:{},inverse:l.program(5,o,e),fn:l.program(3,n,e)});if(g||g===0)f+=g;return f+="
",f})})()
\ No newline at end of file
diff --git a/src/messenger/webim/js/templates/compiled/message.tpl.js b/src/messenger/webim/js/templates/compiled/message.tpl.js
deleted file mode 100644
index 9c9a4b7e..00000000
--- a/src/messenger/webim/js/templates/compiled/message.tpl.js
+++ /dev/null
@@ -1,55 +0,0 @@
-(function() {
- var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['message'] = template(function (Handlebars,depth0,helpers,partials,data) {
- helpers = helpers || Handlebars.helpers;
- var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression, helperMissing=helpers.helperMissing, self=this;
-
-function program1(depth0,data) {
-
- var buffer = "", stack1, foundHelper;
- buffer += "";
- foundHelper = helpers.name;
- if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); }
- else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1() : stack1; }
- buffer += escapeExpression(stack1) + ": ";
- return buffer;}
-
-function program3(depth0,data) {
-
- var stack1, foundHelper;
- stack1 = depth0.message;
- foundHelper = helpers.apply;
- stack1 = foundHelper ? foundHelper.call(depth0, stack1, "urlReplace, nl2br, allowTags", {hash:{}}) : helperMissing.call(depth0, "apply", stack1, "urlReplace, nl2br, allowTags", {hash:{}});
- return escapeExpression(stack1);}
-
-function program5(depth0,data) {
-
- var stack1, foundHelper;
- stack1 = depth0.message;
- foundHelper = helpers.apply;
- stack1 = foundHelper ? foundHelper.call(depth0, stack1, "urlReplace, nl2br", {hash:{}}) : helperMissing.call(depth0, "apply", stack1, "urlReplace, nl2br", {hash:{}});
- return escapeExpression(stack1);}
-
- buffer += "";
- stack1 = depth0.created;
- foundHelper = helpers.formatTime;
- stack1 = foundHelper ? foundHelper.call(depth0, stack1, {hash:{}}) : helperMissing.call(depth0, "formatTime", stack1, {hash:{}});
- buffer += escapeExpression(stack1) + " \r\n";
- stack1 = depth0.name;
- stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.noop,fn:self.program(1, program1, data)});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "\r\n";
- stack1 = depth0.allowFormating;
- stack1 = helpers['if'].call(depth0, stack1, {hash:{},inverse:self.program(5, program5, data),fn:self.program(3, program3, data)});
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "
";
- return buffer;});
-})();
\ No newline at end of file
diff --git a/src/messenger/webim/js/templates/source/default/message.handlebars b/src/messenger/webim/js/templates/source/default/message.handlebars
new file mode 100644
index 00000000..472ee744
--- /dev/null
+++ b/src/messenger/webim/js/templates/source/default/message.handlebars
@@ -0,0 +1,3 @@
+{{formatTime created}}
+{{#if name}}{{name}}: {{/if}}
+{{#if allowFormatting}}{{apply message "urlReplace, nl2br, allowTags"}}{{else}}{{apply message "urlReplace, nl2br"}}{{/if}}
\ No newline at end of file
diff --git a/src/messenger/webim/js/templates/source/message.handlebars b/src/messenger/webim/js/templates/source/message.handlebars
deleted file mode 100644
index 1cb729d2..00000000
--- a/src/messenger/webim/js/templates/source/message.handlebars
+++ /dev/null
@@ -1,3 +0,0 @@
-{{formatTime created}}
-{{#if name}}{{name}}: {{/if}}
-{{#if allowFormating}}{{apply message "urlReplace, nl2br, allowTags"}}{{else}}{{apply message "urlReplace, nl2br"}}{{/if}}
\ No newline at end of file