/*! * This file is a part of Mibew Messenger. * * Copyright 2005-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var Mibew={};!function(e,t,n){t.Marionette.TemplateCache.prototype.compileTemplate=function(e){return n.compile(e)};for(var i in n.templates)n.templates.hasOwnProperty(i)&&n.registerPartial(i,n.templates[i]);e.Models={},e.Collections={},e.Views={},e.Objects={},e.Objects.Models={},e.Objects.Collections={}}(Mibew,Backbone,Handlebars),/*! * This file is a part of Mibew Messenger. * * Copyright 2005-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function(e,t){t.registerHelper("formatTime",function(e){var t=new Date(1e3*e),n=t.getHours().toString(),i=t.getMinutes().toString(),r=t.getSeconds().toString();return n=10>n?"0"+n:n,i=10>i?"0"+i:i,r=10>r?"0"+r:r,n+":"+i+":"+r}),t.registerHelper("urlReplace",function(e){return new t.SafeString(e.toString().replace(/((?:https?|ftp):\/\/\S*)/g,'$1'))}),t.registerHelper("l10n",function(){var t=e.Localization,n=Array.prototype.slice;return t.trans.apply(t,n.call(arguments))}),t.registerHelper("ifEven",function(e,t){return e%2===0?t.fn(this):t.inverse(this)}),t.registerHelper("ifOdd",function(e,t){return e%2!==0?t.fn(this):t.inverse(this)}),t.registerHelper("ifAny",function(){for(var e=arguments.length,t=arguments[e-1],n=[].slice.call(arguments,0,e-1),i=0,r=n.length;r>i;i++)if(n[i])return t.fn(this);return t.inverse(this)}),t.registerHelper("ifEqual",function(e,t,n){return e==t?n.fn(this):n.inverse(this)}),t.registerHelper("repeat",function(e,t){for(var n="",i=t.fn(this),r=0;e>r;r++)n+=i;return n}),t.registerHelper("replace",function(e,t,n){var i=e.replace(/\\n/g,"\n").replace(/\\t/g," ").replace(/\\u([A-Za-z0-9])/g,function(e,t){return String.fromCharCode(parseInt(t,16))});return n.fn(this).split(i).join(t)}),t.registerHelper("cutString",function(e,t){return t.fn(this).substr(0,e)}),t.registerHelper("block",function(e,t){return this._blocksStorage&&this._blocksStorage.hasOwnProperty(e)?this._blocksStorage[e]:t.fn(this)}),t.registerHelper("extends",function(e,n){if(this._blocksStorage=this._blocksStorage||{},n.fn(this),!t.templates.hasOwnProperty(e))throw Error('Parent template "'+e+'" is not defined');return t.templates[e](this)}),t.registerHelper("override",function(e,t){return this._blocksStorage.hasOwnProperty(e)||(this._blocksStorage[e]=t.fn(this)),""}),t.registerHelper("ifOverridden",function(e,t){return this._blocksStorage&&this._blocksStorage.hasOwnProperty(e)?t.fn(this):t.inverse(this)}),t.registerHelper("unlessOverridden",function(e,t){return this._blocksStorage&&this._blocksStorage.hasOwnProperty(e)?t.inverse(this):t.fn(this)})}(Mibew,Handlebars),/*! * This file is a part of Mibew Messenger. * * Copyright 2005-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function(e,t){e.Localization={};var n={};e.Localization.trans=function(e){var t=Array.prototype.slice.call(arguments,1),i=n.hasOwnProperty(e)?n[e]:e;return i.replace(/\{([0-9]+)\}/g,function(e,n){return t[parseInt(n)]||""})},e.Localization.set=function(e){t.extend(n,e)}}(Mibew,_),/*! * This file is a part of Mibew Messenger. * * Copyright 2005-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function(e,t,n,i){e.Server=function(e){this.updateTimer=null,this.options=i.extend({url:"",requestsFrequency:2,reconnectPause:1,onTimeout:function(){},onTransportError:function(){},onCallError:function(e){},onUpdateError:function(e){},onResponseError:function(e){}},e),this.callbacks={},this.callPeriodically={},this.callPeriodicallyLastId=0,this.ajaxRequest=null,this.buffer=[],this.functions={},this.functionsLastId=0,this.mibewAPI=new t(new this.options.interactionType)},e.Server.prototype.callFunctions=function(e,t,n){try{if(!(e instanceof Array))throw new Error("The first arguments must be an array");for(var i=0;i0)n.get(0).play();else{var i=t("