diff --git a/.gitignore b/.gitignore
index d275a528..34522ced 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,6 @@ src/composer.lock
# Do not index third-party libraries
src/mibew/vendor
+
+# Do not index node.js modules that are used for building
+src/node_modules
diff --git a/src/build.xml b/src/build.xml
deleted file mode 100644
index ca9fb3df..00000000
--- a/src/build.xml
+++ /dev/null
@@ -1,394 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
- Compile templates
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Remove temporary files
-
-
-
-
-
-
- Done
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Done
-
-
-
-
-
- Handlebars templates from all styles are built.
-
-
-
-
-
- Compile and concatenate JavaScript files for dialogs styles:
-
-
- Create temporary directories
-
-
-
-
-
-
-
-
-
- Compile JavaScript files
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Concatenate JavaScript files
-
-
-
-
-
-
-
-
-
-
- Remove temporary directories
-
-
-
-
-
-
-
-
- Done
-
-
-
-
-
- Styles built.
-
-
-
-
-
- Compile JavaScript files of the Mibew Core
-
-
- Copy directory tree
-
-
-
-
-
-
-
- Compile JavaScript files
-
-
-
-
-
-
-
-
-
-
-
-
-
- Done
-
-
-
-
-
- Build "${app_name}" JavaScript application
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Done
-
-
-
-
-
-
-
-
- Default JavaScript application built.
-
-
-
-
-
-
-
-
- Chat JavaScript application built.
-
-
-
-
-
-
-
-
-
- Users JavaScript application built.
-
-
-
-
-
-
-
-
- Thread log JavaScript application built.
-
-
-
-
-
- Mibew Messenger built.
-
-
-
-
\ No newline at end of file
diff --git a/src/gulpfile.js b/src/gulpfile.js
new file mode 100644
index 00000000..01412b45
--- /dev/null
+++ b/src/gulpfile.js
@@ -0,0 +1,166 @@
+var fs = require('fs'),
+ eventStream = require('event-stream'),
+ gulp = require('gulp'),
+ uglify = require('gulp-uglify'),
+ concat = require('gulp-concat'),
+ phpcs = require('gulp-phpcs'),
+ order = require('gulp-order'),
+ handlebars = require('gulp-handlebars'),
+ defineModule = require('gulp-define-module'),
+ header = require('gulp-header');
+
+// Set global configs.
+var config = {
+ mibewPath: 'mibew',
+ phpVendorPath: 'mibew/vendor',
+ pluginsPath: 'mibew/plugins',
+ jsPath: 'mibew/js',
+ chatStylesPath: 'mibew/styles/dialogs',
+ pageStylesPath: 'mibew/styles/pages',
+ compiledTemplatesHeader: fs.readFileSync('tools/compiled_templates_header.txt')
+}
+
+
+// Checks all PHP files with PHP Code Sniffer.
+gulp.task('phpcs', function() {
+ return gulp.src([
+ config.mibewPath + '/**/*.php',
+ '!' + config.phpVendorPath + '/**/*.*',
+ '!' + config.pluginsPath + '/**/*.*'
+ ])
+ .pipe(phpcs({
+ bin: config.phpVendorPath + '/bin/phpcs',
+ standard: 'PSR2',
+ warningSeverity: 0
+ }));
+});
+
+// Compile all JavaScript files of the Mibew Core
+gulp.task('js', function() {
+ return eventStream.merge(
+ getClientSideApp('default'),
+ getClientSideApp('chat'),
+ getClientSideApp('thread_log'),
+ getClientSideApp('users'),
+ gulp.src(config.jsPath + '/source/**/*.js')
+ )
+ .pipe(uglify({preserveComments: 'some'}))
+ .pipe(gulp.dest(config.jsPath + '/compiled'));
+});
+
+// Performs all job related with chat styles.
+gulp.task('chat-styles', ['chat-styles-handlebars', 'chat-styles-js'], function() {
+ // This task is just a combination of other tasks. That is why there is no
+ // real code.
+});
+
+// Compile and concatenate handlebars files for all chat styles.
+gulp.task('chat-styles-handlebars', function() {
+ // TODO: Process all available styles, not only the default one.
+ var stylePath = config.chatStylesPath + '/default';
+
+ return gulp.src(stylePath + '/templates_src/client_side/**/*.handlebars')
+ .pipe(handlebars())
+ .pipe(wrapHandlebarsTemplate())
+ .pipe(concat('templates.js'))
+ .pipe(uglify({preserveComments: 'some'}))
+ .pipe(header(config.compiledTemplatesHeader))
+ .pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
+});
+
+// Compile and concatenate js files for all chat styles.
+gulp.task('chat-styles-js', function() {
+ // TODO: Process all available styles, not only the default one.
+ var stylePath = config.chatStylesPath + '/default';
+
+ return gulp.src(stylePath + '/js/source/**/*.js')
+ .pipe(concat('scripts.js'))
+ .pipe(uglify({preserveComments: 'some'}))
+ .pipe(gulp.dest(stylePath + '/js/compiled'));
+});
+
+// Performs all job related with pages styles.
+gulp.task('page-styles', function() {
+ // TODO: Process all available styles, not only the default one.
+ var stylePath = config.pageStylesPath + '/default';
+
+ return eventStream.merge(
+ gulp.src(stylePath + '/templates_src/client_side/default/**/*.handlebars')
+ .pipe(handlebars())
+ .pipe(wrapHandlebarsTemplate())
+ .pipe(concat('default_app.tpl.js')),
+ gulp.src(stylePath + '/templates_src/client_side/users/**/*.handlebars')
+ .pipe(handlebars())
+ .pipe(wrapHandlebarsTemplate())
+ .pipe(concat('users_app.tpl.js'))
+ )
+ .pipe(uglify({preserveComments: 'some'}))
+ .pipe(header(config.compiledTemplatesHeader))
+ .pipe(gulp.dest(stylePath + '/templates_compiled/client_side'));
+});
+
+// Runs all existing tasks.
+gulp.task('default', ['phpcs', 'js', 'chat-styles', 'page-styles'], function() {
+ // This task is just a combination of other tasks. That is why there is no
+ // real code.
+});
+
+
+/**
+ * Loads and prepare js file for a client side application with the specified
+ * name.
+ *
+ * @param {String} name Application name
+ * @returns A files stream that can be piped to any gulp plugin.
+ */
+var getClientSideApp = function(name) {
+ var appSource = config.jsPath + '/source/' + name;
+
+ return gulp.src(appSource + '/**/*.js')
+ .pipe(order(
+ [
+ appSource + '/init.js',
+ // The following line is equivalent to
+ // gulp.src([appSource + '/*.js', '!' + appSource + '/app.js']);
+ appSource + '/!(app).js',
+ appSource + '/models/**/base*.js',
+ appSource + '/models/**/*.js',
+ appSource + '/collections/**/base*.js',
+ appSource + '/collections/**/*.js',
+ appSource + '/model_views/**/base*.js',
+ appSource + '/model_views/**/*.js',
+ appSource + '/collection_views/**/base*.js',
+ appSource + '/collection_views/**/*.js',
+ appSource + '/regions/**/base*.js',
+ appSource + '/regions/**/*.js',
+ appSource + '/layouts/**/base*.js',
+ appSource + '/layouts/**/*.js',
+ appSource + '/**/base*.js',
+ // The following line is equivalent to
+ // gulp.src([appSource + '/**/*.js', '!' + appSource + '/app.js']);
+ '!' + appSource + '/app.js',
+ appSource + '/app.js'
+ ],
+ {base: process.cwd()}
+ ))
+ .pipe(concat(name + '_app.js'));
+}
+
+/**
+ * Wraps a handlebars template with a function and attach it to the
+ * Handlebars.templates object.
+ *
+ * @returns {Function} A function that can be used in pipe() method of a file
+ * stream right after gulp-handlebars plugin.
+ */
+var wrapHandlebarsTemplate = function() {
+ return defineModule('plain', {
+ wrapper: '(function() {\n'
+ + 'var templates = Handlebars.templates = Handlebars.templates || {};\n'
+ + 'Handlebars.templates["<%= relative %>"] = <%= handlebars %>;\n'
+ + '})()',
+ context: function(context) {
+ return {relative: context.file.relative.replace(/\.js$/, '')};
+ }
+ });
+}
diff --git a/src/mibew/js/compiled/brws.js b/src/mibew/js/compiled/brws.js
index b0905500..33e0b74e 100644
--- a/src/mibew/js/compiled/brws.js
+++ b/src/mibew/js/compiled/brws.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-var myAgent="",myVer=0,myRealAgent="";function detectAgent(){for(var a="opera msie safari firefox netscape mozilla".split(" "),d=navigator.userAgent.toLowerCase(),b=0;bn;n++)t=s.messages[n],t.kind==d?"object"==typeof t.data&&null!==t.data&&(l=t.plugin||!1,a="process:"+(l!==!1?l+":":"")+"plugin:message",i={messageData:t,model:!1},this.trigger(a,i),i.model&&(i.model.get("id")||i.model.set({id:t.id}),o.push(i.model))):o.push(new e.Models.Message(t));o.length>0&&this.add(o)},updateMessagesFunctionBuilder:function(){var s=e.Objects.Models.thread,t=e.Objects.Models.user;return[{"function":"updateMessages",arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:s.get("id"),token:s.get("token"),lastId:s.get("lastId"),user:!t.get("isAgent")}}]},add:function(){var e=Array.prototype.slice.apply(arguments),t=s.Collection.prototype.add.apply(this,e);return this.trigger("multiple:add"),t}})}(Mibew,Backbone,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/collections/status.js b/src/mibew/js/compiled/chat/collections/status.js
index 96b67085..75a0b62d 100644
--- a/src/mibew/js/compiled/chat/collections/status.js
+++ b/src/mibew/js/compiled/chat/collections/status.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Collections.Status=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(t,e){t.Collections.Status=e.Collection.extend({comparator:function(t){return t.get("weight")}})}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/init.js b/src/mibew/js/compiled/chat/init.js
index f398669a..6f7e1e66 100644
--- a/src/mibew/js/compiled/chat/init.js
+++ b/src/mibew/js/compiled/chat/init.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a){a.Regions={};a.Layouts={};a.Application=new Backbone.Marionette.Application})(Mibew);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(i){i.Regions={},i.Layouts={},i.Application=new Backbone.Marionette.Application}(Mibew);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/layouts/chat.js b/src/mibew/js/compiled/chat/layouts/chat.js
index 7b9da289..7ed4f560 100644
--- a/src/mibew/js/compiled/chat/layouts/chat.js
+++ b/src/mibew/js/compiled/chat/layouts/chat.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(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);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,a){e.Layouts.Chat=a.Marionette.Layout.extend({template:Handlebars.templates["chat/layout"],regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:e.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var a=e.Objects.Models;return{page:a.page.toJSON(),user:a.user.toJSON()}}})}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/layouts/invitation.js b/src/mibew/js/compiled/chat/layouts/invitation.js
index 7dc17d45..0351ec40 100644
--- a/src/mibew/js/compiled/chat/layouts/invitation.js
+++ b/src/mibew/js/compiled/chat/layouts/invitation.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Layouts.Invitation=b.Marionette.Layout.extend({template:Handlebars.templates["invitation/layout"],regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:a.Regions.Messages}}})})(Mibew,Backbone);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t){e.Layouts.Invitation=t.Marionette.Layout.extend({template:Handlebars.templates["invitation/layout"],regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:e.Regions.Messages}}})}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/layouts/leave_message.js b/src/mibew/js/compiled/chat/layouts/leave_message.js
index ce1ae0d9..a2cd99f0 100644
--- a/src/mibew/js/compiled/chat/layouts/leave_message.js
+++ b/src/mibew/js/compiled/chat/layouts/leave_message.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Layouts.LeaveMessage=b.Marionette.Layout.extend({template:Handlebars.templates["leave_message/layout"],regions:{leaveMessageFormRegion:"#content-wrapper",descriptionRegion:"#description-region"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,a){e.Layouts.LeaveMessage=a.Marionette.Layout.extend({template:Handlebars.templates["leave_message/layout"],regions:{leaveMessageFormRegion:"#content-wrapper",descriptionRegion:"#description-region"},serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/layouts/survey.js b/src/mibew/js/compiled/chat/layouts/survey.js
index fb3e31f7..d7175c03 100644
--- a/src/mibew/js/compiled/chat/layouts/survey.js
+++ b/src/mibew/js/compiled/chat/layouts/survey.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Layouts.Survey=b.Marionette.Layout.extend({template:Handlebars.templates["survey/layout"],regions:{surveyFormRegion:"#content-wrapper"},serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t){e.Layouts.Survey=t.Marionette.Layout.extend({template:Handlebars.templates["survey/layout"],regions:{surveyFormRegion:"#content-wrapper"},serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/mibewapi_chat_interaction.js b/src/mibew/js/compiled/chat/mibewapi_chat_interaction.js
index ef793853..7ccd0a4e 100644
--- a/src/mibew/js/compiled/chat/mibewapi_chat_interaction.js
+++ b/src/mibew/js/compiled/chat/mibewapi_chat_interaction.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-MibewAPIChatInteraction=function(){this.mandatoryArguments=function(){return{"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}}};this.getReservedFunctionsNames=function(){return["result"]}};MibewAPIChatInteraction.prototype=new MibewAPIInteraction;
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+MibewAPIChatInteraction=function(){this.mandatoryArguments=function(){return{"*":{threadId:null,token:null,"return":{},references:{}},result:{errorCode:0}}},this.getReservedFunctionsNames=function(){return["result"]}},MibewAPIChatInteraction.prototype=new MibewAPIInteraction;
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/avatar.js b/src/mibew/js/compiled/chat/model_views/avatar.js
index d4076901..0cc6190b 100644
--- a/src/mibew/js/compiled/chat/model_views/avatar.js
+++ b/src/mibew/js/compiled/chat/model_views/avatar.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b,c){a.Views.Avatar=b.Marionette.ItemView.extend({template:c.templates["chat/avatar"],className:"avatar",modelEvents:{change:"render"}})})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,a,t){e.Views.Avatar=a.Marionette.ItemView.extend({template:t.templates["chat/avatar"],className:"avatar",modelEvents:{change:"render"}})}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/close.js b/src/mibew/js/compiled/chat/model_views/controls/close.js
index 950f116a..848e223d 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/close.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/close.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,c,d){a.Views.CloseControl=a.Views.Control.extend({template:c.templates["chat/controls/close"],events:d.extend({},a.Views.Control.prototype.events,{click:"closeThread"}),closeThread:function(){var b=a.Localization.get("Are you sure want to leave chat?");(!1===b||confirm(b))&&this.model.closeThread()}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,o,t){e.Views.CloseControl=e.Views.Control.extend({template:o.templates["chat/controls/close"],events:t.extend({},e.Views.Control.prototype.events,{click:"closeThread"}),closeThread:function(){var o=e.Localization.get("Are you sure want to leave chat?");(o===!1||confirm(o))&&this.model.closeThread()}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/history.js b/src/mibew/js/compiled/chat/model_views/controls/history.js
index fe7fd151..f25ed58c 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/history.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/history.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,d,e){b.Views.HistoryControl=b.Views.Control.extend({template:d.templates["chat/controls/history"],events:e.extend({},b.Views.Control.prototype.events,{click:"showHistory"}),showHistory:function(){var c=b.Objects.Models.user,a=this.model.get("link");c.get("isAgent")&&a&&(c=this.model.get("windowParams"),a=a.replace("&","&","g"),a=window.open(a,"UserHistory",c),null!==a&&(a.focus(),a.opener=window))}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,o){e.Views.HistoryControl=e.Views.Control.extend({template:t.templates["chat/controls/history"],events:o.extend({},e.Views.Control.prototype.events,{click:"showHistory"}),showHistory:function(){var t=e.Objects.Models.user,o=this.model.get("link");if(t.get("isAgent")&&o){var s=this.model.get("windowParams");o=o.replace("&","&","g");var n=window.open(o,"UserHistory",s);null!==n&&(n.focus(),n.opener=window)}}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/redirect.js b/src/mibew/js/compiled/chat/model_views/controls/redirect.js
index 5d512edb..c3acbbeb 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/redirect.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/redirect.js
@@ -1,9 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,e,f){b.Views.RedirectControl=b.Views.Control.extend({template:e.templates["chat/controls/redirect"],events:f.extend({},b.Views.Control.prototype.events,{click:"redirect"}),initialize:function(){b.Objects.Models.user.on("change",this.render,this)},serializeData:function(){var a=this.model.toJSON();a.user=b.Objects.Models.user.toJSON();return a},redirect:function(){var a=b.Objects.Models.user;if(a.get("isAgent")&&a.get("canPost")&&(a=this.model.get("link"))){var c=b.Objects.Models.page.get("style"),
-d="";c&&(d=(-1===a.indexOf("?")?"?":"&")+"style="+c);window.location.href=a.replace(/\&\;/g,"&")+d}}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,i){e.Views.RedirectControl=e.Views.Control.extend({template:t.templates["chat/controls/redirect"],events:i.extend({},e.Views.Control.prototype.events,{click:"redirect"}),initialize:function(){e.Objects.Models.user.on("change",this.render,this)},serializeData:function(){var t=this.model.toJSON();return t.user=e.Objects.Models.user.toJSON(),t},redirect:function(){var t=e.Objects.Models.user;if(t.get("isAgent")&&t.get("canPost")){var i=this.model.get("link");if(i){var s=e.Objects.Models.page.get("style"),n="";s&&(n=(-1===i.indexOf("?")?"?":"&")+"style="+s),window.location.href=i.replace(/\&\;/g,"&")+n}}}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/refresh.js b/src/mibew/js/compiled/chat/model_views/controls/refresh.js
index a927dacf..4118cc51 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/refresh.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/refresh.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b,c){a.Views.RefreshControl=a.Views.Control.extend({template:b.templates["chat/controls/refresh"],events:c.extend({},a.Views.Control.prototype.events,{click:"refresh"}),refresh:function(){this.model.refresh()}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,r){e.Views.RefreshControl=e.Views.Control.extend({template:t.templates["chat/controls/refresh"],events:r.extend({},e.Views.Control.prototype.events,{click:"refresh"}),refresh:function(){this.model.refresh()}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/secure_mode.js b/src/mibew/js/compiled/chat/model_views/controls/secure_mode.js
index 9042817d..b2d52385 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/secure_mode.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/secure_mode.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,d,e){a.Views.SecureModeControl=a.Views.Control.extend({template:d.templates["chat/controls/secure_mode"],events:e.extend({},a.Views.Control.prototype.events,{click:"secure"}),secure:function(){var b=this.model.get("link");if(b){var c=a.Objects.Models.page.get("style");window.location.href=b.replace(/\&\;/g,"&")+(c?"&style="+c:"")}}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,o){e.Views.SecureModeControl=e.Views.Control.extend({template:t.templates["chat/controls/secure_mode"],events:o.extend({},e.Views.Control.prototype.events,{click:"secure"}),secure:function(){var t=this.model.get("link");if(t){var o=e.Objects.Models.page.get("style");window.location.href=t.replace(/\&\;/g,"&")+(o?"&style="+o:"")}}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/send_mail.js b/src/mibew/js/compiled/chat/model_views/controls/send_mail.js
index fc52085e..f1c16249 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/send_mail.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/send_mail.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,d,f){b.Views.SendMailControl=b.Views.Control.extend({template:d.templates["chat/controls/send_mail"],events:f.extend({},b.Views.Control.prototype.events,{click:"sendMail"}),sendMail:function(){var a=this.model.get("link"),c=b.Objects.Models.page;if(a){var d=this.model.get("windowParams"),c=c.get("style"),e="";c&&(e=(-1===a.indexOf("?")?"?":"&")+"style="+c);a=a.replace(/\&\;/g,"&")+e;a=window.open(a,"ForwardMail",d);null!==a&&(a.focus(),a.opener=window)}}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,n,t){e.Views.SendMailControl=e.Views.Control.extend({template:n.templates["chat/controls/send_mail"],events:t.extend({},e.Views.Control.prototype.events,{click:"sendMail"}),sendMail:function(){var n=this.model.get("link"),t=e.Objects.Models.page;if(n){var l=this.model.get("windowParams"),o=t.get("style"),i="";o&&(i=(-1===n.indexOf("?")?"?":"&")+"style="+o),n=n.replace(/\&\;/g,"&")+i;var a=window.open(n,"ForwardMail",l);null!==a&&(a.focus(),a.opener=window)}}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/sound.js b/src/mibew/js/compiled/chat/model_views/controls/sound.js
index 195f29d5..32a9a1ba 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/sound.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/sound.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b,c){a.Views.SoundControl=a.Views.Control.extend({template:b.templates["chat/controls/sound"],events:c.extend({},a.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.toggle()}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,o){e.Views.SoundControl=e.Views.Control.extend({template:t.templates["chat/controls/sound"],events:o.extend({},e.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.toggle()}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/controls/user_name.js b/src/mibew/js/compiled/chat/model_views/controls/user_name.js
index 73c465cf..b1b7a715 100644
--- a/src/mibew/js/compiled/chat/model_views/controls/user_name.js
+++ b/src/mibew/js/compiled/chat/model_views/controls/user_name.js
@@ -1,9 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,c,d){b.Views.UserNameControl=b.Views.Control.extend({template:c.templates["chat/controls/user_name"],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,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,n,t){e.Views.UserNameControl=e.Views.Control.extend({template:n.templates["chat/controls/user_name"],events:t.extend({},e.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(){e.Objects.Models.user.on("change:name",this.hideNameInput,this),this.nameInput=e.Objects.Models.user.get("defaultName")},serializeData:function(){var n=this.model.toJSON();return n.user=e.Objects.Models.user.toJSON(),n.nameInput=this.nameInput,n},inputKeyDown:function(e){var n=e.which;(13==n||10==n)&&this.changeName()},hideNameInput:function(){this.nameInput=!1,this.render()},showNameInput:function(){this.nameInput=!0,this.render()},changeName:function(){var e=this.ui.nameInput.val();this.model.changeName(e)}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_description.js b/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_description.js
index 37bcb580..ee065d81 100644
--- a/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_description.js
+++ b/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_description.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b,c){a.Views.LeaveMessageDescription=b.Marionette.ItemView.extend({template:c.templates["leave_message/description"],serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,a){e.Views.LeaveMessageDescription=t.Marionette.ItemView.extend({template:a.templates["leave_message/description"],serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_form.js b/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_form.js
index a7a2e797..3861201f 100644
--- a/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_form.js
+++ b/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_form.js
@@ -1,9 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(d,e,b){var c=d.Views.BaseSurveyForm;d.Views.LeaveMessageForm=c.extend({template:e.templates["leave_message/form"],events:b.extend({},c.prototype.events,{"click #send-message":"submitForm"}),ui:b.extend({},c.prototype.ui,{captcha:'input[name="captcha"]',captchaImg:"#captcha-img"}),modelEvents:b.extend({},c.prototype.modelEvents,{"submit:error":"hideAjaxLoader showError submitError"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());
-a.name=this.ui.name.val()||"";a.email=this.ui.email.val()||"";a.message=this.ui.message.val()||"";this.model.get("showCaptcha")&&(a.captcha=this.ui.captcha.val()||"");this.model.set(a,{validate:!0});this.model.submit()},submitError:function(a,c){if(c.code==a.ERROR_WRONG_CAPTCHA&&a.get("showCaptcha")){var b=this.ui.captchaImg.attr("src"),b=b.replace(/\?d\=[0-9]+/,"");this.ui.captchaImg.attr("src",b+"?d="+(new Date).getTime())}}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,a){var s=e.Views.BaseSurveyForm;e.Views.LeaveMessageForm=s.extend({template:t.templates["leave_message/form"],events:a.extend({},s.prototype.events,{"click #send-message":"submitForm"}),ui:a.extend({},s.prototype.ui,{captcha:'input[name="captcha"]',captchaImg:"#captcha-img"}),modelEvents:a.extend({},s.prototype.modelEvents,{"submit:error":"hideAjaxLoader showError submitError"}),submitForm:function(){this.showAjaxLoader();var e={};this.model.get("groups")&&(e.groupId=this.ui.groupSelect.val()),e.name=this.ui.name.val()||"",e.email=this.ui.email.val()||"",e.message=this.ui.message.val()||"",this.model.get("showCaptcha")&&(e.captcha=this.ui.captcha.val()||""),this.model.set(e,{validate:!0}),this.model.submit()},submitError:function(e,t){if(t.code==e.ERROR_WRONG_CAPTCHA&&e.get("showCaptcha")){var a=this.ui.captchaImg.attr("src");a=a.replace(/\?d\=[0-9]+/,""),this.ui.captchaImg.attr("src",a+"?d="+(new Date).getTime())}}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_sent_description.js b/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_sent_description.js
index 62d00862..b9e9c9cf 100644
--- a/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_sent_description.js
+++ b/src/mibew/js/compiled/chat/model_views/leave_message/leave_message_sent_description.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b,c){a.Views.LeaveMessageSentDescription=b.Marionette.ItemView.extend({template:c.templates["leave_message/sent_description"],serializeData:function(){return{page:a.Objects.Models.page.toJSON()}}})})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,a){e.Views.LeaveMessageSentDescription=t.Marionette.ItemView.extend({template:a.templates["leave_message/sent_description"],serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/messages/message.js b/src/mibew/js/compiled/chat/model_views/messages/message.js
index b6b5c160..d1bbb4e0 100644
--- a/src/mibew/js/compiled/chat/model_views/messages/message.js
+++ b/src/mibew/js/compiled/chat/model_views/messages/message.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Views.Message=a.Views.Message.extend({template:b.templates["chat/message"]})})(Mibew,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,s){e.Views.Message=e.Views.Message.extend({template:s.templates["chat/message"]})}(Mibew,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/messages/message_form.js b/src/mibew/js/compiled/chat/model_views/messages/message_form.js
index e05f5365..ef716678 100644
--- a/src/mibew/js/compiled/chat/model_views/messages/message_form.js
+++ b/src/mibew/js/compiled/chat/model_views/messages/message_form.js
@@ -1,11 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,d,e){b.Views.MessageForm=d.Marionette.ItemView.extend({template:e.templates["chat/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,c=""!=this.ui.message.val();c!=a.get("typing")&&a.set({typing:c})},setFocus:function(){this.focused=!0},dropFocus:function(){this.focused=!1}})})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,s,t){e.Views.MessageForm=s.Marionette.ItemView.extend({template:t.templates["chat/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(){e.Objects.Models.user.on("change:canPost",this.render,this)},serializeData:function(){var s=this.model.toJSON();return s.user=e.Objects.Models.user.toJSON(),s},postMessage:function(){var s=this.ui.message.val();""!=s&&(this.disableInput(),this.model.postMessage(s)),e.Objects.Collections.messages.on("multiple:add",this.postMessageComplete,this)},messageKeyDown:function(e){var s=e.which,t=e.ctrlKey;(13==s&&(t||this.model.get("ignoreCtrl"))||10==s)&&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(),e.Objects.Collections.messages.off("multiple:add",this.postMessageComplete,this)},selectPredefinedAnswer:function(){var e=this.ui.message,s=this.ui.predefinedAnswer,t=s.get(0).selectedIndex;t&&(e.val(this.model.get("predefinedAnswers")[t-1].full).change(),e.focus(),s.get(0).selectedIndex=0)},checkUserTyping:function(){var s=e.Objects.Models.user,t=""!=this.ui.message.val();t!=s.get("typing")&&s.set({typing:t})},setFocus:function(){this.focused=!0},dropFocus:function(){this.focused=!1}})}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/status/base_status.js b/src/mibew/js/compiled/chat/model_views/status/base_status.js
index 19b80d0a..80cd33fa 100644
--- a/src/mibew/js/compiled/chat/model_views/status/base_status.js
+++ b/src/mibew/js/compiled/chat/model_views/status/base_status.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b,c){a.Views.Status=b.Marionette.ItemView.extend({template:c.templates["chat/status/base"],className:"status",modelEvents:{change:"render"},onBeforeRender:function(){this.model.get("visible")?this.$el.show():this.$el.hide()}})})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,s){e.Views.Status=t.Marionette.ItemView.extend({template:s.templates["chat/status/base"],className:"status",modelEvents:{change:"render"},onBeforeRender:function(){this.model.get("visible")?this.$el.show():this.$el.hide()}})}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/status/message.js b/src/mibew/js/compiled/chat/model_views/status/message.js
index b2ee34c3..61532677 100644
--- a/src/mibew/js/compiled/chat/model_views/status/message.js
+++ b/src/mibew/js/compiled/chat/model_views/status/message.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Views.StatusMessage=a.Views.Status.extend({template:b.templates["chat/status/message"]})})(Mibew,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t){e.Views.StatusMessage=e.Views.Status.extend({template:t.templates["chat/status/message"]})}(Mibew,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/status/typing.js b/src/mibew/js/compiled/chat/model_views/status/typing.js
index 5bd9e692..40439206 100644
--- a/src/mibew/js/compiled/chat/model_views/status/typing.js
+++ b/src/mibew/js/compiled/chat/model_views/status/typing.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Views.StatusTyping=a.Views.Status.extend({template:b.templates["chat/status/typing"]})})(Mibew,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(t,e){t.Views.StatusTyping=t.Views.Status.extend({template:e.templates["chat/status/typing"]})}(Mibew,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/survey/base_survey_form.js b/src/mibew/js/compiled/chat/model_views/survey/base_survey_form.js
index 07f731e6..4c9d6a05 100644
--- a/src/mibew/js/compiled/chat/model_views/survey/base_survey_form.js
+++ b/src/mibew/js/compiled/chat/model_views/survey/base_survey_form.js
@@ -1,9 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(c,d){c.Views.BaseSurveyForm=d.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors",ajaxLoader:"#ajax-loader"},modelEvents:{invalid:"hideAjaxLoader showError","submit:error":"hideAjaxLoader showError"},preventSubmit:function(a){a.preventDefault()},
-changeGroupDescription:function(){var a=this.ui.groupSelect.prop("selectedIndex"),a=this.model.get("groups")[a].description||"";this.ui.groupDescription.text(a)},showError:function(a,b){this.ui.errors.html("string"==typeof b?b:b.message)},serializeData:function(){var a=this.model.toJSON();a.page=c.Objects.Models.page.toJSON();return a},showAjaxLoader:function(){this.ui.ajaxLoader.show()},hideAjaxLoader:function(){this.ui.ajaxLoader.hide()}})})(Mibew,Backbone);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,r){e.Views.BaseSurveyForm=r.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors",ajaxLoader:"#ajax-loader"},modelEvents:{invalid:"hideAjaxLoader showError","submit:error":"hideAjaxLoader showError"},preventSubmit:function(e){e.preventDefault()},changeGroupDescription:function(){var e=this.ui.groupSelect.prop("selectedIndex"),r=this.model.get("groups")[e].description||"";this.ui.groupDescription.text(r)},showError:function(e,r){var o;o="string"==typeof r?r:r.message,this.ui.errors.html(o)},serializeData:function(){var r=this.model.toJSON();return r.page=e.Objects.Models.page.toJSON(),r},showAjaxLoader:function(){this.ui.ajaxLoader.show()},hideAjaxLoader:function(){this.ui.ajaxLoader.hide()}})}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/model_views/survey/survey_form.js b/src/mibew/js/compiled/chat/model_views/survey/survey_form.js
index fc849292..de203661 100644
--- a/src/mibew/js/compiled/chat/model_views/survey/survey_form.js
+++ b/src/mibew/js/compiled/chat/model_views/survey/survey_form.js
@@ -1,9 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,d,e){var c=b.Views.BaseSurveyForm;b.Views.SurveyForm=c.extend({template:d.templates["survey/form"],events:e.extend({},c.prototype.events,{"click #submit-survey":"submitForm"}),submitForm:function(){this.showAjaxLoader();var a={};this.model.get("groups")&&(a.groupId=this.ui.groupSelect.val());this.model.get("canChangeName")&&(a.name=this.ui.name.val()||"");this.model.get("showEmail")&&(a.email=this.ui.email.val()||"");this.model.get("showMessage")&&(a.message=this.ui.message.val()||"");
-this.model.set(a,{validate:!0});this.model.submit()}})})(Mibew,Handlebars,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,s,t){var i=e.Views.BaseSurveyForm;e.Views.SurveyForm=i.extend({template:s.templates["survey/form"],events:t.extend({},i.prototype.events,{"click #submit-survey":"submitForm"}),submitForm:function(){this.showAjaxLoader();var e={};this.model.get("groups")&&(e.groupId=this.ui.groupSelect.val()),this.model.get("canChangeName")&&(e.name=this.ui.name.val()||""),this.model.get("showEmail")&&(e.email=this.ui.email.val()||""),this.model.get("showMessage")&&(e.message=this.ui.message.val()||""),this.model.set(e,{validate:!0}),this.model.submit()}})}(Mibew,Handlebars,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/chat/models/avatar.js b/src/mibew/js/compiled/chat/models/avatar.js
index 59d86740..9dbd3f84 100644
--- a/src/mibew/js/compiled/chat/models/avatar.js
+++ b/src/mibew/js/compiled/chat/models/avatar.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,c){b.Models.Avatar=b.Models.Base.extend({defaults:{imageLink:!1},initialize:function(){this.registeredFunctions=[];this.registeredFunctions.push(b.Objects.server.registerFunction("setupAvatar",c.bind(this.apiSetupAvatar,this)))},finalize:function(){for(var a=0;al;l++)s=t.messages[l],s.kind==i?"object"==typeof s.data&&null!==s.data&&(o=s.plugin||!1,n="process:"+(o!==!1?o+":":"")+"plugin:message",a={messageData:s,model:!1},this.trigger(n,a),a.model&&(a.model.get("id")||a.model.set({id:s.id}),r.push(a.model))):r.push(new e.Models.Message(s));r.length>0&&this.add(r)},updateMessagesFunctionBuilder:function(){var t=e.Objects.Models.thread,s=e.Objects.Models.user;return[{"function":"updateMessages",arguments:{"return":{messages:"messages",lastId:"lastId"},references:{},threadId:t.get("id"),token:t.get("token"),lastId:t.get("lastId"),user:!s.get("isAgent")}}]},add:function(){var e=Array.prototype.slice.apply(arguments),s=t.Collection.prototype.add.apply(this,e);return this.trigger("multiple:add"),s}})}(Mibew,Backbone,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Collections.Status=t.Collection.extend({comparator:function(e){return e.get("weight")}})}(Mibew,Backbone),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.Status=t.Marionette.ItemView.extend({template:s.templates["chat/status/base"],className:"status",modelEvents:{change:"render"},onBeforeRender:function(){this.model.get("visible")?this.$el.show():this.$el.hide()}})}(Mibew,Backbone,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Views.BaseSurveyForm=t.Marionette.ItemView.extend({events:{'change select[name="group"]':"changeGroupDescription","submit form":"preventSubmit"},ui:{groupSelect:'select[name="group"]',groupDescription:"#groupDescription",name:'input[name="name"]',email:'input[name="email"]',message:'textarea[name="message"]',errors:".errors",ajaxLoader:"#ajax-loader"},modelEvents:{invalid:"hideAjaxLoader showError","submit:error":"hideAjaxLoader showError"},preventSubmit:function(e){e.preventDefault()},changeGroupDescription:function(){var e=this.ui.groupSelect.prop("selectedIndex"),t=this.model.get("groups")[e].description||"";this.ui.groupDescription.text(t)},showError:function(e,t){var s;s="string"==typeof t?t:t.message,this.ui.errors.html(s)},serializeData:function(){var t=this.model.toJSON();return t.page=e.Objects.Models.page.toJSON(),t},showAjaxLoader:function(){this.ui.ajaxLoader.show()},hideAjaxLoader:function(){this.ui.ajaxLoader.hide()}})}(Mibew,Backbone),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.Avatar=t.Marionette.ItemView.extend({template:s.templates["chat/avatar"],className:"avatar",modelEvents:{change:"render"}})}(Mibew,Backbone,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.CloseControl=e.Views.Control.extend({template:t.templates["chat/controls/close"],events:s.extend({},e.Views.Control.prototype.events,{click:"closeThread"}),closeThread:function(){var t=e.Localization.get("Are you sure want to leave chat?");(t===!1||confirm(t))&&this.model.closeThread()}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.HistoryControl=e.Views.Control.extend({template:t.templates["chat/controls/history"],events:s.extend({},e.Views.Control.prototype.events,{click:"showHistory"}),showHistory:function(){var t=e.Objects.Models.user,s=this.model.get("link");if(t.get("isAgent")&&s){var o=this.model.get("windowParams");s=s.replace("&","&","g");var n=window.open(s,"UserHistory",o);null!==n&&(n.focus(),n.opener=window)}}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.RedirectControl=e.Views.Control.extend({template:t.templates["chat/controls/redirect"],events:s.extend({},e.Views.Control.prototype.events,{click:"redirect"}),initialize:function(){e.Objects.Models.user.on("change",this.render,this)},serializeData:function(){var t=this.model.toJSON();return t.user=e.Objects.Models.user.toJSON(),t},redirect:function(){var t=e.Objects.Models.user;if(t.get("isAgent")&&t.get("canPost")){var s=this.model.get("link");if(s){var o=e.Objects.Models.page.get("style"),n="";o&&(n=(-1===s.indexOf("?")?"?":"&")+"style="+o),window.location.href=s.replace(/\&\;/g,"&")+n}}}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.RefreshControl=e.Views.Control.extend({template:t.templates["chat/controls/refresh"],events:s.extend({},e.Views.Control.prototype.events,{click:"refresh"}),refresh:function(){this.model.refresh()}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.SecureModeControl=e.Views.Control.extend({template:t.templates["chat/controls/secure_mode"],events:s.extend({},e.Views.Control.prototype.events,{click:"secure"}),secure:function(){var t=this.model.get("link");if(t){var s=e.Objects.Models.page.get("style");window.location.href=t.replace(/\&\;/g,"&")+(s?"&style="+s:"")}}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.SendMailControl=e.Views.Control.extend({template:t.templates["chat/controls/send_mail"],events:s.extend({},e.Views.Control.prototype.events,{click:"sendMail"}),sendMail:function(){var t=this.model.get("link"),s=e.Objects.Models.page;if(t){var o=this.model.get("windowParams"),n=s.get("style"),a="";n&&(a=(-1===t.indexOf("?")?"?":"&")+"style="+n),t=t.replace(/\&\;/g,"&")+a;var i=window.open(t,"ForwardMail",o);null!==i&&(i.focus(),i.opener=window)}}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.SoundControl=e.Views.Control.extend({template:t.templates["chat/controls/sound"],events:s.extend({},e.Views.Control.prototype.events,{click:"toggle"}),toggle:function(){this.model.toggle()}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.UserNameControl=e.Views.Control.extend({template:t.templates["chat/controls/user_name"],events:s.extend({},e.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(){e.Objects.Models.user.on("change:name",this.hideNameInput,this),this.nameInput=e.Objects.Models.user.get("defaultName")},serializeData:function(){var t=this.model.toJSON();return t.user=e.Objects.Models.user.toJSON(),t.nameInput=this.nameInput,t},inputKeyDown:function(e){var t=e.which;(13==t||10==t)&&this.changeName()},hideNameInput:function(){this.nameInput=!1,this.render()},showNameInput:function(){this.nameInput=!0,this.render()},changeName:function(){var e=this.ui.nameInput.val();this.model.changeName(e)}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.LeaveMessageDescription=t.Marionette.ItemView.extend({template:s.templates["leave_message/description"],serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){var o=e.Views.BaseSurveyForm;e.Views.LeaveMessageForm=o.extend({template:t.templates["leave_message/form"],events:s.extend({},o.prototype.events,{"click #send-message":"submitForm"}),ui:s.extend({},o.prototype.ui,{captcha:'input[name="captcha"]',captchaImg:"#captcha-img"}),modelEvents:s.extend({},o.prototype.modelEvents,{"submit:error":"hideAjaxLoader showError submitError"}),submitForm:function(){this.showAjaxLoader();var e={};this.model.get("groups")&&(e.groupId=this.ui.groupSelect.val()),e.name=this.ui.name.val()||"",e.email=this.ui.email.val()||"",e.message=this.ui.message.val()||"",this.model.get("showCaptcha")&&(e.captcha=this.ui.captcha.val()||""),this.model.set(e,{validate:!0}),this.model.submit()},submitError:function(e,t){if(t.code==e.ERROR_WRONG_CAPTCHA&&e.get("showCaptcha")){var s=this.ui.captchaImg.attr("src");s=s.replace(/\?d\=[0-9]+/,""),this.ui.captchaImg.attr("src",s+"?d="+(new Date).getTime())}}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.LeaveMessageSentDescription=t.Marionette.ItemView.extend({template:s.templates["leave_message/sent_description"],serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Views.Message=e.Views.Message.extend({template:t.templates["chat/message"]})}(Mibew,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){e.Views.MessageForm=t.Marionette.ItemView.extend({template:s.templates["chat/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(){e.Objects.Models.user.on("change:canPost",this.render,this)},serializeData:function(){var t=this.model.toJSON();return t.user=e.Objects.Models.user.toJSON(),t},postMessage:function(){var t=this.ui.message.val();""!=t&&(this.disableInput(),this.model.postMessage(t)),e.Objects.Collections.messages.on("multiple:add",this.postMessageComplete,this)},messageKeyDown:function(e){var t=e.which,s=e.ctrlKey;(13==t&&(s||this.model.get("ignoreCtrl"))||10==t)&&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(),e.Objects.Collections.messages.off("multiple:add",this.postMessageComplete,this)},selectPredefinedAnswer:function(){var e=this.ui.message,t=this.ui.predefinedAnswer,s=t.get(0).selectedIndex;s&&(e.val(this.model.get("predefinedAnswers")[s-1].full).change(),e.focus(),t.get(0).selectedIndex=0)},checkUserTyping:function(){var t=e.Objects.Models.user,s=""!=this.ui.message.val();s!=t.get("typing")&&t.set({typing:s})},setFocus:function(){this.focused=!0},dropFocus:function(){this.focused=!1}})}(Mibew,Backbone,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Views.StatusMessage=e.Views.Status.extend({template:t.templates["chat/status/message"]})}(Mibew,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Views.StatusTyping=e.Views.Status.extend({template:t.templates["chat/status/typing"]})}(Mibew,Handlebars),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t,s){var o=e.Views.BaseSurveyForm;e.Views.SurveyForm=o.extend({template:t.templates["survey/form"],events:s.extend({},o.prototype.events,{"click #submit-survey":"submitForm"}),submitForm:function(){this.showAjaxLoader();var e={};this.model.get("groups")&&(e.groupId=this.ui.groupSelect.val()),this.model.get("canChangeName")&&(e.name=this.ui.name.val()||""),this.model.get("showEmail")&&(e.email=this.ui.email.val()||""),this.model.get("showMessage")&&(e.message=this.ui.message.val()||""),this.model.set(e,{validate:!0}),this.model.submit()}})}(Mibew,Handlebars,_),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e){e.Views.MessagesCollection=e.Views.CollectionBase.extend({itemView:e.Views.Message,className:"messages-collection"})}(Mibew),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e){e.Views.StatusCollection=e.Views.CollectionBase.extend({itemView:e.Views.Status,className:"status-collection"})}(Mibew),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Regions.Messages=t.Marionette.Region.extend({onShow:function(e){e.on("after:item:added",this.scrollToBottom,this)},scrollToBottom:function(){this.$el.scrollTop(this.$el.prop("scrollHeight"))}})}(Mibew,Backbone),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Layouts.Chat=t.Marionette.Layout.extend({template:Handlebars.templates["chat/layout"],regions:{controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:{selector:"#messages-region",regionType:e.Regions.Messages},statusRegion:"#status-region",messageFormRegion:"#message-form-region"},serializeData:function(){var t=e.Objects.Models;return{page:t.page.toJSON(),user:t.user.toJSON()}}})}(Mibew,Backbone),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Layouts.Invitation=t.Marionette.Layout.extend({template:Handlebars.templates["invitation/layout"],regions:{messagesRegion:{selector:"#invitation-messages-region",regionType:e.Regions.Messages}}})}(Mibew,Backbone),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Layouts.LeaveMessage=t.Marionette.Layout.extend({template:Handlebars.templates["leave_message/layout"],regions:{leaveMessageFormRegion:"#content-wrapper",descriptionRegion:"#description-region"},serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e,t){e.Layouts.Survey=t.Marionette.Layout.extend({template:Handlebars.templates["survey/layout"],regions:{surveyFormRegion:"#content-wrapper"},serializeData:function(){return{page:e.Objects.Models.page.toJSON()}}})}(Mibew,Backbone),/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function(e){e.Objects.Models.Controls={},e.Objects.Models.Status={};var t=[],s=e.Application,o=s.module("Chat",{startWithParent:!1});o.addInitializer(function(o){var n=e.Objects,a=e.Objects.Models,i=e.Objects.Models.Controls,r=e.Objects.Models.Status;o.page&&a.page.set(o.page),a.thread=new e.Models.Thread(o.thread),a.user=new e.Models.ChatUser(o.user);var l=new e.Layouts.Chat;n.chatLayout=l,s.mainRegion.show(l);var d=new e.Collections.Controls;a.user.get("isAgent")||(i.userName=new e.Models.UserNameControl({weight:220}),d.add(i.userName),i.sendMail=new e.Models.SendMailControl({weight:200,link:o.links.mail,windowParams:o.windowsParams.mail}),d.add(i.sendMail)),a.user.get("isAgent")&&(i.redirect=new e.Models.RedirectControl({weight:200,link:o.links.redirect}),d.add(i.redirect),i.history=new e.Models.HistoryControl({weight:180,link:o.links.history,windowParams:o.windowsParams.history}),d.add(i.history)),i.sound=new e.Models.SoundControl({weight:160}),d.add(i.sound),i.refresh=new e.Models.RefreshControl({weight:140}),d.add(i.refresh),o.links.ssl&&(i.secureMode=new e.Models.SecureModeControl({weight:120,link:o.links.ssl}),d.add(i.secureMode)),i.close=new e.Models.CloseControl({weight:100}),d.add(i.close),n.Collections.controls=d,l.controlsRegion.show(new e.Views.ControlsCollection({collection:d})),r.message=new e.Models.StatusMessage({hideTimeout:5e3}),r.typing=new e.Models.StatusTyping({hideTimeout:5e3}),n.Collections.status=new e.Collections.Status([r.message,r.typing]),l.statusRegion.show(new e.Views.StatusCollection({collection:n.Collections.status})),a.user.get("isAgent")||(a.avatar=new e.Models.Avatar,l.avatarRegion.show(new e.Views.Avatar({model:a.avatar}))),n.Collections.messages=new e.Collections.Messages,a.messageForm=new e.Models.MessageForm(o.messageForm),l.messageFormRegion.show(new e.Views.MessageForm({model:a.messageForm})),l.messagesRegion.show(new e.Views.MessagesCollection({collection:n.Collections.messages})),a.soundManager=new e.Models.ChatSoundManager,t.push(n.server.callFunctionsPeriodically(function(){var t=e.Objects.Models.thread,s=e.Objects.Models.user;return[{"function":"update",arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:t.get("id"),token:t.get("token"),lastId:t.get("lastId"),typed:s.get("typing"),user:!s.get("isAgent")}}]},function(t){return t.errorCode?void e.Objects.Models.Status.message.setMessage(t.errorMessage||"refresh failed"):(t.typing&&e.Objects.Models.Status.typing.show(),void e.Objects.Models.user.set({canPost:t.canPost||!1}))}))}),o.on("start",function(){e.Objects.server.restartUpdater()}),o.addFinalizer(function(){e.Objects.chatLayout.close();for(var s=0;s$2$1>");a=a.replace(/<span class="(.*?)">(.*?)<\/span>/g,'$2');
-return new c.SafeString(a)});c.registerHelper("formatTime",function(a){var b=new Date(1E3*a);a=b.getHours().toString();var c=b.getMinutes().toString(),b=b.getSeconds().toString();return(10>a?"0"+a:a)+":"+(10>c?"0"+c:c)+":"+(10>b?"0"+b:b)});c.registerHelper("urlReplace",function(a){return new c.SafeString(a.replace(/((?:https?|ftp):\/\/\S*)/g,'$1'))});c.registerHelper("nl2br",function(a){return new c.SafeString(a.replace(/\n/g," "))});c.registerHelper("l10n",function(a){return e.Localization.get(a)||
-""});c.registerHelper("ifEven",function(a,b){return 0===a%2?b.fn(this):b.inverse(this)});c.registerHelper("ifOdd",function(a,b){return 0!==a%2?b.fn(this):b.inverse(this)})})(Mibew,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,r){r.registerHelper("apply",function(e,t){var n=e,i=/^[0-9A-z_]+$/;t=t.split(/\s*,\s*/);for(var s in t)if(t.hasOwnProperty(s)&&i.test(t[s])){if("function"!=typeof r.helpers[t[s]])throw new Error("Unregistered helper '"+t[s]+"'!");n=r.helpers[t[s]](n).toString()}return new r.SafeString(n)}),r.registerHelper("allowTags",function(e){var t=e;return t=t.replace(/<(span|strong)>(.*?)<\/\1>/g,"<$1>$2$1>"),t=t.replace(/<span class="(.*?)">(.*?)<\/span>/g,'$2'),new r.SafeString(t)}),r.registerHelper("formatTime",function(e){var r=new Date(1e3*e),t=r.getHours().toString(),n=r.getMinutes().toString(),i=r.getSeconds().toString();return t=10>t?"0"+t:t,n=10>n?"0"+n:n,i=10>i?"0"+i:i,t+":"+n+":"+i}),r.registerHelper("urlReplace",function(e){return new r.SafeString(e.replace(/((?:https?|ftp):\/\/\S*)/g,'$1'))}),r.registerHelper("nl2br",function(e){return new r.SafeString(e.replace(/\n/g," "))}),r.registerHelper("l10n",function(r){return e.Localization.get(r)||""}),r.registerHelper("ifEven",function(e,r){return e%2===0?r.fn(this):r.inverse(this)}),r.registerHelper("ifOdd",function(e,r){return e%2!==0?r.fn(this):r.inverse(this)})}(Mibew,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/init.js b/src/mibew/js/compiled/default/init.js
index 387a6c41..0093db82 100644
--- a/src/mibew/js/compiled/default/init.js
+++ b/src/mibew/js/compiled/default/init.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-var Mibew={};(function(a,d,b){d.Marionette.TemplateCache.prototype.compileTemplate=function(a){return b.compile(a)};for(var c in b.templates)b.templates.hasOwnProperty(c)&&b.registerPartial(c,b.templates[c]);a.Models={};a.Collections={};a.Views={};a.Objects={};a.Objects.Models={};a.Objects.Collections={}})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+var Mibew={};!function(e,t,o){t.Marionette.TemplateCache.prototype.compileTemplate=function(e){return o.compile(e)};for(var a in o.templates)o.templates.hasOwnProperty(a)&&o.registerPartial(a,o.templates[a]);e.Models={},e.Collections={},e.Views={},e.Objects={},e.Objects.Models={},e.Objects.Collections={}}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/localization.js b/src/mibew/js/compiled/default/localization.js
index 8eaa7613..ce8b499b 100644
--- a/src/mibew/js/compiled/default/localization.js
+++ b/src/mibew/js/compiled/default/localization.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(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,_);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(n,t){n.Localization={};var i={};n.Localization.get=function(n){return i.hasOwnProperty(n)?i[n]:!1},n.Localization.set=function(n){t.extend(i,n)}}(Mibew,_);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/model_views/control.js b/src/mibew/js/compiled/default/model_views/control.js
index 7ca9274b..bbdbd020 100644
--- a/src/mibew/js/compiled/default/model_views/control.js
+++ b/src/mibew/js/compiled/default/model_views/control.js
@@ -1,9 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,c,d){b.Views.Control=c.Marionette.ItemView.extend({template:d.templates.default_control,modelEvents:{change:"render"},events:{mouseover:"mouseOver",mouseleave:"mouseLeave"},attributes:function(){var a=[];a.push("control");this.className&&(a.push(this.className),this.className="");var b=this.getDashedControlType();b&&a.push(b);return{"class":a.join(" ")}},mouseOver:function(){var a=this.getDashedControlType();this.$el.addClass("active"+(a?"-"+a:""))},mouseLeave:function(){var a=this.getDashedControlType();
-this.$el.removeClass("active"+(a?"-"+a:""))},getDashedControlType:function(){"undefined"==typeof this.dashedControlType&&(this.dashedControlType=b.Utils.toDashFormat(this.model.getModelType())||"");return this.dashedControlType}})})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,s){e.Views.Control=t.Marionette.ItemView.extend({template:s.templates.default_control,modelEvents:{change:"render"},events:{mouseover:"mouseOver",mouseleave:"mouseLeave"},attributes:function(){var e=[];e.push("control"),this.className&&(e.push(this.className),this.className="");var t=this.getDashedControlType();return t&&e.push(t),{"class":e.join(" ")}},mouseOver:function(){var e=this.getDashedControlType();this.$el.addClass("active"+(e?"-"+e:""))},mouseLeave:function(){var e=this.getDashedControlType();this.$el.removeClass("active"+(e?"-"+e:""))},getDashedControlType:function(){return"undefined"==typeof this.dashedControlType&&(this.dashedControlType=e.Utils.toDashFormat(this.model.getModelType())||""),this.dashedControlType}})}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/model_views/message.js b/src/mibew/js/compiled/default/model_views/message.js
index 70af6a63..9f3fe8fc 100644
--- a/src/mibew/js/compiled/default/model_views/message.js
+++ b/src/mibew/js/compiled/default/model_views/message.js
@@ -1,9 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(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":a==this.model.KIND_PLUGIN?"plugin":""},escapeString:function(a){return a.replace(g,function(a){return f[a]||"&"})}})})(Mibew,Backbone,Handlebars);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,t,n){var i={"<":"<",">":">","&":"&",'"':""","'":"'","`":"`"},s=/[&<>'"`]/g;e.Views.Message=t.Marionette.ItemView.extend({template:n.templates.message,className:"message",modelEvents:{change:"render"},serializeData:function(){var e=this.model.toJSON(),t=this.model.get("kind");return e.allowFormatting=t!=this.model.KIND_USER&&t!=this.model.KIND_AGENT,e.kindName=this.kindToString(t),e.message=this.escapeString(e.message),e},kindToString:function(e){return e==this.model.KIND_USER?"user":e==this.model.KIND_AGENT?"agent":e==this.model.KIND_FOR_AGENT?"hidden":e==this.model.KIND_INFO?"inf":e==this.model.KIND_CONN?"conn":e==this.model.KIND_EVENTS?"event":e==this.model.KIND_PLUGIN?"plugin":""},escapeString:function(e){return e.replace(s,function(e){return i[e]||"&"})}})}(Mibew,Backbone,Handlebars);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/models/base.js b/src/mibew/js/compiled/default/models/base.js
index 619e87a9..890cdb8a 100644
--- a/src/mibew/js/compiled/default/models/base.js
+++ b/src/mibew/js/compiled/default/models/base.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Models.Base=b.Model.extend({getModelType:function(){return""}})})(Mibew,Backbone);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,n){e.Models.Base=n.Model.extend({getModelType:function(){return""}})}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/models/control.js b/src/mibew/js/compiled/default/models/control.js
index ddaf0ad6..265a5f1e 100644
--- a/src/mibew/js/compiled/default/models/control.js
+++ b/src/mibew/js/compiled/default/models/control.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a){a.Models.Control=a.Models.Base.extend({defaults:{title:"",weight:0}})})(Mibew);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e){e.Models.Control=e.Models.Base.extend({defaults:{title:"",weight:0}})}(Mibew);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/models/message.js b/src/mibew/js/compiled/default/models/message.js
index 382fb4b8..437528e9 100644
--- a/src/mibew/js/compiled/default/models/message.js
+++ b/src/mibew/js/compiled/default/models/message.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a){a.Models.Message=a.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:"",plugin:"",data:{}},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6,KIND_PLUGIN:7})})(Mibew);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e){e.Models.Message=e.Models.Base.extend({defaults:{kind:null,created:0,name:"",message:"",plugin:"",data:{}},KIND_USER:1,KIND_AGENT:2,KIND_FOR_AGENT:3,KIND_INFO:4,KIND_CONN:5,KIND_EVENTS:6,KIND_PLUGIN:7})}(Mibew);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/models/page.js b/src/mibew/js/compiled/default/models/page.js
index 8e919a83..eb9bbdcf 100644
--- a/src/mibew/js/compiled/default/models/page.js
+++ b/src/mibew/js/compiled/default/models/page.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a,b){a.Models.Page=b.Model.extend()})(Mibew,Backbone);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e,n){e.Models.Page=n.Model.extend()}(Mibew,Backbone);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/models/thread.js b/src/mibew/js/compiled/default/models/thread.js
index d1322f00..653752cb 100644
--- a/src/mibew/js/compiled/default/models/thread.js
+++ b/src/mibew/js/compiled/default/models/thread.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(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,STATE_INVITED:6})})(Mibew);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(T){T.Models.Thread=T.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,STATE_INVITED:6})}(Mibew);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/models/user.js b/src/mibew/js/compiled/default/models/user.js
index af897b7e..715633ed 100644
--- a/src/mibew/js/compiled/default/models/user.js
+++ b/src/mibew/js/compiled/default/models/user.js
@@ -1,8 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(a){a.Models.User=a.Models.Base.extend({defaults:{isAgent:!1,name:""}})})(Mibew);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(e){e.Models.User=e.Models.Base.extend({defaults:{isAgent:!1,name:""}})}(Mibew);
\ No newline at end of file
diff --git a/src/mibew/js/compiled/default/server.js b/src/mibew/js/compiled/default/server.js
index 507bb4f9..1496786c 100644
--- a/src/mibew/js/compiled/default/server.js
+++ b/src/mibew/js/compiled/default/server.js
@@ -1,15 +1,8 @@
-/*
- Copyright 2005-2014 the original author or authors.
-
- Licensed under the Apache License, Version 2.0 (the "License").
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
-*/
-(function(b,f,g,e){b.Server=function(a){this.updateTimer=null;this.options=e.extend({url:"",requestsFrequency:2,reconnectPause:1,onTimeout:function(){},onTransportError:function(){},onCallError:function(){},onUpdateError:function(){},onResponseError:function(){}},a);this.callbacks={};this.callPeriodically={};this.callPeriodicallyLastId=0;this.ajaxRequest=null;this.buffer=[];this.functions={};this.functionsLastId=0;this.mibewAPI=new f(new this.options.interactionType)};b.Server.prototype.callFunctions=
-function(a,c,b){try{if(!(a instanceof Array))throw Error("The first arguments must be an array");for(var d=0;d()[\]\\.,;:\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)};
-c.Utils.playSound=function(a){var b=d('audio[data-file="'+a+'"]');0",{autoplay:!0,style:"display: none"}).append(''),d("body").append(b),d.isFunction(b.get(0).play)&&b.attr("data-file",a))}})(Mibew,$);
+/**
+ * @preserve Copyright 2005-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+!function(t,e){t.Utils={},t.Utils.toUpperCaseFirst=function(t){return"string"!=typeof t?!1:""===t?t:t.substring(0,1).toUpperCase()+t.substring(1)},t.Utils.toDashFormat=function(t){if("string"!=typeof t)return!1;for(var e=t.match(/((?:[A-Z]?[a-z]+)|(?:[A-Z][a-z]*))/g),a=0;a()[\]\\.,;:\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(t)},t.Utils.playSound=function(t){var a=e('audio[data-file="'+t+'"]');if(a.length>0)a.get(0).play();else{var i=e("