UI, history: correct current dataset, tags, annos

Correct the 'currently used dataset' indicator (the left, blue border)
making sure it clears when non-dataset related content loads in the
center panel.

Correct the toggling of tags and annotations in the current history
view forcing the subviews to show/hide based on the history view
and not by toggling them individually.
This commit is contained in:
carlfeberhard
2016-04-04 11:12:54 -04:00
parent ea921d2d7a
commit c4f8a30bbd
19 changed files with 70 additions and 88 deletions
+1 -2
View File
@@ -241,7 +241,6 @@ var CenterPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend({
search : location.search,
hash : location.hash
});
this.trigger( 'galaxy_main:load', location );
}
},
@@ -260,7 +259,7 @@ var CenterPanel = Backbone.View.extend( BASE_MVC.LoggableMixin ).extend({
this.prev = view;
this.$( '#galaxy_main' ).attr( 'src', 'about:blank' ).hide();
this.$( '#center-panel' ).scrollTop( 0 ).append( view.$el ).show();
this.trigger( 'center-panel:load', view );
Galaxy.trigger( 'center-panel:load', view );
} else {
if( view ){
+1 -6
View File
@@ -29,7 +29,6 @@ var AnnotationEditor = Backbone.View
render : function(){
var view = this;
this.$el.html( this._template() );
this.$el.find( "[title]" ).tooltip( this.tooltipConfig );
//TODO: handle empties better
this.$annotation().make_text_editable({
@@ -48,15 +47,11 @@ var AnnotationEditor = Backbone.View
/** @returns {String} the html text used to build the view's DOM */
_template : function(){
var annotation = this.model.get( 'annotation' );
//if( !annotation ){
// //annotation = [ '<em class="annotation-empty">', _l( 'Click to add an annotation' ), '</em>' ].join( '' );
// annotation = [ '<em class="annotation-empty"></em>' ].join( '' );
//}
return [
//TODO: make prompt optional
'<label class="prompt">', _l( 'Annotation' ), '</label>',
// set up initial tags by adding as CSV to input vals (necc. to init select2)
'<div class="annotation" title="', _l( 'Edit annotation' ), '">',
'<div class="annotation">',
_.escape( annotation ),
'</div>'
].join( '' );
@@ -190,11 +190,7 @@ var HistoryContents = _super.extend( BASE_MVC.LoggableMixin ).extend({
visible : ''
};
}
// console.log( 'fetching updated:', this.historyId, since );
return this.fetch( options )
// .done( function( r ){ console.log( 'updated:\n', JSON.stringify( r ) ); })
.done( function( r ){ console.log( 'updated:', r.length, r ); })
;
return this.fetch( options );
},
/** */
@@ -348,10 +348,15 @@ var CurrentHistoryView = _super.extend(
// ........................................................................ external objects/MVC
listenToGalaxy : function( galaxy ){
// TODO: MEM: questionable reference island / closure practice
this.listenTo( galaxy, 'galaxy_main:load', function( data ){
var pathToMatch = data.fullpath,
useToURLRegexMap = {
this.listenTo( galaxy, {
// when the galaxy_main iframe is loaded with a new page,
// compare the url to the following list and if there's a match
// pull the id from url and indicate in the history view that
// the dataset with that id is the 'current'ly active dataset
'galaxy_main:load': function( data ){
var pathToMatch = data.fullpath;
var hdaId = null;
var useToURLRegexMap = {
'display' : /datasets\/([a-f0-9]+)\/display/,
'edit' : /datasets\/([a-f0-9]+)\/edit/,
'report_error' : /dataset\/errors\?id=([a-f0-9]+)/,
@@ -359,21 +364,19 @@ var CurrentHistoryView = _super.extend(
'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 );
};
_.find( useToURLRegexMap, function( regex, use ){
// grab the more specific match result (1), save, and use it as the find flag
hdaId = _.result( pathToMatch.match( regex ), 1 );
return hdaId;
});
// need to type mangle to go from web route to history contents
this._setCurrentContentById( hdaId? ( 'dataset-' + hdaId ) : null );
},
// when the center panel is given a new view, clear the current indicator
'center-panel:load': function( view ){
this._setCurrentContentById();
}
});
},
@@ -367,21 +367,19 @@ var HistoryViewEdit = _super.extend(
},
/** toggle the visibility of each content's tagsEditor applying all the args sent to this function */
toggleHDATagEditors : function( showOrHide ){
var args = Array.prototype.slice.call( arguments, 1 );
toggleHDATagEditors : function( showOrHide, speed ){
_.each( this.views, function( view ){
if( view.tagsEditor ){
view.tagsEditor.toggle.apply( view.tagsEditor, args );
view.tagsEditor.toggle( showOrHide, speed );
}
});
},
/** toggle the visibility of each content's annotationEditor applying all the args sent to this function */
toggleHDAAnnotationEditors : function( showOrHide ){
var args = Array.prototype.slice.call( arguments, 1 );
toggleHDAAnnotationEditors : function( showOrHide, speed ){
_.each( this.views, function( view ){
if( view.annotationEditor ){
view.annotationEditor.toggle.apply( view.annotationEditor, args );
view.annotationEditor.toggle( showOrHide, speed );
}
});
},
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"panel.js","sources":["../../src/layout/panel.js"],"names":["define","jQuery","_","Backbone","BASE_MVC","$","MIN_PANEL_WIDTH","MAX_PANEL_WIDTH","SidePanel","View","extend","LoggableMixin","_logNamespace","initialize","attributes","this","log","title","hidden","savedSize","hiddenByTool","$center","$el","siblings","$toggleButton","render","html","template","id","_templateHeader","_templateBody","_templateFooter","join","escape","events","mousedown .unified-panel-footer > .drag","click .unified-panel-footer > .panel-collapse","_mousedownDragHandler","ev","move","e","delta","pageX","prevX","oldWidth","self","width","newWidth","draggingLeft","Math","min","max","resize","show","on","one","hide","off","newSize","css","animation","whichSide","animate","removeClass","addClass","toggle","handle_minwidth_hint","hint","space","force_panel","op","toString","LeftPanel","RightPanel","CenterPanel","options","prev","bind","_iframeChangeHandler","iframe","currentTarget","location","contentWindow","host","remove","Galaxy","trigger","fullpath","pathname","search","hash","display","view","message","onbeforeunload","confirm","undefined","attr","scrollTop","append"],"mappings":"AAAAA,QACI,SACA,kBACA,gBACA,gBACD,SAAUC,EAAQC,EAAGC,EAAUC,GAElC,YAEA,IAAIC,GAAIJ,EAEJK,EAAkB,IAClBC,EAAkB,IAMlBC,EAAYL,EAASM,KAAKC,OAAQN,EAASO,eAAgBD,QAC3DE,cAAgB,SAEhBC,WAAY,SAAUC,GAClBC,KAAKC,IAAKD,KAAO,eAAgBD,GACjCC,KAAKE,MAAQH,EAAWG,OAAS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PANEL_WIDTH","SidePanel","View","extend","LoggableMixin","_logNamespace","initialize","attributes","this","log","title","hidden","savedSize","hiddenByTool","$center","$el","siblings","$toggleButton","render","html","template","id","_templateHeader","_templateBody","_templateFooter","join","escape","events","mousedown .unified-panel-footer > .drag","click .unified-panel-footer > .panel-collapse","_mousedownDragHandler","ev","move","e","delta","pageX","prevX","oldWidth","self","width","newWidth","draggingLeft","Math","min","max","resize","show","on","one","hide","off","newSize","css","animation","whichSide","animate","removeClass","addClass","toggle","handle_minwidth_hint","hint","space","force_panel","op","toString","LeftPanel","RightPanel","CenterPanel","options","prev","bind","_iframeChangeHandler","iframe","currentTarget","location","contentWindow","host","remove","Galaxy","trigger","fullpath","pathname","search","hash","display","view","message","onbeforeunload","confirm","undefined","attr","scrollTop","append"],"mappings":"AAAAA,QACI,SACA,kBACA,gBACA,gBACD,SAAUC,EAAQC,EAAGC,EAAUC,GAElC,YAEA,IAAIC,GAAIJ,EAEJK,EAAkB,IAClBC,EAAkB,IAMlBC,EAAYL,EAASM,KAAKC,OAAQN,EAASO,eAAgBD,QAC3DE,cAAgB,SAEhBC,WAAY,SAAUC,GAClBC,KAAKC,IAAKD,KAAO,eAAgBD,GACjCC,KAAKE,MAAQH,EAAWG,OAASF,KAAKE,OAAS,GAE/CF,KAAKG,QAAS,EACdH,KAAKI,UAAY,KACjBJ,KAAKK,cAAe,GAGxBC,QAAU,WACN,MAAON,MAAKO,IAAIC,SAAU,YAG9BC,cAAgB,WACZ,MAAOT,MAAKV,EAAG,4CAGnBoB,OAAQ,WACJV,KAAKC,IAAKD,KAAO,YACjBA,KAAKO,IAAII,KAAMX,KAAKY,SAAUZ,KAAKa,MAIvCD,SAAU,WACN,OACIZ,KAAKc,kBACLd,KAAKe,gBACLf,KAAKgB,mBACPC,KAAK,KAIXH,gBAAiB,WACb,OACI,uDACI,2CACI,2DACA,kCAAmC3B,EAAE+B,OAAQlB,KAAKE,OAAS,SAC/D,SACJ,UACFe,KAAK,KAIXF,cAAe,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AAWP,EAASQ,OAASR,EAASS,KACzDF,SAAUP,EAASO,SACnBC,OAAUR,EAASQ,OACnBC,KAAUT,EAASS,SAM/BC,QAAS,SAAUC,GAGf,GAAIV,GAAgBnE,KAAKV,EAAG,gBAAkB,GAAI6E,kBAC9CW,EAAUX,EAAcY,gBAAkBZ,EAAcY,kBACtDD,GAAWE,QAASF,IACtBX,EAAcY,eAAiBE,OAE3BjF,KAAK6D,MACL7D,KAAK6D,KAAKQ,SAEdrE,KAAK6D,KAAOgB,EACZ7E,KAAKV,EAAG,gBAAiB4F,KAAM,MAAO,eAAgBzC,OACtDzC,KAAKV,EAAG,iBAAkB6F,UAAW,GAAIC,OAAQP,EAAKtE,KAAM+B,OAC5DgC,OAAOC,QAAS,oBAAqBM,IAGjCA,GACAA,EAAKR,UAKjBzD,SAAU,WACN,OAEI,8DACI,+DACQ,2DACR,0BACK,yGACT,UACFK,KAAK,KAGXuC,SAAW,WAAY,MAAO,gBAK9B,QACIC,UAAYA,EACZC,WAAaA,EACbC,YAAcA"}
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"annotation.js","sources":["../../src/mvc/annotation.js"],"names":["define","baseMVC","_l","AnnotationEditor","Backbone","View","extend","LoggableMixin","HiddenUntilActivatedViewMixin","tagName","className","initialize","options","this","tooltipConfig","placement","listenTo","model","render","hiddenUntilActivated","$activator","view","$el","html","_template","find","tooltip","$annotation","make_text_editable","use_textarea","on_finish","newAnnotation","text","save","annotation","silent","fail","previous","get","_","escape","join","remove","off","stopListening","prototype","call","toString"],"mappings":"AAAAA,QACI,eACA,qBACA,oBACD,SAAUC,EAASC,GAItB,GAAIC,GAAmBC,SAASC,KACvBC,OAAQL,EAAQM,eAChBD,OAAQL,EAAQO,+BAAgCF,QAErDG,QAAc,MACdC,UAAc,qBAGdC,WAAa,SAAUC,GACnBA,EAAUA,MACVC,KAAKC,cAAgBF,EAAQE,gBAAmBC,UAAW,UAG3DF,KAAKG,SAAUH,KAAKI,MAAO,oBAAqB,WAC5CJ,KAAKK,WAETL,KAAKM,qBAAsBP,EAAQQ,WAAYR,IAInDM,OAAS,WACL,GAAIG,GAAOR,IAeX,OAdAA,MAAKS,IAAIC,KAAMV,KAAKW,aACpBX,KAAKS,IAAIG,KAAM,WAAYC,QAASb,KAAKC,eAGzCD,KAAKc,cAAcC,oBACfC,cAAc,EACdC,UAAW,SAAUC,GACjBV,EAAKM,cAAcK,KAAMD,GACzBV,EAAKJ,MAAMgB,MAAOC,WAAYH,IAAmBI,QAAQ,IACpDC,KAAM,WACHf,EAAKM,cAAcK,KAAMX,EAAKJ,MAAMoB,SAAU,oBAIvDxB,MAIXW,UAAY,WACR,GAAIU,GAAarB,KAAKI,MAAMqB,IAAK,aAKjC,QAEI,yBAA0BpC,EAAI,cAAgB,WAE9C,kCAAmCA,EAAI,mBAAqB,KACxDqC,EAAEC,OAAQN,GACd,UACFO,KAAM,KAIZd,YAAc,WACV,MAAOd,MAAKS,IAAIG,KAAM,gBAI1BiB,OAAS,WACL7B,KAAKc,YAAYgB,MACjB9B,KAAK+B,cAAe/B,KAAKI,OACzBb,SAASC,KAAKwC,UAAUH,OAAOI,KAAMjC,OAIzCkC,SAAW,WAAY,OAAS,oBAAqBlC,KAAKI,MAAQ,GAAI,KAAMwB,KAAK,MAGrF,QACItC,iBAAmBA"}
{"version":3,"file":"annotation.js","sources":["../../src/mvc/annotation.js"],"names":["define","baseMVC","_l","AnnotationEditor","Backbone","View","extend","LoggableMixin","HiddenUntilActivatedViewMixin","tagName","className","initialize","options","this","tooltipConfig","placement","listenTo","model","render","hiddenUntilActivated","$activator","view","$el","html","_template","$annotation","make_text_editable","use_textarea","on_finish","newAnnotation","text","save","annotation","silent","fail","previous","get","_","escape","join","find","remove","off","stopListening","prototype","call","toString"],"mappings":"AAAAA,QACI,eACA,qBACA,oBACD,SAAUC,EAASC,GAItB,GAAIC,GAAmBC,SAASC,KACvBC,OAAQL,EAAQM,eAChBD,OAAQL,EAAQO,+BAAgCF,QAErDG,QAAc,MACdC,UAAc,qBAGdC,WAAa,SAAUC,GACnBA,EAAUA,MACVC,KAAKC,cAAgBF,EAAQE,gBAAmBC,UAAW,UAG3DF,KAAKG,SAAUH,KAAKI,MAAO,oBAAqB,WAC5CJ,KAAKK,WAETL,KAAKM,qBAAsBP,EAAQQ,WAAYR,IAInDM,OAAS,WACL,GAAIG,GAAOR,IAcX,OAbAA,MAAKS,IAAIC,KAAMV,KAAKW,aAGpBX,KAAKY,cAAcC,oBACfC,cAAc,EACdC,UAAW,SAAUC,GACjBR,EAAKI,cAAcK,KAAMD,GACzBR,EAAKJ,MAAMc,MAAOC,WAAYH,IAAmBI,QAAQ,IACpDC,KAAM,WACHb,EAAKI,cAAcK,KAAMT,EAAKJ,MAAMkB,SAAU,oBAIvDtB,MAIXW,UAAY,WACR,GAAIQ,GAAanB,KAAKI,MAAMmB,IAAK,aACjC,QAEI,yBAA0BlC,EAAI,cAAgB,WAE9C,2BACImC,EAAEC,OAAQN,GACd,UACFO,KAAM,KAIZd,YAAc,WACV,MAAOZ,MAAKS,IAAIkB,KAAM,gBAI1BC,OAAS,WACL5B,KAAKY,YAAYiB,MACjB7B,KAAK8B,cAAe9B,KAAKI,OACzBb,SAASC,KAAKuC,UAAUH,OAAOI,KAAMhC,OAIzCiC,SAAW,WAAY,OAAS,oBAAqBjC,KAAKI,MAAQ,GAAI,KAAMsB,KAAK,MAGrF,QACIpC,iBAAmBA"}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+28 -36
View File
@@ -13464,10 +13464,15 @@ webpackJsonp([0,1],[
// ........................................................................ external objects/MVC
listenToGalaxy : function( galaxy ){
// TODO: MEM: questionable reference island / closure practice
this.listenTo( galaxy, 'galaxy_main:load', function( data ){
var pathToMatch = data.fullpath,
useToURLRegexMap = {
this.listenTo( galaxy, {
// when the galaxy_main iframe is loaded with a new page,
// compare the url to the following list and if there's a match
// pull the id from url and indicate in the history view that
// the dataset with that id is the 'current'ly active dataset
'galaxy_main:load': function( data ){
var pathToMatch = data.fullpath;
var hdaId = null;
var useToURLRegexMap = {
'display' : /datasets\/([a-f0-9]+)\/display/,
'edit' : /datasets\/([a-f0-9]+)\/edit/,
'report_error' : /dataset\/errors\?id=([a-f0-9]+)/,
@@ -13475,21 +13480,19 @@ webpackJsonp([0,1],[
'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 );
};
_.find( useToURLRegexMap, function( regex, use ){
// grab the more specific match result (1), save, and use it as the find flag
hdaId = _.result( pathToMatch.match( regex ), 1 );
return hdaId;
});
// need to type mangle to go from web route to history contents
this._setCurrentContentById( hdaId? ( 'dataset-' + hdaId ) : null );
},
// when the center panel is given a new view, clear the current indicator
'center-panel:load': function( view ){
this._setCurrentContentById();
}
});
},
@@ -14261,11 +14264,7 @@ webpackJsonp([0,1],[
visible : ''
};
}
// console.log( 'fetching updated:', this.historyId, since );
return this.fetch( options )
// .done( function( r ){ console.log( 'updated:\n', JSON.stringify( r ) ); })
.done( function( r ){ console.log( 'updated:', r.length, r ); })
;
return this.fetch( options );
},
/** */
@@ -16358,21 +16357,19 @@ webpackJsonp([0,1],[
},
/** toggle the visibility of each content's tagsEditor applying all the args sent to this function */
toggleHDATagEditors : function( showOrHide ){
var args = Array.prototype.slice.call( arguments, 1 );
toggleHDATagEditors : function( showOrHide, speed ){
_.each( this.views, function( view ){
if( view.tagsEditor ){
view.tagsEditor.toggle.apply( view.tagsEditor, args );
view.tagsEditor.toggle( showOrHide, speed );
}
});
},
/** toggle the visibility of each content's annotationEditor applying all the args sent to this function */
toggleHDAAnnotationEditors : function( showOrHide ){
var args = Array.prototype.slice.call( arguments, 1 );
toggleHDAAnnotationEditors : function( showOrHide, speed ){
_.each( this.views, function( view ){
if( view.annotationEditor ){
view.annotationEditor.toggle.apply( view.annotationEditor, args );
view.annotationEditor.toggle( showOrHide, speed );
}
});
},
@@ -22218,7 +22215,6 @@ webpackJsonp([0,1],[
render : function(){
var view = this;
this.$el.html( this._template() );
this.$el.find( "[title]" ).tooltip( this.tooltipConfig );
//TODO: handle empties better
this.$annotation().make_text_editable({
@@ -22237,15 +22233,11 @@ webpackJsonp([0,1],[
/** @returns {String} the html text used to build the view's DOM */
_template : function(){
var annotation = this.model.get( 'annotation' );
//if( !annotation ){
// //annotation = [ '<em class="annotation-empty">', _l( 'Click to add an annotation' ), '</em>' ].join( '' );
// annotation = [ '<em class="annotation-empty"></em>' ].join( '' );
//}
return [
//TODO: make prompt optional
'<label class="prompt">', _l( 'Annotation' ), '</label>',
// set up initial tags by adding as CSV to input vals (necc. to init select2)
'<div class="annotation" title="', _l( 'Edit annotation' ), '">',
'<div class="annotation">',
_.escape( annotation ),
'</div>'
].join( '' );
File diff suppressed because one or more lines are too long
+1 -2
View File
@@ -15429,7 +15429,6 @@
search : location.search,
hash : location.hash
});
this.trigger( 'galaxy_main:load', location );
}
},
@@ -15448,7 +15447,7 @@
this.prev = view;
this.$( '#galaxy_main' ).attr( 'src', 'about:blank' ).hide();
this.$( '#center-panel' ).scrollTop( 0 ).append( view.$el ).show();
this.trigger( 'center-panel:load', view );
Galaxy.trigger( 'center-panel:load', view );
} else {
if( view ){
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,2 +1,2 @@
define(["jquery","libs/underscore","libs/backbone","mvc/base-mvc"],function(a,b,c,d){"use strict";var e=a,f=160,g=800,h=c.View.extend(d.LoggableMixin).extend({_logNamespace:"layout",initialize:function(a){this.log(this+".initialize:",a),this.title=a.title||this.title||"",this.hidden=!1,this.savedSize=null,this.hiddenByTool=!1},$center:function(){return this.$el.siblings("#center")},$toggleButton:function(){return this.$(".unified-panel-footer > .panel-collapse")},render:function(){this.log(this+".render:"),this.$el.html(this.template(this.id))},template:function(){return[this._templateHeader(),this._templateBody(),this._templateFooter()].join("")},_templateHeader:function(){return['<div class="unified-panel-header" unselectable="on">','<div class="unified-panel-header-inner">','<div class="panel-header-buttons" style="float: right"/>','<div class="panel-header-text">',b.escape(this.title),"</div>","</div>","</div>"].join("")},_templateBody:function(){return'<div class="unified-panel-body"/>'},_templateFooter:function(){return['<div class="unified-panel-footer">','<div class="panel-collapse ',b.escape(this.id),'"/>','<div class="drag"/>',"</div>"].join("")},events:{"mousedown .unified-panel-footer > .drag":"_mousedownDragHandler","click .unified-panel-footer > .panel-collapse":"toggle"},_mousedownDragHandler:function(a){function b(a){var b=a.pageX-h;h=a.pageX;var e=c.$el.width(),i=d?e+b:e-b;i=Math.min(g,Math.max(f,i)),c.resize(i)}var c=this,d="left"===this.id,h=a.pageX;e("#dd-helper").show().on("mousemove",b).one("mouseup",function(){e(this).hide().off("mousemove",b)})},resize:function(a){return this.$el.css("width",a),this.$center().css(this.id,a),self},show:function(){if(this.hidden){var a=this,b={},c=this.id;return b[c]=0,a.$el.css(c,-this.savedSize).show().animate(b,"fast",function(){a.resize(a.savedSize)}),a.hidden=!1,a.$toggleButton().removeClass("hidden"),a}},hide:function(){if(!this.hidden){var a=this,b={},c=this.id;return a.savedSize=this.$el.width(),b[c]=-this.savedSize,this.$el.animate(b,"fast"),this.$center().css(c,0),a.hidden=!0,a.$toggleButton().addClass("hidden"),a}},toggle:function(){var a=this;return a.hidden?a.show():a.hide(),a.hiddenByTool=!1,a},handle_minwidth_hint:function(a){var b=this.$center().width()-(this.hidden?this.savedSize:0);return a>b?this.hidden||(this.toggle(),this.hiddenByTool=!0):this.hiddenByTool&&(this.toggle(),this.hiddenByTool=!1),self},force_panel:function(a){return"show"==a?this.show():"hide"==a?this.hide():self},toString:function(){return"SidePanel("+this.id+")"}}),i=h.extend({id:"left"}),j=h.extend({id:"right"}),k=c.View.extend(d.LoggableMixin).extend({_logNamespace:"layout",initialize:function(a){this.log(this+".initialize:",a),this.prev=null},render:function(){this.log(this+".render:"),this.$el.html(this.template()),this.$("#galaxy_main").on("load",b.bind(this._iframeChangeHandler,this))},_iframeChangeHandler:function(a){var b=a.currentTarget,c=b.contentWindow&&b.contentWindow.location;c&&c.host&&(e(b).show(),this.prev&&this.prev.remove(),this.$("#center-panel").hide(),Galaxy.trigger("galaxy_main:load",{fullpath:c.pathname+c.search+c.hash,pathname:c.pathname,search:c.search,hash:c.hash}),this.trigger("galaxy_main:load",c))},display:function(a){var b=this.$("#galaxy_main")[0].contentWindow||{},c=b.onbeforeunload&&b.onbeforeunload();!c||confirm(c)?(b.onbeforeunload=void 0,this.prev&&this.prev.remove(),this.prev=a,this.$("#galaxy_main").attr("src","about:blank").hide(),this.$("#center-panel").scrollTop(0).append(a.$el).show(),this.trigger("center-panel:load",a)):a&&a.remove()},template:function(){return['<div style="position: absolute; width: 100%; height: 100%">','<iframe name="galaxy_main" id="galaxy_main" frameborder="0" ','style="position: absolute; width: 100%; height: 100%;"/>','<div id="center-panel" ','style="display: none; position: absolute; width: 100%; height: 100%; padding: 10px; overflow: auto;"/>',"</div>"].join("")},toString:function(){return"CenterPanel"}});return{LeftPanel:i,RightPanel:j,CenterPanel:k}});
define(["jquery","libs/underscore","libs/backbone","mvc/base-mvc"],function(a,b,c,d){"use strict";var e=a,f=160,g=800,h=c.View.extend(d.LoggableMixin).extend({_logNamespace:"layout",initialize:function(a){this.log(this+".initialize:",a),this.title=a.title||this.title||"",this.hidden=!1,this.savedSize=null,this.hiddenByTool=!1},$center:function(){return this.$el.siblings("#center")},$toggleButton:function(){return this.$(".unified-panel-footer > .panel-collapse")},render:function(){this.log(this+".render:"),this.$el.html(this.template(this.id))},template:function(){return[this._templateHeader(),this._templateBody(),this._templateFooter()].join("")},_templateHeader:function(){return['<div class="unified-panel-header" unselectable="on">','<div class="unified-panel-header-inner">','<div class="panel-header-buttons" style="float: right"/>','<div class="panel-header-text">',b.escape(this.title),"</div>","</div>","</div>"].join("")},_templateBody:function(){return'<div class="unified-panel-body"/>'},_templateFooter:function(){return['<div class="unified-panel-footer">','<div class="panel-collapse ',b.escape(this.id),'"/>','<div class="drag"/>',"</div>"].join("")},events:{"mousedown .unified-panel-footer > .drag":"_mousedownDragHandler","click .unified-panel-footer > .panel-collapse":"toggle"},_mousedownDragHandler:function(a){function b(a){var b=a.pageX-h;h=a.pageX;var e=c.$el.width(),i=d?e+b:e-b;i=Math.min(g,Math.max(f,i)),c.resize(i)}var c=this,d="left"===this.id,h=a.pageX;e("#dd-helper").show().on("mousemove",b).one("mouseup",function(){e(this).hide().off("mousemove",b)})},resize:function(a){return this.$el.css("width",a),this.$center().css(this.id,a),self},show:function(){if(this.hidden){var a=this,b={},c=this.id;return b[c]=0,a.$el.css(c,-this.savedSize).show().animate(b,"fast",function(){a.resize(a.savedSize)}),a.hidden=!1,a.$toggleButton().removeClass("hidden"),a}},hide:function(){if(!this.hidden){var a=this,b={},c=this.id;return a.savedSize=this.$el.width(),b[c]=-this.savedSize,this.$el.animate(b,"fast"),this.$center().css(c,0),a.hidden=!0,a.$toggleButton().addClass("hidden"),a}},toggle:function(){var a=this;return a.hidden?a.show():a.hide(),a.hiddenByTool=!1,a},handle_minwidth_hint:function(a){var b=this.$center().width()-(this.hidden?this.savedSize:0);return a>b?this.hidden||(this.toggle(),this.hiddenByTool=!0):this.hiddenByTool&&(this.toggle(),this.hiddenByTool=!1),self},force_panel:function(a){return"show"==a?this.show():"hide"==a?this.hide():self},toString:function(){return"SidePanel("+this.id+")"}}),i=h.extend({id:"left"}),j=h.extend({id:"right"}),k=c.View.extend(d.LoggableMixin).extend({_logNamespace:"layout",initialize:function(a){this.log(this+".initialize:",a),this.prev=null},render:function(){this.log(this+".render:"),this.$el.html(this.template()),this.$("#galaxy_main").on("load",b.bind(this._iframeChangeHandler,this))},_iframeChangeHandler:function(a){var b=a.currentTarget,c=b.contentWindow&&b.contentWindow.location;c&&c.host&&(e(b).show(),this.prev&&this.prev.remove(),this.$("#center-panel").hide(),Galaxy.trigger("galaxy_main:load",{fullpath:c.pathname+c.search+c.hash,pathname:c.pathname,search:c.search,hash:c.hash}))},display:function(a){var b=this.$("#galaxy_main")[0].contentWindow||{},c=b.onbeforeunload&&b.onbeforeunload();!c||confirm(c)?(b.onbeforeunload=void 0,this.prev&&this.prev.remove(),this.prev=a,this.$("#galaxy_main").attr("src","about:blank").hide(),this.$("#center-panel").scrollTop(0).append(a.$el).show(),Galaxy.trigger("center-panel:load",a)):a&&a.remove()},template:function(){return['<div style="position: absolute; width: 100%; height: 100%">','<iframe name="galaxy_main" id="galaxy_main" frameborder="0" ','style="position: absolute; width: 100%; height: 100%;"/>','<div id="center-panel" ','style="display: none; position: absolute; width: 100%; height: 100%; padding: 10px; overflow: auto;"/>',"</div>"].join("")},toString:function(){return"CenterPanel"}});return{LeftPanel:i,RightPanel:j,CenterPanel:k}});
//# sourceMappingURL=../../maps/layout/panel.js.map
+1 -1
View File
@@ -1,2 +1,2 @@
define(["mvc/base-mvc","utils/localization","ui/editable-text"],function(a,b){var c=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(a){a=a||{},this.tooltipConfig=a.tooltipConfig||{placement:"bottom"},this.listenTo(this.model,"change:annotation",function(){this.render()}),this.hiddenUntilActivated(a.$activator,a)},render:function(){var a=this;return this.$el.html(this._template()),this.$el.find("[title]").tooltip(this.tooltipConfig),this.$annotation().make_text_editable({use_textarea:!0,on_finish:function(b){a.$annotation().text(b),a.model.save({annotation:b},{silent:!0}).fail(function(){a.$annotation().text(a.model.previous("annotation"))})}}),this},_template:function(){var a=this.model.get("annotation");return['<label class="prompt">',b("Annotation"),"</label>",'<div class="annotation" title="',b("Edit annotation"),'">',_.escape(a),"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off(),this.stopListening(this.model),Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:c}});
define(["mvc/base-mvc","utils/localization","ui/editable-text"],function(a,b){var c=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(a){a=a||{},this.tooltipConfig=a.tooltipConfig||{placement:"bottom"},this.listenTo(this.model,"change:annotation",function(){this.render()}),this.hiddenUntilActivated(a.$activator,a)},render:function(){var a=this;return this.$el.html(this._template()),this.$annotation().make_text_editable({use_textarea:!0,on_finish:function(b){a.$annotation().text(b),a.model.save({annotation:b},{silent:!0}).fail(function(){a.$annotation().text(a.model.previous("annotation"))})}}),this},_template:function(){var a=this.model.get("annotation");return['<label class="prompt">',b("Annotation"),"</label>",'<div class="annotation">',_.escape(a),"</div>"].join("")},$annotation:function(){return this.$el.find(".annotation")},remove:function(){this.$annotation.off(),this.stopListening(this.model),Backbone.View.prototype.remove.call(this)},toString:function(){return["AnnotationEditor(",this.model+"",")"].join("")}});return{AnnotationEditor:c}});
//# sourceMappingURL=../../maps/mvc/annotation.js.map
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long