mirror of
https://github.com/Mibew/java.git
synced 2025-01-23 01:50:34 +03:00
Update JavaScript application files structure
Move models views and collection views to various directories
This commit is contained in:
parent
6172334090
commit
4a23ae7dc4
@ -176,11 +176,21 @@
|
|||||||
<exclude name="**/base*.js" />
|
<exclude name="**/base*.js" />
|
||||||
</fileset>
|
</fileset>
|
||||||
|
|
||||||
<!-- Include views files -->
|
<!-- Include models views files -->
|
||||||
<fileset dir="${js_path}/compiled/${app_name}/views">
|
<fileset dir="${js_path}/compiled/${app_name}/model_views">
|
||||||
<include name="**/base*.js" />
|
<include name="**/base*.js" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${js_path}/compiled/${app_name}/views">
|
<fileset dir="${js_path}/compiled/${app_name}/model_views">
|
||||||
|
<include name="**/*.js" />
|
||||||
|
<!-- Exclude base files -->
|
||||||
|
<exclude name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
|
||||||
|
<!-- Include collections views files -->
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/collection_views">
|
||||||
|
<include name="**/base*.js" />
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${js_path}/compiled/${app_name}/collection_views">
|
||||||
<include name="**/*.js" />
|
<include name="**/*.js" />
|
||||||
<!-- Exclude base files -->
|
<!-- Exclude base files -->
|
||||||
<exclude name="**/base*.js" />
|
<exclude name="**/base*.js" />
|
||||||
@ -191,7 +201,8 @@
|
|||||||
<include name="**/base*.js" />
|
<include name="**/base*.js" />
|
||||||
<exclude name="models/**/base*.js" />
|
<exclude name="models/**/base*.js" />
|
||||||
<exclude name="collections/**/base*.js" />
|
<exclude name="collections/**/base*.js" />
|
||||||
<exclude name="views/**/base*.js" />
|
<exclude name="model_views/**/base*.js" />
|
||||||
|
<exclude name="collection_views/**/base*.js" />
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${js_path}/compiled/${app_name}">
|
<fileset dir="${js_path}/compiled/${app_name}">
|
||||||
<include name="**/*.js" />
|
<include name="**/*.js" />
|
||||||
@ -200,7 +211,8 @@
|
|||||||
<!-- Exclude models, collections and views files -->
|
<!-- Exclude models, collections and views files -->
|
||||||
<exclude name="models/**/*.js" />
|
<exclude name="models/**/*.js" />
|
||||||
<exclude name="collections/**/*.js" />
|
<exclude name="collections/**/*.js" />
|
||||||
<exclude name="views/**/*.js" />
|
<exclude name="model_views/**/*.js" />
|
||||||
|
<exclude name="collection_views/**/*.js" />
|
||||||
<!-- Exclude base files -->
|
<!-- Exclude base files -->
|
||||||
<exclude name="**/base*.js" />
|
<exclude name="**/base*.js" />
|
||||||
</fileset>
|
</fileset>
|
||||||
|
@ -43,11 +43,11 @@ a==this.KIND_AGENT?"agent":a==this.KIND_FOR_AGENT?"hidden":a==this.KIND_INFO?"in
|
|||||||
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",
|
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,
|
"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);
|
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);
|
||||||
|
(function(a,b){a.Views.StatusMessage=a.Views.Status.extend({template:b.templates.status_message})})(Mibew,Handlebars);
|
||||||
|
(function(a,b){a.Views.StatusTyping=a.Views.Status.extend({template:b.templates.status_typing})})(Mibew,Handlebars);
|
||||||
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection",initialize:function(){this.collection.on("multiple:add",this.messagesAdded,this);a.Objects.Models.messageForm.on("before:post",this.messagePost,this)},skipNextSound:!0,messagePost:function(){this.skipNextSound=!0},messagesAdded:function(){if(!this.skipNextSound&&a.Objects.Models.Controls.sound.get("enabled")){var b=a.Objects.Models.page.get("webimRoot");b&&a.Objects.Models.sound.play(b+
|
(function(a){a.Views.MessagesCollection=a.Views.CollectionBase.extend({itemView:a.Views.Message,className:"messages-collection",initialize:function(){this.collection.on("multiple:add",this.messagesAdded,this);a.Objects.Models.messageForm.on("before:post",this.messagePost,this)},skipNextSound:!0,messagePost:function(){this.skipNextSound=!0},messagesAdded:function(){if(!this.skipNextSound&&a.Objects.Models.Controls.sound.get("enabled")){var b=a.Objects.Models.page.get("webimRoot");b&&a.Objects.Models.sound.play(b+
|
||||||
"/sounds/new_message.wav")}this.skipNextSound=!1}})})(Mibew);
|
"/sounds/new_message.wav")}this.skipNextSound=!1}})})(Mibew);
|
||||||
(function(a,b){a.Views.StatusMessage=a.Views.Status.extend({template:b.templates.status_message})})(Mibew,Handlebars);
|
|
||||||
(function(a){a.Views.StatusCollection=a.Views.CollectionBase.extend({itemView:a.Views.Status,className:"status-collection"})})(Mibew);
|
(function(a){a.Views.StatusCollection=a.Views.CollectionBase.extend({itemView:a.Views.Status,className:"status-collection"})})(Mibew);
|
||||||
(function(a,b){a.Views.StatusTyping=a.Views.Status.extend({template:b.templates.status_typing})})(Mibew,Handlebars);
|
|
||||||
(function(a,b){a.Regions.Messages=b.Marionette.Region.extend({el:"#messages-region",onShow:function(a){a.on("after:item:added",this.scrollToBottom,this)},scrollToBottom:function(){this.$el.scrollTop(this.$el.prop("scrollHeight"))}})})(Mibew,Backbone);
|
(function(a,b){a.Regions.Messages=b.Marionette.Region.extend({el:"#messages-region",onShow:function(a){a.on("after:item:added",this.scrollToBottom,this)},scrollToBottom:function(){this.$el.scrollTop(this.$el.prop("scrollHeight"))}})})(Mibew,Backbone);
|
||||||
(function(a,j,k){var f=new j.Marionette.Application;f.addRegions({controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:a.Regions.Messages,statusRegion:"#status-region",messageFormRegion:"#message-form-region",soundRegion:"#sound-region"});f.addInitializer(function(d){var g=a.Objects,c=a.Objects.Models,b=a.Objects.Models.Controls,h=a.Objects.Models.Status;g.server=new a.Server(k.extend({interactionType:MibewAPIChatInteraction},d.server));g.thread=new a.Thread(d.thread);c.user=
|
(function(a,j,k){var f=new j.Marionette.Application;f.addRegions({controlsRegion:"#controls-region",avatarRegion:"#avatar-region",messagesRegion:a.Regions.Messages,statusRegion:"#status-region",messageFormRegion:"#message-form-region",soundRegion:"#sound-region"});f.addInitializer(function(d){var g=a.Objects,c=a.Objects.Models,b=a.Objects.Models.Controls,h=a.Objects.Models.Status;g.server=new a.Server(k.extend({interactionType:MibewAPIChatInteraction},d.server));g.thread=new a.Thread(d.thread);c.user=
|
||||||
new a.Models.User(d.user);c.page=new a.Models.Page(d.page);var e=new a.Collections.Controls;c.user.get("isAgent")||(b.userName=new a.Models.UserNameControl({weight:220}),e.push(b.userName),b.sendMail=new a.Models.SendMailControl({weight:200,link:d.links.mailLink}),e.push(b.sendMail));c.user.get("isAgent")&&(b.redirect=new a.Models.RedirectControl({weight:200,link:d.links.redirectLink}),e.push(b.redirect),b.history=new a.Models.HistoryControl({weight:180,link:d.links.historyLink}),e.push(b.history));
|
new a.Models.User(d.user);c.page=new a.Models.Page(d.page);var e=new a.Collections.Controls;c.user.get("isAgent")||(b.userName=new a.Models.UserNameControl({weight:220}),e.push(b.userName),b.sendMail=new a.Models.SendMailControl({weight:200,link:d.links.mailLink}),e.push(b.sendMail));c.user.get("isAgent")&&(b.redirect=new a.Models.RedirectControl({weight:200,link:d.links.redirectLink}),e.push(b.redirect),b.history=new a.Models.HistoryControl({weight:180,link:d.links.historyLink}),e.push(b.history));
|
||||||
|
@ -23,8 +23,8 @@ b.Server.prototype.registerFunction=function(a,b){a in this.functions||(this.fun
|
|||||||
(function(a,b){a.Models.Sound=b.Model.extend({play:function(a){this.set({file:a});this.trigger("sound:play",this)}})})(Mibew,Backbone);
|
(function(a,b){a.Models.Sound=b.Model.extend({play:function(a){this.set({file:a});this.trigger("sound:play",this)}})})(Mibew,Backbone);
|
||||||
(function(a,b){a.Models.User=b.Model.extend({defaults:{isAgent:!1,canPost:!0,typing:!1,name:"",canChangeName:!1,dafaultName:!0}})})(Mibew,Backbone);
|
(function(a,b){a.Models.User=b.Model.extend({defaults:{isAgent:!1,canPost:!0,typing:!1,name:"",canChangeName:!1,dafaultName:!0}})})(Mibew,Backbone);
|
||||||
(function(a,b){a.Collections.Controls=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);
|
(function(a,b){a.Collections.Controls=b.Collection.extend({comparator:function(a){return a.get("weight")}})})(Mibew,Backbone);
|
||||||
(function(d,b,e){d.Views.CollectionBase=b.Marionette.CollectionView.extend({itemView:b.Marionette.ItemView,buildItemView:function(a,b,c){c=e.extend({model:a},c);return(a=a.getModelType())&&d.Views[a]?new d.Views[a](c):new b(c)}})})(Mibew,Backbone,_);
|
|
||||||
(function(b,c,d){b.Views.Control=c.Marionette.ItemView.extend({template:d.templates.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();
|
(function(b,c,d){b.Views.Control=c.Marionette.ItemView.extend({template:d.templates.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);
|
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);
|
||||||
(function(a){a.Views.ControlsCollection=a.Views.CollectionBase.extend({itemView:a.Views.Control,className:"controls-collection"})})(Mibew);
|
|
||||||
(function(a,b,c){a.Views.Sound=b.Marionette.ItemView.extend({template:c.templates.sound,className:"sound-player",modelEvents:{"sound:play":"render"}})})(Mibew,Backbone,Handlebars);
|
(function(a,b,c){a.Views.Sound=b.Marionette.ItemView.extend({template:c.templates.sound,className:"sound-player",modelEvents:{"sound:play":"render"}})})(Mibew,Backbone,Handlebars);
|
||||||
|
(function(d,b,e){d.Views.CollectionBase=b.Marionette.CollectionView.extend({itemView:b.Marionette.ItemView,buildItemView:function(a,b,c){c=e.extend({model:a},c);return(a=a.getModelType())&&d.Views[a]?new d.Views[a](c):new b(c)}})})(Mibew,Backbone,_);
|
||||||
|
(function(a){a.Views.ControlsCollection=a.Views.CollectionBase.extend({itemView:a.Views.Control,className:"controls-collection"})})(Mibew);
|
||||||
|
Loading…
Reference in New Issue
Block a user