diff --git a/src/messenger/webim/js/compiled/chat/app.js b/src/messenger/webim/js/compiled/chat/app.js index 2e8981b0..a1967eea 100644 --- a/src/messenger/webim/js/compiled/chat/app.js +++ b/src/messenger/webim/js/compiled/chat/app.js @@ -5,5 +5,5 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 */ -(function(a,d){var b=a.Application;b.addRegions({mainRegion:"#main-region"});b.addInitializer(function(c){a.Objects.server=new a.Server(d.extend({interactionType:MibewAPIChatInteraction},c.server));a.Objects.Models.page=new a.Models.Page(c.page);switch(c.startFrom){case "chat":b.Chat.start(c.chatOptions);break;case "survey":b.Survey.start(c.surveyOptions);break;case "leaveMessage":b.LeaveMessage.start(c.leaveMessageOptions);break;default:throw Error("Dont know how to start!");}});b.on("start",function(){a.Objects.server.runUpdater()})})(Mibew, -_); +(function(a,d){var c=a.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(b){a.PluginOptions=b.plugins||{};a.Objects.server=new a.Server(d.extend({interactionType:MibewAPIChatInteraction},b.server));a.Objects.Models.page=new a.Models.Page(b.page);switch(b.startFrom){case "chat":c.Chat.start(b.chatOptions);break;case "survey":c.Survey.start(b.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(b.leaveMessageOptions);break;default:throw Error("Dont know how to start!"); +}});c.on("start",function(){a.Objects.server.runUpdater()})})(Mibew,_); diff --git a/src/messenger/webim/js/compiled/chat_app.js b/src/messenger/webim/js/compiled/chat_app.js index e88e039d..e8c1d506 100644 --- a/src/messenger/webim/js/compiled/chat_app.js +++ b/src/messenger/webim/js/compiled/chat_app.js @@ -369,5 +369,5 @@ c.leaveMessageForm.on("submit:complete",function(){b.leaveMessageLayout.leaveMes You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 */ -(function(a,d){var b=a.Application;b.addRegions({mainRegion:"#main-region"});b.addInitializer(function(c){a.Objects.server=new a.Server(d.extend({interactionType:MibewAPIChatInteraction},c.server));a.Objects.Models.page=new a.Models.Page(c.page);switch(c.startFrom){case "chat":b.Chat.start(c.chatOptions);break;case "survey":b.Survey.start(c.surveyOptions);break;case "leaveMessage":b.LeaveMessage.start(c.leaveMessageOptions);break;default:throw Error("Dont know how to start!");}});b.on("start",function(){a.Objects.server.runUpdater()})})(Mibew, -_); +(function(a,d){var c=a.Application;c.addRegions({mainRegion:"#main-region"});c.addInitializer(function(b){a.PluginOptions=b.plugins||{};a.Objects.server=new a.Server(d.extend({interactionType:MibewAPIChatInteraction},b.server));a.Objects.Models.page=new a.Models.Page(b.page);switch(b.startFrom){case "chat":c.Chat.start(b.chatOptions);break;case "survey":c.Survey.start(b.surveyOptions);break;case "leaveMessage":c.LeaveMessage.start(b.leaveMessageOptions);break;default:throw Error("Dont know how to start!"); +}});c.on("start",function(){a.Objects.server.runUpdater()})})(Mibew,_); diff --git a/src/messenger/webim/js/compiled/users/app.js b/src/messenger/webim/js/compiled/users/app.js index 8342e306..545d0d8d 100644 --- a/src/messenger/webim/js/compiled/users/app.js +++ b/src/messenger/webim/js/compiled/users/app.js @@ -5,6 +5,6 @@ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 */ -(function(a,h,j){var c=0,g=function(){c++;10==c&&(alert(a.Localization.get("pending.errors.network")),c=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region"});b.addInitializer(function(e){var c=a.Objects,f=a.Objects.Models,d=a.Objects.Collections;c.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g},e.server));f.page= -new a.Models.Page(e.page);f.agent=new a.Models.Agent(e.agent);d.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:d.threads}));e.page.showOnlineOperators&&(d.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:d.visitors})));f.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:f.statusPanel}));e.page.showOnlineOperators&&(d.agents=new a.Collections.Agents,b.agentsRegion.show(new a.Views.AgentsCollection({collection:d.agents}))); -c.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:f.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_); +(function(a,h,j){var c=0,g=function(){c++;10==c&&(alert(a.Localization.get("pending.errors.network")),c=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region"});b.addInitializer(function(d){a.PluginOptions=d.plugins||{};var c=a.Objects,f=a.Objects.Models,e=a.Objects.Collections;c.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g}, +d.server));f.page=new a.Models.Page(d.page);f.agent=new a.Models.Agent(d.agent);e.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:e.threads}));d.page.showOnlineOperators&&(e.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:e.visitors})));f.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:f.statusPanel}));d.page.showOnlineOperators&&(e.agents=new a.Collections.Agents, +b.agentsRegion.show(new a.Views.AgentsCollection({collection:e.agents})));c.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:f.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_); diff --git a/src/messenger/webim/js/compiled/users_app.js b/src/messenger/webim/js/compiled/users_app.js index c47b0c78..a879df65 100644 --- a/src/messenger/webim/js/compiled/users_app.js +++ b/src/messenger/webim/js/compiled/users_app.js @@ -177,6 +177,6 @@ this)},updateTimers:function(){a.Utils.updateTimers(this.$el,".timesince")}})})( You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 */ -(function(a,h,j){var c=0,g=function(){c++;10==c&&(alert(a.Localization.get("pending.errors.network")),c=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region"});b.addInitializer(function(e){var c=a.Objects,f=a.Objects.Models,d=a.Objects.Collections;c.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g},e.server));f.page= -new a.Models.Page(e.page);f.agent=new a.Models.Agent(e.agent);d.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:d.threads}));e.page.showOnlineOperators&&(d.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:d.visitors})));f.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:f.statusPanel}));e.page.showOnlineOperators&&(d.agents=new a.Collections.Agents,b.agentsRegion.show(new a.Views.AgentsCollection({collection:d.agents}))); -c.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:f.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_); +(function(a,h,j){var c=0,g=function(){c++;10==c&&(alert(a.Localization.get("pending.errors.network")),c=0)},b=new h.Marionette.Application;b.addRegions({agentsRegion:"#agents-region",statusPanelRegion:"#status-panel-region",threadsRegion:"#threads-region",visitorsRegion:"#visitors-region"});b.addInitializer(function(d){a.PluginOptions=d.plugins||{};var c=a.Objects,f=a.Objects.Models,e=a.Objects.Collections;c.server=new a.Server(j.extend({interactionType:MibewAPIUsersInteraction,onTimeout:g,onTransportError:g}, +d.server));f.page=new a.Models.Page(d.page);f.agent=new a.Models.Agent(d.agent);e.threads=new a.Collections.Threads;b.threadsRegion.show(new a.Views.ThreadsCollection({collection:e.threads}));d.page.showOnlineOperators&&(e.visitors=new a.Collections.Visitors,b.visitorsRegion.show(new a.Views.VisitorsCollection({collection:e.visitors})));f.statusPanel=new a.Models.StatusPanel;b.statusPanelRegion.show(new a.Views.StatusPanel({model:f.statusPanel}));d.page.showOnlineOperators&&(e.agents=new a.Collections.Agents, +b.agentsRegion.show(new a.Views.AgentsCollection({collection:e.agents})));c.server.callFunctionsPeriodically(function(){return[{"function":"update",arguments:{"return":{},references:{},agentId:f.agent.id}}]},function(){})});b.on("start",function(){a.Objects.server.runUpdater()});a.Application=b})(Mibew,Backbone,_); diff --git a/src/messenger/webim/js/source/chat/app.js b/src/messenger/webim/js/source/chat/app.js index dd63a582..7c01bf8d 100644 --- a/src/messenger/webim/js/source/chat/app.js +++ b/src/messenger/webim/js/source/chat/app.js @@ -18,6 +18,9 @@ // Initialize application app.addInitializer(function(options){ + // Store plugin options + Mibew.PluginOptions = options.plugins || {}; + // Initialize Server Mibew.Objects.server = new Mibew.Server(_.extend( {'interactionType': MibewAPIChatInteraction}, diff --git a/src/messenger/webim/js/source/users/app.js b/src/messenger/webim/js/source/users/app.js index adf40b9f..e0a90604 100644 --- a/src/messenger/webim/js/source/users/app.js +++ b/src/messenger/webim/js/source/users/app.js @@ -41,6 +41,8 @@ // Initialize application App.addInitializer(function(options){ + // Store plugin options + Mibew.PluginOptions = options.plugins || {}; // Create some shortcuts var objs = Mibew.Objects;