mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
3 lines
3.2 KiB
JavaScript
3 lines
3.2 KiB
JavaScript
"use strict";define(["layout/masthead","layout/panel","mvc/ui/ui-modal","utils/utils"],function(e,i,t,s){return{View:Backbone.View.extend({el:"body",className:"full-content",_panelids:["left","right"],initialize:function(n){var a=this;this.config=_.defaults(n.config||{},{message_box_visible:!1,message_box_content:"",message_box_class:"info",show_inactivity_warning:!1,inactivity_box_content:""}),Galaxy.modal=this.modal=new t.View,Galaxy.display=this.display=function(e){e.title?(s.setWindowTitle(e.title),e.allow_title_display=!1):(s.setWindowTitle(),e.allow_title_display=!0),a.center.display(e)},Galaxy.router=this.router=n.Router&&new n.Router(a,n),this.masthead=new e.View(this.config),this.center=new i.CenterPanel,this.$el.attr("scroll","no"),this.$el.html(this._template()),this.$("#masthead").replaceWith(this.masthead.$el),this.$("#center").append(this.center.$el),this.$el.append(this.masthead.frame.$el),this.$el.append(this.modal.$el),this.$messagebox=this.$("#messagebox"),this.$inactivebox=this.$("#inactivebox"),this.panels={},_.each(this._panelids,function(e){var t=e.charAt(0).toUpperCase()+e.slice(1),s=n[t];if(s){var o=new s(a,n);a[o.toString()]=o,a.panels[e]=new i.SidePanel({id:e,el:a.$("#"+e),view:o})}}),this.render(),this.router&&Backbone.history.start({root:Galaxy.root,pushState:!0})},render:function(){return $(".select2-hidden-accessible").remove(),this.masthead.render(),this.renderMessageBox(),this.renderInactivityBox(),this.renderPanels(),this._checkCommunicationServerOnline(),this},renderMessageBox:function(){if(this.config.message_box_visible){var e=this.config.message_box_content||"",i=this.config.message_box_class||"info";this.$el.addClass("has-message-box"),this.$messagebox.attr("class","panel-"+i+"-message").html(e).toggle(!!e).show()}else this.$el.removeClass("has-message-box"),this.$messagebox.hide();return this},renderInactivityBox:function(){if(this.config.show_inactivity_warning){var e=this.config.inactivity_box_content||"",i=$("<a/>").attr("href",Galaxy.root+"user/resend_verification").text("Resend verification");this.$el.addClass("has-inactivity-box"),this.$inactivebox.html(e+" ").append(i).toggle(!!e).show()}else this.$el.removeClass("has-inactivity-box"),this.$inactivebox.hide();return this},renderPanels:function(){var e=this;return _.each(this._panelids,function(i){var t=e.panels[i];t?t.render():(e.$("#center").css(i,0),e.$("#"+i).hide())}),this},_template:function(){return['<div id="everything">','<div id="background"/>','<div id="masthead"/>','<div id="messagebox"/>','<div id="inactivebox" class="panel-warning-message" />','<div id="left" />','<div id="center" />','<div id="right" />',"</div>",'<div id="dd-helper" />'].join("")},toString:function(){return"PageLayoutView"},_checkCommunicationServerOnline:function(){var e=window.Galaxy.config.communication_server_host,i=window.Galaxy.config.communication_server_port,t=window.Galaxy.user.attributes.preferences,s=$("#show-chat-online");t&&-1!=["1","true"].indexOf(t.communication_server)?$.ajax({url:e+":"+i}).success(function(e){null!==window.Galaxy.user.id&&"hidden"===s.css("visibility")&&s.css("visibility","visible")}).error(function(e){s.css("visibility","hidden")}):s.css("visibility","hidden")}})}});
|
|
//# sourceMappingURL=../../maps/layout/page.js.map
|