commit/galaxy-central: carlfeberhard: Temporary fix to galaxy.panels.mako to ensure AMD order
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/b8c2e0027697/ Changeset: b8c2e0027697 User: carlfeberhard Date: 2014-04-15 21:06:40 Summary: Temporary fix to galaxy.panels.mako to ensure AMD order Affected #: 5 files diff -r a03ea4880a7117156cead39eecb658ca1da301b3 -r b8c2e002769773350c8bc729f099110cc26d9d01 static/scripts/galaxy-app-base.js --- a/static/scripts/galaxy-app-base.js +++ b/static/scripts/galaxy-app-base.js @@ -46,6 +46,11 @@ self._initUser( options.userJSON || {} ); self.debug( 'GalaxyApp.user: ', self.user ); + //TODO: temp + if( typeof options.onload === 'function' ){ + options.onload(); + } + return self; }; @@ -69,6 +74,8 @@ var self = this; self.debug( '_initUser:', userJSON ); self.user = new userModel.User( userJSON ); + //TODO: temp + self.currUser = self.user; return self; }; diff -r a03ea4880a7117156cead39eecb658ca1da301b3 -r b8c2e002769773350c8bc729f099110cc26d9d01 static/scripts/packed/galaxy-app-base.js --- a/static/scripts/packed/galaxy-app-base.js +++ b/static/scripts/packed/galaxy-app-base.js @@ -1,1 +1,1 @@ -define(["mvc/user/user-model","utils/metrics-logger","utils/add-logging","utils/localization"],function(a,c,f,d){function g(m){var l=this;return l._init(m||{})}f(g,"GalaxyApp");g.defaultOptions={root:"/"};g.prototype._init=function j(m){var l=this;l._processOptions(m);l.debug("GalaxyApp.options: ",l.options);l._initLogger(m.loggerOptions||{});l.debug("GalaxyApp.logger: ",l.logger);l._initLocale();l.debug("GalaxyApp.localize: ",l.localize);l.config=m.config||{};l.debug("GalaxyApp.config: ",l.config);l._initUser(m.userJSON||{});l.debug("GalaxyApp.user: ",l.user);return l};g.prototype._processOptions=function e(n){var m=this,o=g.defaultOptions;m.debug("_processOptions: ",n);m.options={};for(var l in o){if(o.hasOwnProperty(l)){m.options[l]=(n.hasOwnProperty(l))?(n[l]):(o[l])}}return m};g.prototype._initUser=function i(m){var l=this;l.debug("_initUser:",m);l.user=new a.User(m);return l};g.prototype._initLogger=function k(m){var l=this;l.debug("_initLogger:",m);l.logger=new c.MetricsLogger(m);return l};g.prototype._initLocale=function h(m){var l=this;l.debug("_initLocale:",m);l.localize=d;window._l=l.localize;return l};g.prototype.toString=function b(){var l=this.user.get("email")||"(anonymous)";return"GalaxyApp("+l+")"};return{GalaxyApp:g}}); \ No newline at end of file +define(["mvc/user/user-model","utils/metrics-logger","utils/add-logging","utils/localization"],function(a,c,f,d){function g(m){var l=this;return l._init(m||{})}f(g,"GalaxyApp");g.defaultOptions={root:"/"};g.prototype._init=function j(m){var l=this;l._processOptions(m);l.debug("GalaxyApp.options: ",l.options);l._initLogger(m.loggerOptions||{});l.debug("GalaxyApp.logger: ",l.logger);l._initLocale();l.debug("GalaxyApp.localize: ",l.localize);l.config=m.config||{};l.debug("GalaxyApp.config: ",l.config);l._initUser(m.userJSON||{});l.debug("GalaxyApp.user: ",l.user);if(typeof m.onload==="function"){m.onload()}return l};g.prototype._processOptions=function e(n){var m=this,o=g.defaultOptions;m.debug("_processOptions: ",n);m.options={};for(var l in o){if(o.hasOwnProperty(l)){m.options[l]=(n.hasOwnProperty(l))?(n[l]):(o[l])}}return m};g.prototype._initUser=function i(m){var l=this;l.debug("_initUser:",m);l.user=new a.User(m);l.currUser=l.user;return l};g.prototype._initLogger=function k(m){var l=this;l.debug("_initLogger:",m);l.logger=new c.MetricsLogger(m);return l};g.prototype._initLocale=function h(m){var l=this;l.debug("_initLocale:",m);l.localize=d;window._l=l.localize;return l};g.prototype.toString=function b(){var l=this.user.get("email")||"(anonymous)";return"GalaxyApp("+l+")"};return{GalaxyApp:g}}); \ No newline at end of file diff -r a03ea4880a7117156cead39eecb658ca1da301b3 -r b8c2e002769773350c8bc729f099110cc26d9d01 templates/galaxy_client_app.mako --- a/templates/galaxy_client_app.mako +++ b/templates/galaxy_client_app.mako @@ -22,6 +22,7 @@ userJSON : ${ get_user_json() }, root : '${h.url_for( "/" )}', //TODO: get these options from the server + onload : window.Galaxy? window.Galaxy.onload: null, loggerOptions : { } }); diff -r a03ea4880a7117156cead39eecb658ca1da301b3 -r b8c2e002769773350c8bc729f099110cc26d9d01 templates/webapps/galaxy/galaxy.masthead.mako --- a/templates/webapps/galaxy/galaxy.masthead.mako +++ b/templates/webapps/galaxy/galaxy.masthead.mako @@ -85,33 +85,36 @@ 'mvc/user/user-model', 'mvc/user/user-quotameter' ], function( mod_masthead, mod_menu, mod_modal, mod_frame, GalaxyUpload, user, quotameter ){ + if( !Galaxy.currUser ){ + // this doesn't need to wait for the page being readied + Galaxy.currUser = new user.User(${ h.to_json_string( get_user_json(), indent=2 ) }); + } + $(function() { - ## check if masthead is available - if (Galaxy.masthead) + // check if masthead is available + if (Galaxy.masthead){ return; + } - ## get configuration + // get configuration var masthead_config = ${ h.to_json_string( masthead_config ) }; - ## load global galaxy objects + // load global galaxy objects Galaxy.masthead = new mod_masthead.GalaxyMasthead(masthead_config); Galaxy.modal = new mod_modal.View(); Galaxy.frame = new mod_frame.GalaxyFrame(); - ## construct default menu options + // construct default menu options Galaxy.menu = new mod_menu.GalaxyMenu({ masthead: Galaxy.masthead, config: masthead_config }); - ## add upload plugin + // add upload plugin Galaxy.upload = new GalaxyUpload(masthead_config); - if( !Galaxy.currUser ){ - Galaxy.currUser = new user.User(${ h.to_json_string( get_user_json(), indent=2 ) }); - } - ## set up the quota meter (And fetch the current user data from trans) - ## add quota meter to masthead + // set up the quota meter (And fetch the current user data from trans) + // add quota meter to masthead Galaxy.quotaMeter = new quotameter.UserQuotaMeter({ model : Galaxy.currUser, el : Galaxy.masthead.$('.quota-meter-container') diff -r a03ea4880a7117156cead39eecb658ca1da301b3 -r b8c2e002769773350c8bc729f099110cc26d9d01 templates/webapps/galaxy/galaxy.panels.mako --- a/templates/webapps/galaxy/galaxy.panels.mako +++ b/templates/webapps/galaxy/galaxy.panels.mako @@ -1,4 +1,5 @@ <%namespace name="masthead" file="/webapps/galaxy/galaxy.masthead.mako"/> +<%namespace name="galaxy_client" file="../../galaxy_client_app.mako" /><!DOCTYPE HTML> @@ -93,6 +94,7 @@ %endif </style> + ## default script wrapper <script type="text/javascript"> ## configure require @@ -104,27 +106,25 @@ "libs/backbone/backbone": { exports: "Backbone" }, } }); - - ## get configuration + + // load any app configured var galaxy_config = ${ h.to_json_string( self.galaxy_config ) }; - - ## on page load - $(function() - { - ## check if script is defined + Galaxy.onload = function(){ var jscript = galaxy_config.app.jscript; - if (jscript) - { - ## load galaxy app - require([jscript], function(js_lib) - { - ## load galaxy module application - var module = new js_lib.GalaxyApp(); + if( jscript ){ + $( function(){ + require([ jscript ], function( js_lib ){ + ## load galaxy module application + var module = new js_lib.GalaxyApp(); + }); }); - } else + } else { console.log("'galaxy_config.app.jscript' missing."); - }); + } + } </script> + ${ galaxy_client.bootstrap() } + </%def> ## default late-load javascripts @@ -229,4 +229,4 @@ ## Scripts can be loaded later since they progressively add features to ## the panels, but do not change layout ${self.late_javascripts()} -</html> \ No newline at end of file +</html> Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org