diff --git a/client/galaxy/scripts/galaxy-app-base.js b/client/galaxy/scripts/galaxy-app-base.js index 1a2f20532be..cbcfb806775 100644 --- a/client/galaxy/scripts/galaxy-app-base.js +++ b/client/galaxy/scripts/galaxy-app-base.js @@ -143,7 +143,38 @@ GalaxyApp.prototype._setUpListeners = function _setUpListeners(){ }; //TODO:?? we might somehow manage to *retry* ajax using either this hook or Backbone.sync }); + self._listenToGalaxyMain(); + return self; +}; +/** trigger an event when the main frame loads a new page */ +GalaxyApp.prototype._listenToGalaxyMain = function _listenToGalaxyMain(){ + var self = this, + selector = 'iframe#galaxy_main', + galaxy_main = $( selector ); + galaxy_main = galaxy_main.size()? galaxy_main.get( 0 ).contentWindow : undefined ; + if( galaxy_main ){ + // TODO: this would be better external to this function so it can be removed + var handler = function __galaxyMainOnLoadHandler( ev ){ + try { + var _galaxy_main = $( selector ).get( 0 ).contentWindow, + full = _galaxy_main.location.pathname + _galaxy_main.location.search + _galaxy_main.location.hash; + self.trigger( 'galaxy_main:load', { + fullpath: full, + pathname: _galaxy_main.location.pathname, + search : _galaxy_main.location.search, + hash : _galaxy_main.location.hash + }); + + } catch( err ){ + self.debug( 'Error handling main frame load:', err ); + } + }; + $( selector ).on( 'load', handler ); + + } else { + self.debug( 'No galaxy_main found' ); + } }; /** string rep */ diff --git a/client/galaxy/scripts/mvc/history/history-panel-edit-current.js b/client/galaxy/scripts/mvc/history/history-panel-edit-current.js index 81be7ad8367..e7dbe3f7203 100644 --- a/client/galaxy/scripts/mvc/history/history-panel-edit-current.js +++ b/client/galaxy/scripts/mvc/history/history-panel-edit-current.js @@ -124,7 +124,7 @@ var CurrentHistoryPanel = _super.extend( //}); }; return this.loadHistoryWithDetails( historyId, attributes, historyFn ) - .then(function( historyData, contentsData ){ + .then( function( historyData, contentsData ){ panel.trigger( 'switched-history', panel ); }); }, @@ -293,11 +293,9 @@ var CurrentHistoryPanel = _super.extend( /** Override to add the current-content highlight class to currentContentId's view */ _attachItems : function( $whereTo ){ _super.prototype._attachItems.call( this, $whereTo ); - var panel = this, - currentContentView; - if( panel.currentContentId - && ( currentContentView = panel.viewFromModelId( panel.currentContentId ) ) ){ - panel.setCurrentContent( currentContentView ); + var panel = this; + if( panel.currentContentId ){ + panel._setCurrentContentById( panel.currentContentId ); } return this; }, @@ -325,9 +323,9 @@ var CurrentHistoryPanel = _super.extend( }, this ); // when content is manipulated, make it the current-content - view.on( 'display edit params rerun report-err visualize', function( v, ev ){ - this.setCurrentContent( v ); - }, this ); + // view.on( 'visualize', function( v, ev ){ + // this.setCurrentContent( v ); + // }, this ); return this; }, @@ -343,6 +341,12 @@ var CurrentHistoryPanel = _super.extend( } }, + /** find the view with the id and then call setCurrentContent on it */ + _setCurrentContentById : function( id ){ + var view = this.viewFromModelId( id ) || null; + this.setCurrentContent( view ); + }, + /** Handle drill down by hiding this panels list and controls and showing the sub-panel */ _expandDrilldownPanel : function( drilldown ){ this.panelStack.push( drilldown ); @@ -360,6 +364,36 @@ var CurrentHistoryPanel = _super.extend( }, // ........................................................................ external objects/MVC + listenToGalaxy : function( galaxy ){ + // TODO: MEM: questionable reference island / closure practice + galaxy.on( 'galaxy_main:load', function( data ){ + var pathToMatch = data.fullpath, + useToURLRegexMap = { + 'display' : /datasets\/([a-f0-9]+)\/display/, + 'edit' : /datasets\/([a-f0-9]+)\/edit/, + 'report_error' : /dataset\/errors\?id=([a-f0-9]+)/, + 'rerun' : /tool_runner\/rerun\?id=([a-f0-9]+)/, + 'show_params' : /datasets\/([a-f0-9]+)\/show_params/, + // no great way to do this here? (leave it in the dataset event handlers above?) + // 'visualization' : 'visualization', + }, + hdaId = null, + hdaUse = null; + _.find( useToURLRegexMap, function( regex, use ){ + var match = pathToMatch.match( regex ); + if( match && match.length == 2 ){ + hdaId = match[1]; + hdaUse = use; + return true; + } + return false; + }); + // need to type mangle to go from web route to history contents + hdaId = 'dataset-' + hdaId; + this._setCurrentContentById( hdaId ); + }, this ); + }, + //TODO: remove quota meter from panel and remove this /** add listeners to an external quota meter (mvc/user/user-quotameter.js) */ connectToQuotaMeter : function( quotaMeter ){ diff --git a/static/maps/galaxy-app-base.js.map b/static/maps/galaxy-app-base.js.map index c363142deca..4bd4bbdce7f 100644 --- a/static/maps/galaxy-app-base.js.map +++ b/static/maps/galaxy-app-base.js.map @@ -1 +1 @@ -{"version":3,"file":"galaxy-app-base.js","sources":["../src/galaxy-app-base.js"],"names":["define","userModel","metricsLogger","addLogging","localize","bootstrapped","GalaxyApp","options","self","this","_init","prototype","defaultOptions","patchExisting","root","_","extend","Backbone","Events","_processOptions","debug","_patchGalaxy","window","Galaxy","_initLogger","loggerOptions","logger","_initLocale","config","_initUser","user","trigger","_setUpListeners","defaults","k","hasOwnProperty","patchWith","MetricsLogger","_l","userJSON","User","currUser","lastAjax","$","document","bind","ev","xhr","data","JSON","parse","err","url","location","href","slice","toString","userEmail","get"],"mappings":"AAAAA,QACI,sBACA,uBACA,oBACA,qBACA,qBACD,SAAUC,EAAWC,EAAeC,EAAYC,EAAUC,GAU7D,QAASC,GAAWC,GAChB,GAAIC,GAAOC,IACX,OAAOD,GAAKE,MAAOH,OA0InB,MAtIJJ,GAAYG,EAAW,aAGvBA,EAAUK,UAAUC,gBAEhBC,eAAkB,EAGlBC,KAAkB,KAItBR,EAAUK,UAAUD,MAAQ,SAAeH,GACvC,GAAIC,GAAOC,IA4BX,OA3BAM,GAAEC,OAAQR,EAAMS,SAASC,QAEzBV,EAAKW,gBAAiBZ,GACtBC,EAAKY,MAAO,sBAAuBZ,EAAKD,SAExCC,EAAKa,aAAcC,OAAOC,QAE1Bf,EAAKgB,YAAajB,EAAQkB,mBAC1BjB,EAAKY,MAAO,qBAAsBZ,EAAKkB,QAEvClB,EAAKmB,cACLnB,EAAKY,MAAO,uBAAwBZ,EAAKJ,UAEzCI,EAAKoB,OAASrB,EAAQqB,QAAUvB,EAAauB,WAC7CpB,EAAKY,MAAO,qBAAsBZ,EAAKoB,QAEvCpB,EAAKqB,UAAWtB,EAAQuB,MAA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AAY,SAAUC,EAAIC,EAAKxC,GAC/C,GAAIyC,GAAOzC,EAAQyC,IACnB,KACIA,EAAOC,KAAKC,MAAOF,GACrB,MAAOG,IAET3C,EAAKkC,UACDU,IAAUC,SAASC,KAAKC,MAAO,EAAG,IAAOhD,EAAQ6C,IACjDJ,KAAUA,MAQtB1C,EAAUK,UAAU6C,SAAW,WAC3B,GAAIC,GAAYhD,KAAKqB,KAAK4B,IAAK,UAAa,aAC5C,OAAO,aAAeD,EAAY,MAM9BnD,UAAYA"} \ No newline at end of file +{"version":3,"file":"galaxy-app-base.js","sources":["../src/galaxy-app-base.js"],"names":["define","userModel","metricsLogger","addLogging","localize","bootstrapped","GalaxyApp","options","self","this","_init","prototype","defaultOptions","patchExisting","root","_","extend","Backbone","Events","_processOptions","debug","_patchGalaxy","window","Galaxy","_initLogger","loggerOptions","logger","_initLocale","config","_initUser","user","trigger","_setUpListeners","defaults","k","hasOwnProperty","patchWith","MetricsLogger","_l","userJSON","User","currUser","lastAjax","$","document","bind","ev","xhr","data","JSON","parse","err","url","location","href","slice","_listenToGalaxyMain","selector","galaxy_main","size","get","contentWindow","undefined","handler","_galaxy_main","full","pathname","search","hash","fullpath","on","toString","userEmail"],"mappings":"AAAAA,QACI,sBACA,uBACA,oBACA,qBACA,qBACD,SAAUC,EAAWC,EAAeC,EAAYC,EAAUC,GAU7D,QAASC,GAAWC,GAChB,GAAIC,GAAOC,IACX,OAAOD,GAAKE,MAAOH,OAyKnB,MArKJJ,GAAYG,EAAW,aAGvBA,EAAUK,UAAUC,gBAEhBC,eAAkB,EAGlBC,KAAkB,KAItBR,EAAUK,UAAUD,MAAQ,SAAeH,GACvC,GAAIC,GAAOC,IA4BX,OA3BAM,GAAEC,OAAQR,EAAMS,SAASC,QAEzBV,EAAKW,gBAAiBZ,GACtBC,EAAKY,MAAO,sBAAuBZ,EAAKD,SAExCC,EAAKa,aAAcC,OAAOC,QAE1Bf,EAAKgB,YAAajB,EAAQkB,mBAC1BjB,EAAK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JAD,GAAKY,MAAO,aAAcmB,GAC1B/B,EAAKsB,KAAO,GAAI7B,GAAUuC,KAAMD,GAEhC/B,EAAKiC,SAAWjC,EAAKsB,KACdtB,GAIXF,EAAUK,UAAUqB,gBAAkB,WAClC,GAAIxB,GAAOC,IAkBX,OAdAD,GAAKkC,YACLC,EAAGC,UAAWC,KAAM,WAAY,SAAUC,EAAIC,EAAKxC,GAC/C,GAAIyC,GAAOzC,EAAQyC,IACnB,KACIA,EAAOC,KAAKC,MAAOF,GACrB,MAAOG,IAET3C,EAAKkC,UACDU,IAAUC,SAASC,KAAKC,MAAO,EAAG,IAAOhD,EAAQ6C,IACjDJ,KAAUA,KAIlBxC,EAAKgD,sBACEhD,GAIXF,EAAUK,UAAU6C,oBAAsB,WACtC,GAAIhD,GAAOC,KACPgD,EAAW,qBACXC,EAAcf,EAAGc,EAErB,IADAC,EAAcA,EAAYC,OAAQD,EAAYE,IAAK,GAAIC,cAAgBC,OACtD,CAEb,GAAIC,GAAU,WACV,IACI,GAAIC,GAAerB,EAAGc,GAAWG,IAAK,GAAIC,cACtCI,EAAOD,EAAaX,SAASa,SAAWF,EAAaX,SAASc,OAASH,EAAaX,SAASe,IACjG5D,GAAKuB,QAAS,oBACVsC,SAAUJ,EACVC,SAAUF,EAAaX,SAASa,SAChCC,OAAUH,EAAaX,SAASc,OAChCC,KAAUJ,EAAaX,SAASe,OAGtC,MAAOjB,GACL3C,EAAKY,MAAO,kCAAmC+B,IAGvDR,GAAGc,GAAWa,GAAI,OAAQP,OAG1BvD,GAAKY,MAAO,yBAKpBd,EAAUK,UAAU4D,SAAW,WAC3B,GAAIC,GAAY/D,KAAKqB,KAAK8B,IAAK,UAAa,aAC5C,OAAO,aAAeY,EAAY,MAM9BlE,UAAYA"} \ No newline at end of file diff --git a/static/maps/mvc/history/history-panel-edit-current.js.map b/static/maps/mvc/history/history-panel-edit-current.js.map index d0e9d1628de..ab17a74b06b 100644 --- a/static/maps/mvc/history/history-panel-edit-current.js.map +++ b/static/maps/mvc/history/history-panel-edit-current.js.map @@ -1 +1 @@ -{"version":3,"file":"history-panel-edit-current.js","sources":["../../../src/mvc/history/history-panel-edit-current.js"],"names":["define","HISTORY_MODEL","HPANEL_EDIT","DC_PANEL","BASE_MVC","_l","HistoryPanelPrefs","SessionStorageModel","extend","defaults","tagsEditorShown","annotationEditorShown","scrollPosition","toString","JSON","stringify","this","toJSON","storageKey","_super","HistoryPanelEdit","CurrentHistoryPanel","className","prototype","emptyMsg","noneFoundMsg","HDCAViewClass","foldoutStyle","initialize","attributes","preferences","_","id","pick","keys","call","panelStack","currentContentId","_setUpListeners","panel","$scrollContainer","on","$el","is","set","$","scrollTop","loadCurrentHistory","debug","loadHistoryWithDetails","then","trigger","switchToHistory","historyId","historyFn","jQuery","getJSON","galaxy_config","root","createNewHistory","Galaxy","currUser","isAnonymous","displayMessage","when","loadHistory","undefined","setModel","model","render","log","checkForUpdates","_setUpCollectionListeners","collection","get","storage","removeItemView","_setUpModelListeners","quotaMeter","listenTo","update","_buildNewRender","$newRender","find","prependTo","_renderQuotaMessage","$whereTo","templates","quotaMsg","_renderEmptyMessage","$emptyMsg","$emptyMessage","$toolMenu","isEmpty","views","searchFor","upload","size","empty","html","join","click","ev","show","parent","_renderTags","$where","tagsEditor","toggle","hidden","_renderAnnotation","annotationEditor","_swapNewRender","delay","pos","scrollTo","_attachItems","currentContentView","viewFromModelId","setCurrentContent","addItemView","options","view","length","_collapseDrilldownPanel","_setUpItemViewListeners","v","drilldown","_expandDrilldownPanel","removeClass","addClass","push","add","$list","hide","parentName","append","pop","connectToQuotaMeter","showQuotaMessage","hideQuotaMessage","isOverQuota","clearMessages","$target","isUndefined","$messages","children","currentTarget","not","fadeOut","fxSpeed","remove","$msg","slideDown","slideUp","quotaMsgTemplate","wrapTemplate","clone"],"mappings":"AAAAA,QACI,4BACA,iCACA,kCACA,eACA,sBACD,SAAUC,EAAeC,EAAaC,EAAUC,EAAUC,GAI7D,GAAIC,GAAoBF,EAAS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H,KAAKqD,UAMTqE,oBAAsB,SAAU5D,GAC5B,MAAKA,IAIL9D,KAAK+D,SAAUD,EAAY,aAAe9D,KAAK2H,kBAC/C3H,KAAK+D,SAAUD,EAAY,cAAe9D,KAAK4H,kBAG/C5H,KAAKyB,GAAI,4BAA6B,WAC9BqC,GAAcA,EAAW+D,eACzB7H,KAAK2H,qBAGN3H,MAZIA,MAiBf8H,cAAgB,SAAUxC,GACtB,GAAIyC,GAAWhH,EAAEiH,YAAa1C,GAEzBtF,KAAKiI,YAAYC,SAAU,sBAD5BrG,EAAGyD,EAAG6C,cAMV,OAJAJ,GAAUA,EAAQK,IAAK,kBACvBL,EAAQM,QAASrI,KAAKsI,QAAS,WAC3BzG,EAAG7B,MAAOuI,WAEPvI,MAKX2H,iBAAmB,WACf,GAAIa,GAAOxI,KAAK6B,EAAG,iBACf2G,GAAK7G,GAAI,YAAe6G,EAAKC,UAAWzI,KAAKsI,UAMrDV,iBAAmB,WACf,GAAIY,GAAOxI,KAAK6B,EAAG,iBACd2G,GAAK7G,GAAI,YAAe6G,EAAKE,QAAS1I,KAAKsI,UAKpDzI,SAAc,WACV,MAAO,wBAA4BG,KAAW,MAAIA,KAAKoD,MAAMM,IAAK,QAAU,IAAU,MAsB1F,OAhBJrD,GAAoBE,UAAUgE,UAAa,WAEvC,GAAIoE,GAAmBvJ,EAASwJ,cAC5B,2CACIvJ,EAAI,gCAAkC,KACtCA,EAAI,oFAAsF,IAC9F,UACD,UACH,OAAO0B,GAAEvB,OAAQuB,EAAE8H,MAAO1I,EAAOI,UAAUgE,YACvCC,SAAWmE,QAQXtI,oBAA6BA"} \ No newline at end of file +{"version":3,"file":"history-panel-edit-current.js","sources":["../../../src/mvc/history/history-panel-edit-current.js"],"names":["define","HISTORY_MODEL","HPANEL_EDIT","DC_PANEL","BASE_MVC","_l","HistoryPanelPrefs","SessionStorageModel","extend","defaults","tagsEditorShown","annotationEditorShown","scrollPosition","toString","JSON","stringify","this","toJSON","storageKey","_super","HistoryPanelEdit","CurrentHistoryPanel","className","prototype","emptyMsg","noneFoundMsg","HDCAViewClass","foldoutStyle","initialize","attributes","preferences","_","id","pick","keys","call","panelStack","currentContentId","_setUpListeners","panel","$scrollContainer","on","$el","is","set","$","scrollTop","loadCurrentHistory","debug","loadHistoryWithDetails","then","trigger","switchToHistory","historyId","historyFn","jQuery","getJSON","galaxy_config","root","createNewHistory","Galaxy","currUser","isAnonymous","displayMessage","when","loadHistory","undefined","setModel","model","render","log","checkForUpdates","_setUpCollectionListeners","collection","get","storage","removeItemView","_setUpModelListeners","quotaMeter","listenTo","update","_buildNewRender","$newRender","find","prependTo","_renderQuotaMessage","$whereTo","templates","quotaMsg","_renderEmptyMessage","$emptyMsg","$emptyMessage","$toolMenu","isEmpty","views","searchFor","upload","size","empty","html","join","click","ev","show","parent","_renderTags","$where","tagsEditor","toggle","hidden","_renderAnnotation","annotationEditor","_swapNewRender","delay","pos","scrollTo","_attachItems","_setCurrentContentById","addItemView","options","view","length","_collapseDrilldownPanel","_setUpItemViewListeners","v","drilldown","_expandDrilldownPanel","setCurrentContent","removeClass","addClass","viewFromModelId","push","add","$list","hide","parentName","append","pop","listenToGalaxy","galaxy","data","pathToMatch","fullpath","useToURLRegexMap","display","edit","report_error","rerun","show_params","hdaId","hdaUse","regex","use","match","connectToQuotaMeter","showQuotaMessage","hideQuotaMessage","isOverQuota","clearMessages","$target","isUndefined","$messages","children","currentTarget","not","fadeOut","fxSpeed","remove","$msg","slideDown","slideUp","quotaMsgTemplate","wrapTemplate","clone"],"mappings":"AAAAA,QACI,4BACA,iCACA,kCACA,eACA,sBACD,SAAUC,EAAeC,EAAaC,EAAUC,EAAUC,GAI7D,GAAIC,GAAoBF,EAASG,oBAAoBC,QAEjDC,UAEIC,iBAAkB,EAElBC,uBAAwB,EAMxBC,eAAiB,GAErBC,SAAW,WACP,MAAO,qBAAuBC,KAAKC,UAAWC,KAAKC,UAAa,MAKxEX,GAAkBY,WAAa,WAC3B,MAAO,gBAOX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,QAQXtJ,oBAA6BA"} \ No newline at end of file diff --git a/static/scripts/galaxy-app-base.js b/static/scripts/galaxy-app-base.js index 2a936f67005..9bf049f5016 100644 --- a/static/scripts/galaxy-app-base.js +++ b/static/scripts/galaxy-app-base.js @@ -1,2 +1,2 @@ -define(["mvc/user/user-model","utils/metrics-logger","utils/add-logging","utils/localization","bootstrapped-data"],function(a,b,c,d,e){function f(a){var b=this;return b._init(a||{})}return c(f,"GalaxyApp"),f.prototype.defaultOptions={patchExisting:!0,root:"/"},f.prototype._init=function(a){var b=this;return _.extend(b,Backbone.Events),b._processOptions(a),b.debug("GalaxyApp.options: ",b.options),b._patchGalaxy(window.Galaxy),b._initLogger(a.loggerOptions||{}),b.debug("GalaxyApp.logger: ",b.logger),b._initLocale(),b.debug("GalaxyApp.localize: ",b.localize),b.config=a.config||e.config||{},b.debug("GalaxyApp.config: ",b.config),b._initUser(a.user||e.user||{}),b.debug("GalaxyApp.user: ",b.user),b.trigger("ready",b),b._setUpListeners(),b},f.prototype._processOptions=function(a){var b=this,c=b.defaultOptions;b.debug("_processOptions: ",a),b.options={};for(var d in c)c.hasOwnProperty(d)&&(b.options[d]=a.hasOwnProperty(d)?a[d]:c[d]);return b},f.prototype._patchGalaxy=function(a){var b=this;if(b.options.patchExisting&&a){b.debug("found existing Galaxy object:",a);for(var c in a)a.hasOwnProperty(c)&&(b.debug(" patching in "+c+" to Galaxy"),b[c]=a[c])}},f.prototype._initLogger=function(a){var c=this;return c.debug("_initLogger:",a),c.logger=new b.MetricsLogger(a),c},f.prototype._initLocale=function(a){var b=this;return b.debug("_initLocale:",a),b.localize=d,window._l=b.localize,b},f.prototype._initUser=function(b){var c=this;return c.debug("_initUser:",b),c.user=new a.User(b),c.currUser=c.user,c},f.prototype._setUpListeners=function(){var a=this;a.lastAjax={},$(document).bind("ajaxSend",function(b,c,d){var e=d.data;try{e=JSON.parse(e)}catch(f){}a.lastAjax={url:location.href.slice(0,-1)+d.url,data:e}})},f.prototype.toString=function(){var a=this.user.get("email")||"(anonymous)";return"GalaxyApp("+a+")"},{GalaxyApp:f}}); +define(["mvc/user/user-model","utils/metrics-logger","utils/add-logging","utils/localization","bootstrapped-data"],function(a,b,c,d,e){function f(a){var b=this;return b._init(a||{})}return c(f,"GalaxyApp"),f.prototype.defaultOptions={patchExisting:!0,root:"/"},f.prototype._init=function(a){var b=this;return _.extend(b,Backbone.Events),b._processOptions(a),b.debug("GalaxyApp.options: ",b.options),b._patchGalaxy(window.Galaxy),b._initLogger(a.loggerOptions||{}),b.debug("GalaxyApp.logger: ",b.logger),b._initLocale(),b.debug("GalaxyApp.localize: ",b.localize),b.config=a.config||e.config||{},b.debug("GalaxyApp.config: ",b.config),b._initUser(a.user||e.user||{}),b.debug("GalaxyApp.user: ",b.user),b.trigger("ready",b),b._setUpListeners(),b},f.prototype._processOptions=function(a){var b=this,c=b.defaultOptions;b.debug("_processOptions: ",a),b.options={};for(var d in c)c.hasOwnProperty(d)&&(b.options[d]=a.hasOwnProperty(d)?a[d]:c[d]);return b},f.prototype._patchGalaxy=function(a){var b=this;if(b.options.patchExisting&&a){b.debug("found existing Galaxy object:",a);for(var c in a)a.hasOwnProperty(c)&&(b.debug(" patching in "+c+" to Galaxy"),b[c]=a[c])}},f.prototype._initLogger=function(a){var c=this;return c.debug("_initLogger:",a),c.logger=new b.MetricsLogger(a),c},f.prototype._initLocale=function(a){var b=this;return b.debug("_initLocale:",a),b.localize=d,window._l=b.localize,b},f.prototype._initUser=function(b){var c=this;return c.debug("_initUser:",b),c.user=new a.User(b),c.currUser=c.user,c},f.prototype._setUpListeners=function(){var a=this;return a.lastAjax={},$(document).bind("ajaxSend",function(b,c,d){var e=d.data;try{e=JSON.parse(e)}catch(f){}a.lastAjax={url:location.href.slice(0,-1)+d.url,data:e}}),a._listenToGalaxyMain(),a},f.prototype._listenToGalaxyMain=function(){var a=this,b="iframe#galaxy_main",c=$(b);if(c=c.size()?c.get(0).contentWindow:void 0){var d=function(){try{var c=$(b).get(0).contentWindow,d=c.location.pathname+c.location.search+c.location.hash;a.trigger("galaxy_main:load",{fullpath:d,pathname:c.location.pathname,search:c.location.search,hash:c.location.hash})}catch(e){a.debug("Error handling main frame load:",e)}};$(b).on("load",d)}else a.debug("No galaxy_main found")},f.prototype.toString=function(){var a=this.user.get("email")||"(anonymous)";return"GalaxyApp("+a+")"},{GalaxyApp:f}}); //# sourceMappingURL=../maps/galaxy-app-base.js.map \ No newline at end of file diff --git a/static/scripts/mvc/history/history-panel-edit-current.js b/static/scripts/mvc/history/history-panel-edit-current.js index 8ec0e50e112..5bae59108ea 100644 --- a/static/scripts/mvc/history/history-panel-edit-current.js +++ b/static/scripts/mvc/history/history-panel-edit-current.js @@ -1,2 +1,2 @@ -define(["mvc/history/history-model","mvc/history/history-panel-edit","mvc/collection/collection-panel","mvc/base-mvc","utils/localization"],function(a,b,c,d,e){var f=d.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});f.storageKey=function(){return"history-panel"};var g=b.HistoryPanelEdit,h=g.extend({className:g.prototype.className+" current-history-panel",emptyMsg:e("This history is empty. Click 'Get Data' on the left tool menu to start"),noneFoundMsg:e("No matching datasets found"),HDCAViewClass:g.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),initialize:function(a){a=a||{},this.preferences=new f(_.extend({id:f.storageKey()},_.pick(a,_.keys(f.prototype.defaults)))),g.prototype.initialize.call(this,a),this.panelStack=[],this.currentContentId=a.currentContentId||null},_setUpListeners:function(){g.prototype._setUpListeners.call(this);var a=this;this.$scrollContainer().on("scroll",function(){a.$el.is(":visible")&&a.preferences.set("scrollPosition",$(this).scrollTop())}),this.on("new-model",function(){a.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(a){this.debug(this+".loadCurrentHistory");var b=this;return this.loadHistoryWithDetails("current",a).then(function(){b.trigger("current-history",b)})},switchToHistory:function(a,b){var c=this,d=function(){return jQuery.getJSON(galaxy_config.root+"history/set_as_current?id="+a)};return this.loadHistoryWithDetails(a,b,d).then(function(){c.trigger("switched-history",c)})},createNewHistory:function(a){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous())return this.displayMessage("error",e("You must be logged in to create histories")),$.when();var b=this,c=function(){return jQuery.getJSON(galaxy_config.root+"history/create_new_current")};return this.loadHistory(void 0,a,c).then(function(){b.trigger("new-history",b)})},setModel:function(a,b,c){return g.prototype.setModel.call(this,a,b,c),this.model&&(this.log("checking for updates"),this.model.checkForUpdates()),this},_setUpCollectionListeners:function(){g.prototype._setUpCollectionListeners.call(this),this.collection.on("state:ready",function(a){a.get("visible")||this.storage.get("show_hidden")||this.removeItemView(a)},this)},_setUpModelListeners:function(){g.prototype._setUpModelListeners.call(this),Galaxy&&Galaxy.quotaMeter&&this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})},_buildNewRender:function(){if(!this.model)return $();var a=g.prototype._buildNewRender.call(this);return a.find(".search").prependTo(a.find(".controls")),this._renderQuotaMessage(a),a},_renderQuotaMessage:function(a){return a=a||this.$el,$(this.templates.quotaMsg({},this)).prependTo(a.find(".messages"))},_renderEmptyMessage:function(a){var b=this,c=b.$emptyMessage(a),d=$(".toolMenuContainer");return _.isEmpty(b.views)&&!b.searchFor&&Galaxy&&Galaxy.upload&&d.size()?(c.empty(),c.html([e("This history is empty"),". ",e("You can "),'',e("load your own data"),"",e(" or "),'',e("get data from an external source"),""].join("")),c.find(".uploader-link").click(function(a){Galaxy.upload.show(a)}),c.find(".get-data-link").click(function(){d.parent().scrollTop(0),d.find('span:contains("Get Data")').click()}),c.show()):g.prototype._renderEmptyMessage.call(this,a)},_renderTags:function(a){var b=this;g.prototype._renderTags.call(this,a),this.preferences.get("tagsEditorShown")&&this.tagsEditor.toggle(!0),this.tagsEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(a){b.preferences.set("tagsEditorShown",a.hidden)})},_renderAnnotation:function(a){var b=this;g.prototype._renderAnnotation.call(this,a),this.preferences.get("annotationEditorShown")&&this.annotationEditor.toggle(!0),this.annotationEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(a){b.preferences.set("annotationEditorShown",a.hidden)})},_swapNewRender:function(a){g.prototype._swapNewRender.call(this,a);var b=this;return _.delay(function(){var a=b.preferences.get("scrollPosition");a&&b.scrollTo(a)},10),this},_attachItems:function(a){g.prototype._attachItems.call(this,a);var b,c=this;return c.currentContentId&&(b=c.viewFromModelId(c.currentContentId))&&c.setCurrentContent(b),this},addItemView:function(a,b,c){var d=g.prototype.addItemView.call(this,a,b,c);return d&&this.panelStack.length?this._collapseDrilldownPanel():d},_setUpItemViewListeners:function(a){var b=this;return g.prototype._setUpItemViewListeners.call(b,a),a.on("expanded:drilldown",function(a,b){this._expandDrilldownPanel(b)},this),a.on("collapsed:drilldown",function(a,b){this._collapseDrilldownPanel(b)},this),a.on("display edit params rerun report-err visualize",function(a){this.setCurrentContent(a)},this),this},setCurrentContent:function(a){this.$(".history-content.current-content").removeClass("current-content"),a?(a.$el.addClass("current-content"),this.currentContentId=a.model.id):this.currentContentId=null},_expandDrilldownPanel:function(a){this.panelStack.push(a),this.$("> .controls").add(this.$list()).hide(),a.parentName=this.model.get("name"),this.$el.append(a.render().$el)},_collapseDrilldownPanel:function(){this.panelStack.pop(),this.render()},connectToQuotaMeter:function(a){return a?(this.listenTo(a,"quota:over",this.showQuotaMessage),this.listenTo(a,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){a&&a.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(a){var b=_.isUndefined(a)?this.$messages().children('[class$="message"]'):$(a.currentTarget);return b=b.not(".quota-message"),b.fadeOut(this.fxSpeed,function(){$(this).remove()}),this},showQuotaMessage:function(){var a=this.$(".quota-message");a.is(":hidden")&&a.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var a=this.$(".quota-message");a.is(":hidden")||a.slideUp(this.fxSpeed)},toString:function(){return"CurrentHistoryPanel("+(this.model?this.model.get("name"):"")+")"}});return h.prototype.templates=function(){var a=d.wrapTemplate(['
',e("You are over your disk quota"),". ",e("Tool execution is on hold until your disk usage drops below your allocated quota"),".","
"],"history");return _.extend(_.clone(g.prototype.templates),{quotaMsg:a})}(),{CurrentHistoryPanel:h}}); +define(["mvc/history/history-model","mvc/history/history-panel-edit","mvc/collection/collection-panel","mvc/base-mvc","utils/localization"],function(a,b,c,d,e){var f=d.SessionStorageModel.extend({defaults:{tagsEditorShown:!1,annotationEditorShown:!1,scrollPosition:0},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});f.storageKey=function(){return"history-panel"};var g=b.HistoryPanelEdit,h=g.extend({className:g.prototype.className+" current-history-panel",emptyMsg:e("This history is empty. Click 'Get Data' on the left tool menu to start"),noneFoundMsg:e("No matching datasets found"),HDCAViewClass:g.prototype.HDCAViewClass.extend({foldoutStyle:"drilldown"}),initialize:function(a){a=a||{},this.preferences=new f(_.extend({id:f.storageKey()},_.pick(a,_.keys(f.prototype.defaults)))),g.prototype.initialize.call(this,a),this.panelStack=[],this.currentContentId=a.currentContentId||null},_setUpListeners:function(){g.prototype._setUpListeners.call(this);var a=this;this.$scrollContainer().on("scroll",function(){a.$el.is(":visible")&&a.preferences.set("scrollPosition",$(this).scrollTop())}),this.on("new-model",function(){a.preferences.set("scrollPosition",0)})},loadCurrentHistory:function(a){this.debug(this+".loadCurrentHistory");var b=this;return this.loadHistoryWithDetails("current",a).then(function(){b.trigger("current-history",b)})},switchToHistory:function(a,b){var c=this,d=function(){return jQuery.getJSON(galaxy_config.root+"history/set_as_current?id="+a)};return this.loadHistoryWithDetails(a,b,d).then(function(){c.trigger("switched-history",c)})},createNewHistory:function(a){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous())return this.displayMessage("error",e("You must be logged in to create histories")),$.when();var b=this,c=function(){return jQuery.getJSON(galaxy_config.root+"history/create_new_current")};return this.loadHistory(void 0,a,c).then(function(){b.trigger("new-history",b)})},setModel:function(a,b,c){return g.prototype.setModel.call(this,a,b,c),this.model&&(this.log("checking for updates"),this.model.checkForUpdates()),this},_setUpCollectionListeners:function(){g.prototype._setUpCollectionListeners.call(this),this.collection.on("state:ready",function(a){a.get("visible")||this.storage.get("show_hidden")||this.removeItemView(a)},this)},_setUpModelListeners:function(){g.prototype._setUpModelListeners.call(this),Galaxy&&Galaxy.quotaMeter&&this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})},_buildNewRender:function(){if(!this.model)return $();var a=g.prototype._buildNewRender.call(this);return a.find(".search").prependTo(a.find(".controls")),this._renderQuotaMessage(a),a},_renderQuotaMessage:function(a){return a=a||this.$el,$(this.templates.quotaMsg({},this)).prependTo(a.find(".messages"))},_renderEmptyMessage:function(a){var b=this,c=b.$emptyMessage(a),d=$(".toolMenuContainer");return _.isEmpty(b.views)&&!b.searchFor&&Galaxy&&Galaxy.upload&&d.size()?(c.empty(),c.html([e("This history is empty"),". ",e("You can "),'',e("load your own data"),"",e(" or "),'',e("get data from an external source"),""].join("")),c.find(".uploader-link").click(function(a){Galaxy.upload.show(a)}),c.find(".get-data-link").click(function(){d.parent().scrollTop(0),d.find('span:contains("Get Data")').click()}),c.show()):g.prototype._renderEmptyMessage.call(this,a)},_renderTags:function(a){var b=this;g.prototype._renderTags.call(this,a),this.preferences.get("tagsEditorShown")&&this.tagsEditor.toggle(!0),this.tagsEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(a){b.preferences.set("tagsEditorShown",a.hidden)})},_renderAnnotation:function(a){var b=this;g.prototype._renderAnnotation.call(this,a),this.preferences.get("annotationEditorShown")&&this.annotationEditor.toggle(!0),this.annotationEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(a){b.preferences.set("annotationEditorShown",a.hidden)})},_swapNewRender:function(a){g.prototype._swapNewRender.call(this,a);var b=this;return _.delay(function(){var a=b.preferences.get("scrollPosition");a&&b.scrollTo(a)},10),this},_attachItems:function(a){g.prototype._attachItems.call(this,a);var b=this;return b.currentContentId&&b._setCurrentContentById(b.currentContentId),this},addItemView:function(a,b,c){var d=g.prototype.addItemView.call(this,a,b,c);return d&&this.panelStack.length?this._collapseDrilldownPanel():d},_setUpItemViewListeners:function(a){var b=this;return g.prototype._setUpItemViewListeners.call(b,a),a.on("expanded:drilldown",function(a,b){this._expandDrilldownPanel(b)},this),a.on("collapsed:drilldown",function(a,b){this._collapseDrilldownPanel(b)},this),this},setCurrentContent:function(a){this.$(".history-content.current-content").removeClass("current-content"),a?(a.$el.addClass("current-content"),this.currentContentId=a.model.id):this.currentContentId=null},_setCurrentContentById:function(a){var b=this.viewFromModelId(a)||null;this.setCurrentContent(b)},_expandDrilldownPanel:function(a){this.panelStack.push(a),this.$("> .controls").add(this.$list()).hide(),a.parentName=this.model.get("name"),this.$el.append(a.render().$el)},_collapseDrilldownPanel:function(){this.panelStack.pop(),this.render()},listenToGalaxy:function(a){a.on("galaxy_main:load",function(a){var b=a.fullpath,c={display:/datasets\/([a-f0-9]+)\/display/,edit:/datasets\/([a-f0-9]+)\/edit/,report_error:/dataset\/errors\?id=([a-f0-9]+)/,rerun:/tool_runner\/rerun\?id=([a-f0-9]+)/,show_params:/datasets\/([a-f0-9]+)\/show_params/},d=null,e=null;_.find(c,function(a,c){var f=b.match(a);return f&&2==f.length?(d=f[1],e=c,!0):!1}),d="dataset-"+d,this._setCurrentContentById(d)},this)},connectToQuotaMeter:function(a){return a?(this.listenTo(a,"quota:over",this.showQuotaMessage),this.listenTo(a,"quota:under",this.hideQuotaMessage),this.on("rendered rendered:initial",function(){a&&a.isOverQuota()&&this.showQuotaMessage()}),this):this},clearMessages:function(a){var b=_.isUndefined(a)?this.$messages().children('[class$="message"]'):$(a.currentTarget);return b=b.not(".quota-message"),b.fadeOut(this.fxSpeed,function(){$(this).remove()}),this},showQuotaMessage:function(){var a=this.$(".quota-message");a.is(":hidden")&&a.slideDown(this.fxSpeed)},hideQuotaMessage:function(){var a=this.$(".quota-message");a.is(":hidden")||a.slideUp(this.fxSpeed)},toString:function(){return"CurrentHistoryPanel("+(this.model?this.model.get("name"):"")+")"}});return h.prototype.templates=function(){var a=d.wrapTemplate(['
',e("You are over your disk quota"),". ",e("Tool execution is on hold until your disk usage drops below your allocated quota"),".","
"],"history");return _.extend(_.clone(g.prototype.templates),{quotaMsg:a})}(),{CurrentHistoryPanel:h}}); //# sourceMappingURL=../../../maps/mvc/history/history-panel-edit-current.js.map \ No newline at end of file diff --git a/templates/webapps/galaxy/root/index.mako b/templates/webapps/galaxy/root/index.mako index d4514e7c125..86e8570161f 100644 --- a/templates/webapps/galaxy/root/index.mako +++ b/templates/webapps/galaxy/root/index.mako @@ -27,7 +27,7 @@ var galaxy_async = new GalaxyAsync(); galaxy_async.set_func_url( galaxy_async.set_user_pref, "${h.url_for( controller='user', action='set_user_pref_async' )}"); - + $(function(){ // Fix iFrame scrolling on iOS if( navigator.userAgent.match( /(iPhone|iPod|iPad)/i ) ) { @@ -82,7 +82,7 @@ else: center_url = h.url_for( controller="root", action="welcome" ) %> - +
@@ -150,6 +150,7 @@ $scrollContainer: function(){ return this.$el.parent(); } }); currPanel.connectToQuotaMeter( Galaxy.quotaMeter ); + currPanel.listenToGalaxy( Galaxy ); currPanel.loadCurrentHistory(); Galaxy.currHistoryPanel = currPanel; });