galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2014
- 1 participants
- 170 discussions
commit/galaxy-central: davebgx: Functional test script for installing, updating, uninstalling, and reinstalling a repository.
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/944e6ae11d5e/
Changeset: 944e6ae11d5e
User: davebgx
Date: 2014-03-20 21:53:25
Summary: Functional test script for installing, updating, uninstalling, and reinstalling a repository.
Affected #: 2 files
diff -r b95ae5f6d6f513760fa01f596ca52fbc1cff9d6e -r 944e6ae11d5e870ae17b2c928034b4b7cd3b3bb9 test/tool_shed/base/test_db_util.py
--- a/test/tool_shed/base/test_db_util.py
+++ b/test/tool_shed/base/test_db_util.py
@@ -63,11 +63,13 @@
.filter( galaxy.model.tool_shed_install.ToolShedRepository.table.c.id == repository_id ) \
.first()
-def get_installed_repository_by_name_owner( repository_name, owner ):
- return install_session.query( galaxy.model.tool_shed_install.ToolShedRepository ) \
- .filter( and_( galaxy.model.tool_shed_install.ToolShedRepository.table.c.name == repository_name,
- galaxy.model.tool_shed_install.ToolShedRepository.table.c.owner == owner ) ) \
- .first()
+def get_installed_repository_by_name_owner( repository_name, owner, return_multiple=False ):
+ query = install_session.query( galaxy.model.tool_shed_install.ToolShedRepository ) \
+ .filter( and_( galaxy.model.tool_shed_install.ToolShedRepository.table.c.name == repository_name,
+ galaxy.model.tool_shed_install.ToolShedRepository.table.c.owner == owner ) )
+ if return_multiple:
+ return query.all()
+ return query.first()
def get_private_role( user ):
for role in user.all_roles():
@@ -181,7 +183,7 @@
.filter( galaxy.model.User.table.c.email==email ) \
.first()
-def get_repository_by_name_and_owner( name, owner_username ):
+def get_repository_by_name_and_owner( name, owner_username, return_multiple=False ):
owner = get_user_by_name( owner_username )
repository = sa_session.query( model.Repository ) \
.filter( and_( model.Repository.table.c.name == name,
diff -r b95ae5f6d6f513760fa01f596ca52fbc1cff9d6e -r 944e6ae11d5e870ae17b2c928034b4b7cd3b3bb9 test/tool_shed/functional/test_1470_updating_installed_repositories.py
--- /dev/null
+++ b/test/tool_shed/functional/test_1470_updating_installed_repositories.py
@@ -0,0 +1,138 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import logging
+
+log = logging.getLogger(__name__)
+
+repository_name = 'filtering_1470'
+repository_description = "Galaxy's filtering tool"
+repository_long_description = "Long description of Galaxy's filtering tool"
+
+category_name = 'Test 1470 - Updating Installed Repositories'
+category_description = 'Functional test suite to ensure that updating installed repositories does not create white ghosts.'
+
+'''
+1. Install a repository into Galaxy.
+2. In the Tool Shed, update the repository from Step 1.
+3. In Galaxy, get updates to the repository.
+4. In Galaxy, uninstall the repository.
+5. In Galaxy, reinstall the repository.
+6. Make sure step 5 created no white ghosts.
+'''
+
+
+class TestUpdateInstalledRepository( ShedTwillTestCase ):
+ '''Verify that the code correctly handles updating an installed repository, then uninstalling and reinstalling.'''
+
+ def test_0000_initiate_users( self ):
+ """Create necessary user accounts."""
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = self.test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
+
+ def test_0005_create_filtering_repository( self ):
+ """Create and populate the filtering_0530 repository."""
+ category = self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ repository = self.get_or_create_repository( name=repository_name,
+ description=repository_description,
+ long_description=repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ self.upload_file( repository,
+ filename='filtering/filtering_1.1.0.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=True,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Uploaded filtering 1.1.0 tarball.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_install_filtering_to_galaxy( self ):
+ '''Install the filtering_1470 repository to galaxy.'''
+ '''
+ This is step 1 - Install a repository into Galaxy.
+ '''
+ self.galaxy_logout()
+ self.galaxy_login( email=common.admin_email, username=common.admin_username )
+ self.install_repository( repository_name,
+ common.test_user_1_name,
+ category_name,
+ install_tool_dependencies=False,
+ install_repository_dependencies=False,
+ new_tool_panel_section_label='Filtering' )
+ installed_repository = self.test_db_util.get_installed_repository_by_name_owner( repository_name,
+ common.test_user_1_name )
+ strings_displayed = [ 'filtering_1470',
+ self.url.replace( 'http://', '' ),
+ installed_repository.installed_changeset_revision,
+ installed_repository.changeset_revision ]
+ self.display_galaxy_browse_repositories_page( strings_displayed=strings_displayed )
+ self.display_installed_repository_manage_page( installed_repository,
+ strings_displayed=strings_displayed )
+
+ def test_0015_update_repository( self ):
+ '''Upload a readme file to the filtering_1470 repository.'''
+ '''
+ This is step 2 - In the Tool Shed, update the repository from Step 1.
+
+ Importantly, this update should *not* create a new installable changeset revision, because that would
+ eliminate the process we're testing in this script. So, we upload a readme file.
+ '''
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ self.upload_file( repository,
+ filename='filtering/readme.txt',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=False,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Uploaded readme.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0020_get_repository_updates( self ):
+ '''Get updates to the installed repository.'''
+ '''
+ This is step 3 - In Galaxy, get updates to the repository.
+ '''
+ installed_repository = self.test_db_util.get_installed_repository_by_name_owner( repository_name,
+ common.test_user_1_name )
+ self.update_installed_repository( installed_repository )
+
+ def test_0025_uninstall_repository( self ):
+ '''Uninstall the filtering_1470 repository.'''
+ '''
+ This is step 4 - In Galaxy, uninstall the repository.
+ '''
+ installed_repository = self.test_db_util.get_installed_repository_by_name_owner( repository_name,
+ common.test_user_1_name )
+ self.uninstall_repository( installed_repository )
+
+ def test_0030_reinstall_repository( self ):
+ '''Reinstall the filtering_1470 repository.'''
+ '''
+ This is step 5 - In Galaxy, reinstall the repository.
+ '''
+ installed_repository = self.test_db_util.get_installed_repository_by_name_owner( repository_name,
+ common.test_user_1_name )
+ self.reinstall_repository( installed_repository )
+
+ def test_0035_verify_absence_of_ghosts( self ):
+ '''Check the count of repositories in the database named filtering_1470 and owned by user1.'''
+ '''
+ This is step 6 - Make sure step 5 created no white ghosts.
+ '''
+ installed_repository = self.test_db_util.get_installed_repository_by_name_owner( repository_name,
+ common.test_user_1_name,
+ return_multiple=True )
+ assert len( installed_repository ) == 1, 'Multiple filtering repositories found in the Galaxy database, possibly indicating a "white ghost" scenario.'
+
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.
1
0
commit/galaxy-central: martenson: fix: dont override default initialization of bootstrap tooltip with placement 'top'
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b95ae5f6d6f5/
Changeset: b95ae5f6d6f5
User: martenson
Date: 2014-03-20 21:54:43
Summary: fix: dont override default initialization of bootstrap tooltip with placement 'top'
Affected #: 2 files
diff -r 7155334f5ec5743188f90053a54ac851be3e2d58 -r b95ae5f6d6f513760fa01f596ca52fbc1cff9d6e static/scripts/galaxy.base.js
--- a/static/scripts/galaxy.base.js
+++ b/static/scripts/galaxy.base.js
@@ -682,8 +682,9 @@
// Put tooltips below items in panel header so that they do not overlap masthead.
$(".unified-panel-header [title]").tooltip( { placement: 'bottom' } );
- // Default tooltip location to be above item.
- $("[title]").tooltip( { placement: 'top' } );
+ // default tooltip initialization, it will follow the data-placement tag for tooltip location
+ // and fallback to 'top' if not present
+ $("[title]").tooltip();
}
// Make popup menus.
make_popup_menus();
diff -r 7155334f5ec5743188f90053a54ac851be3e2d58 -r b95ae5f6d6f513760fa01f596ca52fbc1cff9d6e static/scripts/packed/galaxy.base.js
--- a/static/scripts/packed/galaxy.base.js
+++ b/static/scripts/packed/galaxy.base.js
@@ -1,1 +1,1 @@
-(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){var l=i.action||i;g.append($("<li></li>").append($("<a>").attr("href",i.url).html(j).click(l)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]={url:f,action:function(){if(!e||confirm(e)){if(h){window.open(f,h);return false}else{g.click()}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=("cur_text" in g?g.cur_text:a.text()),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}$(document).ready(function(){init_refresh_on_change();if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip({placement:"top"})}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})});
\ No newline at end of file
+(function(){var b=0;var c=["ms","moz","webkit","o"];for(var a=0;a<c.length&&!window.requestAnimationFrame;++a){window.requestAnimationFrame=window[c[a]+"RequestAnimationFrame"];window.cancelRequestAnimationFrame=window[c[a]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame){window.requestAnimationFrame=function(h,e){var d=new Date().getTime();var f=Math.max(0,16-(d-b));var g=window.setTimeout(function(){h(d+f)},f);b=d+f;return g}}if(!window.cancelAnimationFrame){window.cancelAnimationFrame=function(d){clearTimeout(d)}}}());if(!Array.indexOf){Array.prototype.indexOf=function(c){for(var b=0,a=this.length;b<a;b++){if(this[b]==c){return b}}return -1}}function obj_length(c){if(c.length!==undefined){return c.length}var b=0;for(var a in c){b++}return b}$.fn.makeAbsolute=function(a){return this.each(function(){var b=$(this);var c=b.position();b.css({position:"absolute",marginLeft:0,marginTop:0,top:c.top,left:c.left,right:$(window).width()-(c.left+b.width())});if(a){b.remove().appendTo("body")}})};function make_popupmenu(b,c){var a=(b.data("menu_options"));b.data("menu_options",c);if(a){return}b.bind("click.show_popup",function(d){$(".popmenu-wrapper").remove();setTimeout(function(){var g=$("<ul class='dropdown-menu' id='"+b.attr("id")+"-menu'></ul>");var f=b.data("menu_options");if(obj_length(f)<=0){$("<li>No Options.</li>").appendTo(g)}$.each(f,function(j,i){if(i){var l=i.action||i;g.append($("<li></li>").append($("<a>").attr("href",i.url).html(j).click(l)))}else{g.append($("<li></li>").addClass("head").append($("<a href='#'></a>").html(j)))}});var h=$("<div class='popmenu-wrapper' style='position: absolute;left: 0; top: -1000;'></div>").append(g).appendTo("body");var e=d.pageX-h.width()/2;e=Math.min(e,$(document).scrollLeft()+$(window).width()-$(h).width()-5);e=Math.max(e,$(document).scrollLeft()+5);h.css({top:d.pageY,left:e})},10);setTimeout(function(){var f=function(h){$(h).bind("click.close_popup",function(){$(".popmenu-wrapper").remove();h.unbind("click.close_popup")})};f($(window.document));f($(window.top.document));for(var e=window.top.frames.length;e--;){var g=$(window.top.frames[e].document);f(g)}},50);return false})}function make_popup_menus(a){a=a||document;$(a).find("div[popupmenu]").each(function(){var b={};var d=$(this);d.find("a").each(function(){var g=$(this),i=g.get(0),e=i.getAttribute("confirm"),f=i.getAttribute("href"),h=i.getAttribute("target");if(!f){b[g.text()]=null}else{b[g.text()]={url:f,action:function(){if(!e||confirm(e)){if(h){window.open(f,h);return false}else{g.click()}}}}}});var c=$(a).find("#"+d.attr("popupmenu"));c.find("a").bind("click",function(f){f.stopPropagation();return true});make_popupmenu(c,b);c.addClass("popup");d.remove()})}function naturalSort(j,h){var p=/(-?[0-9\.]+)/g,k=j.toString().toLowerCase()||"",g=h.toString().toLowerCase()||"",l=String.fromCharCode(0),n=k.replace(p,l+"$1"+l).split(l),e=g.replace(p,l+"$1"+l).split(l),d=(new Date(k)).getTime(),o=d?(new Date(g)).getTime():null;if(o){if(d<o){return -1}else{if(d>o){return 1}}}var m,f;for(var i=0,c=Math.max(n.length,e.length);i<c;i++){m=parseFloat(n[i])||n[i];f=parseFloat(e[i])||e[i];if(m<f){return -1}else{if(m>f){return 1}}}return 0}$.fn.refresh_select2=function(){var b=$(this);var a={width:"resolve",closeOnSelect:!b.is("[MULTIPLE]")};return b.select2(a)};function replace_big_select_inputs(a,c,b){if(!jQuery.fn.select2){return}if(a===undefined){a=20}if(c===undefined){c=3000}b=b||$("select");b.each(function(){var e=$(this);var d=e.find("option").length;if((d<a)||(d>c)){return}if(e.hasClass("no-autocomplete")){return}e.refresh_select2()})}$.fn.make_text_editable=function(g){var d=("num_cols" in g?g.num_cols:30),c=("num_rows" in g?g.num_rows:4),e=("use_textarea" in g?g.use_textarea:false),b=("on_finish" in g?g.on_finish:null),f=("help_text" in g?g.help_text:null);var a=$(this);a.addClass("editable-text").click(function(l){if($(this).children(":input").length>0){return}a.removeClass("editable-text");var i=function(m){a.find(":input").remove();if(m!==""){a.text(m)}else{a.html("<br>")}a.addClass("editable-text");if(b){b(m)}};var h=("cur_text" in g?g.cur_text:a.text()),k,j;if(e){k=$("<textarea/>").attr({rows:c,cols:d}).text($.trim(h)).keyup(function(m){if(m.keyCode===27){i(h)}});j=$("<button/>").text("Done").click(function(){i(k.val());return false})}else{k=$("<input type='text'/>").attr({value:$.trim(h),size:d}).blur(function(){i(h)}).keyup(function(m){if(m.keyCode===27){$(this).trigger("blur")}else{if(m.keyCode===13){i($(this).val())}}})}a.text("");a.append(k);if(j){a.append(j)}k.focus();k.select();l.stopPropagation()});if(f){a.attr("title",f).tooltip()}return a};function async_save_text(d,f,e,a,c,h,i,g,b){if(c===undefined){c=30}if(i===undefined){i=4}$("#"+d).click(function(){if($("#renaming-active").length>0){return}var l=$("#"+f),k=l.text(),j;if(h){j=$("<textarea></textarea>").attr({rows:i,cols:c}).text($.trim(k))}else{j=$("<input type='text'></input>").attr({value:$.trim(k),size:c})}j.attr("id","renaming-active");j.blur(function(){$(this).remove();l.show();if(b){b(j)}});j.keyup(function(n){if(n.keyCode===27){$(this).trigger("blur")}else{if(n.keyCode===13){var m={};m[a]=$(this).val();$(this).trigger("blur");$.ajax({url:e,data:m,error:function(){alert("Text editing for elt "+f+" failed")},success:function(o){if(o!==""){l.text(o)}else{l.html("<em>None</em>")}if(b){b(j)}}})}}});if(g){g(j)}l.hide();j.insertAfter(l);j.focus();j.select();return})}function init_history_items(d,a,c){var b=function(){try{var e=$.jStorage.get("history_expand_state");if(e){for(var g in e){$("#"+g+" div.historyItemBody").show()}}}catch(f){$.jStorage.deleteKey("history_expand_state")}if($.browser.mozilla){$("div.historyItemBody").each(function(){if(!$(this).is(":visible")){$(this).find("pre.peek").css("overflow","hidden")}})}d.each(function(){var j=this.id,h=$(this).children("div.historyItemBody"),i=h.find("pre.peek");$(this).find(".historyItemTitleBar > .historyItemTitle").wrap("<a href='javascript:void(0);'></a>").click(function(){var k;if(h.is(":visible")){if($.browser.mozilla){i.css("overflow","hidden")}h.slideUp("fast");if(!c){k=$.jStorage.get("history_expand_state");if(k){delete k[j];$.jStorage.set("history_expand_state",k)}}}else{h.slideDown("fast",function(){if($.browser.mozilla){i.css("overflow","auto")}});if(!c){k=$.jStorage.get("history_expand_state");if(!k){k={}}k[j]=true;$.jStorage.set("history_expand_state",k)}}return false})});$("#top-links > a.toggle").click(function(){var h=$.jStorage.get("history_expand_state");if(!h){h={}}$("div.historyItemBody:visible").each(function(){if($.browser.mozilla){$(this).find("pre.peek").css("overflow","hidden")}$(this).slideUp("fast");if(h){delete h[$(this).parent().attr("id")]}});$.jStorage.set("history_expand_state",h)}).show()};b()}function commatize(b){b+="";var a=/(\d+)(\d{3})/;while(a.test(b)){b=b.replace(a,"$1,$2")}return b}function reset_tool_search(a){var c=$("#galaxy_tools").contents();if(c.length===0){c=$(document)}$(this).removeClass("search_active");c.find(".toolTitle").removeClass("search_match");c.find(".toolSectionBody").hide();c.find(".toolTitle").show();c.find(".toolPanelLabel").show();c.find(".toolSectionWrapper").each(function(){if($(this).attr("id")!=="recently_used_wrapper"){$(this).show()}else{if($(this).hasClass("user_pref_visible")){$(this).show()}}});c.find("#search-no-results").hide();c.find("#search-spinner").hide();if(a){var b=c.find("#tool-search-query");b.val("search tools")}}var GalaxyAsync=function(a){this.url_dict={};this.log_action=(a===undefined?false:a)};GalaxyAsync.prototype.set_func_url=function(a,b){this.url_dict[a]=b};GalaxyAsync.prototype.set_user_pref=function(a,b){var c=this.url_dict[arguments.callee];if(c===undefined){return false}$.ajax({url:c,data:{pref_name:a,pref_value:b},error:function(){return false},success:function(){return true}})};GalaxyAsync.prototype.log_user_action=function(c,b,d){if(!this.log_action){return}var a=this.url_dict[arguments.callee];if(a===undefined){return false}$.ajax({url:a,data:{action:c,context:b,params:d},error:function(){return false},success:function(){return true}})};function init_refresh_on_change(){$("select[refresh_on_change='true']").off("change").change(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");$(document).trigger("convert_to_values");a.get(0).form.submit()});$(":checkbox[refresh_on_change='true']").off("click").click(function(){var a=$(this),e=a.val(),d=false,c=a.attr("refresh_on_change_values");if(c){c=c.split(",");var b=a.attr("last_selected_value");if($.inArray(e,c)===-1&&$.inArray(b,c)===-1){return}}$(window).trigger("refresh_on_change");a.get(0).form.submit()});$("a[confirm]").off("click").click(function(){return confirm($(this).attr("confirm"))})}$(document).ready(function(){init_refresh_on_change();if($.fn.tooltip){$(".unified-panel-header [title]").tooltip({placement:"bottom"});$("[title]").tooltip()}make_popup_menus();replace_big_select_inputs(20,1500);$("a").click(function(){var b=$(this);var c=(parent.frames&&parent.frames.galaxy_main);if((b.attr("target")=="galaxy_main")&&(!c)){var a=b.attr("href");if(a.indexOf("?")==-1){a+="?"}else{a+="&"}a+="use_panels=True";b.attr("href",a);b.attr("target","_self")}return b})});
\ No newline at end of file
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.
1
0
commit/galaxy-central: carlfeberhard: UI: move base-mvc, annotation and tag editors, user model and quotameter to AMD; fix loading order and currUser in masthead, view, history; remove loggable mixin from scatterplot
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7155334f5ec5/
Changeset: 7155334f5ec5
User: carlfeberhard
Date: 2014-03-20 21:52:06
Summary: UI: move base-mvc, annotation and tag editors, user model and quotameter to AMD; fix loading order and currUser in masthead, view, history; remove loggable mixin from scatterplot
Affected #: 33 files
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 config/plugins/visualizations/scatterplot/src/scatterplot-config-editor.js
--- a/config/plugins/visualizations/scatterplot/src/scatterplot-config-editor.js
+++ b/config/plugins/visualizations/scatterplot/src/scatterplot-config-editor.js
@@ -29,7 +29,7 @@
* configuring which data will be used
* configuring the plot display
*/
-var ScatterplotConfigEditor = Backbone.View.extend( LoggableMixin ).extend({
+var ScatterplotConfigEditor = Backbone.View.extend({
//TODO: !should be a view on a visualization model
//logger : console,
className : 'scatterplot-control-form',
@@ -39,13 +39,13 @@
if( !this.model ){
this.model = new Visualization({ type: 'scatterplot' });
}
- this.log( this + '.initialize, attributes:', attributes );
+ //this.log( this + '.initialize, attributes:', attributes );
if( !attributes || !attributes.dataset ){
throw new Error( "ScatterplotConfigEditor requires a dataset" );
}
this.dataset = attributes.dataset;
- this.log( 'dataset:', this.dataset );
+ //this.log( 'dataset:', this.dataset );
this.display = new ScatterplotDisplay({
dataset : attributes.dataset,
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 config/plugins/visualizations/scatterplot/static/scatterplot-edit.js
--- a/config/plugins/visualizations/scatterplot/static/scatterplot-edit.js
+++ b/config/plugins/visualizations/scatterplot/static/scatterplot-edit.js
@@ -1,1 +1,1 @@
-function scatterplot(a,b,c){function d(){var a={v:{},h:{}};return a.v.lines=p.selectAll("line.v-grid-line").data(m.x.ticks(q.x.fn.ticks()[0])),a.v.lines.enter().append("svg:line").classed("grid-line v-grid-line",!0),a.v.lines.attr("x1",m.x).attr("x2",m.x).attr("y1",0).attr("y2",b.height),a.v.lines.exit().remove(),a.h.lines=p.selectAll("line.h-grid-line").data(m.y.ticks(q.y.fn.ticks()[0])),a.h.lines.enter().append("svg:line").classed("grid-line h-grid-line",!0),a.h.lines.attr("x1",0).attr("x2",b.width).attr("y1",m.y).attr("y2",m.y),a.h.lines.exit().remove(),a}function e(){return t.attr("cx",function(a,b){return m.x(j(a,b))}).attr("cy",function(a,b){return m.y(k(a,b))}).style("display","block").filter(function(){var a=d3.select(this).attr("cx"),c=d3.select(this).attr("cy");return 0>a||a>b.width?!0:0>c||c>b.height?!0:!1}).style("display","none")}function f(){$(".chart-info-box").remove(),q.redraw(),e(),s=d(),$(o.node()).trigger("zoom.scatterplot",{scale:n.scale(),translate:n.translate()})}function g(a,c,d){return c+=8,$(['<div class="chart-info-box" style="position: absolute">',void 0!==b.idColumn?"<div>"+d[b.idColumn]+"</div>":"","<div>",j(d),"</div>","<div>",k(d),"</div>","</div>"].join("")).css({top:a,left:c,"z-index":2})}var h=function(a,b){return"translate("+a+","+b+")"},i=function(a,b,c){return"rotate("+a+","+b+","+c+")"},j=function(a){return a[b.xColumn]},k=function(a){return a[b.yColumn]},l={x:{extent:d3.extent(c,j)},y:{extent:d3.extent(c,k)}},m={x:d3.scale.linear().domain(l.x.extent).range([0,b.width]),y:d3.scale.linear().domain(l.y.extent).range([b.height,0])},n=d3.behavior.zoom().x(m.x).y(m.y).scaleExtent([1,30]).scale(b.scale||1).translate(b.translate||[0,0]),o=d3.select(a).attr("class","scatterplot").attr("width","100%").attr("height",b.height+(b.margin.top+b.margin.bottom)),p=o.append("g").attr("class","content").attr("transform",h(b.margin.left,b.margin.top)).call(n);p.append("rect").attr("class","zoom-rect").attr("width",b.width).attr("height",b.height).style("fill","transparent");var q={x:{},y:{}};q.x.fn=d3.svg.axis().orient("bottom").scale(m.x).ticks(b.xTicks).tickFormat(d3.format("s")),q.y.fn=d3.svg.axis().orient("left").scale(m.y).ticks(b.yTicks).tickFormat(d3.format("s")),q.x.g=p.append("g").attr("class","x axis").attr("transform",h(0,b.height)).call(q.x.fn),q.y.g=p.append("g").attr("class","y axis").call(q.y.fn);var r=6;q.x.label=o.append("text").attr("id","x-axis-label").attr("class","axis-label").text(b.xLabel).attr("text-anchor","middle").attr("dominant-baseline","text-after-edge").attr("x",b.width/2+b.margin.left).attr("y",b.height+b.margin.bottom+b.margin.top-r),q.y.label=o.append("text").attr("id","y-axis-label").attr("class","axis-label").text(b.yLabel).attr("text-anchor","middle").attr("dominant-baseline","text-before-edge").attr("x",r).attr("y",b.height/2).attr("transform",i(-90,r,b.height/2)),q.redraw=function(){o.select(".x.axis").call(q.x.fn),o.select(".y.axis").call(q.y.fn)};var s=d(),t=p.selectAll(".glyph").data(c).enter().append("svg:circle").classed("glyph",!0).attr("cx",function(a,b){return m.x(j(a,b))}).attr("cy",function(a,b){return m.y(k(a,b))}).attr("r",0);t.transition().duration(b.animDuration).attr("r",b.datapointSize),e(),n.on("zoom",f),t.on("mouseover",function(a,c){var d=d3.select(this);d.classed("highlight",!0).style("fill","red").style("fill-opacity",1),p.append("line").attr("stroke","red").attr("stroke-width",1).attr("x1",d.attr("cx")-b.datapointSize).attr("y1",d.attr("cy")).attr("x2",0).attr("y2",d.attr("cy")).classed("hoverline",!0),d.attr("cy")<b.height&&p.append("line").attr("stroke","red").attr("stroke-width",1).attr("x1",d.attr("cx")).attr("y1",+d.attr("cy")+b.datapointSize).attr("x2",d.attr("cx")).attr("y2",b.height).classed("hoverline",!0);var e=this.getBoundingClientRect();$("body").append(g(e.top,e.right,a)),$(o.node()).trigger("mouseover-datapoint.scatterplot",[this,a,c])}),t.on("mouseout",function(){d3.select(this).classed("highlight",!1).style("fill","black").style("fill-opacity",.2),p.selectAll(".hoverline").remove(),$(".chart-info-box").remove()})}this.scatterplot=this.scatterplot||{},this.scatterplot.chartcontrol=Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var f,g="",h="function",i=this.escapeExpression;return g+='<p class="help-text">\n Use the following controls to how the chart is displayed.\n The slide controls can be moved by the mouse or, if the \'handle\' is in focus, your keyboard\'s arrow keys.\n Move the focus between controls by using the tab or shift+tab keys on your keyboard.\n Use the \'Draw\' button to render (or re-render) the chart with the current settings.\n</p>\n\n<div data-config-key="datapointSize" class="form-input numeric-slider-input">\n <label for="datapointSize">Size of data point: </label>\n <div class="slider-output">',(f=c.datapointSize)?f=f.call(b,{hash:{},data:e}):(f=b.datapointSize,f=typeof f===h?f.apply(b):f),g+=i(f)+'</div>\n <div class="slider"></div>\n <p class="form-help help-text-small">\n Size of the graphic representation of each data point\n </p>\n</div>\n\n<div data-config-key="width" class="form-input numeric-slider-input">\n <label for="width">Chart width: </label>\n <div class="slider-output">',(f=c.width)?f=f.call(b,{hash:{},data:e}):(f=b.width,f=typeof f===h?f.apply(b):f),g+=i(f)+'</div>\n <div class="slider"></div>\n <p class="form-help help-text-small">\n (not including chart margins and axes)\n </p>\n</div>\n\n<div data-config-key="height" class="form-input numeric-slider-input">\n <label for="height">Chart height: </label>\n <div class="slider-output">',(f=c.height)?f=f.call(b,{hash:{},data:e}):(f=b.height,f=typeof f===h?f.apply(b):f),g+=i(f)+'</div>\n <div class="slider"></div>\n <p class="form-help help-text-small">\n (not including chart margins and axes)\n </p>\n</div>\n\n<div data-config-key="X-axis-label"class="text-input form-input">\n <label for="X-axis-label">Re-label the X axis: </label>\n <input type="text" name="X-axis-label" id="X-axis-label" value="',(f=c.xLabel)?f=f.call(b,{hash:{},data:e}):(f=b.xLabel,f=typeof f===h?f.apply(b):f),g+=i(f)+'" />\n <p class="form-help help-text-small"></p>\n</div>\n\n<div data-config-key="Y-axis-label" class="text-input form-input">\n <label for="Y-axis-label">Re-label the Y axis: </label>\n <input type="text" name="Y-axis-label" id="Y-axis-label" value="',(f=c.yLabel)?f=f.call(b,{hash:{},data:e}):(f=b.yLabel,f=typeof f===h?f.apply(b):f),g+=i(f)+'" />\n <p class="form-help help-text-small"></p>\n</div>\n\n<button class="render-button btn btn-primary active">Draw</button>\n'}),this.scatterplot.datacontrol=Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var f,g="",h="function";return g+='<p class="help-text">\n Use the following control to change which columns are used by the chart. Click any cell\n from the last three rows of the table to select the column for the appropriate data.\n Use the \'Draw\' button to render (or re-render) the chart with the current settings.\n</p>\n\n<ul class="help-text" style="margin-left: 8px">\n <li><b>X Column</b>: which column values will be used for the x axis of the chart.</li>\n <li><b>Y Column</b>: which column values will be used for the y axis of the chart.</li>\n <li><b>ID Column</b>: an additional column value displayed when the user hovers over a data point.\n It may be useful to select unique or categorical identifiers here (such as gene ids).\n </li>\n</ul>\n\n<div class="column-selection">\n <pre class="peek">',(f=c.peek)?f=f.call(b,{hash:{},data:e}):(f=b.peek,f=typeof f===h?f.apply(b):f),(f||0===f)&&(g+=f),g+='</pre>\n</div>\n\n<p class="help-text help-text-small">\n <b>Note</b>: If it can be determined from the dataset\'s filetype that a column is not numeric,\n that column choice may be disabled for either the x or y axis.\n</p>\n\n<button class="render-button btn btn-primary active">Draw</button>\n'}),this.scatterplot.editor=Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var f="";return f+='<div class="scatterplot-editor tabbable tabs-left">\n \n <ul class="nav nav-tabs">\n \n <li class="active">\n <a title="Use this tab to change which data are used"\n href="#data-control" data-toggle="tab">Data Controls</a>\n </li>\n <li>\n <a title="Use this tab to change how the chart is drawn"\n href="#chart-control" data-toggle="tab" >Chart Controls</a>\n </li>\n \n <li class="disabled">\n <a title="This tab will display the chart"\n href="#chart-display" data-toggle="tab">Chart</a>\n </li>\n \n <li class="file-controls">\n<!-- <button class="copy-btn btn btn-default"\n title="Save this as a new visualization">Save to new</button>-->\n <button class="save-btn btn btn-default">Save</button>\n </li>\n </ul>\n\n \n <div class="tab-content">\n \n <div id="data-control" class="scatterplot-config-control tab-pane active">\n \n </div>\n \n \n <div id="chart-control" class="scatterplot-config-control tab-pane">\n \n </div>\n\n \n <div id="chart-display" class="scatterplot-display tab-pane"></div>\n\n </div>\n</div>\n'});var ScatterplotConfigEditor=Backbone.View.extend(LoggableMixin).extend({className:"scatterplot-control-form",initialize:function(a){if(this.model||(this.model=new Visualization({type:"scatterplot"})),this.log(this+".initialize, attributes:",a),!a||!a.dataset)throw new Error("ScatterplotConfigEditor requires a dataset");this.dataset=a.dataset,this.log("dataset:",this.dataset),this.display=new ScatterplotDisplay({dataset:a.dataset,model:this.model})},render:function(){this.$el.empty().append(ScatterplotConfigEditor.templates.mainLayout({})),this.model.id&&(this.$el.find(".copy-btn").show(),this.$el.find(".save-btn").text("Update saved")),this.$el.find("[title]").tooltip(),this._render_dataControl(),this._render_chartControls(),this._render_chartDisplay();var a=this.model.get("config");return this.model.id&&_.isFinite(a.xColumn)&&_.isFinite(a.yColumn)&&this.renderChart(),this},_getColumnIndecesByType:function(){var a={numeric:[],text:[],all:[]};return _.each(this.dataset.metadata_column_types||[],function(b,c){"int"===b||"float"===b?a.numeric.push(c):("str"===b||"list"===b)&&a.text.push(c),a.all.push(c)}),a.numeric.length<2&&(a.numeric=[]),a},_render_dataControl:function(a){a=a||this.$el;var b=this,c=this.model.get("config"),d=this._getColumnIndecesByType(),e=a.find(".tab-pane#data-control");return e.html(ScatterplotConfigEditor.templates.dataControl({peek:this.dataset.peek})),e.find(".peek").peekControl({controls:[{label:"X Column",id:"xColumn",selected:c.xColumn,disabled:d.text},{label:"Y Column",id:"yColumn",selected:c.yColumn,disabled:d.text},{label:"ID Column",id:"idColumn",selected:c.idColumn}]}).on("peek-control.change",function(a,c){b.model.set("config",c)}).on("peek-control.rename",function(){}),e.find("[title]").tooltip(),e},_render_chartControls:function(a){function b(){var a=$(this),b=a.slider("value");c.model.set("config",_.object([[a.parent().data("config-key"),b]])),a.siblings(".slider-output").text(b)}a=a||this.$el;var c=this,d=this.model.get("config"),e=a.find("#chart-control");e.html(ScatterplotConfigEditor.templates.chartControl(d));var f={datapointSize:{min:2,max:10,step:1},width:{min:200,max:800,step:20},height:{min:200,max:800,step:20}};e.find(".numeric-slider-input").each(function(){var a=$(this),c=a.attr("data-config-key"),e=_.extend(f[c],{value:d[c],change:b,slide:b});a.find(".slider").slider(e),a.children(".slider-output").text(d[c])});var g=this.dataset.metadata_column_names||[],h=d.xLabel||g[d.xColumn]||"X",i=d.yLabel||g[d.yColumn]||"Y";return e.find('input[name="X-axis-label"]').val(h).on("change",function(){c.model.set("config",{xLabel:$(this).val()})}),e.find('input[name="Y-axis-label"]').val(i).on("change",function(){c.model.set("config",{yLabel:$(this).val()})}),e.find("[title]").tooltip(),e},_render_chartDisplay:function(a){a=a||this.$el;var b=a.find(".tab-pane#chart-display");return this.display.setElement(b),this.display.render(),b.find("[title]").tooltip(),b},events:{"change #include-id-checkbox":"toggleThirdColumnSelector","click #data-control .render-button":"renderChart","click #chart-control .render-button":"renderChart","click .save-btn":"saveVisualization"},saveVisualization:function(){var a=this;this.model.save().fail(function(b,c,d){console.error(b,c,d),a.trigger("save:error",view),alert("Error loading data:\n"+b.responseText)}).then(function(){a.display.render()})},toggleThirdColumnSelector:function(){this.$el.find('select[name="idColumn"]').parent().toggle()},renderChart:function(){this.$el.find(".nav li.disabled").removeClass("disabled"),this.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show"),this.display.fetchData()},toString:function(){return"ScatterplotConfigEditor("+(this.dataset?this.dataset.id:"")+")"}});ScatterplotConfigEditor.templates={mainLayout:scatterplot.editor,dataControl:scatterplot.datacontrol,chartControl:scatterplot.chartcontrol};var ScatterplotDisplay=Backbone.View.extend({initialize:function(a){this.data=null,this.dataset=a.dataset,this.lineCount=this.dataset.metadata_data_lines||null},fetchData:function(){this.showLoadingIndicator();var a=this,b=this.model.get("config"),c=jQuery.getJSON("/api/datasets/"+this.dataset.id,{data_type:"raw_data",provider:"dataset-column",limit:b.pagination.perPage,offset:b.pagination.currPage*b.pagination.perPage});return c.done(function(b){a.data=b.data,a.trigger("data:fetched",a),a.renderData()}),c.fail(function(b,c,d){console.error(b,c,d),a.trigger("data:error",a),alert("Error loading data:\n"+b.responseText)}),c},showLoadingIndicator:function(){this.$el.find(".scatterplot-data-info").html(['<div class="loading-indicator">','<span class="fa fa-spinner fa-spin"></span>','<span class="loading-indicator-message">loading...</span>',"</div>"].join(""))},template:function(){var a=['<div class="controls clear">','<div class="right">','<p class="scatterplot-data-info"></p>','<button class="stats-toggle-btn">Stats</button>','<button class="rerender-btn">Redraw</button>',"</div>",'<div class="left">','<div class="page-control"></div>',"</div>","</div>","<svg/>",'<div class="stats-display"></div>'].join("");return a},render:function(){return this.$el.addClass("scatterplot-display").html(this.template()),this.data&&this.renderData(),this},renderData:function(){this.renderLeftControls(),this.renderRightControls(),this.renderPlot(this.data),this.getStats()},renderLeftControls:function(){var a=this,b=this.model.get("config");return this.$el.find(".controls .left .page-control").pagination({startingPage:b.pagination.currPage,perPage:b.pagination.perPage,totalDataSize:this.lineCount,currDataSize:this.data.length}).off().on("pagination.page-change",function(c,d){b.pagination.currPage=d,a.model.set("config",{pagination:b.pagination}),a.resetZoom(),a.fetchData()}),this},renderRightControls:function(){var a=this;this.setLineInfo(this.data),this.$el.find(".stats-toggle-btn").off().click(function(){a.toggleStats()}),this.$el.find(".rerender-btn").off().click(function(){a.resetZoom(),a.renderPlot(this.data)})},renderPlot:function(){var a=this,b=this.$el.find("svg");this.toggleStats(!1),b.off().empty().show().on("zoom.scatterplot",function(b,c){a.model.set("config",c)}),scatterplot(b.get(0),this.model.get("config"),this.data)},setLineInfo:function(a,b){if(a){var c=this.model.get("config"),d=this.lineCount||"an unknown total",e=c.pagination.currPage*c.pagination.perPage,f=e+a.length;this.$el.find(".controls p.scatterplot-data-info").text([e+1,"to",f,"of",d].join(" "))}else this.$el.find(".controls p.scatterplot-data-info").html(b||"");return this},resetZoom:function(a,b){return a=void 0!==a?a:1,b=void 0!==b?b:[0,0],this.model.set("config",{scale:a,translate:b}),this},getStats:function(){if(this.data){var a=this,b=this.model.get("config"),c=new Worker("/plugins/visualizations/scatterplot/static/worker-stats.js");c.postMessage({data:this.data,keys:[b.xColumn,b.yColumn]}),c.onerror=function(){c.terminate()},c.onmessage=function(b){a.renderStats(b.data)}}},renderStats:function(a){var b=this.model.get("config"),c=this.$el.find(".stats-display"),d=b.xLabel,e=b.yLabel,f=$("<table/>").addClass("table").append(["<thead><th></th><th>",d,"</th><th>",e,"</th></thead>"].join("")).append(_.map(a,function(a,b){return $(["<tr><td>",b,"</td><td>",a[0],"</td><td>",a[1],"</td></tr>"].join(""))}));c.empty().append(f)},toggleStats:function(a){var b=this.$el.find(".stats-display");a=void 0===a?b.is(":hidden"):a,a?(this.$el.find("svg").hide(),b.show(),this.$el.find(".controls .stats-toggle-btn").text("Plot")):(b.hide(),this.$el.find("svg").show(),this.$el.find(".controls .stats-toggle-btn").text("Stats"))},toString:function(){return"ScatterplotView()"}}),ScatterplotModel=Visualization.extend({defaults:{type:"scatterplot",config:{pagination:{currPage:0,perPage:3e3},width:400,height:400,margin:{top:16,right:16,bottom:40,left:54},xTicks:10,xLabel:"X",yTicks:10,yLabel:"Y",datapointSize:4,animDuration:500,scale:1,translate:[0,0]}}});
\ No newline at end of file
+function scatterplot(a,b,c){function d(){var a={v:{},h:{}};return a.v.lines=p.selectAll("line.v-grid-line").data(m.x.ticks(q.x.fn.ticks()[0])),a.v.lines.enter().append("svg:line").classed("grid-line v-grid-line",!0),a.v.lines.attr("x1",m.x).attr("x2",m.x).attr("y1",0).attr("y2",b.height),a.v.lines.exit().remove(),a.h.lines=p.selectAll("line.h-grid-line").data(m.y.ticks(q.y.fn.ticks()[0])),a.h.lines.enter().append("svg:line").classed("grid-line h-grid-line",!0),a.h.lines.attr("x1",0).attr("x2",b.width).attr("y1",m.y).attr("y2",m.y),a.h.lines.exit().remove(),a}function e(){return t.attr("cx",function(a,b){return m.x(j(a,b))}).attr("cy",function(a,b){return m.y(k(a,b))}).style("display","block").filter(function(){var a=d3.select(this).attr("cx"),c=d3.select(this).attr("cy");return 0>a||a>b.width?!0:0>c||c>b.height?!0:!1}).style("display","none")}function f(){$(".chart-info-box").remove(),q.redraw(),e(),s=d(),$(o.node()).trigger("zoom.scatterplot",{scale:n.scale(),translate:n.translate()})}function g(a,c,d){return c+=8,$(['<div class="chart-info-box" style="position: absolute">',void 0!==b.idColumn?"<div>"+d[b.idColumn]+"</div>":"","<div>",j(d),"</div>","<div>",k(d),"</div>","</div>"].join("")).css({top:a,left:c,"z-index":2})}var h=function(a,b){return"translate("+a+","+b+")"},i=function(a,b,c){return"rotate("+a+","+b+","+c+")"},j=function(a){return a[b.xColumn]},k=function(a){return a[b.yColumn]},l={x:{extent:d3.extent(c,j)},y:{extent:d3.extent(c,k)}},m={x:d3.scale.linear().domain(l.x.extent).range([0,b.width]),y:d3.scale.linear().domain(l.y.extent).range([b.height,0])},n=d3.behavior.zoom().x(m.x).y(m.y).scaleExtent([1,30]).scale(b.scale||1).translate(b.translate||[0,0]),o=d3.select(a).attr("class","scatterplot").attr("width","100%").attr("height",b.height+(b.margin.top+b.margin.bottom)),p=o.append("g").attr("class","content").attr("transform",h(b.margin.left,b.margin.top)).call(n);p.append("rect").attr("class","zoom-rect").attr("width",b.width).attr("height",b.height).style("fill","transparent");var q={x:{},y:{}};q.x.fn=d3.svg.axis().orient("bottom").scale(m.x).ticks(b.xTicks).tickFormat(d3.format("s")),q.y.fn=d3.svg.axis().orient("left").scale(m.y).ticks(b.yTicks).tickFormat(d3.format("s")),q.x.g=p.append("g").attr("class","x axis").attr("transform",h(0,b.height)).call(q.x.fn),q.y.g=p.append("g").attr("class","y axis").call(q.y.fn);var r=6;q.x.label=o.append("text").attr("id","x-axis-label").attr("class","axis-label").text(b.xLabel).attr("text-anchor","middle").attr("dominant-baseline","text-after-edge").attr("x",b.width/2+b.margin.left).attr("y",b.height+b.margin.bottom+b.margin.top-r),q.y.label=o.append("text").attr("id","y-axis-label").attr("class","axis-label").text(b.yLabel).attr("text-anchor","middle").attr("dominant-baseline","text-before-edge").attr("x",r).attr("y",b.height/2).attr("transform",i(-90,r,b.height/2)),q.redraw=function(){o.select(".x.axis").call(q.x.fn),o.select(".y.axis").call(q.y.fn)};var s=d(),t=p.selectAll(".glyph").data(c).enter().append("svg:circle").classed("glyph",!0).attr("cx",function(a,b){return m.x(j(a,b))}).attr("cy",function(a,b){return m.y(k(a,b))}).attr("r",0);t.transition().duration(b.animDuration).attr("r",b.datapointSize),e(),n.on("zoom",f),t.on("mouseover",function(a,c){var d=d3.select(this);d.classed("highlight",!0).style("fill","red").style("fill-opacity",1),p.append("line").attr("stroke","red").attr("stroke-width",1).attr("x1",d.attr("cx")-b.datapointSize).attr("y1",d.attr("cy")).attr("x2",0).attr("y2",d.attr("cy")).classed("hoverline",!0),d.attr("cy")<b.height&&p.append("line").attr("stroke","red").attr("stroke-width",1).attr("x1",d.attr("cx")).attr("y1",+d.attr("cy")+b.datapointSize).attr("x2",d.attr("cx")).attr("y2",b.height).classed("hoverline",!0);var e=this.getBoundingClientRect();$("body").append(g(e.top,e.right,a)),$(o.node()).trigger("mouseover-datapoint.scatterplot",[this,a,c])}),t.on("mouseout",function(){d3.select(this).classed("highlight",!1).style("fill","black").style("fill-opacity",.2),p.selectAll(".hoverline").remove(),$(".chart-info-box").remove()})}this.scatterplot=this.scatterplot||{},this.scatterplot.chartcontrol=Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var f,g="",h="function",i=this.escapeExpression;return g+='<p class="help-text">\n Use the following controls to how the chart is displayed.\n The slide controls can be moved by the mouse or, if the \'handle\' is in focus, your keyboard\'s arrow keys.\n Move the focus between controls by using the tab or shift+tab keys on your keyboard.\n Use the \'Draw\' button to render (or re-render) the chart with the current settings.\n</p>\n\n<div data-config-key="datapointSize" class="form-input numeric-slider-input">\n <label for="datapointSize">Size of data point: </label>\n <div class="slider-output">',(f=c.datapointSize)?f=f.call(b,{hash:{},data:e}):(f=b.datapointSize,f=typeof f===h?f.apply(b):f),g+=i(f)+'</div>\n <div class="slider"></div>\n <p class="form-help help-text-small">\n Size of the graphic representation of each data point\n </p>\n</div>\n\n<div data-config-key="width" class="form-input numeric-slider-input">\n <label for="width">Chart width: </label>\n <div class="slider-output">',(f=c.width)?f=f.call(b,{hash:{},data:e}):(f=b.width,f=typeof f===h?f.apply(b):f),g+=i(f)+'</div>\n <div class="slider"></div>\n <p class="form-help help-text-small">\n (not including chart margins and axes)\n </p>\n</div>\n\n<div data-config-key="height" class="form-input numeric-slider-input">\n <label for="height">Chart height: </label>\n <div class="slider-output">',(f=c.height)?f=f.call(b,{hash:{},data:e}):(f=b.height,f=typeof f===h?f.apply(b):f),g+=i(f)+'</div>\n <div class="slider"></div>\n <p class="form-help help-text-small">\n (not including chart margins and axes)\n </p>\n</div>\n\n<div data-config-key="X-axis-label"class="text-input form-input">\n <label for="X-axis-label">Re-label the X axis: </label>\n <input type="text" name="X-axis-label" id="X-axis-label" value="',(f=c.xLabel)?f=f.call(b,{hash:{},data:e}):(f=b.xLabel,f=typeof f===h?f.apply(b):f),g+=i(f)+'" />\n <p class="form-help help-text-small"></p>\n</div>\n\n<div data-config-key="Y-axis-label" class="text-input form-input">\n <label for="Y-axis-label">Re-label the Y axis: </label>\n <input type="text" name="Y-axis-label" id="Y-axis-label" value="',(f=c.yLabel)?f=f.call(b,{hash:{},data:e}):(f=b.yLabel,f=typeof f===h?f.apply(b):f),g+=i(f)+'" />\n <p class="form-help help-text-small"></p>\n</div>\n\n<button class="render-button btn btn-primary active">Draw</button>\n'}),this.scatterplot.datacontrol=Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var f,g="",h="function";return g+='<p class="help-text">\n Use the following control to change which columns are used by the chart. Click any cell\n from the last three rows of the table to select the column for the appropriate data.\n Use the \'Draw\' button to render (or re-render) the chart with the current settings.\n</p>\n\n<ul class="help-text" style="margin-left: 8px">\n <li><b>X Column</b>: which column values will be used for the x axis of the chart.</li>\n <li><b>Y Column</b>: which column values will be used for the y axis of the chart.</li>\n <li><b>ID Column</b>: an additional column value displayed when the user hovers over a data point.\n It may be useful to select unique or categorical identifiers here (such as gene ids).\n </li>\n</ul>\n\n<div class="column-selection">\n <pre class="peek">',(f=c.peek)?f=f.call(b,{hash:{},data:e}):(f=b.peek,f=typeof f===h?f.apply(b):f),(f||0===f)&&(g+=f),g+='</pre>\n</div>\n\n<p class="help-text help-text-small">\n <b>Note</b>: If it can be determined from the dataset\'s filetype that a column is not numeric,\n that column choice may be disabled for either the x or y axis.\n</p>\n\n<button class="render-button btn btn-primary active">Draw</button>\n'}),this.scatterplot.editor=Handlebars.template(function(a,b,c,d,e){this.compilerInfo=[4,">= 1.0.0"],c=this.merge(c,a.helpers),e=e||{};var f="";return f+='<div class="scatterplot-editor tabbable tabs-left">\n \n <ul class="nav nav-tabs">\n \n <li class="active">\n <a title="Use this tab to change which data are used"\n href="#data-control" data-toggle="tab">Data Controls</a>\n </li>\n <li>\n <a title="Use this tab to change how the chart is drawn"\n href="#chart-control" data-toggle="tab" >Chart Controls</a>\n </li>\n \n <li class="disabled">\n <a title="This tab will display the chart"\n href="#chart-display" data-toggle="tab">Chart</a>\n </li>\n \n <li class="file-controls">\n<!-- <button class="copy-btn btn btn-default"\n title="Save this as a new visualization">Save to new</button>-->\n <button class="save-btn btn btn-default">Save</button>\n </li>\n </ul>\n\n \n <div class="tab-content">\n \n <div id="data-control" class="scatterplot-config-control tab-pane active">\n \n </div>\n \n \n <div id="chart-control" class="scatterplot-config-control tab-pane">\n \n </div>\n\n \n <div id="chart-display" class="scatterplot-display tab-pane"></div>\n\n </div>\n</div>\n'});var ScatterplotConfigEditor=Backbone.View.extend({className:"scatterplot-control-form",initialize:function(a){if(this.model||(this.model=new Visualization({type:"scatterplot"})),!a||!a.dataset)throw new Error("ScatterplotConfigEditor requires a dataset");this.dataset=a.dataset,this.display=new ScatterplotDisplay({dataset:a.dataset,model:this.model})},render:function(){this.$el.empty().append(ScatterplotConfigEditor.templates.mainLayout({})),this.model.id&&(this.$el.find(".copy-btn").show(),this.$el.find(".save-btn").text("Update saved")),this.$el.find("[title]").tooltip(),this._render_dataControl(),this._render_chartControls(),this._render_chartDisplay();var a=this.model.get("config");return this.model.id&&_.isFinite(a.xColumn)&&_.isFinite(a.yColumn)&&this.renderChart(),this},_getColumnIndecesByType:function(){var a={numeric:[],text:[],all:[]};return _.each(this.dataset.metadata_column_types||[],function(b,c){"int"===b||"float"===b?a.numeric.push(c):("str"===b||"list"===b)&&a.text.push(c),a.all.push(c)}),a.numeric.length<2&&(a.numeric=[]),a},_render_dataControl:function(a){a=a||this.$el;var b=this,c=this.model.get("config"),d=this._getColumnIndecesByType(),e=a.find(".tab-pane#data-control");return e.html(ScatterplotConfigEditor.templates.dataControl({peek:this.dataset.peek})),e.find(".peek").peekControl({controls:[{label:"X Column",id:"xColumn",selected:c.xColumn,disabled:d.text},{label:"Y Column",id:"yColumn",selected:c.yColumn,disabled:d.text},{label:"ID Column",id:"idColumn",selected:c.idColumn}]}).on("peek-control.change",function(a,c){b.model.set("config",c)}).on("peek-control.rename",function(){}),e.find("[title]").tooltip(),e},_render_chartControls:function(a){function b(){var a=$(this),b=a.slider("value");c.model.set("config",_.object([[a.parent().data("config-key"),b]])),a.siblings(".slider-output").text(b)}a=a||this.$el;var c=this,d=this.model.get("config"),e=a.find("#chart-control");e.html(ScatterplotConfigEditor.templates.chartControl(d));var f={datapointSize:{min:2,max:10,step:1},width:{min:200,max:800,step:20},height:{min:200,max:800,step:20}};e.find(".numeric-slider-input").each(function(){var a=$(this),c=a.attr("data-config-key"),e=_.extend(f[c],{value:d[c],change:b,slide:b});a.find(".slider").slider(e),a.children(".slider-output").text(d[c])});var g=this.dataset.metadata_column_names||[],h=d.xLabel||g[d.xColumn]||"X",i=d.yLabel||g[d.yColumn]||"Y";return e.find('input[name="X-axis-label"]').val(h).on("change",function(){c.model.set("config",{xLabel:$(this).val()})}),e.find('input[name="Y-axis-label"]').val(i).on("change",function(){c.model.set("config",{yLabel:$(this).val()})}),e.find("[title]").tooltip(),e},_render_chartDisplay:function(a){a=a||this.$el;var b=a.find(".tab-pane#chart-display");return this.display.setElement(b),this.display.render(),b.find("[title]").tooltip(),b},events:{"change #include-id-checkbox":"toggleThirdColumnSelector","click #data-control .render-button":"renderChart","click #chart-control .render-button":"renderChart","click .save-btn":"saveVisualization"},saveVisualization:function(){var a=this;this.model.save().fail(function(b,c,d){console.error(b,c,d),a.trigger("save:error",view),alert("Error loading data:\n"+b.responseText)}).then(function(){a.display.render()})},toggleThirdColumnSelector:function(){this.$el.find('select[name="idColumn"]').parent().toggle()},renderChart:function(){this.$el.find(".nav li.disabled").removeClass("disabled"),this.$el.find("ul.nav").find('a[href="#chart-display"]').tab("show"),this.display.fetchData()},toString:function(){return"ScatterplotConfigEditor("+(this.dataset?this.dataset.id:"")+")"}});ScatterplotConfigEditor.templates={mainLayout:scatterplot.editor,dataControl:scatterplot.datacontrol,chartControl:scatterplot.chartcontrol};var ScatterplotDisplay=Backbone.View.extend({initialize:function(a){this.data=null,this.dataset=a.dataset,this.lineCount=this.dataset.metadata_data_lines||null},fetchData:function(){this.showLoadingIndicator();var a=this,b=this.model.get("config"),c=jQuery.getJSON("/api/datasets/"+this.dataset.id,{data_type:"raw_data",provider:"dataset-column",limit:b.pagination.perPage,offset:b.pagination.currPage*b.pagination.perPage});return c.done(function(b){a.data=b.data,a.trigger("data:fetched",a),a.renderData()}),c.fail(function(b,c,d){console.error(b,c,d),a.trigger("data:error",a),alert("Error loading data:\n"+b.responseText)}),c},showLoadingIndicator:function(){this.$el.find(".scatterplot-data-info").html(['<div class="loading-indicator">','<span class="fa fa-spinner fa-spin"></span>','<span class="loading-indicator-message">loading...</span>',"</div>"].join(""))},template:function(){var a=['<div class="controls clear">','<div class="right">','<p class="scatterplot-data-info"></p>','<button class="stats-toggle-btn">Stats</button>','<button class="rerender-btn">Redraw</button>',"</div>",'<div class="left">','<div class="page-control"></div>',"</div>","</div>","<svg/>",'<div class="stats-display"></div>'].join("");return a},render:function(){return this.$el.addClass("scatterplot-display").html(this.template()),this.data&&this.renderData(),this},renderData:function(){this.renderLeftControls(),this.renderRightControls(),this.renderPlot(this.data),this.getStats()},renderLeftControls:function(){var a=this,b=this.model.get("config");return this.$el.find(".controls .left .page-control").pagination({startingPage:b.pagination.currPage,perPage:b.pagination.perPage,totalDataSize:this.lineCount,currDataSize:this.data.length}).off().on("pagination.page-change",function(c,d){b.pagination.currPage=d,a.model.set("config",{pagination:b.pagination}),a.resetZoom(),a.fetchData()}),this},renderRightControls:function(){var a=this;this.setLineInfo(this.data),this.$el.find(".stats-toggle-btn").off().click(function(){a.toggleStats()}),this.$el.find(".rerender-btn").off().click(function(){a.resetZoom(),a.renderPlot(this.data)})},renderPlot:function(){var a=this,b=this.$el.find("svg");this.toggleStats(!1),b.off().empty().show().on("zoom.scatterplot",function(b,c){a.model.set("config",c)}),scatterplot(b.get(0),this.model.get("config"),this.data)},setLineInfo:function(a,b){if(a){var c=this.model.get("config"),d=this.lineCount||"an unknown total",e=c.pagination.currPage*c.pagination.perPage,f=e+a.length;this.$el.find(".controls p.scatterplot-data-info").text([e+1,"to",f,"of",d].join(" "))}else this.$el.find(".controls p.scatterplot-data-info").html(b||"");return this},resetZoom:function(a,b){return a=void 0!==a?a:1,b=void 0!==b?b:[0,0],this.model.set("config",{scale:a,translate:b}),this},getStats:function(){if(this.data){var a=this,b=this.model.get("config"),c=new Worker("/plugins/visualizations/scatterplot/static/worker-stats.js");c.postMessage({data:this.data,keys:[b.xColumn,b.yColumn]}),c.onerror=function(){c.terminate()},c.onmessage=function(b){a.renderStats(b.data)}}},renderStats:function(a){var b=this.model.get("config"),c=this.$el.find(".stats-display"),d=b.xLabel,e=b.yLabel,f=$("<table/>").addClass("table").append(["<thead><th></th><th>",d,"</th><th>",e,"</th></thead>"].join("")).append(_.map(a,function(a,b){return $(["<tr><td>",b,"</td><td>",a[0],"</td><td>",a[1],"</td></tr>"].join(""))}));c.empty().append(f)},toggleStats:function(a){var b=this.$el.find(".stats-display");a=void 0===a?b.is(":hidden"):a,a?(this.$el.find("svg").hide(),b.show(),this.$el.find(".controls .stats-toggle-btn").text("Plot")):(b.hide(),this.$el.find("svg").show(),this.$el.find(".controls .stats-toggle-btn").text("Stats"))},toString:function(){return"ScatterplotView()"}}),ScatterplotModel=Visualization.extend({defaults:{type:"scatterplot",config:{pagination:{currPage:0,perPage:3e3},width:400,height:400,margin:{top:16,right:16,bottom:40,left:54},xTicks:10,xLabel:"X",yTicks:10,yLabel:"Y",datapointSize:4,animDuration:500,scale:1,translate:[0,0]}}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 config/plugins/visualizations/scatterplot/templates/scatterplot.mako
--- a/config/plugins/visualizations/scatterplot/templates/scatterplot.mako
+++ b/config/plugins/visualizations/scatterplot/templates/scatterplot.mako
@@ -32,7 +32,6 @@
'libs/backbone/backbone',
'libs/d3',
'libs/handlebars.runtime',
- 'mvc/base-mvc',
'mvc/ui',
'mvc/visualization/visualization-model' )}
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/annotations.js
--- a/static/scripts/mvc/annotations.js
+++ b/static/scripts/mvc/annotations.js
@@ -1,9 +1,12 @@
define([
-], function(){
+ "mvc/base-mvc"
+], function( baseMVC ){
// =============================================================================
/** A view on any model that has a 'annotation' attribute
*/
-var AnnotationEditor = Backbone.View.extend( LoggableMixin ).extend( HiddenUntilActivatedViewMixin ).extend({
+var AnnotationEditor = Backbone.View
+ .extend( baseMVC.LoggableMixin )
+ .extend( baseMVC.HiddenUntilActivatedViewMixin ).extend({
tagName : 'div',
className : 'annotation-display',
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/base-mvc.js
--- a/static/scripts/mvc/base-mvc.js
+++ b/static/scripts/mvc/base-mvc.js
@@ -1,3 +1,6 @@
+define([
+], function(){
+//ASSUMES: backbone
//==============================================================================
/** @class Mixin to add logging capabilities to an object.
* Designed to allow switching an objects log output off/on at one central
@@ -188,3 +191,10 @@
return this.HUAVOptions.showFn.apply( this.HUAVOptions.$elementShown, arguments );
}
};
+
+//==============================================================================
+return {
+ LoggableMixin : LoggableMixin,
+ SessionStorageModel : SessionStorageModel,
+ HiddenUntilActivatedViewMixin : HiddenUntilActivatedViewMixin
+};});
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -1,7 +1,8 @@
define([
- "mvc/dataset/hda-model"
-], function( hdaModel ){
-/* global Backbone, LoggableMixin, HistoryDatasetAssociation, HDABaseView */
+ "mvc/dataset/hda-model",
+ "mvc/base-mvc"
+], function( hdaModel, baseMVC ){
+/* global Backbone */
//==============================================================================
/** @class Read only view for HistoryDatasetAssociation.
* @name HDABaseView
@@ -11,7 +12,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var HDABaseView = Backbone.View.extend( LoggableMixin ).extend(
+var HDABaseView = Backbone.View.extend( baseMVC.LoggableMixin ).extend(
/** @lends HDABaseView.prototype */{
///** logger used to record this.log messages, commonly set to console */
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -13,7 +13,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var HDAEditView = hdaBase.HDABaseView.extend( LoggableMixin ).extend(
+var HDAEditView = hdaBase.HDABaseView.extend(
/** @lends HDAEditView.prototype */{
// ......................................................................... set up
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -1,5 +1,6 @@
define([
-], function(){
+ "mvc/base-mvc"
+], function( baseMVC ){
//==============================================================================
/** @class (HDA) model for a Galaxy dataset
* related to a history.
@@ -10,7 +11,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var HistoryDatasetAssociation = Backbone.Model.extend( LoggableMixin ).extend(
+var HistoryDatasetAssociation = Backbone.Model.extend( baseMVC.LoggableMixin ).extend(
/** @lends HistoryDatasetAssociation.prototype */{
///** logger used to record this.log messages, commonly set to console */
@@ -401,7 +402,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var HDACollection = Backbone.Collection.extend( LoggableMixin ).extend(
+var HDACollection = Backbone.Collection.extend( baseMVC.LoggableMixin ).extend(
/** @lends HDACollection.prototype */{
model : HistoryDatasetAssociation,
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/history/current-history-panel.js
--- a/static/scripts/mvc/history/current-history-panel.js
+++ b/static/scripts/mvc/history/current-history-panel.js
@@ -1,11 +1,12 @@
define([
"mvc/dataset/hda-edit",
- "mvc/history/history-panel"
-], function( hdaEdit, hpanel ){
+ "mvc/history/history-panel",
+ "mvc/base-mvc"
+], function( hdaEdit, hpanel, baseMVC ){
// ============================================================================
/** session storage for history panel preferences (and to maintain state)
*/
-var HistoryPanelPrefs = SessionStorageModel.extend({
+var HistoryPanelPrefs = baseMVC.SessionStorageModel.extend({
defaults : {
/** is the panel currently showing the search/filter controls? */
searching : false,
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -1,6 +1,7 @@
define([
- "mvc/dataset/hda-model"
-], function( hdaModel ){
+ "mvc/dataset/hda-model",
+ "mvc/base-mvc"
+], function( hdaModel, baseMVC ){
//==============================================================================
/** @class Model for a Galaxy history resource - both a record of user
* tool use and a collection of the datasets those tools produced.
@@ -11,7 +12,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var History = Backbone.Model.extend( LoggableMixin ).extend(
+var History = Backbone.Model.extend( baseMVC.LoggableMixin ).extend(
/** @lends History.prototype */{
///** logger used to record this.log messages, commonly set to console */
@@ -114,13 +115,6 @@
},
// ........................................................................ common queries
- /** is this model already associated with a user? */
-//TODO: remove
- hasUser : function(){
- var user = this.get( 'user' );
- return !!( user && user.id );
- },
-
/** T/F is this history owned by the current user (Galaxy.currUser)
* Note: that this will return false for an anon user even if the history is theirs.
*/
@@ -295,7 +289,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var HistoryCollection = Backbone.Collection.extend( LoggableMixin ).extend(
+var HistoryCollection = Backbone.Collection.extend( baseMVC.LoggableMixin ).extend(
/** @lends HistoryCollection.prototype */{
model : History,
urlRoot : galaxy_config.root + 'api/histories'
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -84,7 +84,7 @@
$newRender.append( HistoryPanel.templates.historyPanel( this.model.toJSON() ) );
this.$emptyMessage( $newRender ).text( this.emptyMsg );
- if( Galaxy.currUser.id && Galaxy.currUser.id === this.model.get( 'user_id' ) ){
+ if( Galaxy && Galaxy.currUser && Galaxy.currUser.id && Galaxy.currUser.id === this.model.get( 'user_id' ) ){
this._renderTags( $newRender );
this._renderAnnotation( $newRender );
}
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/history/readonly-history-panel.js
--- a/static/scripts/mvc/history/readonly-history-panel.js
+++ b/static/scripts/mvc/history/readonly-history-panel.js
@@ -1,10 +1,11 @@
define([
"mvc/history/history-model",
- "mvc/dataset/hda-base"
-], function( historyModel, hdaBase ){
+ "mvc/dataset/hda-base",
+ "mvc/base-mvc"
+], function( historyModel, hdaBase, baseMVC ){
// ============================================================================
/** session storage for individual history preferences */
-var HistoryPrefs = SessionStorageModel.extend({
+var HistoryPrefs = baseMVC.SessionStorageModel.extend({
defaults : {
//TODO:?? expandedHdas to array?
expandedHdas : {},
@@ -71,7 +72,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var ReadOnlyHistoryPanel = Backbone.View.extend( LoggableMixin ).extend(
+var ReadOnlyHistoryPanel = Backbone.View.extend( baseMVC.LoggableMixin ).extend(
/** @lends ReadOnlyHistoryPanel.prototype */{
/** logger used to record this.log messages, commonly set to console */
@@ -311,11 +312,11 @@
attributes = attributes || {};
//this.log( 'JSONToModel:', newHistoryJSON, newHdaJSON.length, attributes );
- // set up the new model and render
- if( Galaxy && Galaxy.currUser ){
-//TODO: global
- newHistoryJSON.user = Galaxy.currUser.toJSON();
- }
+// // set up the new model and render
+// if( Galaxy && Galaxy.currUser ){
+////TODO: global
+// newHistoryJSON.user = Galaxy.currUser.toJSON();
+// }
var model = new historyModel.History( newHistoryJSON, newHdaJSON, attributes );
this.setModel( model );
return this;
@@ -334,10 +335,10 @@
if( model ){
// set up the new model with user, logger, storage, events
- if( Galaxy && Galaxy.currUser ){
-//TODO: global
- model.user = Galaxy.currUser.toJSON();
- }
+// if( Galaxy && Galaxy.currUser ){
+////TODO: global
+// model.user = Galaxy.currUser.toJSON();
+// }
this.model = model;
if( this.logger ){
this.model.logger = this.logger;
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/tags.js
--- a/static/scripts/mvc/tags.js
+++ b/static/scripts/mvc/tags.js
@@ -1,11 +1,12 @@
define([
-], function(){
+ "mvc/base-mvc"
+], function( baseMVC ){
// =============================================================================
/** A view on any model that has a 'tags' attribute (a list of tag strings)
* Incorporates the select2 jQuery plugin for tags display/editing:
* http://ivaynberg.github.io/select2/
*/
-var TagsEditor = Backbone.View.extend( LoggableMixin ).extend( HiddenUntilActivatedViewMixin ).extend({
+var TagsEditor = Backbone.View.extend( baseMVC.LoggableMixin ).extend( baseMVC.HiddenUntilActivatedViewMixin ).extend({
tagName : 'div',
className : 'tags-display',
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/user/user-model.js
--- a/static/scripts/mvc/user/user-model.js
+++ b/static/scripts/mvc/user/user-model.js
@@ -1,3 +1,7 @@
+define([
+ "mvc/base-mvc"
+], function( baseMVC ){
+//==============================================================================
/** @class Model for a Galaxy user (including anonymous users).
* @name User
*
@@ -6,7 +10,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var User = Backbone.Model.extend( LoggableMixin ).extend(
+var User = Backbone.Model.extend( baseMVC.LoggableMixin ).extend(
/** @lends User.prototype */{
///** logger used to record this.log messages, commonly set to console */
@@ -107,8 +111,14 @@
};
// (stub) collection for users (shouldn't be common unless admin UI)
-var UserCollection = Backbone.Collection.extend( LoggableMixin ).extend({
+var UserCollection = Backbone.Collection.extend( baseMVC.LoggableMixin ).extend({
model : User,
urlRoot : galaxy_config.root + 'api/users'
//logger : console,
});
+
+
+//==============================================================================
+return {
+ User : User
+};});
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/user/user-quotameter.js
--- a/static/scripts/mvc/user/user-quotameter.js
+++ b/static/scripts/mvc/user/user-quotameter.js
@@ -1,3 +1,7 @@
+define([
+ "mvc/base-mvc"
+], function( baseMVC ){
+//==============================================================================
/** @class View to display a user's disk/storage usage
* either as a progress bar representing the percentage of a quota used
* or a simple text element displaying the human readable size used.
@@ -8,7 +12,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var UserQuotaMeter = Backbone.View.extend( LoggableMixin ).extend(
+var UserQuotaMeter = Backbone.View.extend( baseMVC.LoggableMixin ).extend(
/** @lends UserQuotaMeter.prototype */{
///** logger used to record this.log messages, commonly set to console */
@@ -149,3 +153,9 @@
return 'UserQuotaMeter(' + this.model + ')';
}
});
+
+
+//==============================================================================
+return {
+ UserQuotaMeter : UserQuotaMeter
+};});
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/mvc/visualization/visualization-model.js
--- a/static/scripts/mvc/visualization/visualization-model.js
+++ b/static/scripts/mvc/visualization/visualization-model.js
@@ -5,11 +5,9 @@
/** @class Model for a saved Galaxy visualization.
*
* @augments Backbone.Model
- * @borrows LoggableMixin#logger as #logger
- * @borrows LoggableMixin#log as #log
* @constructs
*/
-var Visualization = Backbone.Model.extend( LoggableMixin ).extend(
+var Visualization = Backbone.Model.extend(
/** @lends Visualization.prototype */{
///** logger used to record this.log messages, commonly set to console */
@@ -31,7 +29,7 @@
* @see Backbone.Model#initialize
*/
initialize : function( data ){
- this.log( this + '.initialize', data, this.attributes );
+ //this.log( this + '.initialize', data, this.attributes );
// munge config sub-object here since bbone won't handle defaults with this
if( _.isObject( data.config ) && _.isObject( this.defaults.config ) ){
@@ -84,7 +82,7 @@
* @borrows LoggableMixin#log as #log
* @constructs
*/
-var VisualizationCollection = Backbone.Collection.extend( LoggableMixin ).extend(
+var VisualizationCollection = Backbone.Collection.extend(
/** @lends VisualizationCollection.prototype */{
model : Visualization,
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/annotations.js
--- a/static/scripts/packed/mvc/annotations.js
+++ b/static/scripts/packed/mvc/annotations.js
@@ -1,1 +1,1 @@
-define([],function(){var a=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(b){b=b||{};this.tooltipConfig=b.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(b.$activator,b)},render:function(){var b=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(c){b.$annotation().text(c);b.model.save({annotation:c},{silent:true}).fail(function(){b.$annotation().text(b.model.previous("annotation"))})}});return this},_template:function(){var b=this.model.get("annotation");return['<label class="prompt">',_l("Annotation"),"</label>",'<div class="annotation" title="',_l("Edit annotation"),'">',b,"</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:a}});
\ No newline at end of file
+define(["mvc/base-mvc"],function(a){var b=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(c){c=c||{};this.tooltipConfig=c.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(c.$activator,c)},render:function(){var c=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(d){c.$annotation().text(d);c.model.save({annotation:d},{silent:true}).fail(function(){c.$annotation().text(c.model.previous("annotation"))})}});return this},_template:function(){var c=this.model.get("annotation");return['<label class="prompt">',_l("Annotation"),"</label>",'<div class="annotation" title="',_l("Edit annotation"),'">',c,"</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:b}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/base-mvc.js
--- a/static/scripts/packed/mvc/base-mvc.js
+++ b/static/scripts/packed/mvc/base-mvc.js
@@ -1,1 +1,1 @@
-var LoggableMixin={logger:null,log:function(){if(this.logger){var a=this.logger.log;if(typeof this.logger.log==="object"){a=Function.prototype.bind.call(this.logger.log,this.logger)}return a.apply(this.logger,arguments)}return undefined}};var SessionStorageModel=Backbone.Model.extend({initialize:function(b){b.id=(!_.isString(b.id))?(_.uniqueId()):(b.id);this.id=b.id;var a=(!this.isNew())?(this._read(this)):({});this.clear({silent:true});this.save(_.extend({},this.defaults,a,b),{silent:true});this.on("change",function(){this.save()})},sync:function(d,b,a){if(!a.silent){b.trigger("request",b,{},a)}var c;switch(d){case"create":c=this._create(b);break;case"read":c=this._read(b);break;case"update":c=this._update(b);break;case"delete":c=this._delete(b);break}if(c!==undefined||c!==null){if(a.success){a.success()}}else{if(a.error){a.error()}}return c},_create:function(a){var b=a.toJSON(),c=sessionStorage.setItem(a.id,JSON.stringify(b));return(c===null)?(c):(b)},_read:function(a){return JSON.parse(sessionStorage.getItem(a.id))},_update:function(a){return a._create(a)},_delete:function(a){return sessionStorage.removeItem(a.id)},isNew:function(){return !sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});(function(){SessionStorageModel.prototype=_.omit(SessionStorageModel.prototype,"url","urlRoot")}());var HiddenUntilActivatedViewMixin={hiddenUntilActivated:function(a,c){c=c||{};this.HUAVOptions={$elementShown:this.$el,showFn:jQuery.prototype.toggle,showSpeed:"fast"};_.extend(this.HUAVOptions,c||{});this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible");this.hidden=this.isHidden();if(a){var b=this;a.on("click",function(d){b.toggle(b.HUAVOptions.showSpeed)})}},isHidden:function(){return(this.HUAVOptions.$elementShown.is(":hidden"))},toggle:function(){if(this.hidden){if(!this.HUAVOptions.hasBeenShown){if(_.isFunction(this.HUAVOptions.onshowFirstTime)){this.HUAVOptions.hasBeenShown=true;this.HUAVOptions.onshowFirstTime.call(this)}}if(_.isFunction(this.HUAVOptions.onshow)){this.HUAVOptions.onshow.call(this);this.trigger("hiddenUntilActivated:shown",this)}this.hidden=false}else{if(_.isFunction(this.HUAVOptions.onhide)){this.HUAVOptions.onhide.call(this);this.trigger("hiddenUntilActivated:hidden",this)}this.hidden=true}return this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}};
\ No newline at end of file
+define([],function(){var c={logger:null,log:function(){if(this.logger){var d=this.logger.log;if(typeof this.logger.log==="object"){d=Function.prototype.bind.call(this.logger.log,this.logger)}return d.apply(this.logger,arguments)}return undefined}};var a=Backbone.Model.extend({initialize:function(e){e.id=(!_.isString(e.id))?(_.uniqueId()):(e.id);this.id=e.id;var d=(!this.isNew())?(this._read(this)):({});this.clear({silent:true});this.save(_.extend({},this.defaults,d,e),{silent:true});this.on("change",function(){this.save()})},sync:function(g,e,d){if(!d.silent){e.trigger("request",e,{},d)}var f;switch(g){case"create":f=this._create(e);break;case"read":f=this._read(e);break;case"update":f=this._update(e);break;case"delete":f=this._delete(e);break}if(f!==undefined||f!==null){if(d.success){d.success()}}else{if(d.error){d.error()}}return f},_create:function(d){var e=d.toJSON(),f=sessionStorage.setItem(d.id,JSON.stringify(e));return(f===null)?(f):(e)},_read:function(d){return JSON.parse(sessionStorage.getItem(d.id))},_update:function(d){return d._create(d)},_delete:function(d){return sessionStorage.removeItem(d.id)},isNew:function(){return !sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});(function(){a.prototype=_.omit(a.prototype,"url","urlRoot")}());var b={hiddenUntilActivated:function(d,f){f=f||{};this.HUAVOptions={$elementShown:this.$el,showFn:jQuery.prototype.toggle,showSpeed:"fast"};_.extend(this.HUAVOptions,f||{});this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible");this.hidden=this.isHidden();if(d){var e=this;d.on("click",function(g){e.toggle(e.HUAVOptions.showSpeed)})}},isHidden:function(){return(this.HUAVOptions.$elementShown.is(":hidden"))},toggle:function(){if(this.hidden){if(!this.HUAVOptions.hasBeenShown){if(_.isFunction(this.HUAVOptions.onshowFirstTime)){this.HUAVOptions.hasBeenShown=true;this.HUAVOptions.onshowFirstTime.call(this)}}if(_.isFunction(this.HUAVOptions.onshow)){this.HUAVOptions.onshow.call(this);this.trigger("hiddenUntilActivated:shown",this)}this.hidden=false}else{if(_.isFunction(this.HUAVOptions.onhide)){this.HUAVOptions.onhide.call(this);this.trigger("hiddenUntilActivated:hidden",this)}this.hidden=true}return this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}};return{LoggableMixin:c,SessionStorageModel:a,HiddenUntilActivatedViewMixin:b}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(c){var b=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(e){if(e.logger){this.logger=this.model.logger=e.logger}this.log(this+".initialize:",e);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=e.linkTarget||"_blank";this.selectable=e.selectable||false;this.selected=e.selected||false;this.expanded=e.expanded||false;this.draggable=e.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(f,e){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(g){g=(g===undefined)?(true):(g);var e=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var f=this._buildNewRender();if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).addClass("state-"+e.model.get("state")).append(f.children());if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()});return this},_buildNewRender:function(){var e=$(b.templates.skeleton(this.model.toJSON()));e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(e);return e},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===c.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var f={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){f.disabled=true;f.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===c.HistoryDatasetAssociation.STATES.UPLOAD){f.disabled=true;f.title=_l("This dataset must finish uploading before it can be viewed")}else{f.title=_l("View data");f.href=this.urls.display;var e=this;f.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+e.model.get("name"),type:"url",content:e.urls.display})}}}}f.faIcon="fa-eye";return faIconButton(f)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var f=this.urls,g=this.model.get("meta_files");if(_.isEmpty(g)){return $(['<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var h="dataset-"+this.model.get("id")+"-popup",e=['<div popupmenu="'+h+'">','<a href="'+f.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(g,function(i){return['<a class="action-button" href="',f.meta_download+i.file_type,'">',_l("Download")," ",i.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+h+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(e)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var f=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),e=this["_render_body_"+this.model.get("state")];if(_.isFunction(e)){f=e.call(this)}this._setUpBehaviors(f);if(this.expanded){f.show()}return f},_render_stateBodyHelper:function(e,h){h=h||[];var f=this,g=$(b.templates.body(_.extend(this.model.toJSON(),{body:e})));g.find(".dataset-actions .left").append(_.map(h,function(i){return i.call(f)}));return g},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var e=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){e="<div>"+this.model.get("misc_blurb")+"</div>"+e}return this._render_stateBodyHelper(e,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var e=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),f=this._render_body_ok();f.prepend(e);return f},_render_body_ok:function(){var e=this,g=$(b.templates.body(this.model.toJSON())),f=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);g.find(".dataset-actions .left").append(_.map(f,function(h){return h.call(e)}));if(this.model.isDeletedOrPurged()){return g}return g},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(h,f){var e=32,g=13;if(h&&(h.type==="keydown")&&!(h.keyCode===e||h.keyCode===g)){return true}var i=this.$el.find(".dataset-body");f=(f===undefined)?(!i.is(":visible")):(f);if(f){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._render_body());e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.expanded=true;e.trigger("body-expanded",e.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(g){e.urls=e.model.urls();f()})}else{f()}},collapseBody:function(){var e=this;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.expanded=false;e.trigger("body-collapsed",e.model.get("id"))})},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},remove:function(f){var e=this;this.$el.fadeOut(e.fxSpeed,function(){e.$el.remove();e.off();if(f){f()}})},toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+e+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var d=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");b.templates={skeleton:function(e){return _.template(a,e,{variable:"hda"})},body:function(e){return _.template(d,e,{variable:"hda"})}};return{HDABaseView:b}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/base-mvc"],function(d,b){var c=Backbone.View.extend(b.LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(f){if(f.logger){this.logger=this.model.logger=f.logger}this.log(this+".initialize:",f);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=f.linkTarget||"_blank";this.selectable=f.selectable||false;this.selected=f.selected||false;this.expanded=f.expanded||false;this.draggable=f.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(g,f){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(h){h=(h===undefined)?(true):(h);var f=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var g=this._buildNewRender();if(h){$(f).queue(function(i){this.$el.fadeOut(f.fxSpeed,i)})}$(f).queue(function(i){this.$el.empty().attr("class",f.className).addClass("state-"+f.model.get("state")).append(g.children());if(this.selectable){this.showSelector(0)}i()});if(h){$(f).queue(function(i){this.$el.fadeIn(f.fxSpeed,i)})}$(f).queue(function(i){this.trigger("rendered",f);if(this.model.inReadyState()){this.trigger("rendered:ready",f)}if(this.draggable){this.draggableOn()}i()});return this},_buildNewRender:function(){var f=$(c.templates.skeleton(this.model.toJSON()));f.find(".dataset-primary-actions").append(this._render_titleButtons());f.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(f);return f},_setUpBehaviors:function(f){f=f||this.$el;make_popup_menus(f);f.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var g={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){g.disabled=true;g.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){g.disabled=true;g.title=_l("This dataset must finish uploading before it can be viewed")}else{g.title=_l("View data");g.href=this.urls.display;var f=this;g.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+f.model.get("name"),type:"url",content:f.urls.display})}}}}g.faIcon="fa-eye";return faIconButton(g)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var g=this.urls,h=this.model.get("meta_files");if(_.isEmpty(h)){return $(['<a href="'+g.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var i="dataset-"+this.model.get("id")+"-popup",f=['<div popupmenu="'+i+'">','<a href="'+g.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(h,function(j){return['<a class="action-button" href="',g.meta_download+j.file_type,'">',_l("Download")," ",j.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+g.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+i+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(f)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var g=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),f=this["_render_body_"+this.model.get("state")];if(_.isFunction(f)){g=f.call(this)}this._setUpBehaviors(g);if(this.expanded){g.show()}return g},_render_stateBodyHelper:function(f,i){i=i||[];var g=this,h=$(c.templates.body(_.extend(this.model.toJSON(),{body:f})));h.find(".dataset-actions .left").append(_.map(i,function(j){return j.call(g)}));return h},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var f=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){f="<div>"+this.model.get("misc_blurb")+"</div>"+f}return this._render_stateBodyHelper(f,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var f=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),g=this._render_body_ok();g.prepend(f);return g},_render_body_ok:function(){var f=this,h=$(c.templates.body(this.model.toJSON())),g=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);h.find(".dataset-actions .left").append(_.map(g,function(i){return i.call(f)}));if(this.model.isDeletedOrPurged()){return h}return h},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(i,g){var f=32,h=13;if(i&&(i.type==="keydown")&&!(i.keyCode===f||i.keyCode===h)){return true}var j=this.$el.find(".dataset-body");g=(g===undefined)?(!j.is(":visible")):(g);if(g){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var f=this;function g(){f.$el.children(".dataset-body").replaceWith(f._render_body());f.$el.children(".dataset-body").slideDown(f.fxSpeed,function(){f.expanded=true;f.trigger("body-expanded",f.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(h){f.urls=f.model.urls();g()})}else{g()}},collapseBody:function(){var f=this;this.$el.children(".dataset-body").slideUp(f.fxSpeed,function(){f.expanded=false;f.trigger("body-collapsed",f.model.get("id"))})},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(f){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(f){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(f){if(this.selected){this.deselect(f)}else{this.select(f)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var f=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);f.addEventListener("dragstart",this.dragStartHandler,false);f.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var f=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);f.removeEventListener("dragstart",this.dragStartHandler,false);f.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(f){this.trigger("dragstart",this);f.dataTransfer.effectAllowed="move";f.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(f){this.trigger("dragend",this);return false},remove:function(g){var f=this;this.$el.fadeOut(f.fxSpeed,function(){f.$el.remove();f.off();if(g){g()}})},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+f+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var e=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");c.templates={skeleton:function(f){return _.template(a,f,{variable:"hda"})},body:function(f){return _.template(e,f,{variable:"hda"})}};return{HDABaseView:c}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/tags","mvc/annotations"],function(f,b,a,e){var g=b.HDABaseView.extend(LoggableMixin).extend({initialize:function(h){b.HDABaseView.prototype.initialize.call(this,h);this.hasUser=h.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=h.tagsEditorShown||false;this.annotationEditorShown=h.annotationEditorShown||false},_render_titleButtons:function(){return b.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===f.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var j=this.model.get("purged"),h=this.model.get("deleted"),i={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(h||j){i.disabled=true;if(j){i.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(h){i.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===f.HistoryDatasetAssociation.STATES.UPLOAD){i.disabled=true;i.title=_l("This dataset must finish uploading before it can be edited")}}i.faIcon="fa-pencil";return faIconButton(i)},_render_deleteButton:function(){if((this.model.get("state")===f.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var h=this,i={title:_l("Delete"),classes:"dataset-delete",onclick:function(){h.$el.find(".icon-btn.dataset-delete").trigger("mouseout");h.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),disabled:true}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==f.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var h=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(h))){return null}if(_.isObject(h[0])){return this._render_visualizationsFrameworkButton(h)}if(!this.urls.visualization){return null}var j=this.model.get("dbkey"),n=this.urls.visualization,k={},o={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(j){o.dbkey=j}var i=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});function l(p){if(p==="trackster"){return c(n,o,j)}return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:n+"/"+p+"?"+$.param(o)})}}function m(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(h.length===1){i.attr("data-original-title",_l("Visualize in ")+_l(m(h[0])));i.click(l(h[0]))}else{_.each(h,function(p){k[_l(m(p))]=l(p)});make_popupmenu(i,k)}return i},_render_visualizationsFrameworkButton:function(h){if(!(this.model.hasData())||!(h&&!_.isEmpty(h))){return null}var j=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(h.length===1){var i=h[0];j.attr("data-original-title",_l("Visualize in ")+i.html);j.attr("href",i.href)}else{var k=[];_.each(h,function(l){l.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:l.href});return false}return true};k.push(l);return false});PopupMenu.create(j,k)}return j},_buildNewRender:function(){var h=b.HDABaseView.prototype._buildNewRender.call(this);h.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));h.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return h},_render_body_failed_metadata:function(){var i=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),h=$("<span/>").text(". "+_l("You may be able to")+" ").append(i),j=b.HDABaseView.prototype._render_body_failed_metadata.call(this);j.find(".warningmessagesmall strong").append(h);return j},_render_body_error:function(){var h=b.HDABaseView.prototype._render_body_error.call(this);h.find(".dataset-actions .left").prepend(this._render_errButton());return h},_render_body_ok:function(){var h=b.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return h}this.makeDbkeyEditLink(h);if(this.hasUser){h.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(h);this._renderAnnotation(h)}return h},_renderTags:function(h){var i=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:h.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.tagsEditorShown=true},onhide:function(){i.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(h){var i=this;this.annotationEditor=new e.AnnotationEditor({model:this.model,el:h.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.annotationEditorShown=true},onhide:function(){i.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(i){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var h=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);i.find(".dataset-dbkey .value").replaceWith(h)}},events:_.extend(_.clone(b.HDABaseView.prototype.events),{"click .dataset-undelete":function(h){this.model.undelete();return false},"click .dataset-unhide":function(h){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function d(h){this.model.purge();return false},toString:function(){var h=(this.model)?(this.model+""):("(no model)");return"HDAView("+h+")"}});function c(h,j,i){return function(){var k={};if(i){k["f-dbkey"]=i}$.ajax({url:h+"/list_tracks?"+$.param(k),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(l){var m=window.parent;m.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){m.Galaxy.modal.hide()},"View in saved visualization":function(){m.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:l,buttons:{Cancel:function(){m.Galaxy.modal.hide()},"Add to visualization":function(){$(m.document).find("input[name=id]:checked").each(function(){m.Galaxy.modal.hide();var n=$(this).val();j.id=n;m.Galaxy.frame.add({title:"Trackster",type:"url",content:h+"/trackster?"+$.param(j)})})}}})},"View in new visualization":function(){m.Galaxy.modal.hide();var n=h+"/trackster?"+$.param(j);m.Galaxy.frame.add({title:"Trackster",type:"url",content:n})}}})}});return false}}return{HDAEditView:g}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/tags","mvc/annotations"],function(f,b,a,e){var g=b.HDABaseView.extend({initialize:function(h){b.HDABaseView.prototype.initialize.call(this,h);this.hasUser=h.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=h.tagsEditorShown||false;this.annotationEditorShown=h.annotationEditorShown||false},_render_titleButtons:function(){return b.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===f.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var j=this.model.get("purged"),h=this.model.get("deleted"),i={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(h||j){i.disabled=true;if(j){i.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(h){i.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===f.HistoryDatasetAssociation.STATES.UPLOAD){i.disabled=true;i.title=_l("This dataset must finish uploading before it can be edited")}}i.faIcon="fa-pencil";return faIconButton(i)},_render_deleteButton:function(){if((this.model.get("state")===f.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var h=this,i={title:_l("Delete"),classes:"dataset-delete",onclick:function(){h.$el.find(".icon-btn.dataset-delete").trigger("mouseout");h.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),disabled:true}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==f.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var h=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(h))){return null}if(_.isObject(h[0])){return this._render_visualizationsFrameworkButton(h)}if(!this.urls.visualization){return null}var j=this.model.get("dbkey"),n=this.urls.visualization,k={},o={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(j){o.dbkey=j}var i=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});function l(p){if(p==="trackster"){return c(n,o,j)}return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:n+"/"+p+"?"+$.param(o)})}}function m(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(h.length===1){i.attr("data-original-title",_l("Visualize in ")+_l(m(h[0])));i.click(l(h[0]))}else{_.each(h,function(p){k[_l(m(p))]=l(p)});make_popupmenu(i,k)}return i},_render_visualizationsFrameworkButton:function(h){if(!(this.model.hasData())||!(h&&!_.isEmpty(h))){return null}var j=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(h.length===1){var i=h[0];j.attr("data-original-title",_l("Visualize in ")+i.html);j.attr("href",i.href)}else{var k=[];_.each(h,function(l){l.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:l.href});return false}return true};k.push(l);return false});PopupMenu.create(j,k)}return j},_buildNewRender:function(){var h=b.HDABaseView.prototype._buildNewRender.call(this);h.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));h.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return h},_render_body_failed_metadata:function(){var i=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),h=$("<span/>").text(". "+_l("You may be able to")+" ").append(i),j=b.HDABaseView.prototype._render_body_failed_metadata.call(this);j.find(".warningmessagesmall strong").append(h);return j},_render_body_error:function(){var h=b.HDABaseView.prototype._render_body_error.call(this);h.find(".dataset-actions .left").prepend(this._render_errButton());return h},_render_body_ok:function(){var h=b.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return h}this.makeDbkeyEditLink(h);if(this.hasUser){h.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(h);this._renderAnnotation(h)}return h},_renderTags:function(h){var i=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:h.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.tagsEditorShown=true},onhide:function(){i.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(h){var i=this;this.annotationEditor=new e.AnnotationEditor({model:this.model,el:h.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.annotationEditorShown=true},onhide:function(){i.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(i){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var h=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);i.find(".dataset-dbkey .value").replaceWith(h)}},events:_.extend(_.clone(b.HDABaseView.prototype.events),{"click .dataset-undelete":function(h){this.model.undelete();return false},"click .dataset-unhide":function(h){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function d(h){this.model.purge();return false},toString:function(){var h=(this.model)?(this.model+""):("(no model)");return"HDAView("+h+")"}});function c(h,j,i){return function(){var k={};if(i){k["f-dbkey"]=i}$.ajax({url:h+"/list_tracks?"+$.param(k),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(l){var m=window.parent;m.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){m.Galaxy.modal.hide()},"View in saved visualization":function(){m.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:l,buttons:{Cancel:function(){m.Galaxy.modal.hide()},"Add to visualization":function(){$(m.document).find("input[name=id]:checked").each(function(){m.Galaxy.modal.hide();var n=$(this).val();j.id=n;m.Galaxy.frame.add({title:"Trackster",type:"url",content:h+"/trackster?"+$.param(j)})})}}})},"View in new visualization":function(){m.Galaxy.modal.hide();var n=h+"/trackster?"+$.param(j);m.Galaxy.frame.add({title:"Trackster",type:"url",content:n})}}})}});return false}}return{HDAEditView:g}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},h)},undelete:function a(h){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},h)},hide:function b(h){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},h)},unhide:function g(h){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},h)},purge:function f(h){if(this.get("purged")){return jQuery.when()}h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set({deleted:true,purged:true})});j.fail(function(o,k,n){var l=_l("Unable to purge dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})});return j},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(j,h){var i=this.get(j);if(!h||(i===undefined||i===null)){return false}if(_.isArray(i)){return this._searchArrayAttribute(i,h)}return(i.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)},_searchArrayAttribute:function(i,h){h=h.toLowerCase();return _.any(i,function(j){return(j.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)})},search:function(h){var i=this;return _.filter(this.searchAttributes,function(j){return i.searchAttribute(j,h)})},matches:function(i){var k="=",h=i.split(k);if(h.length>=2){var j=h[0];j=this.searchAliases[j]||j;return this.searchAttribute(j,h[1])}return !!this.search(i).length},matchesAll:function(i){var h=this;i=i.match(/(".*"|\w*=".*"|\S*)/g).filter(function(j){return !!j});return _.all(i,function(j){j=j.replace(/"/g,"");return h.matches(j)})},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];var i=new e(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new e(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:d,HDACollection:e}});
\ No newline at end of file
+define(["mvc/base-mvc"],function(b){var e=Backbone.Model.extend(b.LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var j=this.get("id");if(!j){return{}}var i={purge:galaxy_config.root+"datasets/"+j+"/purge_async",display:galaxy_config.root+"datasets/"+j+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+j+"/edit",download:galaxy_config.root+"datasets/"+j+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+j,rerun:galaxy_config.root+"tool_runner/rerun?id="+j,show_params:galaxy_config.root+"datasets/"+j+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+j,set:galaxy_config.root+"dataset/annotate_async?id="+j},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+j+"&metadata_name="};return i},initialize:function(i){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",e.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(j,i){this.log(this+" has changed state:",j,i);if(this.inReadyState()){this.trigger("state:ready",j,i,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(j,k){var i=true;if((!j)&&(this.get("deleted")||this.get("purged"))){i=false}if((!k)&&(!this.get("visible"))){i=false}return i},hidden:function(){return !this.get("visible")},inReadyState:function(){var i=_.contains(e.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||i)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function d(i){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},i)},undelete:function a(i){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},i)},hide:function c(i){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},i)},unhide:function h(i){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},i)},purge:function g(i){if(this.get("purged")){return jQuery.when()}i=i||{};i.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var j=this,k=jQuery.ajax(i);k.done(function(n,l,m){j.set({deleted:true,purged:true})});k.fail(function(p,l,o){var m=_l("Unable to purge dataset");var n=("Removal of datasets by users is not allowed in this Galaxy instance");if(p.responseJSON&&p.responseJSON.error){m=p.responseJSON.error}else{if(p.responseText.indexOf(n)!==-1){m=n}}p.responseText=m;j.trigger("error",j,p,i,_l(m),{error:m})});return k},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(k,i){var j=this.get(k);if(!i||(j===undefined||j===null)){return false}if(_.isArray(j)){return this._searchArrayAttribute(j,i)}return(j.toString().toLowerCase().indexOf(i.toLowerCase())!==-1)},_searchArrayAttribute:function(j,i){i=i.toLowerCase();return _.any(j,function(k){return(k.toString().toLowerCase().indexOf(i.toLowerCase())!==-1)})},search:function(i){var j=this;return _.filter(this.searchAttributes,function(k){return j.searchAttribute(k,i)})},matches:function(j){var l="=",i=j.split(l);if(i.length>=2){var k=i[0];k=this.searchAliases[k]||k;return this.searchAttribute(k,i[1])}return !!this.search(j).length},matchesAll:function(j){var i=this;j=j.match(/(".*"|\w*=".*"|\S*)/g).filter(function(k){return !!k});return _.all(j,function(k){k=k.replace(/"/g,"");return i.matches(k)})},toString:function(){var i=this.get("id")||"";if(this.get("name")){i=this.get("hid")+' :"'+this.get("name")+'",'+i}return"HDA("+i+")"}});e.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};e.READY_STATES=[e.STATES.NEW,e.STATES.OK,e.STATES.EMPTY,e.STATES.PAUSED,e.STATES.FAILED_METADATA,e.STATES.NOT_VIEWABLE,e.STATES.DISCARDED,e.STATES.ERROR];e.NOT_READY_STATES=[e.STATES.UPLOAD,e.STATES.QUEUED,e.STATES.RUNNING,e.STATES.SETTING_METADATA];var f=Backbone.Collection.extend(b.LoggableMixin).extend({model:e,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(j,i){i=i||{};this.historyId=i.historyId},ids:function(){return this.map(function(i){return i.id})},notReady:function(){return this.filter(function(i){return !i.inReadyState()})},running:function(){var i=[];this.each(function(j){if(!j.inReadyState()){i.push(j.get("id"))}});return i},getByHid:function(i){return _.first(this.filter(function(j){return j.get("hid")===i}))},getVisible:function(i,l,k){k=k||[];var j=new f(this.filter(function(m){return m.isVisible(i,l)}));_.each(k,function(m){if(!_.isFunction(m)){return}j=new f(j.filter(m))});return j},haveDetails:function(){return this.all(function(i){return i.hasDetails()})},fetchAllDetails:function(j){j=j||{};var i={details:"all"};j.data=(j.data)?(_.extend(j.data,i)):(i);return this.fetch(j)},ajaxQueue:function(l,k){var j=jQuery.Deferred(),i=this.length,n=[];if(!i){j.resolve([]);return j}var m=this.chain().reverse().map(function(p,o){return function(){var q=l.call(p,k);q.done(function(r){j.notify({curr:o,total:i,response:r,model:p})});q.always(function(r){n.push(r);if(m.length){m.shift()()}else{j.resolve(n)}})}}).value();m.shift()();return j},matches:function(i){return this.filter(function(j){return j.matches(i)})},set:function(k,i){var j=this;k=_.map(k,function(m){var n=j.get(m.id);if(!n){return m}var l=n.toJSON();_.extend(l,m);return l});Backbone.Collection.prototype.set.call(this,k,i)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:e,HDACollection:f}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/history/current-history-panel.js
--- a/static/scripts/packed/mvc/history/current-history-panel.js
+++ b/static/scripts/packed/mvc/history/current-history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-edit","mvc/history/history-panel"],function(b,e){var c=SessionStorageModel.extend({defaults:{searching:false,tagsEditorShown:false,annotationEditorShown:false},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});c.storageKey=function d(){return("history-panel")};var a=e.HistoryPanel.extend({HDAViewClass:b.HDAEditView,emptyMsg:_l("This history is empty. Click 'Get Data' on the left tool menu to start"),noneFoundMsg:_l("No matching datasets found"),initialize:function(f){f=f||{};this.preferences=new c(_.extend({id:c.storageKey()},_.pick(f,_.keys(c.prototype.defaults))));e.HistoryPanel.prototype.initialize.call(this,f)},loadCurrentHistory:function(g){var f=this;return this.loadHistoryWithHDADetails("current",g).then(function(i,h){f.trigger("current-history",f)})},switchToHistory:function(i,h){var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories/"+i+"/set_as_current")};return this.loadHistoryWithHDADetails(i,h,g).then(function(k,j){f.trigger("switched-history",f)})},createNewHistory:function(h){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var f=this,g=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,h,g).then(function(j,i){f.trigger("new-history",f)})},setModel:function(g,f,h){e.HistoryPanel.prototype.setModel.call(this,g,f,h);if(this.model){this.log("checking for updates");this.model.checkForUpdates()}return this},_setUpModelEventHandlers:function(){e.HistoryPanel.prototype._setUpModelEventHandlers.call(this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("state:ready",function(g,h,f){if((!g.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[g.id])}},this)},render:function(h,i){h=(h===undefined)?(this.fxSpeed):(h);var f=this,g;if(this.model){g=this.renderModel()}else{g=this.renderWithoutModel()}$(f).queue("fx",[function(j){if(h&&f.$el.is(":visible")){f.$el.fadeOut(h,j)}else{j()}},function(j){f.$el.empty();if(g){f.$el.append(g.children());f.renderBasedOnPrefs()}j()},function(j){if(h&&!f.$el.is(":visible")){f.$el.fadeIn(h,j)}else{j()}},function(j){if(i){i.call(this)}f.trigger("rendered",this);j()}]);return this},renderBasedOnPrefs:function(){if(this.preferences.get("searching")){this.toggleSearchControls(0,true)}},_renderEmptyMsg:function(h){var g=this,f=g.$emptyMessage(h),i=$(".toolMenuContainer");if((_.isEmpty(g.hdaViews)&&!g.searchFor)&&(Galaxy&&Galaxy.upload&&i.size())){f.empty();f.html([_l("This history is empty. "),_l("You can "),'<a class="uploader-link" href="javascript:void(0)">',_l("load your own data"),"</a>",_l(" or "),'<a class="get-data-link" href="javascript:void(0)">',_l("get data from an external source"),"</a>"].join(""));f.find(".uploader-link").click(function(j){Galaxy.upload._eventShow(j)});f.find(".get-data-link").click(function(j){i.parent().scrollTop(0);i.find('span:contains("Get Data")').click()});f.show()}else{e.HistoryPanel.prototype._renderEmptyMsg.call(this,h)}return this},toggleSearchControls:function(g,f){var h=e.HistoryPanel.prototype.toggleSearchControls.call(this,g,f);this.preferences.set("searching",h)},_renderTags:function(f){var g=this;e.HistoryPanel.prototype._renderTags.call(this,f);if(this.preferences.get("tagsEditorShown")){this.tagsEditor.toggle(true)}this.tagsEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("tagsEditorShown",h.hidden)})},_renderAnnotation:function(f){var g=this;e.HistoryPanel.prototype._renderAnnotation.call(this,f);if(this.preferences.get("annotationEditorShown")){this.annotationEditor.toggle(true)}this.annotationEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(h){g.preferences.set("annotationEditorShown",h.hidden)})},connectToQuotaMeter:function(f){if(!f){return this}this.listenTo(f,"quota:over",this.showQuotaMessage);this.listenTo(f,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(f&&f.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var f=this.$el.find(".quota-message");if(f.is(":hidden")){f.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var f=this.$el.find(".quota-message");if(!f.is(":hidden")){f.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(f){if(!f){return this}this.on("new-storage",function(h,g){if(f&&h){f.findItemByHtml(_l("Include Deleted Datasets")).checked=h.get("show_deleted");f.findItemByHtml(_l("Include Hidden Datasets")).checked=h.get("show_hidden")}});return this},toString:function(){return"CurrentHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CurrentHistoryPanel:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-edit","mvc/history/history-panel","mvc/base-mvc"],function(b,f,c){var d=c.SessionStorageModel.extend({defaults:{searching:false,tagsEditorShown:false,annotationEditorShown:false},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});d.storageKey=function e(){return("history-panel")};var a=f.HistoryPanel.extend({HDAViewClass:b.HDAEditView,emptyMsg:_l("This history is empty. Click 'Get Data' on the left tool menu to start"),noneFoundMsg:_l("No matching datasets found"),initialize:function(g){g=g||{};this.preferences=new d(_.extend({id:d.storageKey()},_.pick(g,_.keys(d.prototype.defaults))));f.HistoryPanel.prototype.initialize.call(this,g)},loadCurrentHistory:function(h){var g=this;return this.loadHistoryWithHDADetails("current",h).then(function(j,i){g.trigger("current-history",g)})},switchToHistory:function(j,i){var g=this,h=function(){return jQuery.post(galaxy_config.root+"api/histories/"+j+"/set_as_current")};return this.loadHistoryWithHDADetails(j,i,h).then(function(l,k){g.trigger("switched-history",g)})},createNewHistory:function(i){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var g=this,h=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,i,h).then(function(k,j){g.trigger("new-history",g)})},setModel:function(h,g,i){f.HistoryPanel.prototype.setModel.call(this,h,g,i);if(this.model){this.log("checking for updates");this.model.checkForUpdates()}return this},_setUpModelEventHandlers:function(){f.HistoryPanel.prototype._setUpModelEventHandlers.call(this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("state:ready",function(h,i,g){if((!h.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[h.id])}},this)},render:function(i,j){i=(i===undefined)?(this.fxSpeed):(i);var g=this,h;if(this.model){h=this.renderModel()}else{h=this.renderWithoutModel()}$(g).queue("fx",[function(k){if(i&&g.$el.is(":visible")){g.$el.fadeOut(i,k)}else{k()}},function(k){g.$el.empty();if(h){g.$el.append(h.children());g.renderBasedOnPrefs()}k()},function(k){if(i&&!g.$el.is(":visible")){g.$el.fadeIn(i,k)}else{k()}},function(k){if(j){j.call(this)}g.trigger("rendered",this);k()}]);return this},renderBasedOnPrefs:function(){if(this.preferences.get("searching")){this.toggleSearchControls(0,true)}},_renderEmptyMsg:function(i){var h=this,g=h.$emptyMessage(i),j=$(".toolMenuContainer");if((_.isEmpty(h.hdaViews)&&!h.searchFor)&&(Galaxy&&Galaxy.upload&&j.size())){g.empty();g.html([_l("This history is empty. "),_l("You can "),'<a class="uploader-link" href="javascript:void(0)">',_l("load your own data"),"</a>",_l(" or "),'<a class="get-data-link" href="javascript:void(0)">',_l("get data from an external source"),"</a>"].join(""));g.find(".uploader-link").click(function(k){Galaxy.upload._eventShow(k)});g.find(".get-data-link").click(function(k){j.parent().scrollTop(0);j.find('span:contains("Get Data")').click()});g.show()}else{f.HistoryPanel.prototype._renderEmptyMsg.call(this,i)}return this},toggleSearchControls:function(h,g){var i=f.HistoryPanel.prototype.toggleSearchControls.call(this,h,g);this.preferences.set("searching",i)},_renderTags:function(g){var h=this;f.HistoryPanel.prototype._renderTags.call(this,g);if(this.preferences.get("tagsEditorShown")){this.tagsEditor.toggle(true)}this.tagsEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(i){h.preferences.set("tagsEditorShown",i.hidden)})},_renderAnnotation:function(g){var h=this;f.HistoryPanel.prototype._renderAnnotation.call(this,g);if(this.preferences.get("annotationEditorShown")){this.annotationEditor.toggle(true)}this.annotationEditor.on("hiddenUntilActivated:shown hiddenUntilActivated:hidden",function(i){h.preferences.set("annotationEditorShown",i.hidden)})},connectToQuotaMeter:function(g){if(!g){return this}this.listenTo(g,"quota:over",this.showQuotaMessage);this.listenTo(g,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(g&&g.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var g=this.$el.find(".quota-message");if(g.is(":hidden")){g.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var g=this.$el.find(".quota-message");if(!g.is(":hidden")){g.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(g){if(!g){return this}this.on("new-storage",function(i,h){if(g&&i){g.findItemByHtml(_l("Include Deleted Datasets")).checked=i.get("show_deleted");g.findItemByHtml(_l("Include Hidden Datasets")).checked=i.get("show_hidden")}});return this},toString:function(){return"CurrentHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{CurrentHistoryPanel:a}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/history/history-model.js
--- a/static/scripts/packed/mvc/history/history-model.js
+++ b/static/scripts/packed/mvc/history/history-model.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(a){var c=Backbone.Model.extend(LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",renameUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"history/rename_async?id="+this.get("id")},annotateUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"history/annotate_async?id="+this.get("id")},tagUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"tag/get_tagging_elt_async?item_id="+this.get("id")+"&item_class=History"},initialize:function(f,g,e){e=e||{};this.logger=e.logger||null;this.log(this+".initialize:",f,g,e);this.hdas=new a.HDACollection(g||[],{historyId:this.get("id")});if(g&&_.isArray(g)){this.hdas.reset(g)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(f,i,e,h,g){this.errorHandler(f,i,e,h,g)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(f,e){if(this.hdas){this.hdas.historyId=e}},this)},errorHandler:function(f,i,e,h,g){this.clearUpdateTimeout()},hasUser:function(){var e=this.get("user");return !!(e&&e.id)},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(e,f){return e+f},0)},checkForUpdates:function(e){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(e)){e.call(this)}}return this},setUpdateTimeout:function(e){e=e||c.UPDATE_DELAY;var f=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){f.refresh()},e);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(f,e){f=f||[];e=e||{};var g=this;e.data=e.data||{};if(f.length){e.data.details=f.join(",")}var h=this.hdas.fetch(e);h.done(function(i){g.checkForUpdates(function(){this.fetch()})});return h},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});c.UPDATE_DELAY=4000;c.getHistoryData=function d(f,p){p=p||{};var j=p.hdaDetailIds||[];var l=jQuery.Deferred(),k=null;function g(q){return jQuery.ajax(galaxy_config.root+"api/histories/"+f)}function e(q){if(!q||!q.state_ids){return 0}return _.reduce(q.state_ids,function(r,t,s){return r+t.length},0)}function o(r){if(!e(r)){return[]}if(_.isFunction(j)){j=j(r)}var q=(j.length)?({details:j.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+r.id+"/contents",{data:q})}var n=p.historyFn||g,m=p.hdaFn||o;var i=n(f);i.done(function(q){k=q;l.notify({status:"history data retrieved",historyJSON:k})});i.fail(function(s,q,r){l.reject(s,"loading the history")});var h=i.then(m);h.then(function(q){l.notify({status:"dataset data retrieved",historyJSON:k,hdaJSON:q});l.resolve(k,q)});h.fail(function(s,q,r){l.reject(s,"loading the datasets",{history:k})});return l};var b=Backbone.Collection.extend(LoggableMixin).extend({model:c,urlRoot:galaxy_config.root+"api/histories"});return{History:c,HistoryCollection:b}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/base-mvc"],function(b,a){var d=Backbone.Model.extend(a.LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",renameUrl:function(){var f=this.get("id");if(!f){return undefined}return galaxy_config.root+"history/rename_async?id="+this.get("id")},annotateUrl:function(){var f=this.get("id");if(!f){return undefined}return galaxy_config.root+"history/annotate_async?id="+this.get("id")},tagUrl:function(){var f=this.get("id");if(!f){return undefined}return galaxy_config.root+"tag/get_tagging_elt_async?item_id="+this.get("id")+"&item_class=History"},initialize:function(g,h,f){f=f||{};this.logger=f.logger||null;this.log(this+".initialize:",g,h,f);this.hdas=new b.HDACollection(h||[],{historyId:this.get("id")});if(h&&_.isArray(h)){this.hdas.reset(h)}this._setUpListeners();this.updateTimeoutId=null},_setUpListeners:function(){this.on("error",function(g,j,f,i,h){this.errorHandler(g,j,f,i,h)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(g,f){if(this.hdas){this.hdas.historyId=f}},this)},errorHandler:function(g,j,f,i,h){this.clearUpdateTimeout()},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(f,g){return f+g},0)},checkForUpdates:function(f){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(f)){f.call(this)}}return this},setUpdateTimeout:function(f){f=f||d.UPDATE_DELAY;var g=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){g.refresh()},f);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(g,f){g=g||[];f=f||{};var h=this;f.data=f.data||{};if(g.length){f.data.details=g.join(",")}var i=this.hdas.fetch(f);i.done(function(j){h.checkForUpdates(function(){this.fetch()})});return i},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});d.UPDATE_DELAY=4000;d.getHistoryData=function e(g,q){q=q||{};var k=q.hdaDetailIds||[];var m=jQuery.Deferred(),l=null;function h(r){return jQuery.ajax(galaxy_config.root+"api/histories/"+g)}function f(r){if(!r||!r.state_ids){return 0}return _.reduce(r.state_ids,function(s,u,t){return s+u.length},0)}function p(s){if(!f(s)){return[]}if(_.isFunction(k)){k=k(s)}var r=(k.length)?({details:k.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+s.id+"/contents",{data:r})}var o=q.historyFn||h,n=q.hdaFn||p;var j=o(g);j.done(function(r){l=r;m.notify({status:"history data retrieved",historyJSON:l})});j.fail(function(t,r,s){m.reject(t,"loading the history")});var i=j.then(n);i.then(function(r){m.notify({status:"dataset data retrieved",historyJSON:l,hdaJSON:r});m.resolve(l,r)});i.fail(function(t,r,s){m.reject(t,"loading the datasets",{history:l})});return m};var c=Backbone.Collection.extend(a.LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories"});return{History:d,HistoryCollection:c}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations"],function(e,b,d,a,c){var f=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(g){g=g||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=g.selecting||false;this.annotationEditorShown=g.annotationEditorShown||false;this.tagsEditorShown=g.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,g)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this)},renderModel:function(){var g=$("<div/>");g.append(f.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(g).text(this.emptyMsg);if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(g);this._renderAnnotation(g)}g.find(".history-secondary-actions").prepend(this._renderSelectButton());g.find(".history-dataset-actions").toggle(this.selecting);g.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){var h=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDATagEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDATagEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){var h=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDAAnnotationEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDAAnnotationEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_renderSelectButton:function(g){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(g){g=g||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,g);if(!this.model){return}this._setUpDatasetActionsPopup(g);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var h=this;g.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(i){var j=h.model.get("name");if(i&&i!==j){h.$el.find(".history-name").text(i);h.model.save({name:i}).fail(function(){h.$el.find(".history-name").text(h.model.previous("name"))})}else{h.$el.find(".history-name").text(j)}}})},_setUpDatasetActionsPopup:function(g){var h=this;(new PopupMenu(g.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.hide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Unhide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.unhide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Delete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype["delete"];h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Undelete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.undelete;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var i=e.HistoryDatasetAssociation.prototype.purge;h.getSelectedHdaCollection().ajaxQueue(i)}}}]))},_handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},_handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},_createHdaView:function(h){var g=h.get("id"),i=new this.HDAViewClass({model:h,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[g],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(i);return i},_setUpHdaListeners:function(h){var g=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,h);h.on("selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.union(g.selectedHdaIds,[j])});h.on("de-selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.without(g.selectedHdaIds,j)})},toggleHDATagEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.annotationEditor){i.annotationEditor.toggle.apply(i.annotationEditor,h)}})},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$emptyMessage().fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":"toggleSelectors","click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(g);_.each(this.hdaViews,function(h){h.showSelector()});this.selectedHdaIds=[]},hideSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(g);_.each(this.hdaViews,function(h){h.hideSelector()});this.selectedHdaIds=[]},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.select(g)})},deselectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.deselect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},getSelectedHdaCollection:function(){return new e.HDACollection(_.map(this.getSelectedHdaViews(),function(g){return g.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations"],function(e,b,d,a,c){var f=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(g){g=g||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=g.selecting||false;this.annotationEditorShown=g.annotationEditorShown||false;this.tagsEditorShown=g.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,g)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this)},renderModel:function(){var g=$("<div/>");g.append(f.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(g).text(this.emptyMsg);if(Galaxy&&Galaxy.currUser&&Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(g);this._renderAnnotation(g)}g.find(".history-secondary-actions").prepend(this._renderSelectButton());g.find(".history-dataset-actions").toggle(this.selecting);g.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){var h=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDATagEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDATagEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){var h=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDAAnnotationEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDAAnnotationEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_renderSelectButton:function(g){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(g){g=g||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,g);if(!this.model){return}this._setUpDatasetActionsPopup(g);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var h=this;g.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(i){var j=h.model.get("name");if(i&&i!==j){h.$el.find(".history-name").text(i);h.model.save({name:i}).fail(function(){h.$el.find(".history-name").text(h.model.previous("name"))})}else{h.$el.find(".history-name").text(j)}}})},_setUpDatasetActionsPopup:function(g){var h=this;(new PopupMenu(g.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.hide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Unhide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.unhide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Delete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype["delete"];h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Undelete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.undelete;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var i=e.HistoryDatasetAssociation.prototype.purge;h.getSelectedHdaCollection().ajaxQueue(i)}}}]))},_handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},_handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},_createHdaView:function(h){var g=h.get("id"),i=new this.HDAViewClass({model:h,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[g],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(i);return i},_setUpHdaListeners:function(h){var g=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,h);h.on("selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.union(g.selectedHdaIds,[j])});h.on("de-selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.without(g.selectedHdaIds,j)})},toggleHDATagEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.annotationEditor){i.annotationEditor.toggle.apply(i.annotationEditor,h)}})},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$emptyMessage().fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":"toggleSelectors","click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(g);_.each(this.hdaViews,function(h){h.showSelector()});this.selectedHdaIds=[]},hideSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(g);_.each(this.hdaViews,function(h){h.hideSelector()});this.selectedHdaIds=[]},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.select(g)})},deselectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.deselect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},getSelectedHdaCollection:function(){return new e.HDACollection(_.map(this.getSelectedHdaViews(),function(g){return g.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:f}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/history/readonly-history-panel.js
--- a/static/scripts/packed/mvc/history/readonly-history-panel.js
+++ b/static/scripts/packed/mvc/history/readonly-history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/dataset/hda-base"],function(h,a){var g=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(j){var i="expandedHdas";this.save(i,_.extend(this.get(i),_.object([j],[true])))},removeExpandedHda:function(j){var i="expandedHdas";this.save(i,_.omit(this.get(i),j))},toString:function(){return"HistoryPrefs("+this.id+")"}});g.storageKeyPrefix="history:";g.historyStorageKey=function f(i){if(!i){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+i)}return(g.storageKeyPrefix+i)};g.get=function d(i){return new g({id:g.historyStorageKey(i)})};g.clearAll=function c(j){for(var i in sessionStorage){if(i.indexOf(g.storageKeyPrefix)===0){sessionStorage.removeItem(i)}}};var b=Backbone.View.extend(LoggableMixin).extend({HDAViewClass:a.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",emptyMsg:_l("This history is empty"),noneFoundMsg:_l("No matching datasets found"),initialize:function(i){i=i||{};if(i.logger){this.logger=i.logger}this.log(this+".initialize:",i);this.linkTarget=i.linkTarget||"_blank";this.fxSpeed=_.has(i,"fxSpeed")?(i.fxSpeed):(this.fxSpeed);this.filters=[];this.searchFor="";this.findContainerFn=i.findContainerFn;this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this._setUpListeners();var j=_.pick(i,"initiallyExpanded","show_deleted","show_hidden");this.setModel(this.model,j,false);if(i.onready){i.onready.call(this)}},_setUpListeners:function(){this.on("error",function(j,m,i,l,k){this.errorHandler(j,m,i,l,k)});this.on("loading-history",function(){this._showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this._hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(i){this.log(this+"",arguments)},this)}return this},errorHandler:function(k,n,j,m,l){console.error(k,n,j,m,l);if(n&&n.status===0&&n.readyState===0){}else{if(n&&n.status===502){}else{var i=this._parseErrorMessage(k,n,j,m,l);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",i.message,i.details)})}else{this.displayMessage("error",i.message,i.details)}}}},_parseErrorMessage:function(l,p,k,o,n){var j=Galaxy.currUser,i={message:this._bePolite(o),details:{user:(j instanceof User)?(j.toJSON()):(j+""),source:(l instanceof Backbone.Model)?(l.toJSON()):(l+""),xhr:p,options:(p)?(_.omit(k,"xhr")):(k)}};_.extend(i.details,n||{});if(p&&_.isFunction(p.getAllResponseHeaders)){var m=p.getAllResponseHeaders();m=_.compact(m.split("\n"));m=_.map(m,function(q){return q.split(": ")});i.details.xhr.responseHeaders=_.object(m)}return i},_bePolite:function(i){i=i||_l("An error occurred while getting updates from the server");return i+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadHistoryWithHDADetails:function(k,j,i,m){var l=function(n){return _.keys(g.get(n.id).get("expandedHdas"))};return this.loadHistory(k,j,i,m,l)},loadHistory:function(l,k,j,o,m){var i=this;k=k||{};i.trigger("loading-history",i);var n=h.History.getHistoryData(l,{historyFn:j,hdaFn:o,hdaDetailIds:k.initiallyExpanded||m});return i._loadHistoryFromXHR(n,k).fail(function(r,p,q){i.trigger("error",i,r,k,_l("An error was encountered while "+p),{historyId:l,history:q||{}})}).always(function(){i.trigger("loading-done",i)})},_loadHistoryFromXHR:function(k,j){var i=this;k.then(function(l,m){i.JSONToModel(l,m,j)});k.fail(function(m,l){i.render()});return k},JSONToModel:function(l,i,j){this.log("JSONToModel:",l,i,j);j=j||{};if(Galaxy&&Galaxy.currUser){l.user=Galaxy.currUser.toJSON()}var k=new h.History(l,i,j);this.setModel(k);return this},setModel:function(j,i,k){i=i||{};k=(k!==undefined)?(k):(true);this.log("setModel:",j,i,k);this.freeModel();this.selectedHdaIds=[];if(j){if(Galaxy&&Galaxy.currUser){j.user=Galaxy.currUser.toJSON()}this.model=j;if(this.logger){this.model.logger=this.logger}this._setUpWebStorage(i.initiallyExpanded,i.show_deleted,i.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this)}if(k){this.render()}return this},freeModel:function(){if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.freeHdaViews();return this},freeHdaViews:function(){this.hdaViews={};return this},_setUpWebStorage:function(j,i,k){this.storage=new g({id:g.historyStorageKey(this.model.get("id"))});if(_.isObject(j)){this.storage.set("exandedHdas",j)}if(_.isBoolean(i)){this.storage.set("show_deleted",i)}if(_.isBoolean(k)){this.storage.set("show_hidden",k)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());return this},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addHdaView,this);this.model.on("error error:hdas",function(j,l,i,k){this.errorHandler(j,l,i,k)},this);return this},render:function(k,l){this.log("render:",k,l);k=(k===undefined)?(this.fxSpeed):(k);var i=this,j;if(this.model){j=this.renderModel()}else{j=this.renderWithoutModel()}$(i).queue("fx",[function(m){if(k&&i.$el.is(":visible")){i.$el.fadeOut(k,m)}else{m()}},function(m){i.$el.empty();if(j){i.$el.append(j.children())}m()},function(m){if(k&&!i.$el.is(":visible")){i.$el.fadeIn(k,m)}else{m()}},function(m){if(l){l.call(this)}i.trigger("rendered",this);m()}]);return this},renderWithoutModel:function(){var i=$("<div/>"),j=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return i.append(j)},renderModel:function(){var i=$("<div/>");i.append(b.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(i).text(this.emptyMsg);i.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(i);this.renderHdas(i);return i},_renderEmptyMsg:function(k){var j=this,i=j.$emptyMessage(k);if(!_.isEmpty(j.hdaViews)){i.hide()}else{if(j.searchFor){i.text(j.noneFoundMsg).show()}else{i.text(j.emptyMsg).show()}}return this},_renderSearchButton:function(i){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(i){i=i||this.$el;i.find("[title]").tooltip({placement:"bottom"});this._setUpSearchInput(i.find(".history-search-controls .history-search-input"));return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(i){return(i||this.$el).find(".datasets-list")},$messages:function(i){return(i||this.$el).find(".message-container")},$emptyMessage:function(i){return(i||this.$el).find(".empty-history-message")},renderHdas:function(j){j=j||this.$el;var i=this,l={},k=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);this.$datasetsList(j).empty();if(k.length){k.each(function(n){var m=n.get("id"),o=i._createHdaView(n);l[m]=o;if(_.contains(i.selectedHdaIds,m)){o.selected=true}i.attachHdaView(o.render(),j)})}this.hdaViews=l;this._renderEmptyMsg(j);return this.hdaViews},_createHdaView:function(j){var i=j.get("id"),k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[i],hasUser:this.model.ownedByCurrUser(),logger:this.logger});this._setUpHdaListeners(k);return k},_setUpHdaListeners:function(j){var i=this;j.on("error",function(l,n,k,m){i.errorHandler(l,n,k,m)});j.on("body-expanded",function(k){i.storage.addExpandedHda(k)});j.on("body-collapsed",function(k){i.storage.removeExpandedHda(k)});return this},attachHdaView:function(k,j){j=j||this.$el;var i=this.$datasetsList(j);i.prepend(k.$el);return this},addHdaView:function(l){this.log("add."+this,l);var j=this;if(!l.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return j}$({}).queue([function k(n){var m=j.$emptyMessage();if(m.is(":visible")){m.fadeOut(j.fxSpeed,n)}else{n()}},function i(m){var n=j._createHdaView(l);j.hdaViews[l.id]=n;n.render().$el.hide();j.scrollToTop();j.attachHdaView(n);n.$el.slideDown(j.fxSpeed)}]);return j},refreshHdas:function(j,i){if(this.model){return this.model.refresh(j,i)}return $.when()},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(i){i.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{});return this},toggleShowDeleted:function(i){i=(i!==undefined)?(i):(!this.storage.get("show_deleted"));this.storage.set("show_deleted",i);this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(i){i=(i!==undefined)?(i):(!this.storage.get("show_hidden"));this.storage.set("show_hidden",i);this.renderHdas();return this.storage.get("show_hidden")},_setUpSearchInput:function(j){var k=this,l=".history-search-input";function i(m){if(k.model.hdas.haveDetails()){k.searchHdas(m);return}k.$el.find(l).searchInput("toggle-loading");k.model.hdas.fetchAllDetails({silent:true}).always(function(){k.$el.find(l).searchInput("toggle-loading")}).done(function(){k.searchHdas(m)})}j.searchInput({initialVal:k.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:i,onsearch:_.bind(this.searchHdas,this),onclear:_.bind(this.clearHdaSearch,this)});return j},toggleSearchControls:function(k,i){var j=this.$el.find(".history-search-controls"),l=(jQuery.type(k)==="number")?(k):(this.fxSpeed);i=(i!==undefined)?(i):(!j.is(":visible"));if(i){j.slideDown(l,function(){$(this).find("input").focus()})}else{j.slideUp(l)}return i},searchHdas:function(i){var j=this;this.searchFor=i;this.filters=[function(k){return k.matchesAll(j.searchFor)}];this.trigger("search:searching",i,this);this.renderHdas();return this},clearHdaSearch:function(i){this.searchFor="";this.filters=[];this.trigger("search:clear",this);this.renderHdas();return this},_showLoadingIndicator:function(j,i,k){i=(i!==undefined)?(i):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,k)}else{this.$el.fadeOut(i);this.indicator.show(j,i,k)}},_hideLoadingIndicator:function(i,j){i=(i!==undefined)?(i):(this.fxSpeed);if(this.indicator){this.indicator.hide(i,j)}},displayMessage:function(n,o,m){var k=this;this.scrollToTop();var l=this.$messages(),i=$("<div/>").addClass(n+"message").html(o);if(!_.isEmpty(m)){var j=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(k._messageToModalOptions(n,o,m));return false});i.append(" ",j)}return l.html(i)},_messageToModalOptions:function(m,o,l){var i=this,n=$("<div/>"),k={title:"Details"};function j(p){p=_.omit(p,_.functions(p));return["<table>",_.map(p,function(r,q){r=(_.isObject(r))?(j(r)):(r);return'<tr><td style="vertical-align: top; color: grey">'+q+'</td><td style="padding-left: 8px">'+r+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(l)){k.body=n.append(j(l))}else{k.body=n.html(l)}k.buttons={Ok:function(){Galaxy.modal.hide();i.clearMessages()}};return k},clearMessages:function(){this.$messages().empty();return this},scrollPosition:function(){return this.$container().scrollTop()},scrollTo:function(i){this.$container().scrollTop(i);return this},scrollToTop:function(){this.$container().scrollTop(0);return this},scrollToId:function(j){if((!j)||(!this.hdaViews[j])){return this}var i=this.hdaViews[j];this.scrollTo(i.el.offsetTop);return this},scrollToHid:function(i){var j=this.model.hdas.getByHid(i);if(!j){return this}return this.scrollToId(j.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var e=['<div class="history-controls">','<div class="history-search-controls">','<div class="history-search-input"></div>',"</div>",'<div class="history-title">',"<% if( history.name ){ %>",'<div class="history-name"><%= history.name %></div>',"<% } %>","</div>",'<div class="history-subtitle clear">',"<% if( history.nice_size ){ %>",'<div class="history-size"><%= history.nice_size %></div>',"<% } %>",'<div class="history-secondary-actions"></div>',"</div>","<% if( history.deleted ){ %>",'<div class="warningmessagesmall"><strong>',_l("You are currently viewing a deleted history!"),"</strong></div>","<% } %>",'<div class="message-container">',"<% if( history.message ){ %>",'<div class="<%= history.status %>message"><%= history.message %></div>',"<% } %>","</div>",'<div class="quota-message errormessage">',_l("You are over your disk quota."),_l("Tool execution is on hold until your disk usage drops below your allocated quota."),"</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="history-dataset-actions">','<div class="btn-group">','<button class="history-select-all-datasets-btn btn btn-default"','data-mode="select">',_l("All"),"</button>",'<button class="history-deselect-all-datasets-btn btn btn-default"','data-mode="select">',_l("None"),"</button>","</div>",'<button class="history-dataset-action-popup-btn btn btn-default">',_l("For all selected"),"...</button>","</div>","</div>",'<div class="datasets-list"></div>','<div class="empty-history-message infomessagesmall">',_l("Your history is empty. Click 'Get Data' on the left pane to start"),"</div>"].join("");b.templates={historyPanel:function(i){return _.template(e,i,{variable:"history"})}};return{ReadOnlyHistoryPanel:b}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/dataset/hda-base","mvc/base-mvc"],function(e,a,d){var g=d.SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(k){var j="expandedHdas";this.save(j,_.extend(this.get(j),_.object([k],[true])))},removeExpandedHda:function(k){var j="expandedHdas";this.save(j,_.omit(this.get(j),k))},toString:function(){return"HistoryPrefs("+this.id+")"}});g.storageKeyPrefix="history:";g.historyStorageKey=function c(j){if(!j){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+j)}return(g.storageKeyPrefix+j)};g.get=function b(j){return new g({id:g.historyStorageKey(j)})};g.clearAll=function f(k){for(var j in sessionStorage){if(j.indexOf(g.storageKeyPrefix)===0){sessionStorage.removeItem(j)}}};var h=Backbone.View.extend(d.LoggableMixin).extend({HDAViewClass:a.HDABaseView,tagName:"div",className:"history-panel",fxSpeed:"fast",emptyMsg:_l("This history is empty"),noneFoundMsg:_l("No matching datasets found"),initialize:function(j){j=j||{};if(j.logger){this.logger=j.logger}this.log(this+".initialize:",j);this.linkTarget=j.linkTarget||"_blank";this.fxSpeed=_.has(j,"fxSpeed")?(j.fxSpeed):(this.fxSpeed);this.filters=[];this.searchFor="";this.findContainerFn=j.findContainerFn;this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this._setUpListeners();var k=_.pick(j,"initiallyExpanded","show_deleted","show_hidden");this.setModel(this.model,k,false);if(j.onready){j.onready.call(this)}},_setUpListeners:function(){this.on("error",function(k,n,j,m,l){this.errorHandler(k,n,j,m,l)});this.on("loading-history",function(){this._showLoadingIndicator("loading history...",40)});this.on("loading-done",function(){this._hideLoadingIndicator(40);if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});if(this.logger){this.on("all",function(j){this.log(this+"",arguments)},this)}return this},errorHandler:function(l,o,k,n,m){console.error(l,o,k,n,m);if(o&&o.status===0&&o.readyState===0){}else{if(o&&o.status===502){}else{var j=this._parseErrorMessage(l,o,k,n,m);if(!this.$messages().is(":visible")){this.once("rendered",function(){this.displayMessage("error",j.message,j.details)})}else{this.displayMessage("error",j.message,j.details)}}}},_parseErrorMessage:function(m,q,l,p,o){var k=Galaxy.currUser,j={message:this._bePolite(p),details:{user:(k instanceof User)?(k.toJSON()):(k+""),source:(m instanceof Backbone.Model)?(m.toJSON()):(m+""),xhr:q,options:(q)?(_.omit(l,"xhr")):(l)}};_.extend(j.details,o||{});if(q&&_.isFunction(q.getAllResponseHeaders)){var n=q.getAllResponseHeaders();n=_.compact(n.split("\n"));n=_.map(n,function(r){return r.split(": ")});j.details.xhr.responseHeaders=_.object(n)}return j},_bePolite:function(j){j=j||_l("An error occurred while getting updates from the server");return j+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadHistoryWithHDADetails:function(l,k,j,n){var m=function(o){return _.keys(g.get(o.id).get("expandedHdas"))};return this.loadHistory(l,k,j,n,m)},loadHistory:function(m,l,k,p,n){var j=this;l=l||{};j.trigger("loading-history",j);var o=e.History.getHistoryData(m,{historyFn:k,hdaFn:p,hdaDetailIds:l.initiallyExpanded||n});return j._loadHistoryFromXHR(o,l).fail(function(s,q,r){j.trigger("error",j,s,l,_l("An error was encountered while "+q),{historyId:m,history:r||{}})}).always(function(){j.trigger("loading-done",j)})},_loadHistoryFromXHR:function(l,k){var j=this;l.then(function(m,n){j.JSONToModel(m,n,k)});l.fail(function(n,m){j.render()});return l},JSONToModel:function(m,j,k){this.log("JSONToModel:",m,j,k);k=k||{};var l=new e.History(m,j,k);this.setModel(l);return this},setModel:function(k,j,l){j=j||{};l=(l!==undefined)?(l):(true);this.log("setModel:",k,j,l);this.freeModel();this.selectedHdaIds=[];if(k){this.model=k;if(this.logger){this.model.logger=this.logger}this._setUpWebStorage(j.initiallyExpanded,j.show_deleted,j.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this)}if(l){this.render()}return this},freeModel:function(){if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.freeHdaViews();return this},freeHdaViews:function(){this.hdaViews={};return this},_setUpWebStorage:function(k,j,l){this.storage=new g({id:g.historyStorageKey(this.model.get("id"))});if(_.isObject(k)){this.storage.set("exandedHdas",k)}if(_.isBoolean(j)){this.storage.set("show_deleted",j)}if(_.isBoolean(l)){this.storage.set("show_hidden",l)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get());return this},_setUpModelEventHandlers:function(){this.model.hdas.on("add",this.addHdaView,this);this.model.on("error error:hdas",function(k,m,j,l){this.errorHandler(k,m,j,l)},this);return this},render:function(l,m){this.log("render:",l,m);l=(l===undefined)?(this.fxSpeed):(l);var j=this,k;if(this.model){k=this.renderModel()}else{k=this.renderWithoutModel()}$(j).queue("fx",[function(n){if(l&&j.$el.is(":visible")){j.$el.fadeOut(l,n)}else{n()}},function(n){j.$el.empty();if(k){j.$el.append(k.children())}n()},function(n){if(l&&!j.$el.is(":visible")){j.$el.fadeIn(l,n)}else{n()}},function(n){if(m){m.call(this)}j.trigger("rendered",this);n()}]);return this},renderWithoutModel:function(){var j=$("<div/>"),k=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return j.append(k)},renderModel:function(){var j=$("<div/>");j.append(h.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(j).text(this.emptyMsg);j.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(j);this.renderHdas(j);return j},_renderEmptyMsg:function(l){var k=this,j=k.$emptyMessage(l);if(!_.isEmpty(k.hdaViews)){j.hide()}else{if(k.searchFor){j.text(k.noneFoundMsg).show()}else{j.text(k.emptyMsg).show()}}return this},_renderSearchButton:function(j){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_setUpBehaviours:function(j){j=j||this.$el;j.find("[title]").tooltip({placement:"bottom"});this._setUpSearchInput(j.find(".history-search-controls .history-search-input"));return this},$container:function(){return(this.findContainerFn)?(this.findContainerFn.call(this)):(this.$el.parent())},$datasetsList:function(j){return(j||this.$el).find(".datasets-list")},$messages:function(j){return(j||this.$el).find(".message-container")},$emptyMessage:function(j){return(j||this.$el).find(".empty-history-message")},renderHdas:function(k){k=k||this.$el;var j=this,m={},l=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);this.$datasetsList(k).empty();if(l.length){l.each(function(o){var n=o.get("id"),p=j._createHdaView(o);m[n]=p;if(_.contains(j.selectedHdaIds,n)){p.selected=true}j.attachHdaView(p.render(),k)})}this.hdaViews=m;this._renderEmptyMsg(k);return this.hdaViews},_createHdaView:function(k){var j=k.get("id"),l=new this.HDAViewClass({model:k,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[j],hasUser:this.model.ownedByCurrUser(),logger:this.logger});this._setUpHdaListeners(l);return l},_setUpHdaListeners:function(k){var j=this;k.on("error",function(m,o,l,n){j.errorHandler(m,o,l,n)});k.on("body-expanded",function(l){j.storage.addExpandedHda(l)});k.on("body-collapsed",function(l){j.storage.removeExpandedHda(l)});return this},attachHdaView:function(l,k){k=k||this.$el;var j=this.$datasetsList(k);j.prepend(l.$el);return this},addHdaView:function(m){this.log("add."+this,m);var k=this;if(!m.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return k}$({}).queue([function l(o){var n=k.$emptyMessage();if(n.is(":visible")){n.fadeOut(k.fxSpeed,o)}else{o()}},function j(n){var o=k._createHdaView(m);k.hdaViews[m.id]=o;o.render().$el.hide();k.scrollToTop();k.attachHdaView(o);o.$el.slideDown(k.fxSpeed)}]);return k},refreshHdas:function(k,j){if(this.model){return this.model.refresh(k,j)}return $.when()},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls"},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(j){j.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{});return this},toggleShowDeleted:function(j){j=(j!==undefined)?(j):(!this.storage.get("show_deleted"));this.storage.set("show_deleted",j);this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(j){j=(j!==undefined)?(j):(!this.storage.get("show_hidden"));this.storage.set("show_hidden",j);this.renderHdas();return this.storage.get("show_hidden")},_setUpSearchInput:function(k){var l=this,m=".history-search-input";function j(n){if(l.model.hdas.haveDetails()){l.searchHdas(n);return}l.$el.find(m).searchInput("toggle-loading");l.model.hdas.fetchAllDetails({silent:true}).always(function(){l.$el.find(m).searchInput("toggle-loading")}).done(function(){l.searchHdas(n)})}k.searchInput({initialVal:l.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:j,onsearch:_.bind(this.searchHdas,this),onclear:_.bind(this.clearHdaSearch,this)});return k},toggleSearchControls:function(l,j){var k=this.$el.find(".history-search-controls"),m=(jQuery.type(l)==="number")?(l):(this.fxSpeed);j=(j!==undefined)?(j):(!k.is(":visible"));if(j){k.slideDown(m,function(){$(this).find("input").focus()})}else{k.slideUp(m)}return j},searchHdas:function(j){var k=this;this.searchFor=j;this.filters=[function(l){return l.matchesAll(k.searchFor)}];this.trigger("search:searching",j,this);this.renderHdas();return this},clearHdaSearch:function(j){this.searchFor="";this.filters=[];this.trigger("search:clear",this);this.renderHdas();return this},_showLoadingIndicator:function(k,j,l){j=(j!==undefined)?(j):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,l)}else{this.$el.fadeOut(j);this.indicator.show(k,j,l)}},_hideLoadingIndicator:function(j,k){j=(j!==undefined)?(j):(this.fxSpeed);if(this.indicator){this.indicator.hide(j,k)}},displayMessage:function(o,p,n){var l=this;this.scrollToTop();var m=this.$messages(),j=$("<div/>").addClass(o+"message").html(p);if(!_.isEmpty(n)){var k=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(l._messageToModalOptions(o,p,n));return false});j.append(" ",k)}return m.html(j)},_messageToModalOptions:function(n,p,m){var j=this,o=$("<div/>"),l={title:"Details"};function k(q){q=_.omit(q,_.functions(q));return["<table>",_.map(q,function(s,r){s=(_.isObject(s))?(k(s)):(s);return'<tr><td style="vertical-align: top; color: grey">'+r+'</td><td style="padding-left: 8px">'+s+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(m)){l.body=o.append(k(m))}else{l.body=o.html(m)}l.buttons={Ok:function(){Galaxy.modal.hide();j.clearMessages()}};return l},clearMessages:function(){this.$messages().empty();return this},scrollPosition:function(){return this.$container().scrollTop()},scrollTo:function(j){this.$container().scrollTop(j);return this},scrollToTop:function(){this.$container().scrollTop(0);return this},scrollToId:function(k){if((!k)||(!this.hdaViews[k])){return this}var j=this.hdaViews[k];this.scrollTo(j.el.offsetTop);return this},scrollToHid:function(j){var k=this.model.hdas.getByHid(j);if(!k){return this}return this.scrollToId(k.id)},toString:function(){return"ReadOnlyHistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});var i=['<div class="history-controls">','<div class="history-search-controls">','<div class="history-search-input"></div>',"</div>",'<div class="history-title">',"<% if( history.name ){ %>",'<div class="history-name"><%= history.name %></div>',"<% } %>","</div>",'<div class="history-subtitle clear">',"<% if( history.nice_size ){ %>",'<div class="history-size"><%= history.nice_size %></div>',"<% } %>",'<div class="history-secondary-actions"></div>',"</div>","<% if( history.deleted ){ %>",'<div class="warningmessagesmall"><strong>',_l("You are currently viewing a deleted history!"),"</strong></div>","<% } %>",'<div class="message-container">',"<% if( history.message ){ %>",'<div class="<%= history.status %>message"><%= history.message %></div>',"<% } %>","</div>",'<div class="quota-message errormessage">',_l("You are over your disk quota."),_l("Tool execution is on hold until your disk usage drops below your allocated quota."),"</div>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="history-dataset-actions">','<div class="btn-group">','<button class="history-select-all-datasets-btn btn btn-default"','data-mode="select">',_l("All"),"</button>",'<button class="history-deselect-all-datasets-btn btn btn-default"','data-mode="select">',_l("None"),"</button>","</div>",'<button class="history-dataset-action-popup-btn btn btn-default">',_l("For all selected"),"...</button>","</div>","</div>",'<div class="datasets-list"></div>','<div class="empty-history-message infomessagesmall">',_l("Your history is empty. Click 'Get Data' on the left pane to start"),"</div>"].join("");h.templates={historyPanel:function(j){return _.template(i,j,{variable:"history"})}};return{ReadOnlyHistoryPanel:h}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/tags.js
--- a/static/scripts/packed/mvc/tags.js
+++ b/static/scripts/packed/mvc/tags.js
@@ -1,1 +1,1 @@
-define([],function(){var a=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(b){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(b.$activator,b)},render:function(){var b=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return b._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var b=this.model.get("tags");if(!_.isArray(b)||_.isEmpty(b)){return""}return b.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var b=this;this.$input().on("change",function(c){b.model.save({tags:c.val},{silent:true});if(c.added){b._addNewTagToTagsUsed(c.added.text+"")}})},_addNewTagToTagsUsed:function(b){var c=Galaxy.currUser.get("tags_used");if(!_.contains(c,b)){c.push(b);c.sort();Galaxy.currUser.set("tags_used",c)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:a}});
\ No newline at end of file
+define(["mvc/base-mvc"],function(a){var b=Backbone.View.extend(a.LoggableMixin).extend(a.HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(c){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(c.$activator,c)},render:function(){var c=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return c._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var c=this.model.get("tags");if(!_.isArray(c)||_.isEmpty(c)){return""}return c.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var c=this;this.$input().on("change",function(d){c.model.save({tags:d.val},{silent:true});if(d.added){c._addNewTagToTagsUsed(d.added.text+"")}})},_addNewTagToTagsUsed:function(c){var d=Galaxy.currUser.get("tags_used");if(!_.contains(d,c)){d.push(c);d.sort();Galaxy.currUser.set("tags_used",d)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:b}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/user/user-model.js
--- a/static/scripts/packed/mvc/user/user-model.js
+++ b/static/scripts/packed/mvc/user/user-model.js
@@ -1,1 +1,1 @@
-var User=Backbone.Model.extend(LoggableMixin).extend({urlRoot:galaxy_config.root+"api/users",defaults:{id:null,username:"("+_l("anonymous user")+")",email:"",total_disk_usage:0,nice_total_disk_usage:"",quota_percent:null},initialize:function(a){this.log("User.initialize:",a);this.on("loaded",function(b,c){this.log(this+" has loaded:",b,c)});this.on("change",function(b,c){this.log(this+" has changed:",b,c.changes)})},isAnonymous:function(){return(!this.get("email"))},loadFromApi:function(d,b){d=d||User.CURRENT_ID_STR;b=b||{};var a=this,c=b.success;b.success=function(f,e){a.trigger("loaded",f,e);if(c){c(f,e)}};if(d===User.CURRENT_ID_STR){b.url=this.urlRoot+"/"+User.CURRENT_ID_STR}return Backbone.Model.prototype.fetch.call(this,b)},clearSessionStorage:function(){for(var a in sessionStorage){if(a.indexOf("history:")===0){sessionStorage.removeItem(a)}else{if(a==="history-panel"){sessionStorage.removeItem(a)}}}},toString:function(){var a=[this.get("username")];if(this.get("id")){a.unshift(this.get("id"));a.push(this.get("email"))}return"User("+a.join(":")+")"}});User.CURRENT_ID_STR="current";User.getCurrentUserFromApi=function(b){var a=new User();a.loadFromApi(User.CURRENT_ID_STR,b);return a};var UserCollection=Backbone.Collection.extend(LoggableMixin).extend({model:User,urlRoot:galaxy_config.root+"api/users"});
\ No newline at end of file
+define(["mvc/base-mvc"],function(a){var c=Backbone.Model.extend(a.LoggableMixin).extend({urlRoot:galaxy_config.root+"api/users",defaults:{id:null,username:"("+_l("anonymous user")+")",email:"",total_disk_usage:0,nice_total_disk_usage:"",quota_percent:null},initialize:function(d){this.log("User.initialize:",d);this.on("loaded",function(e,f){this.log(this+" has loaded:",e,f)});this.on("change",function(e,f){this.log(this+" has changed:",e,f.changes)})},isAnonymous:function(){return(!this.get("email"))},loadFromApi:function(g,e){g=g||c.CURRENT_ID_STR;e=e||{};var d=this,f=e.success;e.success=function(i,h){d.trigger("loaded",i,h);if(f){f(i,h)}};if(g===c.CURRENT_ID_STR){e.url=this.urlRoot+"/"+c.CURRENT_ID_STR}return Backbone.Model.prototype.fetch.call(this,e)},clearSessionStorage:function(){for(var d in sessionStorage){if(d.indexOf("history:")===0){sessionStorage.removeItem(d)}else{if(d==="history-panel"){sessionStorage.removeItem(d)}}}},toString:function(){var d=[this.get("username")];if(this.get("id")){d.unshift(this.get("id"));d.push(this.get("email"))}return"User("+d.join(":")+")"}});c.CURRENT_ID_STR="current";c.getCurrentUserFromApi=function(e){var d=new c();d.loadFromApi(c.CURRENT_ID_STR,e);return d};var b=Backbone.Collection.extend(a.LoggableMixin).extend({model:c,urlRoot:galaxy_config.root+"api/users"});return{User:c}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/user/user-quotameter.js
--- a/static/scripts/packed/mvc/user/user-quotameter.js
+++ b/static/scripts/packed/mvc/user/user-quotameter.js
@@ -1,1 +1,1 @@
-var UserQuotaMeter=Backbone.View.extend(LoggableMixin).extend({options:{warnAtPercent:85,errorAtPercent:100},initialize:function(a){this.log(this+".initialize:",a);_.extend(this.options,a);this.model.bind("change:quota_percent change:total_disk_usage",this.render,this)},update:function(a){this.log(this+" updating user data...",a);this.model.loadFromApi(this.model.get("id"),a);return this},isOverQuota:function(){return(this.model.get("quota_percent")!==null&&this.model.get("quota_percent")>=this.options.errorAtPercent)},_render_quota:function(){var a=this.model.toJSON(),c=a.quota_percent,b=$(this._templateQuotaMeter(a)),d=b.find(".progress-bar");if(this.isOverQuota()){d.attr("class","progress-bar progress-bar-danger");b.find(".quota-meter-text").css("color","white");this.trigger("quota:over",a)}else{if(c>=this.options.warnAtPercent){d.attr("class","progress-bar progress-bar-warning");this.trigger("quota:under quota:under:approaching",a)}else{d.attr("class","progress-bar progress-bar-success");this.trigger("quota:under quota:under:ok",a)}}return b},_render_usage:function(){var a=$(this._templateUsage(this.model.toJSON()));this.log(this+".rendering usage:",a);return a},render:function(){var a=null;this.log(this+".model.quota_percent:",this.model.get("quota_percent"));if((this.model.get("quota_percent")===null)||(this.model.get("quota_percent")===undefined)){a=this._render_usage()}else{a=this._render_quota()}this.$el.html(a);this.$el.find(".quota-meter-text").tooltip();return this},_templateQuotaMeter:function(a){return['<div id="quota-meter" class="quota-meter progress">','<div class="progress-bar" style="width: ',a.quota_percent,'%"></div>','<div class="quota-meter-text" style="top: 6px"',((a.nice_total_disk_usage)?(' title="Using '+a.nice_total_disk_usage+'">'):(">")),_l("Using")," ",a.quota_percent,"%","</div>","</div>"].join("")},_templateUsage:function(a){return['<div id="quota-meter" class="quota-meter" style="background-color: transparent">','<div class="quota-meter-text" style="top: 6px; color: white">',((a.nice_total_disk_usage)?(_l("Using ")+a.nice_total_disk_usage):("")),"</div>","</div>"].join("")},toString:function(){return"UserQuotaMeter("+this.model+")"}});
\ No newline at end of file
+define(["mvc/base-mvc"],function(a){var b=Backbone.View.extend(a.LoggableMixin).extend({options:{warnAtPercent:85,errorAtPercent:100},initialize:function(c){this.log(this+".initialize:",c);_.extend(this.options,c);this.model.bind("change:quota_percent change:total_disk_usage",this.render,this)},update:function(c){this.log(this+" updating user data...",c);this.model.loadFromApi(this.model.get("id"),c);return this},isOverQuota:function(){return(this.model.get("quota_percent")!==null&&this.model.get("quota_percent")>=this.options.errorAtPercent)},_render_quota:function(){var c=this.model.toJSON(),e=c.quota_percent,d=$(this._templateQuotaMeter(c)),f=d.find(".progress-bar");if(this.isOverQuota()){f.attr("class","progress-bar progress-bar-danger");d.find(".quota-meter-text").css("color","white");this.trigger("quota:over",c)}else{if(e>=this.options.warnAtPercent){f.attr("class","progress-bar progress-bar-warning");this.trigger("quota:under quota:under:approaching",c)}else{f.attr("class","progress-bar progress-bar-success");this.trigger("quota:under quota:under:ok",c)}}return d},_render_usage:function(){var c=$(this._templateUsage(this.model.toJSON()));this.log(this+".rendering usage:",c);return c},render:function(){var c=null;this.log(this+".model.quota_percent:",this.model.get("quota_percent"));if((this.model.get("quota_percent")===null)||(this.model.get("quota_percent")===undefined)){c=this._render_usage()}else{c=this._render_quota()}this.$el.html(c);this.$el.find(".quota-meter-text").tooltip();return this},_templateQuotaMeter:function(c){return['<div id="quota-meter" class="quota-meter progress">','<div class="progress-bar" style="width: ',c.quota_percent,'%"></div>','<div class="quota-meter-text" style="top: 6px"',((c.nice_total_disk_usage)?(' title="Using '+c.nice_total_disk_usage+'">'):(">")),_l("Using")," ",c.quota_percent,"%","</div>","</div>"].join("")},_templateUsage:function(c){return['<div id="quota-meter" class="quota-meter" style="background-color: transparent">','<div class="quota-meter-text" style="top: 6px; color: white">',((c.nice_total_disk_usage)?(_l("Using ")+c.nice_total_disk_usage):("")),"</div>","</div>"].join("")},toString:function(){return"UserQuotaMeter("+this.model+")"}});return{UserQuotaMeter:b}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 static/scripts/packed/mvc/visualization/visualization-model.js
--- a/static/scripts/packed/mvc/visualization/visualization-model.js
+++ b/static/scripts/packed/mvc/visualization/visualization-model.js
@@ -1,1 +1,1 @@
-var Visualization=Backbone.Model.extend(LoggableMixin).extend({defaults:{config:{}},urlRoot:function(){var a="/api/visualizations";return((window.galaxy_config&&galaxy_config.root)?(galaxy_config.root+a):(a))},initialize:function(a){this.log(this+".initialize",a,this.attributes);if(_.isObject(a.config)&&_.isObject(this.defaults.config)){_.defaults(a.config,this.defaults.config)}this._setUpListeners()},_setUpListeners:function(){},set:function(b,c){if(b==="config"){var a=this.get("config");if(_.isObject(a)){c=_.extend(_.clone(a),c)}}Backbone.Model.prototype.set.call(this,b,c);return this},toString:function(){var a=this.get("id")||"";if(this.get("title")){a+=":"+this.get("title")}return"Visualization("+a+")"}});var VisualizationCollection=Backbone.Collection.extend(LoggableMixin).extend({model:Visualization,url:function(){return galaxy_config.root+"api/visualizations"},initialize:function(b,a){a=a||{}},set:function(c,a){var b=this;c=_.map(c,function(e){var f=b.get(e.id);if(!f){return e}var d=f.toJSON();_.extend(d,e);return d});Backbone.Collection.prototype.set.call(this,c,a)},toString:function(){return(["VisualizationCollection(",[this.historyId,this.length].join(),")"].join(""))}});
\ No newline at end of file
+var Visualization=Backbone.Model.extend({defaults:{config:{}},urlRoot:function(){var a="/api/visualizations";return((window.galaxy_config&&galaxy_config.root)?(galaxy_config.root+a):(a))},initialize:function(a){if(_.isObject(a.config)&&_.isObject(this.defaults.config)){_.defaults(a.config,this.defaults.config)}this._setUpListeners()},_setUpListeners:function(){},set:function(b,c){if(b==="config"){var a=this.get("config");if(_.isObject(a)){c=_.extend(_.clone(a),c)}}Backbone.Model.prototype.set.call(this,b,c);return this},toString:function(){var a=this.get("id")||"";if(this.get("title")){a+=":"+this.get("title")}return"Visualization("+a+")"}});var VisualizationCollection=Backbone.Collection.extend({model:Visualization,url:function(){return galaxy_config.root+"api/visualizations"},initialize:function(b,a){a=a||{}},set:function(c,a){var b=this;c=_.map(c,function(e){var f=b.get(e.id);if(!f){return e}var d=f.toJSON();_.extend(d,e);return d});Backbone.Collection.prototype.set.call(this,c,a)},toString:function(){return(["VisualizationCollection(",[this.historyId,this.length].join(),")"].join(""))}});
\ No newline at end of file
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 templates/webapps/galaxy/galaxy.masthead.mako
--- a/templates/webapps/galaxy/galaxy.masthead.mako
+++ b/templates/webapps/galaxy/galaxy.masthead.mako
@@ -66,25 +66,28 @@
}
%>
- ${h.js( "mvc/base-mvc", "utils/localization", "mvc/user/user-model", "mvc/user/user-quotameter" )}
+ ##${h.js( "mvc/base-mvc", "utils/localization", "mvc/user/user-model", "mvc/user/user-quotameter" )}
+ ${h.js( "utils/localization" )}
## load the frame manager
<script type="text/javascript">
if( !window.Galaxy ){
- window.Galaxy = {};
+ Galaxy = {};
}
- ## fetch the current user data from trans
- Galaxy.currUser = new User(${ h.to_json_string( get_user_json(), indent=2 ) });
## load additional style sheet
- if (window != window.top)
- $('<link href="' + galaxy_config.root + 'static/style/galaxy.frame.masthead.css" rel="stylesheet">').appendTo('head');
+ if (window != window.top){
+ $('<link href="' + galaxy_config.root + 'static/style/galaxy.frame.masthead.css" rel="stylesheet">')
+ .appendTo('head');
+ }
## load galaxy js-modules
- $(function() {
- require(['galaxy.masthead', 'galaxy.menu', 'mvc/ui/ui-modal', 'galaxy.frame', 'mvc/upload/upload-view'],
- function(mod_masthead, mod_menu, mod_modal, mod_frame, GalaxyUpload)
- {
+ require([
+ 'galaxy.masthead', 'galaxy.menu', 'mvc/ui/ui-modal', 'galaxy.frame', 'mvc/upload/upload-view',
+ 'mvc/user/user-model',
+ 'mvc/user/user-quotameter'
+ ], function( mod_masthead, mod_menu, mod_modal, mod_frame, GalaxyUpload, user, quotameter ){
+ $(function() {
## check if masthead is available
if (Galaxy.masthead)
return;
@@ -106,11 +109,14 @@
## 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
- Galaxy.quotaMeter = new UserQuotaMeter({
+ Galaxy.quotaMeter = new quotameter.UserQuotaMeter({
model : Galaxy.currUser,
- el : $(Galaxy.masthead.el).find('.quota-meter-container')
+ el : Galaxy.masthead.$('.quota-meter-container')
}).render();
});
});
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 templates/webapps/galaxy/history/history_panel.mako
--- a/templates/webapps/galaxy/history/history_panel.mako
+++ b/templates/webapps/galaxy/history/history_panel.mako
@@ -16,7 +16,8 @@
linkTarget : 'galaxy_main',
onready : function loadAsCurrentHistoryPanel(){
var panel = this;
- this.connectToQuotaMeter( Galaxy.quotaMeter ).connectToOptionsMenu( Galaxy.historyOptionsMenu );
+ this.connectToQuotaMeter( Galaxy.quotaMeter )
+ .connectToOptionsMenu( Galaxy.historyOptionsMenu );
this.loadCurrentHistory()
.fail( function(){
panel.render();
@@ -92,7 +93,6 @@
<%def name="history_panel_javascripts()">
${h.js(
"utils/localization",
- "mvc/base-mvc"
)}
${localize_js_strings([
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 templates/webapps/galaxy/history/view.mako
--- a/templates/webapps/galaxy/history/view.mako
+++ b/templates/webapps/galaxy/history/view.mako
@@ -73,17 +73,11 @@
${history_panel_javascripts()}
%if not use_panels:
- ${h.js( 'mvc/user/user-model' )}
+<script type="text/javascript">
+window.Galaxy = {};
+</script>
%endif
-<script type="text/javascript">
- ##TODO: remove when Galaxy is either ensured or removed from the history panel
- var using_panels = ${ 'false' if not use_panels else 'true' };
- %if not use_panels:
- window.Galaxy = {};
- Galaxy.currUser = new User(${h.to_json_string( get_user_json() )});
- %endif
-</script></%def>
## ----------------------------------------------------------------------------
@@ -163,8 +157,12 @@
require.config({
baseUrl : "${h.url_for( '/static/scripts' )}"
- })([ panelToUse.location ], function( panelMod ){
+ })([ 'mvc/user/user-model', panelToUse.location ], function( user, panelMod ){
$(function(){
+ if( !Galaxy.currUser ){
+ Galaxy.currUser = new user.User( ${h.to_json_string( get_user_json() )} );
+ }
+
var panelClass = panelMod[ panelToUse.className ],
// history module is already in the dpn chain from the panel. We can re-scope it here.
historyModel = require( 'mvc/history/history-model' ),
diff -r 08f389432f6876a5af1ad54ef2f25e4d06310999 -r 7155334f5ec5743188f90053a54ac851be3e2d58 templates/webapps/galaxy/root/history.mako
--- a/templates/webapps/galaxy/root/history.mako
+++ b/templates/webapps/galaxy/root/history.mako
@@ -22,47 +22,45 @@
<%def name="javascripts()">
${parent.javascripts()}
${history_panel_javascripts()}
-${h.js(
- "mvc/user/user-model"
-)}
<script type="text/javascript">
- if( !window.Galaxy ){
- window.Galaxy = {};
- Galaxy.currUser = new User(${h.to_json_string( get_user_json() )});
- }
+if( !window.Galaxy ){
+ window.Galaxy = {};
+}
+$(function(){
+ $( 'body' ).addClass( 'historyPage' ).addClass( 'history-panel' );
+});
+require([
+ 'mvc/user/user-model',
+ 'mvc/history/current-history-panel'
+], function( user, historyPanel ){
$(function(){
- $( 'body' ).addClass( 'historyPage' ).addClass( 'history-panel' );
+ Galaxy.currUser = new user.User( ${h.to_json_string( get_user_json() )} );
+ // history module is already in the dpn chain from the panel. We can re-scope it here.
+ var historyModel = require( 'mvc/history/history-model' ),
+ debugging = JSON.parse( sessionStorage.getItem( 'debugging' ) ) || false,
+ historyJSON = ${h.to_json_string( history )},
+ hdaJSON = ${h.to_json_string( hdas )};
+
+ var history = new historyModel.History( historyJSON, hdaJSON, {
+ logger: ( debugging )?( console ):( null )
+ });
+
+ var panel = new historyPanel.CurrentHistoryPanel({
+ show_deleted : ${ 'true' if show_deleted == True else ( 'null' if show_deleted == None else 'false' ) },
+ show_hidden : ${ 'true' if show_hidden == True else ( 'null' if show_hidden == None else 'false' ) },
+ el : $( "body.historyPage" ),
+ model : history,
+ onready : function(){
+ this.render();
+ if( Galaxy ){
+ Galaxy.currHistoryPanel = this;
+ }
+ }
+ });
});
-</script>
-
-<script type="text/javascript">
-onhistoryready.done( function( historyPanel ){
-
- // history module is already in the dpn chain from the panel. We can re-scope it here.
- var historyModel = require( 'mvc/history/history-model' ),
- debugging = JSON.parse( sessionStorage.getItem( 'debugging' ) ) || false,
- historyJSON = ${h.to_json_string( history )},
- hdaJSON = ${h.to_json_string( hdas )};
-
- var history = new historyModel.History( historyJSON, hdaJSON, {
- logger: ( debugging )?( console ):( null )
- });
-
- var panel = new historyPanel.HistoryPanel({
- show_deleted : ${ 'true' if show_deleted == True else ( 'null' if show_deleted == None else 'false' ) },
- show_hidden : ${ 'true' if show_hidden == True else ( 'null' if show_hidden == None else 'false' ) },
- el : $( "body.historyPage" ),
- model : history,
- onready : function(){
- this.render();
- if( Galaxy ){
- Galaxy.currHistoryPanel = this;
- }
- }
- });
-})
+});
</script></%def>
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.
1
0
commit/galaxy-central: carlfeberhard: Fix: add missing js model to scatterplot
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/08f389432f68/
Changeset: 08f389432f68
User: carlfeberhard
Date: 2014-03-20 21:34:54
Summary: Fix: add missing js model to scatterplot
Affected #: 1 file
diff -r 8fb3637b9655a55cc54e1e5fd872bf0f9b9a48c6 -r 08f389432f6876a5af1ad54ef2f25e4d06310999 config/plugins/visualizations/scatterplot/src/scatterplot-model.js
--- /dev/null
+++ b/config/plugins/visualizations/scatterplot/src/scatterplot-model.js
@@ -0,0 +1,39 @@
+var ScatterplotModel = Visualization.extend({
+
+ defaults : {
+ type : 'scatterplot',
+
+ config : {
+ // shouldn't be needed for properly saved splots - also often incorrect
+ //xColumn : 0,
+ //yColumn : 1,
+
+ pagination : {
+ currPage : 0,
+ perPage : 3000
+ },
+
+ // graph style
+ width : 400,
+ height : 400,
+
+ margin : {
+ top : 16,
+ right : 16,
+ bottom : 40,
+ left : 54
+ },
+
+ xTicks : 10,
+ xLabel : 'X',
+ yTicks : 10,
+ yLabel : 'Y',
+
+ datapointSize : 4,
+ animDuration : 500,
+
+ scale : 1,
+ translate : [ 0, 0 ]
+ }
+ }
+});
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.
1
0
commit/galaxy-central: davebgx: Functional test script for granting admin privileges on a repository.
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8fb3637b9655/
Changeset: 8fb3637b9655
User: davebgx
Date: 2014-03-20 20:28:26
Summary: Functional test script for granting admin privileges on a repository.
Affected #: 3 files
diff -r 593833a7ff5395bb585513ba6881012174909180 -r 8fb3637b9655a55cc54e1e5fd872bf0f9b9a48c6 test/tool_shed/base/test_db_util.py
--- a/test/tool_shed/base/test_db_util.py
+++ b/test/tool_shed/base/test_db_util.py
@@ -75,6 +75,19 @@
return role
raise AssertionError( "Private role not found for user '%s'" % user.email )
+def get_role( user, role_name ):
+ for role in user.all_roles():
+ if role.name == role_name:
+ return role
+ return None
+
+def get_repository_role_association( repository_id, role_id ):
+ rra = sa_session.query( model.RepositoryRoleAssociation ) \
+ .filter( and_( model.RepositoryRoleAssociation.table.c.role_id == role_id,
+ model.RepositoryRoleAssociation.table.c.repository_id == repository_id ) ) \
+ .first()
+ return rra
+
def get_repository_reviews( repository_id, reviewer_user_id=None, changeset_revision=None ):
if reviewer_user_id and changeset_revision:
reviews = sa_session.query( model.RepositoryReview ) \
diff -r 593833a7ff5395bb585513ba6881012174909180 -r 8fb3637b9655a55cc54e1e5fd872bf0f9b9a48c6 test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -67,6 +67,14 @@
url = '/repository_review/create_component?operation=create'
self.visit_url( url )
self.submit_form( 1, 'create_component_button', **kwd )
+
+ def assign_admin_role( self, repository, user ):
+ # As elsewhere, twill limits the possibility of submitting the form, this time due to not executing the javascript
+ # attached to the role selection form. Visit the action url directly with the necessary parameters.
+ url = '/repository/manage_repository_admins?id=%s&in_users=%d&manage_role_associations_button=Save' % \
+ ( self.security.encode_id( repository.id ), user.id )
+ self.visit_url( url )
+ self.check_for_strings( strings_displayed=[ 'Role', 'has been associated' ] )
def browse_category( self, category, strings_displayed=[], strings_not_displayed=[] ):
url = '/repository/browse_valid_categories?sort=name&operation=valid_repositories_by_category&id=%s' % \
@@ -518,7 +526,7 @@
tc.submit( "manage_categories_button" )
self.check_for_strings( strings_displayed, strings_not_displayed )
- def edit_repository_information( self, repository, **kwd ):
+ def edit_repository_information( self, repository, revert=True, **kwd ):
url = '/repository/manage_repository?id=%s' % self.security.encode_id( repository.id )
self.visit_url( url )
original_information = dict( repo_name=repository.name, description=repository.description, long_description=repository.long_description )
@@ -530,12 +538,13 @@
strings_displayed.append( self.escape_html( kwd[ input_elem_name ] ) )
tc.submit( "edit_repository_button" )
self.check_for_strings( strings_displayed )
- strings_displayed = []
- for input_elem_name in [ 'repo_name', 'description', 'long_description' ]:
- tc.fv( "edit_repository", input_elem_name, original_information[ input_elem_name ] )
- strings_displayed.append( self.escape_html( original_information[ input_elem_name ] ) )
- tc.submit( "edit_repository_button" )
- self.check_for_strings( strings_displayed )
+ if revert:
+ strings_displayed = []
+ for input_elem_name in [ 'repo_name', 'description', 'long_description' ]:
+ tc.fv( "edit_repository", input_elem_name, original_information[ input_elem_name ] )
+ strings_displayed.append( self.escape_html( original_information[ input_elem_name ] ) )
+ tc.submit( "edit_repository_button" )
+ self.check_for_strings( strings_displayed )
def enable_email_alerts( self, repository, strings_displayed=[], strings_not_displayed=[] ):
repository_id = self.security.encode_id( repository.id )
diff -r 593833a7ff5395bb585513ba6881012174909180 -r 8fb3637b9655a55cc54e1e5fd872bf0f9b9a48c6 test/tool_shed/functional/test_0530_repository_admin_feature.py
--- /dev/null
+++ b/test/tool_shed/functional/test_0530_repository_admin_feature.py
@@ -0,0 +1,165 @@
+from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os
+import logging
+
+log = logging.getLogger( __name__ )
+
+repository_name = 'filtering_0530'
+repository_description = 'Filtering repository for test 0530'
+repository_long_description = 'This is the filtering repository for test 0530.'
+category_name = 'Test 0530 Repository Admin Role'
+category_description = 'Verify the functionality of the code that handles the repository admin role.'
+
+'''
+1. Create new repository as user user1.
+
+2. Check to make sure a new role was created named <repo_name>_user1_admin.
+
+3. Check to make sure a new repository_role_association record was created with appropriate repository id and role id.
+
+4. Change the name of the repository created in step 1 - this can be done as long as the repository has not been installed or cloned.
+
+5. Make sure the name of the role initially inspected in Step 2 has been changed to reflect the new repository name from Step 4.
+
+6. Log into the Tool Shed as a user that is not the repository owner (e.g., user2) and make sure the repository name
+ and description cannot be changed.
+
+7. As user user1, add user user2 as a repository admin user.
+
+8. Log into the Tool Shed as user user2 and make sure the repository name and description can now be changed.
+'''
+
+
+class TestRepositoryAdminRole( ShedTwillTestCase ):
+ '''Verify that the code correctly handles the repository admin role.'''
+
+ def test_0000_initiate_users( self ):
+ """Create necessary user accounts."""
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
+ assert test_user_1 is not None, 'Problem retrieving user with email %s from the database' % test_user_1_email
+ test_user_1_private_role = self.test_db_util.get_private_role( test_user_1 )
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ test_user_2 = self.test_db_util.get_user( common.test_user_2_email )
+ assert test_user_2 is not None, 'Problem retrieving user with email %s from the database' % test_user_2_email
+ test_user_2_private_role = self.test_db_util.get_private_role( test_user_2 )
+ self.logout()
+ self.login( email=common.admin_email, username=common.admin_username )
+ admin_user = self.test_db_util.get_user( common.admin_email )
+ assert admin_user is not None, 'Problem retrieving user with email %s from the database' % admin_email
+ admin_user_private_role = self.test_db_util.get_private_role( admin_user )
+
+ def test_0005_create_filtering_repository( self ):
+ """Create and populate the filtering_0530 repository."""
+ '''
+ This is step 1 - Create new repository as user user1.
+ '''
+ category = self.create_category( name=category_name, description=category_description )
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ repository = self.get_or_create_repository( name=repository_name,
+ description=repository_description,
+ long_description=repository_long_description,
+ owner=common.test_user_1_name,
+ category_id=self.security.encode_id( category.id ),
+ strings_displayed=[] )
+ self.upload_file( repository,
+ filename='filtering/filtering_1.1.0.tar',
+ filepath=None,
+ valid_tools_only=True,
+ uncompress_file=True,
+ remove_repo_files_not_in_tar=False,
+ commit_message='Uploaded filtering 1.1.0 tarball.',
+ strings_displayed=[],
+ strings_not_displayed=[] )
+
+ def test_0010_verify_repository_admin_role_exists( self ):
+ '''Verify that the role filtering_0530_user1_admin exists.'''
+ '''
+ This is step 2 - Check to make sure a new role was created named filtering_0530_user1_admin.
+ '''
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
+ repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_user1_admin' )
+ assert repository_admin_role is not None, 'Admin role for filtering_0530 was not created.'
+
+ def test_0015_verify_repository_role_association( self ):
+ '''Verify that the filtering_0530_user1_admin role is associated with the filtering_0530 repository.'''
+ '''
+ This is step 3 - Check to make sure a new repository_role_association record was created with appropriate repository id and role id.
+ '''
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
+ repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_user1_admin' )
+ repository_role_association = self.test_db_util.get_repository_role_association( repository.id, repository_admin_role.id )
+ assert repository_role_association is not None, 'Repository filtering_0530 is not associated with the filtering_0530_user1_admin role.'
+
+ def test_0020_rename_repository( self ):
+ '''Rename the repository to renamed_filtering_0530.'''
+ '''
+ This is step 4 - Change the name of the repository created in step 1 - this can be done as long as the repository has not
+ been installed or cloned.
+ '''
+ repository = self.test_db_util.get_repository_by_name_and_owner( repository_name, common.test_user_1_name )
+ self.edit_repository_information( repository, revert=False, repo_name='renamed_filtering_0530' )
+ self.test_db_util.refresh( repository )
+ assert repository.name == 'renamed_filtering_0530', 'Repository was not renamed to renamed_filtering_0530.'
+
+ def test_0025_check_admin_role_name( self ):
+ return
+ '''Check that a role renamed_filtering_0530_user1_admin now exists, and filtering_0530_user1_admin does not.'''
+ '''
+ This is step 5 - Make sure the name of the role initially inspected in Step 2 has been changed to reflect the
+ new repository name from Step 4.
+ '''
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
+ old_repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_%s_admin' % test_user_1.username )
+ assert old_repository_admin_role is None, 'Admin role filtering_0530_user1_admin incorrectly exists.'
+ new_repository_admin_role = self.test_db_util.get_role( test_user_1, 'renamed_filtering_0530_%s_admin' % test_user_1.username )
+ assert new_repository_admin_role is not None, 'Admin role renamed_filtering_0530_user1_admin does not exist.'
+
+ def test_0030_verify_access_denied( self ):
+ '''Make sure a non-admin user can't modify the repository.'''
+ '''
+ This is step 6 - Log into the Tool Shed as a user that is not the repository owner (e.g., user2) and make sure the repository
+ name and description cannot be changed.
+ '''
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( 'renamed_filtering_0530', common.test_user_1_name )
+ strings_not_displayed = [ 'Manage repository' ]
+ strings_displayed = [ 'View repository' ]
+ self.display_manage_repository_page( repository, strings_not_displayed=strings_not_displayed )
+ self.submit_form( button='edit_repository_button', description='This description has been modified.' )
+ strings_displayed = [ 'You are not the owner of this repository, so you cannot administer it.' ]
+ strings_not_displayed = [ 'The repository information has been updated.' ]
+ self.check_for_strings( strings_displayed=strings_displayed, strings_not_displayed=strings_not_displayed )
+
+ def test_0035_grant_admin_role( self ):
+ '''Grant the repository admin role to user2.'''
+ '''
+ This is step 7 - As user user1, add user user2 as a repository admin user.
+ '''
+ self.logout()
+ self.login( email=common.test_user_1_email, username=common.test_user_1_name )
+ test_user_2 = self.test_db_util.get_user( common.test_user_2_email )
+ repository = self.test_db_util.get_repository_by_name_and_owner( 'renamed_filtering_0530', common.test_user_1_name )
+ self.assign_admin_role( repository, test_user_2 )
+
+ def test_0040_rename_repository_as_repository_admin( self ):
+ '''Rename the repository as user2.'''
+ '''
+ This is step 8 - Log into the Tool Shed as user user2 and make sure the repository name and description can now be changed.
+ '''
+ self.logout()
+ self.login( email=common.test_user_2_email, username=common.test_user_2_name )
+ repository = self.test_db_util.get_repository_by_name_and_owner( 'renamed_filtering_0530', common.test_user_1_name )
+ self.edit_repository_information( repository, revert=False, repo_name='filtering_0530' )
+ self.test_db_util.refresh( repository )
+ assert repository.name == 'filtering_0530', 'User with admin role failed to rename repository.'
+ test_user_1 = self.test_db_util.get_user( common.test_user_1_email )
+ old_repository_admin_role = self.test_db_util.get_role( test_user_1, 'renamed_filtering_0530_user1_admin' )
+ assert old_repository_admin_role is None, 'Admin role renamed_filtering_0530_user1_admin incorrectly exists.'
+ new_repository_admin_role = self.test_db_util.get_role( test_user_1, 'filtering_0530_user1_admin' )
+ assert new_repository_admin_role is not None, 'Admin role filtering_0530_user1_admin does not exist.'
+
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.
1
0
commit/galaxy-central: jmchilton: Small bug fix in history contents API error handling.
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/593833a7ff53/
Changeset: 593833a7ff53
User: jmchilton
Date: 2014-03-20 19:56:08
Summary: Small bug fix in history contents API error handling.
Affected #: 1 file
diff -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af -r 593833a7ff5395bb585513ba6881012174909180 lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -286,7 +286,7 @@
if contents_type == "dataset":
return self.__update_dataset( trans, history_id, id, payload, **kwd )
else:
- return self.__handle_unknown_contents_type( contents_type )
+ return self.__handle_unknown_contents_type( trans, contents_type )
def __update_dataset( self, trans, history_id, id, payload, **kwd ):
changed = {}
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.
1
0
commit/galaxy-central: carlfeberhard: Remove handlebars common-template helpers, remove unused templates
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e8fac2f5d93f/
Changeset: e8fac2f5d93f
User: carlfeberhard
Date: 2014-03-20 19:16:13
Summary: Remove handlebars common-template helpers, remove unused templates
Affected #: 9 files
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af static/scripts/packed/templates/compiled/helpers-common-templates.js
--- a/static/scripts/packed/templates/compiled/helpers-common-templates.js
+++ /dev/null
@@ -1,1 +0,0 @@
-Handlebars.registerHelper("local",function(a){return _l(a.fn(this))});Handlebars.registerHelper("n2br",function(a){return a.fn(this).replace(/\n/g,"<br/>")});
\ No newline at end of file
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af static/scripts/packed/templates/compiled/template-iconButton.js
--- a/static/scripts/packed/templates/compiled/template-iconButton.js
+++ /dev/null
@@ -1,1 +0,0 @@
-(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-iconButton"]=b(function(i,j,g,e,h){this.compilerInfo=[4,">= 1.0.0"];g=this.merge(g,i.helpers);e=this.merge(e,i.partials);h=h||{};var c="",f,d=this;c+="\n";f=d.invokePartial(e.iconButton,"iconButton",j,g,e,h);if(f||f===0){c+=f}return c})})();
\ No newline at end of file
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af static/scripts/packed/templates/compiled/template-warningmessagesmall.js
--- a/static/scripts/packed/templates/compiled/template-warningmessagesmall.js
+++ /dev/null
@@ -1,1 +0,0 @@
-(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a["template-warningmessagesmall"]=b(function(i,j,f,d,g){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,i.helpers);g=g||{};var c="",e,h="function";c+=' \n <div class="warningmessagesmall"><strong>';if(e=f.warning){e=e.call(j,{hash:{},data:g})}else{e=j.warning;e=typeof e===h?e.apply(j):e}if(e||e===0){c+=e}c+="</strong></div>";return c})})();
\ No newline at end of file
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af static/scripts/templates/common-templates.html
--- a/static/scripts/templates/common-templates.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<script type="text/javascript" class="helper-common" id="helper-local">
-/** Calls _l (from base-mvc.js) to localize strings (if poosible)
- * This helper is specifically for localization within templates
- */
-Handlebars.registerHelper( 'local', function( options ){
- return _l( options.fn( this ) );
-});
-</script>
-
-<script type="text/javascript" class="helper-common" id="helper-n2br">
-/** replace newlines with breaks */
-Handlebars.registerHelper( 'n2br', function( options ){
- return options.fn( this ).replace( /\n/g, '<br/>' );
-});
-</script>
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af static/scripts/templates/compiled/helpers-common-templates.js
--- a/static/scripts/templates/compiled/helpers-common-templates.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/** Calls _l (from base-mvc.js) to localize strings (if poosible)
- * This helper is specifically for localization within templates
- */
-Handlebars.registerHelper( 'local', function( options ){
- return _l( options.fn( this ) );
-});
-/** replace newlines with breaks */
-Handlebars.registerHelper( 'n2br', function( options ){
- return options.fn( this ).replace( /\n/g, '<br/>' );
-});
\ No newline at end of file
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af static/scripts/templates/compiled/template-iconButton.js
--- a/static/scripts/templates/compiled/template-iconButton.js
+++ /dev/null
@@ -1,14 +0,0 @@
-(function() {
- var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['template-iconButton'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); partials = this.merge(partials, Handlebars.partials); data = data || {};
- var buffer = "", stack1, self=this;
-
-
- buffer += "\n";
- stack1 = self.invokePartial(partials.iconButton, 'iconButton', depth0, helpers, partials, data);
- if(stack1 || stack1 === 0) { buffer += stack1; }
- return buffer;
- });
-})();
\ No newline at end of file
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af static/scripts/templates/compiled/template-warningmessagesmall.js
--- a/static/scripts/templates/compiled/template-warningmessagesmall.js
+++ /dev/null
@@ -1,16 +0,0 @@
-(function() {
- var template = Handlebars.template, templates = Handlebars.templates = Handlebars.templates || {};
-templates['template-warningmessagesmall'] = template(function (Handlebars,depth0,helpers,partials,data) {
- this.compilerInfo = [4,'>= 1.0.0'];
-helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
- var buffer = "", stack1, functionType="function";
-
-
- buffer += " \n <div class=\"warningmessagesmall\"><strong>";
- if (stack1 = helpers.warning) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
- else { stack1 = depth0.warning; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
- if(stack1 || stack1 === 0) { buffer += stack1; }
- buffer += "</strong></div>";
- return buffer;
- });
-})();
\ No newline at end of file
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af templates/webapps/galaxy/dataset/tabular_chunked.mako
--- a/templates/webapps/galaxy/dataset/tabular_chunked.mako
+++ b/templates/webapps/galaxy/dataset/tabular_chunked.mako
@@ -6,7 +6,6 @@
<%def name="javascripts()">
${parent.javascripts()}
${h.js( "libs/require" )}
- ${h.templates("helpers-common-templates")}
<script type="text/javascript">
require.config({
@@ -36,4 +35,4 @@
${parent.stylesheets()}
</%def>
-${ render_deleted_data_message( dataset ) }
\ No newline at end of file
+${ render_deleted_data_message( dataset ) }
diff -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 -r e8fac2f5d93f1ab7b87041dd5b1878705e8178af templates/webapps/galaxy/galaxy.masthead.mako
--- a/templates/webapps/galaxy/galaxy.masthead.mako
+++ b/templates/webapps/galaxy/galaxy.masthead.mako
@@ -66,7 +66,6 @@
}
%>
- ${h.templates( "helpers-common-templates" )}
${h.js( "mvc/base-mvc", "utils/localization", "mvc/user/user-model", "mvc/user/user-quotameter" )}
## load the frame manager
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.
1
0
commit/galaxy-central: carlfeberhard: History panel: reduce size of select checkboxes, decrease animation
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/261d9bab3d12/
Changeset: 261d9bab3d12
User: carlfeberhard
Date: 2014-03-20 18:38:10
Summary: History panel: reduce size of select checkboxes, decrease animation
Affected #: 6 files
diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -495,70 +495,34 @@
/** display a (fa-icon) checkbox on the left of the hda that fires events when checked
* Note: this also hides the primary actions
*/
- showSelector : function( speed ){
- speed = ( speed !== undefined )?( speed ):( this.fxSpeed );
-
+ showSelector : function(){
// make sure selected state is represented properly
if( this.selected ){
this.select( null, true );
}
- // create a jq fx queue to do this sequentially: fadeout the buttons, embiggen the selector
- var hdaView = this,
- SELECTOR_WIDTH = 32;
+ this.selectable = true;
+ this.trigger( 'selectable', true, this );
- if( speed ){
- this.$el.queue( 'fx', function( next ){
- $( this ).find( '.dataset-primary-actions' ).fadeOut( speed, next );
- });
- this.$el.queue( 'fx', function( next ){
- $( this ).find( '.dataset-selector' ).show().animate({ width: SELECTOR_WIDTH }, speed, next );
- $( this ).find( '.dataset-title-bar' ).animate({ 'margin-left': SELECTOR_WIDTH }, speed, next );
- hdaView.selectable = true;
- hdaView.trigger( 'selectable', true, hdaView );
- });
- // no animation
- } else {
- this.$el.find( '.dataset-primary-actions' ).hide();
- this.$el.find( '.dataset-selector' ).show().css({ width : SELECTOR_WIDTH });
- this.$el.find( '.dataset-title-bar' ).show().css({ 'margin-left' : SELECTOR_WIDTH });
- hdaView.selectable = true;
- hdaView.trigger( 'selectable', true, hdaView );
- }
+ this.$( '.dataset-primary-actions' ).hide();
+ this.$( '.dataset-selector' ).show();
},
/** remove the selection checkbox */
- hideSelector : function( speed ){
- speed = ( speed !== undefined )?( speed ):( this.fxSpeed );
-
+ hideSelector : function(){
// reverse the process from showSelect
this.selectable = false;
this.trigger( 'selectable', false, this );
- if( speed ){
- this.$el.queue( 'fx', function( next ){
- $( this ).find( '.dataset-title-bar' ).show().css({ 'margin-left' : '0' });
- $( this ).find( '.dataset-selector' ).animate({ width: '0px' }, speed, function(){
- $( this ).hide();
- next();
- });
- });
- this.$el.queue( 'fx', function( next ){
- $( this ).find( '.dataset-primary-actions' ).fadeIn( speed, next );
- });
-
- // no animation
- } else {
- $( this ).find( '.dataset-selector' ).css({ width : '0px' }).hide();
- $( this ).find( '.dataset-primary-actions' ).show();
- }
+ this.$( '.dataset-selector' ).hide();
+ this.$( '.dataset-primary-actions' ).show();
},
- toggleSelector : function( speed ){
+ toggleSelector : function(){
if( !this.$el.find( '.dataset-selector' ).is( ':visible' ) ){
- this.showSelector( speed );
+ this.showSelector();
} else {
- this.hideSelector( speed );
+ this.hideSelector();
}
},
@@ -694,7 +658,9 @@
'</div>',
// multi-select checkbox
- '<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>',
+ '<div class="dataset-selector">',
+ '<span class="fa fa-2x fa-square-o"></span>',
+ '</div>',
// space for title bar buttons
'<div class="dataset-primary-actions"></div>',
diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -336,7 +336,7 @@
// ------------------------------------------------------------------------ panel events
/** event map */
events : _.extend( _.clone( readonlyPanel.ReadOnlyHistoryPanel.prototype.events ), {
- 'click .history-select-btn' : function( e ){ this.toggleSelectors( this.fxSpeed ); },
+ 'click .history-select-btn' : 'toggleSelectors',
'click .history-select-all-datasets-btn' : 'selectAllDatasets',
'click .history-deselect-all-datasets-btn' : 'deselectAllDatasets'
}),
@@ -351,30 +351,32 @@
//TODO: to toggle showOrHide pattern
/** show selectors on all visible hdas and associated controls */
showSelectors : function( speed ){
+ speed = ( speed !== undefined )?( speed ):( this.fxSpeed );
this.selecting = true;
- this.$el.find( '.history-dataset-actions' ).slideDown( speed );
+ this.$( '.history-dataset-actions' ).slideDown( speed );
_.each( this.hdaViews, function( view ){
- view.showSelector( speed );
+ view.showSelector();
});
this.selectedHdaIds = [];
},
/** hide selectors on all visible hdas and associated controls */
hideSelectors : function( speed ){
+ speed = ( speed !== undefined )?( speed ):( this.fxSpeed );
this.selecting = false;
- this.$el.find( '.history-dataset-actions' ).slideUp( speed );
+ this.$( '.history-dataset-actions' ).slideUp( speed );
_.each( this.hdaViews, function( view ){
- view.hideSelector( speed );
+ view.hideSelector();
});
this.selectedHdaIds = [];
},
/** show or hide selectors on all visible hdas and associated controls */
- toggleSelectors : function( speed ){
+ toggleSelectors : function(){
if( !this.selecting ){
- this.showSelectors( speed );
+ this.showSelectors();
} else {
- this.hideSelectors( speed );
+ this.hideSelectors();
}
},
diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(c){var b=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(e){if(e.logger){this.logger=this.model.logger=e.logger}this.log(this+".initialize:",e);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=e.linkTarget||"_blank";this.selectable=e.selectable||false;this.selected=e.selected||false;this.expanded=e.expanded||false;this.draggable=e.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(f,e){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(g){g=(g===undefined)?(true):(g);var e=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var f=this._buildNewRender();if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).addClass("state-"+e.model.get("state")).append(f.children());if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()});return this},_buildNewRender:function(){var e=$(b.templates.skeleton(this.model.toJSON()));e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(e);return e},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===c.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var f={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){f.disabled=true;f.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===c.HistoryDatasetAssociation.STATES.UPLOAD){f.disabled=true;f.title=_l("This dataset must finish uploading before it can be viewed")}else{f.title=_l("View data");f.href=this.urls.display;var e=this;f.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+e.model.get("name"),type:"url",content:e.urls.display})}}}}f.faIcon="fa-eye";return faIconButton(f)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var f=this.urls,g=this.model.get("meta_files");if(_.isEmpty(g)){return $(['<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var h="dataset-"+this.model.get("id")+"-popup",e=['<div popupmenu="'+h+'">','<a href="'+f.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(g,function(i){return['<a class="action-button" href="',f.meta_download+i.file_type,'">',_l("Download")," ",i.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+h+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(e)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var f=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),e=this["_render_body_"+this.model.get("state")];if(_.isFunction(e)){f=e.call(this)}this._setUpBehaviors(f);if(this.expanded){f.show()}return f},_render_stateBodyHelper:function(e,h){h=h||[];var f=this,g=$(b.templates.body(_.extend(this.model.toJSON(),{body:e})));g.find(".dataset-actions .left").append(_.map(h,function(i){return i.call(f)}));return g},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var e=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){e="<div>"+this.model.get("misc_blurb")+"</div>"+e}return this._render_stateBodyHelper(e,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var e=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),f=this._render_body_ok();f.prepend(e);return f},_render_body_ok:function(){var e=this,g=$(b.templates.body(this.model.toJSON())),f=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);g.find(".dataset-actions .left").append(_.map(f,function(h){return h.call(e)}));if(this.model.isDeletedOrPurged()){return g}return g},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(h,f){var e=32,g=13;if(h&&(h.type==="keydown")&&!(h.keyCode===e||h.keyCode===g)){return true}var i=this.$el.find(".dataset-body");f=(f===undefined)?(!i.is(":visible")):(f);if(f){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._render_body());e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.expanded=true;e.trigger("body-expanded",e.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(g){e.urls=e.model.urls();f()})}else{f()}},collapseBody:function(){var e=this;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.expanded=false;e.trigger("body-collapsed",e.model.get("id"))})},showSelector:function(g){g=(g!==undefined)?(g):(this.fxSpeed);if(this.selected){this.select(null,true)}var f=this,e=32;if(g){this.$el.queue("fx",function(h){$(this).find(".dataset-primary-actions").fadeOut(g,h)});this.$el.queue("fx",function(h){$(this).find(".dataset-selector").show().animate({width:e},g,h);$(this).find(".dataset-title-bar").animate({"margin-left":e},g,h);f.selectable=true;f.trigger("selectable",true,f)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:e});this.$el.find(".dataset-title-bar").show().css({"margin-left":e});f.selectable=true;f.trigger("selectable",true,f)}},hideSelector:function(e){e=(e!==undefined)?(e):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},e,function(){$(this).hide();f()})});this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeIn(e,f)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(e){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(e)}else{this.hideSelector(e)}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},remove:function(f){var e=this;this.$el.fadeOut(e.fxSpeed,function(){e.$el.remove();e.off();if(f){f()}})},toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+e+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var d=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");b.templates={skeleton:function(e){return _.template(a,e,{variable:"hda"})},body:function(e){return _.template(d,e,{variable:"hda"})}};return{HDABaseView:b}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(c){var b=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(e){if(e.logger){this.logger=this.model.logger=e.logger}this.log(this+".initialize:",e);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=e.linkTarget||"_blank";this.selectable=e.selectable||false;this.selected=e.selected||false;this.expanded=e.expanded||false;this.draggable=e.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(f,e){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(g){g=(g===undefined)?(true):(g);var e=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var f=this._buildNewRender();if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).addClass("state-"+e.model.get("state")).append(f.children());if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()});return this},_buildNewRender:function(){var e=$(b.templates.skeleton(this.model.toJSON()));e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(e);return e},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===c.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var f={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){f.disabled=true;f.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===c.HistoryDatasetAssociation.STATES.UPLOAD){f.disabled=true;f.title=_l("This dataset must finish uploading before it can be viewed")}else{f.title=_l("View data");f.href=this.urls.display;var e=this;f.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+e.model.get("name"),type:"url",content:e.urls.display})}}}}f.faIcon="fa-eye";return faIconButton(f)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var f=this.urls,g=this.model.get("meta_files");if(_.isEmpty(g)){return $(['<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var h="dataset-"+this.model.get("id")+"-popup",e=['<div popupmenu="'+h+'">','<a href="'+f.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(g,function(i){return['<a class="action-button" href="',f.meta_download+i.file_type,'">',_l("Download")," ",i.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+h+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(e)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var f=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),e=this["_render_body_"+this.model.get("state")];if(_.isFunction(e)){f=e.call(this)}this._setUpBehaviors(f);if(this.expanded){f.show()}return f},_render_stateBodyHelper:function(e,h){h=h||[];var f=this,g=$(b.templates.body(_.extend(this.model.toJSON(),{body:e})));g.find(".dataset-actions .left").append(_.map(h,function(i){return i.call(f)}));return g},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var e=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){e="<div>"+this.model.get("misc_blurb")+"</div>"+e}return this._render_stateBodyHelper(e,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var e=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),f=this._render_body_ok();f.prepend(e);return f},_render_body_ok:function(){var e=this,g=$(b.templates.body(this.model.toJSON())),f=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);g.find(".dataset-actions .left").append(_.map(f,function(h){return h.call(e)}));if(this.model.isDeletedOrPurged()){return g}return g},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(h,f){var e=32,g=13;if(h&&(h.type==="keydown")&&!(h.keyCode===e||h.keyCode===g)){return true}var i=this.$el.find(".dataset-body");f=(f===undefined)?(!i.is(":visible")):(f);if(f){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._render_body());e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.expanded=true;e.trigger("body-expanded",e.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(g){e.urls=e.model.urls();f()})}else{f()}},collapseBody:function(){var e=this;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.expanded=false;e.trigger("body-collapsed",e.model.get("id"))})},showSelector:function(){if(this.selected){this.select(null,true)}this.selectable=true;this.trigger("selectable",true,this);this.$(".dataset-primary-actions").hide();this.$(".dataset-selector").show()},hideSelector:function(){this.selectable=false;this.trigger("selectable",false,this);this.$(".dataset-selector").hide();this.$(".dataset-primary-actions").show()},toggleSelector:function(){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector()}else{this.hideSelector()}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},remove:function(f){var e=this;this.$el.fadeOut(e.fxSpeed,function(){e.$el.remove();e.off();if(f){f()}})},toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+e+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector">','<span class="fa fa-2x fa-square-o"></span>',"</div>",'<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var d=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");b.templates={skeleton:function(e){return _.template(a,e,{variable:"hda"})},body:function(e){return _.template(d,e,{variable:"hda"})}};return{HDABaseView:b}});
\ No newline at end of file
diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations"],function(e,b,d,a,c){var f=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(g){g=g||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=g.selecting||false;this.annotationEditorShown=g.annotationEditorShown||false;this.tagsEditorShown=g.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,g)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this)},renderModel:function(){var g=$("<div/>");g.append(f.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(g).text(this.emptyMsg);if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(g);this._renderAnnotation(g)}g.find(".history-secondary-actions").prepend(this._renderSelectButton());g.find(".history-dataset-actions").toggle(this.selecting);g.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){var h=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDATagEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDATagEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){var h=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDAAnnotationEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDAAnnotationEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_renderSelectButton:function(g){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(g){g=g||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,g);if(!this.model){return}this._setUpDatasetActionsPopup(g);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var h=this;g.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(i){var j=h.model.get("name");if(i&&i!==j){h.$el.find(".history-name").text(i);h.model.save({name:i}).fail(function(){h.$el.find(".history-name").text(h.model.previous("name"))})}else{h.$el.find(".history-name").text(j)}}})},_setUpDatasetActionsPopup:function(g){var h=this;(new PopupMenu(g.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.hide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Unhide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.unhide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Delete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype["delete"];h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Undelete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.undelete;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var i=e.HistoryDatasetAssociation.prototype.purge;h.getSelectedHdaCollection().ajaxQueue(i)}}}]))},_handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},_handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},_createHdaView:function(h){var g=h.get("id"),i=new this.HDAViewClass({model:h,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[g],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(i);return i},_setUpHdaListeners:function(h){var g=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,h);h.on("selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.union(g.selectedHdaIds,[j])});h.on("de-selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.without(g.selectedHdaIds,j)})},toggleHDATagEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.annotationEditor){i.annotationEditor.toggle.apply(i.annotationEditor,h)}})},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$emptyMessage().fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":function(g){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(g){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(g);_.each(this.hdaViews,function(h){h.showSelector(g)});this.selectedHdaIds=[]},hideSelectors:function(g){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(g);_.each(this.hdaViews,function(h){h.hideSelector(g)});this.selectedHdaIds=[]},toggleSelectors:function(g){if(!this.selecting){this.showSelectors(g)}else{this.hideSelectors(g)}},selectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.select(g)})},deselectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.deselect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},getSelectedHdaCollection:function(){return new e.HDACollection(_.map(this.getSelectedHdaViews(),function(g){return g.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations"],function(e,b,d,a,c){var f=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(g){g=g||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=g.selecting||false;this.annotationEditorShown=g.annotationEditorShown||false;this.tagsEditorShown=g.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,g)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this)},renderModel:function(){var g=$("<div/>");g.append(f.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(g).text(this.emptyMsg);if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(g);this._renderAnnotation(g)}g.find(".history-secondary-actions").prepend(this._renderSelectButton());g.find(".history-dataset-actions").toggle(this.selecting);g.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){var h=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDATagEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDATagEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){var h=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDAAnnotationEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDAAnnotationEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_renderSelectButton:function(g){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(g){g=g||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,g);if(!this.model){return}this._setUpDatasetActionsPopup(g);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var h=this;g.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(i){var j=h.model.get("name");if(i&&i!==j){h.$el.find(".history-name").text(i);h.model.save({name:i}).fail(function(){h.$el.find(".history-name").text(h.model.previous("name"))})}else{h.$el.find(".history-name").text(j)}}})},_setUpDatasetActionsPopup:function(g){var h=this;(new PopupMenu(g.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.hide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Unhide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.unhide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Delete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype["delete"];h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Undelete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.undelete;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var i=e.HistoryDatasetAssociation.prototype.purge;h.getSelectedHdaCollection().ajaxQueue(i)}}}]))},_handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},_handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},_createHdaView:function(h){var g=h.get("id"),i=new this.HDAViewClass({model:h,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[g],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(i);return i},_setUpHdaListeners:function(h){var g=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,h);h.on("selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.union(g.selectedHdaIds,[j])});h.on("de-selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.without(g.selectedHdaIds,j)})},toggleHDATagEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.annotationEditor){i.annotationEditor.toggle.apply(i.annotationEditor,h)}})},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$emptyMessage().fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":"toggleSelectors","click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=true;this.$(".history-dataset-actions").slideDown(g);_.each(this.hdaViews,function(h){h.showSelector()});this.selectedHdaIds=[]},hideSelectors:function(g){g=(g!==undefined)?(g):(this.fxSpeed);this.selecting=false;this.$(".history-dataset-actions").slideUp(g);_.each(this.hdaViews,function(h){h.hideSelector()});this.selectedHdaIds=[]},toggleSelectors:function(){if(!this.selecting){this.showSelectors()}else{this.hideSelectors()}},selectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.select(g)})},deselectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.deselect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},getSelectedHdaCollection:function(){return new e.HDACollection(_.map(this.getSelectedHdaViews(),function(g){return g.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:f}});
\ No newline at end of file
diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1617,7 +1617,8 @@
.history-panel .dataset .dataset-padding{padding:6px 10px 6px 8px}
.history-panel .dataset [class$=messagesmall]{margin:6px 10px 2px 8px;font-size:90%}
.history-panel .dataset .help-text{font-weight:normal;color:#555}
-.history-panel .dataset .dataset-selector{float:left;display:none;width:0px;margin:0 0 -6px 0;padding:5px 0 2px 8px;cursor:pointer;vertical-align:middle}
+.history-panel .dataset .dataset-selector{float:left;display:none;width:32px;height:32px;margin:0 0 -6px 0;padding:8px 0 2px 7px;font-size:80%;color:#333;cursor:pointer;vertical-align:middle}
+.history-panel .dataset .dataset-selector:hover{color:maroon}
.history-panel .dataset .dataset-title-bar{cursor:pointer;outline:none;padding:6px 10px 6px 8px}
.history-panel .dataset .dataset-title-bar .dataset-title{display:inline;font-weight:bold;text-decoration:underline;word-wrap:break-word;word-break:break-all;line-height:16px}
.history-panel .dataset .dataset-primary-actions{display:inline-block;float:right;margin:6px 10px 0}.history-panel .dataset .dataset-primary-actions .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
@@ -1654,7 +1655,7 @@
.history-panel .dataset .dataset-body .dataset-display-applications .display-application:last-child{margin-bottom:8px}
.history-panel .dataset .dataset-body .dataset-peek{margin-bottom:8px}.history-panel .dataset .dataset-body .dataset-peek pre.peek{width:100%;margin:0px;border-radius:3px;background:white;color:black;font-size:10px;overflow:auto}.history-panel .dataset .dataset-body .dataset-peek pre.peek th{color:white;background:#5f6990}
.history-panel .dataset .dataset-body .dataset-peek pre.peek table,.history-panel .dataset .dataset-body .dataset-peek pre.peek th,.history-panel .dataset .dataset-body .dataset-peek pre.peek tr,.history-panel .dataset .dataset-body .dataset-peek pre.peek td{font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:10px}
-.history-panel .dataset .state-icon{font-family:FontAwesome;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;vertical-align:middle;width:16px;height:16px;line-height:16px;text-align:center;font-size:16px}
+.history-panel .dataset .state-icon{font-family:FontAwesome;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:4px;vertical-align:middle;width:16px;height:16px;line-height:16px;text-align:center;font-size:16px}
.state-icon-error{background-color:white;border-radius:8px}.state-icon-error:before{font-size:20px;line-height:16px;color:red;content:"\f057"}
.history-panel [class$="messagesmall"]{margin:0px}
.history-panel .editable-text{border:solid transparent 1px}
diff -r f714a3410ec5a22fa571156c376ae2e97baafd50 -r 261d9bab3d12b2bf6fb0ab2e57a8a08e85cbc408 static/style/src/less/history.less
--- a/static/style/src/less/history.less
+++ b/static/style/src/less/history.less
@@ -165,14 +165,19 @@
float: left;
// always initially hidden and zero width
display: none;
- width: 0px;
+ width: 32px;
+ height: 32px;
//HACK: neg. on the bottom due to padding-bottom in title-bar - very tweakish
- margin: 0px 0px -@spacing-bottom 0px;
- padding: ( @spacing-top - 1 ) 0px 2px @spacing-left;
+ margin: 0px 0px -( @spacing-bottom ) 0px;
+ padding: ( @spacing-top + 2 ) 0px 2px ( @spacing-left - 1 );
+ font-size: 80%;
+ color: @btn-default-color;
cursor: pointer;
- //text-align: center;
vertical-align: middle;
}
+ .dataset-selector:hover {
+ color: maroon;
+ }
.dataset-title-bar {
cursor: pointer;
@@ -360,6 +365,7 @@
.dataset .state-icon {
.fa-icon;
display: inline-block;
+ margin-right: 4px;
vertical-align: middle;
width: 16px;
height: 16px;
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.
1
0
commit/galaxy-central: carlfeberhard: Fix to 3268c8606464: properly namespace display applications in template
by commits-noreply@bitbucket.org 20 Mar '14
by commits-noreply@bitbucket.org 20 Mar '14
20 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f714a3410ec5/
Changeset: f714a3410ec5
User: carlfeberhard
Date: 2014-03-20 15:13:38
Summary: Fix to 3268c8606464: properly namespace display applications in template
Affected #: 2 files
diff -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 -r f714a3410ec5a22fa571156c376ae2e97baafd50 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -768,12 +768,12 @@
//TODO: the following two should be compacted
'<% _.each( hda.display_apps, function( app ){ %>',
'<div class="display-application">',
- '<span class="display-application-location"><%- app.label %></span>',
+ '<span class="display-application-location"><%- app.label %></span> ',
'<span class="display-application-links">',
'<% _.each( app.links, function( link ){ %>',
- '<a target="<%= target %>" href="<%= href %>">',
+ '<a target="<%= link.target %>" href="<%= link.href %>">',
'<% print( _l( link.text ) ); %>',
- '</a>',
+ '</a> ',
'<% }); %>',
'</span>',
'</div>',
@@ -781,12 +781,12 @@
'<% _.each( hda.display_types, function( app ){ %>',
'<div class="display-application">',
- '<span class="display-application-location"><%- label %></span>',
+ '<span class="display-application-location"><%- app.label %></span> ',
'<span class="display-application-links">',
'<% _.each( app.links, function( link ){ %>',
- '<a target="<%= target %>" href="<%= href %>">',
+ '<a target="<%= link.target %>" href="<%= link.href %>">',
'<% print( _l( link.text ) ); %>',
- '</a>',
+ '</a> ',
'<% }); %>',
'</span>',
'</div>',
diff -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 -r f714a3410ec5a22fa571156c376ae2e97baafd50 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(c){var b=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(e){if(e.logger){this.logger=this.model.logger=e.logger}this.log(this+".initialize:",e);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=e.linkTarget||"_blank";this.selectable=e.selectable||false;this.selected=e.selected||false;this.expanded=e.expanded||false;this.draggable=e.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(f,e){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(g){g=(g===undefined)?(true):(g);var e=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var f=this._buildNewRender();if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).addClass("state-"+e.model.get("state")).append(f.children());if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()});return this},_buildNewRender:function(){var e=$(b.templates.skeleton(this.model.toJSON()));e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(e);return e},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===c.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var f={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){f.disabled=true;f.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===c.HistoryDatasetAssociation.STATES.UPLOAD){f.disabled=true;f.title=_l("This dataset must finish uploading before it can be viewed")}else{f.title=_l("View data");f.href=this.urls.display;var e=this;f.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+e.model.get("name"),type:"url",content:e.urls.display})}}}}f.faIcon="fa-eye";return faIconButton(f)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var f=this.urls,g=this.model.get("meta_files");if(_.isEmpty(g)){return $(['<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var h="dataset-"+this.model.get("id")+"-popup",e=['<div popupmenu="'+h+'">','<a href="'+f.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(g,function(i){return['<a class="action-button" href="',f.meta_download+i.file_type,'">',_l("Download")," ",i.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+h+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(e)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var f=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),e=this["_render_body_"+this.model.get("state")];if(_.isFunction(e)){f=e.call(this)}this._setUpBehaviors(f);if(this.expanded){f.show()}return f},_render_stateBodyHelper:function(e,h){h=h||[];var f=this,g=$(b.templates.body(_.extend(this.model.toJSON(),{body:e})));g.find(".dataset-actions .left").append(_.map(h,function(i){return i.call(f)}));return g},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var e=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){e="<div>"+this.model.get("misc_blurb")+"</div>"+e}return this._render_stateBodyHelper(e,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var e=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),f=this._render_body_ok();f.prepend(e);return f},_render_body_ok:function(){var e=this,g=$(b.templates.body(this.model.toJSON())),f=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);g.find(".dataset-actions .left").append(_.map(f,function(h){return h.call(e)}));if(this.model.isDeletedOrPurged()){return g}return g},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(h,f){var e=32,g=13;if(h&&(h.type==="keydown")&&!(h.keyCode===e||h.keyCode===g)){return true}var i=this.$el.find(".dataset-body");f=(f===undefined)?(!i.is(":visible")):(f);if(f){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._render_body());e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.expanded=true;e.trigger("body-expanded",e.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(g){e.urls=e.model.urls();f()})}else{f()}},collapseBody:function(){var e=this;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.expanded=false;e.trigger("body-collapsed",e.model.get("id"))})},showSelector:function(g){g=(g!==undefined)?(g):(this.fxSpeed);if(this.selected){this.select(null,true)}var f=this,e=32;if(g){this.$el.queue("fx",function(h){$(this).find(".dataset-primary-actions").fadeOut(g,h)});this.$el.queue("fx",function(h){$(this).find(".dataset-selector").show().animate({width:e},g,h);$(this).find(".dataset-title-bar").animate({"margin-left":e},g,h);f.selectable=true;f.trigger("selectable",true,f)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:e});this.$el.find(".dataset-title-bar").show().css({"margin-left":e});f.selectable=true;f.trigger("selectable",true,f)}},hideSelector:function(e){e=(e!==undefined)?(e):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},e,function(){$(this).hide();f()})});this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeIn(e,f)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(e){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(e)}else{this.hideSelector(e)}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},remove:function(f){var e=this;this.$el.fadeOut(e.fxSpeed,function(){e.$el.remove();e.off();if(f){f()}})},toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+e+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var d=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span>','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= target %>" href="<%= href %>">',"<% print( _l( link.text ) ); %>","</a>","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- label %></span>','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= target %>" href="<%= href %>">',"<% print( _l( link.text ) ); %>","</a>","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");b.templates={skeleton:function(e){return _.template(a,e,{variable:"hda"})},body:function(e){return _.template(d,e,{variable:"hda"})}};return{HDABaseView:b}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(c){var b=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(e){if(e.logger){this.logger=this.model.logger=e.logger}this.log(this+".initialize:",e);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=e.linkTarget||"_blank";this.selectable=e.selectable||false;this.selected=e.selected||false;this.expanded=e.expanded||false;this.draggable=e.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(f,e){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(g){g=(g===undefined)?(true):(g);var e=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var f=this._buildNewRender();if(g){$(e).queue(function(h){this.$el.fadeOut(e.fxSpeed,h)})}$(e).queue(function(h){this.$el.empty().attr("class",e.className).addClass("state-"+e.model.get("state")).append(f.children());if(this.selectable){this.showSelector(0)}h()});if(g){$(e).queue(function(h){this.$el.fadeIn(e.fxSpeed,h)})}$(e).queue(function(h){this.trigger("rendered",e);if(this.model.inReadyState()){this.trigger("rendered:ready",e)}if(this.draggable){this.draggableOn()}h()});return this},_buildNewRender:function(){var e=$(b.templates.skeleton(this.model.toJSON()));e.find(".dataset-primary-actions").append(this._render_titleButtons());e.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(e);return e},_setUpBehaviors:function(e){e=e||this.$el;make_popup_menus(e);e.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===c.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===c.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var f={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){f.disabled=true;f.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===c.HistoryDatasetAssociation.STATES.UPLOAD){f.disabled=true;f.title=_l("This dataset must finish uploading before it can be viewed")}else{f.title=_l("View data");f.href=this.urls.display;var e=this;f.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+e.model.get("name"),type:"url",content:e.urls.display})}}}}f.faIcon="fa-eye";return faIconButton(f)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var f=this.urls,g=this.model.get("meta_files");if(_.isEmpty(g)){return $(['<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var h="dataset-"+this.model.get("id")+"-popup",e=['<div popupmenu="'+h+'">','<a href="'+f.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(g,function(i){return['<a class="action-button" href="',f.meta_download+i.file_type,'">',_l("Download")," ",i.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+f.download+'" title="'+_l("Download")+'" ','class="icon-btn dataset-download-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+h+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(e)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),classes:"dataset-params-btn",href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var f=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),e=this["_render_body_"+this.model.get("state")];if(_.isFunction(e)){f=e.call(this)}this._setUpBehaviors(f);if(this.expanded){f.show()}return f},_render_stateBodyHelper:function(e,h){h=h||[];var f=this,g=$(b.templates.body(_.extend(this.model.toJSON(),{body:e})));g.find(".dataset-actions .left").append(_.map(h,function(i){return i.call(f)}));return g},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var e=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){e="<div>"+this.model.get("misc_blurb")+"</div>"+e}return this._render_stateBodyHelper(e,[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var e=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),f=this._render_body_ok();f.prepend(e);return f},_render_body_ok:function(){var e=this,g=$(b.templates.body(this.model.toJSON())),f=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);g.find(".dataset-actions .left").append(_.map(f,function(h){return h.call(e)}));if(this.model.isDeletedOrPurged()){return g}return g},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(h,f){var e=32,g=13;if(h&&(h.type==="keydown")&&!(h.keyCode===e||h.keyCode===g)){return true}var i=this.$el.find(".dataset-body");f=(f===undefined)?(!i.is(":visible")):(f);if(f){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var e=this;function f(){e.$el.children(".dataset-body").replaceWith(e._render_body());e.$el.children(".dataset-body").slideDown(e.fxSpeed,function(){e.expanded=true;e.trigger("body-expanded",e.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(g){e.urls=e.model.urls();f()})}else{f()}},collapseBody:function(){var e=this;this.$el.children(".dataset-body").slideUp(e.fxSpeed,function(){e.expanded=false;e.trigger("body-collapsed",e.model.get("id"))})},showSelector:function(g){g=(g!==undefined)?(g):(this.fxSpeed);if(this.selected){this.select(null,true)}var f=this,e=32;if(g){this.$el.queue("fx",function(h){$(this).find(".dataset-primary-actions").fadeOut(g,h)});this.$el.queue("fx",function(h){$(this).find(".dataset-selector").show().animate({width:e},g,h);$(this).find(".dataset-title-bar").animate({"margin-left":e},g,h);f.selectable=true;f.trigger("selectable",true,f)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:e});this.$el.find(".dataset-title-bar").show().css({"margin-left":e});f.selectable=true;f.trigger("selectable",true,f)}},hideSelector:function(e){e=(e!==undefined)?(e):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},e,function(){$(this).hide();f()})});this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeIn(e,f)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(e){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(e)}else{this.hideSelector(e)}},select:function(e){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(e){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(e){if(this.selected){this.deselect(e)}else{this.select(e)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var e=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);e.addEventListener("dragstart",this.dragStartHandler,false);e.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var e=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);e.removeEventListener("dragstart",this.dragStartHandler,false);e.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(e){this.trigger("dragstart",this);e.dataTransfer.effectAllowed="move";e.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(e){this.trigger("dragend",this);return false},remove:function(f){var e=this;this.$el.fadeOut(e.fxSpeed,function(){e.$el.remove();e.off();if(f){f()}})},toString:function(){var e=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+e+")"}});var a=['<div class="dataset hda">','<div class="dataset-warnings">',"<% if( hda.error ){ %>",'<div class="errormessagesmall">',_l("There was an error getting the data for this dataset"),":<%- hda.error %>","</div>","<% } %>","<% if( hda.deleted ){ %>","<% if( hda.purged ){ %>",'<div class="dataset-purged-msg warningmessagesmall"><strong>',_l("This dataset has been deleted and removed from disk."),"</strong></div>","<% } else { %>",'<div class="dataset-deleted-msg warningmessagesmall"><strong>',_l("This dataset has been deleted."),"</strong></div>","<% } %>","<% } %>","<% if( !hda.visible ){ %>",'<div class="dataset-hidden-msg warningmessagesmall"><strong>',_l("This dataset has been hidden."),"</strong></div>","<% } %>","</div>",'<div class="dataset-selector"><span class="fa fa-2x fa-square-o"></span></div>','<div class="dataset-primary-actions"></div>','<div class="dataset-title-bar clear" tabindex="0">','<span class="dataset-state-icon state-icon"></span>','<div class="dataset-title">','<span class="hda-hid"><%- hda.hid %></span> ','<span class="dataset-name"><%- hda.name %></span>',"</div>","</div>",'<div class="dataset-body"></div>',"</div>"].join("");var d=['<div class="dataset-body">',"<% if( hda.body ){ %>",'<div class="dataset-summary">',"<%= hda.body %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% } else { %>",'<div class="dataset-summary">',"<% if( hda.misc_blurb ){ %>",'<div class="dataset-blurb">','<span class="value"><%- hda.misc_blurb %></span>',"</div>","<% } %>","<% if( hda.data_type ){ %>",'<div class="dataset-datatype">','<label class="prompt">',_l("format"),"</label>",'<span class="value"><%- hda.data_type %></span>',"</div>","<% } %>","<% if( hda.metadata_dbkey ){ %>",'<div class="dataset-dbkey">','<label class="prompt">',_l("database"),"</label>",'<span class="value">',"<%- hda.metadata_dbkey %>","</span>","</div>","<% } %>","<% if( hda.misc_info ){ %>",'<div class="dataset-info">','<span class="value"><%- hda.misc_info %></span>',"</div>","<% } %>","</div>",'<div class="dataset-actions clear">','<div class="left"></div>','<div class="right"></div>',"</div>","<% if( !hda.deleted ){ %>",'<div class="tags-display"></div>','<div class="annotation-display"></div>','<div class="dataset-display-applications">',"<% _.each( hda.display_apps, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","<% _.each( hda.display_types, function( app ){ %>",'<div class="display-application">','<span class="display-application-location"><%- app.label %></span> ','<span class="display-application-links">',"<% _.each( app.links, function( link ){ %>",'<a target="<%= link.target %>" href="<%= link.href %>">',"<% print( _l( link.text ) ); %>","</a> ","<% }); %>","</span>","</div>","<% }); %>","</div>",'<div class="dataset-peek">',"<% if( hda.peek ){ %>",'<pre class="peek"><%= hda.peek %></pre>',"<% } %>","</div>","<% } %>","<% } %>","</div>"].join("");b.templates={skeleton:function(e){return _.template(a,e,{variable:"hda"})},body:function(e){return _.template(d,e,{variable:"hda"})}};return{HDABaseView:b}});
\ No newline at end of file
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.
1
0
commit/galaxy-central: martenson: libraries: changed to more grid-like styling; added packed versions of recent JS updates that showed up after packing scripts
by commits-noreply@bitbucket.org 19 Mar '14
by commits-noreply@bitbucket.org 19 Mar '14
19 Mar '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4904f18e1cb0/
Changeset: 4904f18e1cb0
User: martenson
Date: 2014-03-19 22:18:36
Summary: libraries: changed to more grid-like styling; added packed versions of recent JS updates that showed up after packing scripts
Affected #: 9 files
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/scripts/galaxy.library.js
--- a/static/scripts/galaxy.library.js
+++ b/static/scripts/galaxy.library.js
@@ -121,10 +121,10 @@
// TOOLBAR
tmpl_array.push('<div id="library_folder_toolbar" >');
- tmpl_array.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="btn btn-primary" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');
- tmpl_array.push(' <button title="Import selected datasets into history" id="toolbtn_bulk_import" class="btn btn-primary" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');
+ tmpl_array.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="primary-button" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');
+ tmpl_array.push(' <button title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');
tmpl_array.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');
- tmpl_array.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">');
+ tmpl_array.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');
tmpl_array.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');
tmpl_array.push(' </button>');
tmpl_array.push(' <ul class="dropdown-menu" role="menu">');
@@ -150,7 +150,7 @@
// FOLDER CONTENT
- tmpl_array.push('<table id="folder_table" class="library_table table table-condensed">');
+ tmpl_array.push('<table id="folder_table" class="grid table table-condensed">');
tmpl_array.push(' <thead>');
tmpl_array.push(' <th class="button_heading"></th>');
tmpl_array.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');
@@ -797,7 +797,6 @@
initialize : function(){
var viewContext = this;
this.collection = new Libraries();
- // this.collection.on('sort', this.render, this);
this.collection.fetch({
success: function(libraries){
@@ -817,8 +816,9 @@
$("#center").css('overflow','auto');
},
- /** Renders the libraries table either from the object's own collection, or from a given array of library models,
- or renders an empty list in case no data is present. */
+ /** Renders the libraries table either from the object's own collection,
+ or from a given array of library models,
+ or renders an empty list in case no data is given. */
render: function (options) {
var template = this.templateLibraryList();
var libraries_to_render = null;
@@ -874,14 +874,18 @@
templateLibraryList: function(){
tmpl_array = [];
+
tmpl_array.push('<div class="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');
- tmpl_array.push('');
+
tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');
- tmpl_array.push('<a href="" id="create_new_library_btn" class="btn btn-primary file ">New Library</a>');
+ tmpl_array.push('<div id="library_toolbar">');
+ tmpl_array.push(' <button title="Create New Library" id="create_new_library_btn" class="primary-button" type="button"><span class="fa fa-plus"></span> New Library</button>');
+ tmpl_array.push('</div>');
+
tmpl_array.push('<% if(libraries.length === 0) { %>');
tmpl_array.push("<div>I see no libraries. Why don't you create one?</div>");
tmpl_array.push('<% } else{ %>');
- tmpl_array.push('<table class="library_table table table-condensed">');
+ tmpl_array.push('<table class="grid table table-condensed">');
tmpl_array.push(' <thead>');
tmpl_array.push(' <th><a title="Click to reverse order" href="#sort/name/<% if(order==="desc"||order===null){print("asc")}else{print("desc")} %>">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');
tmpl_array.push(' <th>description</th>');
@@ -898,6 +902,7 @@
tmpl_array.push(' </tbody>');
tmpl_array.push('</table>');
tmpl_array.push('<% }%>');
+
tmpl_array.push('</div>');
return _.template(tmpl_array.join(''));
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/scripts/packed/galaxy.library.js
--- a/static/scripts/packed/galaxy.library.js
+++ b/static/scripts/packed/galaxy.library.js
@@ -1,1 +1,1 @@
-var view=null;var library_router=null;var responses=[];define(["galaxy.masthead","utils/utils","libs/toastr"],function(k,h,m){var f=Backbone.Model.extend({urlRoot:"/api/libraries"});var c=Backbone.Model.extend({urlRoot:"/api/folders"});var n=Backbone.Collection.extend({url:"/api/libraries",model:f,sort_key:"name",sort_order:null,});var i=Backbone.Model.extend({urlRoot:"/api/libraries/datasets"});var d=Backbone.Collection.extend({model:i});var e=Backbone.Model.extend({defaults:{folder:new d(),full_path:"unknown",urlRoot:"/api/folders/",id:"unknown"},parse:function(q){this.full_path=q[0].full_path;this.get("folder").reset(q[1].folder_contents);return q}});var b=Backbone.Model.extend({urlRoot:"/api/histories/"});var j=Backbone.Model.extend({url:"/api/histories/"});var o=Backbone.Collection.extend({url:"/api/histories",model:j});var l=Backbone.View.extend({el:"#center",progress:0,progressStep:1,lastSelectedHistory:"",modal:null,folders:null,initialize:function(){this.folders=[];this.queue=jQuery.Deferred();this.queue.resolve()},templateFolder:function(){var q=[];q.push('<div class="library_container" style="width: 90%; margin: auto; margin-top: 2em; ">');q.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');q.push('<div id="library_folder_toolbar" >');q.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="btn btn-primary" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');q.push(' <button title="Import selected datasets into history" id="toolbtn_bulk_import" class="btn btn-primary" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');q.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');q.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">');q.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');q.push(" </button>");q.push(' <ul class="dropdown-menu" role="menu">');q.push(' <li><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');q.push(' <li><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');q.push(' <li><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');q.push(" </ul>");q.push(" </div>");q.push("</div>");q.push('<ol class="breadcrumb">');q.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');q.push(" <% _.each(path, function(path_item) { %>");q.push(" <% if (path_item[0] != id) { %>");q.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');q.push("<% } else { %>");q.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');q.push(" <% } %>");q.push(" <% }); %>");q.push("</ol>");q.push('<table id="folder_table" class="library_table table table-condensed">');q.push(" <thead>");q.push(' <th class="button_heading"></th>');q.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');q.push(" <th>name</th>");q.push(" <th>data type</th>");q.push(" <th>size</th>");q.push(" <th>date (UTC)</th>");q.push(" </thead>");q.push(" <tbody>");q.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');q.push(" <td></td>");q.push(" <td></td>");q.push(" <td></td>");q.push(" <td></td>");q.push(" <td></td>");q.push(" </tr>");q.push(" <% _.each(items, function(content_item) { %>");q.push(' <% if (content_item.get("type") === "folder") { %>');q.push(' <tr class="folder_row light" id="<%- content_item.id %>">');q.push(" <td>");q.push(' <span title="Folder" class="fa fa-folder-o"></span>');q.push(" </td>");q.push(" <td></td>");q.push(" <td>");q.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');q.push(' <% if (content_item.get("item_count") === 0) { %>');q.push(' <span class="muted">(empty folder)</span>');q.push(" <% } %>");q.push(" </td>");q.push(" <td>folder</td>");q.push(' <td><%= _.escape(content_item.get("item_count")) %> item(s)</td>');q.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');q.push(" </tr>");q.push(" <% } else { %>");q.push(' <tr class="dataset_row light" id="<%- content_item.id %>">');q.push(" <td>");q.push(' <span title="Dataset" class="fa fa-file-o"></span>');q.push(" </td>");q.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');q.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>');q.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');q.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');q.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');q.push(" </tr>");q.push(" <% } %> ");q.push(" <% }); %>");q.push(" ");q.push(" </tbody>");q.push("</table>");q.push("</div>");return q.join("")},templateDatasetModal:function(){var q=[];q.push('<div class="modal_table">');q.push(' <table class="table table-striped table-condensed">');q.push(" <tr>");q.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');q.push(' <td><%= _.escape(item.get("name")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Data type</th>');q.push(' <td><%= _.escape(item.get("data_type")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Genome build</th>');q.push(' <td><%= _.escape(item.get("genome_build")) %></td>');q.push(" </tr>");q.push(' <th scope="row">Size</th>');q.push(" <td><%= _.escape(size) %></td>");q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Date uploaded (UTC)</th>');q.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Uploaded by</th>');q.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');q.push(" </tr>");q.push(' <tr scope="row">');q.push(' <th scope="row">Data Lines</th>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');q.push(" </tr>");q.push(' <th scope="row">Comment Lines</th>');q.push(' <% if (item.get("metadata_comment_lines") === "") { %>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');q.push(" <% } else { %>");q.push(' <td scope="row">unknown</td>');q.push(" <% } %>");q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Number of Columns</th>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Column Types</th>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Miscellaneous information</th>');q.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');q.push(" </tr>");q.push(" </table>");q.push(' <pre class="peek">');q.push(" </pre>");q.push("</div>");return q.join("")},templateHistorySelectInModal:function(){var q=[];q.push('<span id="history_modal_combo" style="width:90%; margin-left: 1em; margin-right: 1em; ">');q.push("Select history: ");q.push('<select id="dataset_import_single" name="dataset_import_single" style="width:50%; margin-bottom: 1em; "> ');q.push(" <% _.each(histories, function(history) { %>");q.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');q.push(" <% }); %>");q.push("</select>");q.push("</span>");return q.join("")},templateBulkImportInModal:function(){var q=[];q.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');q.push("Select history: ");q.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');q.push(" <% _.each(histories, function(history) { %>");q.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');q.push(" <% }); %>");q.push("</select>");q.push("</span>");return q.join("")},templateProgressBar:function(){var q=[];q.push('<div class="import_text">');q.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");q.push("</div>");q.push('<div class="progress">');q.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');q.push(' <span class="completion_span">0% Complete</span>');q.push(" </div>");q.push("</div>");q.push("");return q.join("")},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return tmpl_array.join("")},events:{"click #select-all-checkboxes":"selectAll","click #toolbtn_bulk_import":"modalBulkImport","click #toolbtn_dl":"bulkDownload","click #toolbtn_create_folder":"createFolderFromModal","click .library-dataset":"showDatasetDetails","click .dataset_row":"selectClickedRow"},render:function(q){$("#center").css("overflow","auto");view=this;var s=this;var r=new e({id:q.id});r.url=r.attributes.urlRoot+q.id+"/contents";r.fetch({success:function(t){for(var v=0;v<r.attributes.folder.models.length;v++){var u=r.attributes.folder.models[v];if(u.get("type")==="file"){u.set("readable_size",s.size_to_string(u.get("file_size")))}}var x=r.full_path;var y;if(x.length===1){y=0}else{y=x[x.length-2][0]}var w=_.template(s.templateFolder(),{path:r.full_path,items:r.attributes.folder.models,id:q.id,upper_folder_id:y});s.$el.html(w)},error:function(){m.error("An error occured :(")}})},size_to_string:function(q){var r="";if(q>=100000000000){q=q/100000000000;r="TB"}else{if(q>=100000000){q=q/100000000;r="GB"}else{if(q>=100000){q=q/100000;r="MB"}else{if(q>=100){q=q/100;r="KB"}else{q=q*10;r="b"}}}}return(Math.round(q)/10)+r},showDatasetDetails:function(t){t.preventDefault();var u=$(t.target).parent().parent().parent().attr("id");if(typeof u==="undefined"){u=$(t.target).parent().attr("id")}if(typeof u==="undefined"){u=$(t.target).parent().parent().attr("id")}var s=new i();var r=new o();s.id=u;var q=this;s.fetch({success:function(v){r.fetch({success:function(w){q.renderModalAfterFetch(v,w)},error:function(){m.error("An error occured during fetching histories:(");q.renderModalAfterFetch(v)}})},error:function(){m.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(v,s){var t=this.size_to_string(v.get("file_size"));var u=_.template(this.templateDatasetModal(),{item:v,size:t});var r=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:u,buttons:{Import:function(){r.importCurrentIntoHistory()},Download:function(){r.downloadCurrent()},Close:function(){r.modal.hide()}}});$(".peek").html(v.get("peek"));if(typeof history.models!==undefined){var q=_.template(this.templateHistorySelectInModal(),{histories:s.models});$(this.modal.elMain).find(".buttons").prepend(q);if(r.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(r.lastSelectedHistory)}}},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var q=[];q.push($("#id_row").attr("data-id"));var r="/api/libraries/datasets/download/uncompressed";var s={ldda_ids:q};folderContentView.processDownload(r,s);this.modal.enableButton("Import");this.modal.enableButton("Download")},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var s=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=s;var q=$("#id_row").attr("data-id");var t=new b();var r=this;t.url=t.urlRoot+s+"/contents";t.save({content:q,source:"library"},{success:function(){m.success("Dataset imported");r.modal.enableButton("Import");r.modal.enableButton("Download")},error:function(){m.error("An error occured! Dataset not imported. Please try again.");r.modal.enableButton("Import");r.modal.enableButton("Download")}})},selectAll:function(r){var q=r.target.checked;that=this;$(":checkbox").each(function(){this.checked=q;$row=$(this.parentElement.parentElement);(q)?that.makeDarkRow($row):that.makeWhiteRow($row)});this.checkTools()},selectClickedRow:function(r){var t="";var q;var s;if(r.target.localName==="input"){t=r.target;q=$(r.target.parentElement.parentElement);s="input"}else{if(r.target.localName==="td"){t=$("#"+r.target.parentElement.id).find(":checkbox")[0];q=$(r.target.parentElement);s="td"}}if(t.checked){if(s==="td"){t.checked="";this.makeWhiteRow(q)}else{if(s==="input"){this.makeDarkRow(q)}}}else{if(s==="td"){t.checked="selected";this.makeDarkRow(q)}else{if(s==="input"){this.makeWhiteRow(q)}}}this.checkTools()},makeDarkRow:function(q){q.removeClass("light");q.find("a").removeClass("light");q.addClass("dark");q.find("a").addClass("dark");q.find("span").removeClass("fa-file-o");q.find("span").addClass("fa-file")},makeWhiteRow:function(q){q.removeClass("dark");q.find("a").removeClass("dark");q.addClass("light");q.find("a").addClass("light");q.find("span").addClass("fa-file-o");q.find("span").removeClass("fa-file")},checkTools:function(){var q=$("#folder_table").find(":checked");if(q.length>0){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}else{$("#toolbtn_bulk_import").hide();$("#toolbtn_dl").hide()}},modalBulkImport:function(){var r=this;var q=new o();q.fetch({success:function(s){var t=_.template(r.templateBulkImportInModal(),{histories:s.models});r.modal=Galaxy.modal;r.modal.show({closing_events:true,title:"Import into History",body:t,buttons:{Import:function(){r.importAllIntoHistory()},Close:function(){r.modal.hide()}}})},error:function(){m.error("An error occured :(")}})},importAllIntoHistory:function(){this.modal.disableButton("Import");var s=$("select[name=dataset_import_bulk] option:selected").val();var w=$("select[name=dataset_import_bulk] option:selected").text();var y=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){y.push(this.parentElement.parentElement.id)}});var x=_.template(this.templateProgressBar(),{history_name:w});$(this.modal.elMain).find(".modal-body").html(x);var t=100/y.length;this.initProgress(t);var q=[];for(var r=y.length-1;r>=0;r--){library_dataset_id=y[r];var u=new b();var v=this;u.url=u.urlRoot+s+"/contents";u.content=library_dataset_id;u.source="library";q.push(u)}this.chainCall(q)},chainCall:function(r){var q=this;var s=r.pop();if(typeof s==="undefined"){m.success("All datasets imported");this.modal.hide();return}var t=$.when(s.save({content:s.content,source:s.source})).done(function(u){q.updateProgress();responses.push(u);q.chainCall(r)})},initProgress:function(q){this.progress=0;this.progressStep=q},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(q,u){var s=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){s.push(this.parentElement.parentElement.id)}});var r="/api/libraries/datasets/download/"+u;var t={ldda_ids:s};this.processDownload(r,t,"get")},processDownload:function(r,s,t){if(r&&s){s=typeof s=="string"?s:$.param(s);var q="";$.each(s.split("&"),function(){var u=this.split("=");q+='<input type="hidden" name="'+u[0]+'" value="'+u[1]+'" />'});$('<form action="'+r+'" method="'+(t||"post")+'">'+q+"</form>").appendTo("body").submit().remove();m.info("Your download will begin soon")}},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var q=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:this.templateNewFolderInModal(),buttons:{Create:function(){q.create_new_folder_event()},Close:function(){q.modal.hide();q.modal=null}}})},create_new_folder_event:function(){var q=this.serialize_new_folder();if(this.validate_new_folder(q)){var s=new c();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];s.url=s.urlRoot+"/"+current_folder_id;var r=this;s.save(q,{success:function(t){r.modal.hide();m.success("Folder created");r.render({id:current_folder_id})},error:function(){m.error("An error occured :(")}})}else{m.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(q){return q.name!==""}});var a=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal"},modal:null,collection:null,initialize:function(){var q=this;this.collection=new n();this.collection.fetch({success:function(r){q.render()},error:function(s,r){if(r.statusCode().status===403){m.info("Please log in first. Redirecting to login page in 3s.");setTimeout(that.redirectToLogin,3000)}else{m.error("An error occured. Please try again.")}}});$("#center").css("overflow","auto")},render:function(r){var s=this.templateLibraryList();var t=null;var q=false;var u=null;if(typeof r!=="undefined"){q=typeof r.with_deleted!=="undefined"?r.with_deleted:false;u=typeof r.models!=="undefined"?r.models:null}if(this.collection!==null&&u===null){if(q){t=this.collection.models}else{t=this.collection.where({deleted:false})}}else{if(u!==null){t=u}else{t=[]}}this.$el.html(s({libraries:t,order:this.collection.sort_order}))},sortLibraries:function(r,q){if(r==="name"){if(q==="asc"){this.collection.sort_order="asc";this.collection.comparator=function(t,s){if(t.get("name").toLowerCase()>s.get("name").toLowerCase()){return 1}if(s.get("name").toLowerCase()>t.get("name").toLowerCase()){return -1}return 0}}else{if(q==="desc"){this.collection.sort_order="desc";this.collection.comparator=function(t,s){if(t.get("name").toLowerCase()>s.get("name").toLowerCase()){return -1}if(s.get("name").toLowerCase()>t.get("name").toLowerCase()){return 1}return 0}}}this.collection.sort()}},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div class="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');tmpl_array.push("");tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<a href="" id="create_new_library_btn" class="btn btn-primary file ">New Library</a>');tmpl_array.push("<% if(libraries.length === 0) { %>");tmpl_array.push("<div>I see no libraries. Why don't you create one?</div>");tmpl_array.push("<% } else{ %>");tmpl_array.push('<table class="library_table table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th><a title="Click to reverse order" href="#sort/name/<% if(order==="desc"||order===null){print("asc")}else{print("desc")} %>">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');tmpl_array.push(" <th>description</th>");tmpl_array.push(" <th>synopsis</th> ");tmpl_array.push(" </thead>");tmpl_array.push(" <tbody>");tmpl_array.push(" <% _.each(libraries, function(library) { %>");tmpl_array.push(" <tr>");tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(" </tr>");tmpl_array.push(" <% }); %>");tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("<% }%>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_modal">');tmpl_array.push(" <form>");tmpl_array.push(' <input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push(' <input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},show_library_modal:function(r){r.preventDefault();r.stopPropagation();var q=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){q.create_new_library_event()},Close:function(){q.modal.hide()}}})},create_new_library_event:function(){var s=this.serialize_new_library();if(this.validate_new_library(s)){var r=new f();var q=this;r.save(s,{success:function(t){q.collection.add(t);q.modal.hide();q.clear_library_modal();q.render();m.success("Library created")},error:function(){m.error("An error occured :(")}})}else{m.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(q){return q.name!==""}});var p=Backbone.Router.extend({routes:{"":"libraries","sort/:sort_by/:order":"sort_libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var g=Backbone.View.extend({initialize:function(){galaxyLibraryview=new a();library_router=new p();folderContentView=new l();library_router.on("route:libraries",function(){galaxyLibraryview.render()});library_router.on("route:sort_libraries",function(r,q){galaxyLibraryview.sortLibraries(r,q);galaxyLibraryview.render()});library_router.on("route:folder_content",function(q){folderContentView.render({id:q})});library_router.on("route:download",function(q,r){if($("#center").find(":checked").length===0){library_router.navigate("folders/"+q,{trigger:true,replace:true})}else{folderContentView.download(q,r);library_router.navigate("folders/"+q,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:g}});
\ No newline at end of file
+var view=null;var library_router=null;var responses=[];define(["galaxy.masthead","utils/utils","libs/toastr"],function(k,h,m){var f=Backbone.Model.extend({urlRoot:"/api/libraries"});var c=Backbone.Model.extend({urlRoot:"/api/folders"});var n=Backbone.Collection.extend({url:"/api/libraries",model:f,sort_key:"name",sort_order:null,});var i=Backbone.Model.extend({urlRoot:"/api/libraries/datasets"});var d=Backbone.Collection.extend({model:i});var e=Backbone.Model.extend({defaults:{folder:new d(),full_path:"unknown",urlRoot:"/api/folders/",id:"unknown"},parse:function(q){this.full_path=q[0].full_path;this.get("folder").reset(q[1].folder_contents);return q}});var b=Backbone.Model.extend({urlRoot:"/api/histories/"});var j=Backbone.Model.extend({url:"/api/histories/"});var o=Backbone.Collection.extend({url:"/api/histories",model:j});var l=Backbone.View.extend({el:"#center",progress:0,progressStep:1,lastSelectedHistory:"",modal:null,folders:null,initialize:function(){this.folders=[];this.queue=jQuery.Deferred();this.queue.resolve()},templateFolder:function(){var q=[];q.push('<div class="library_container" style="width: 90%; margin: auto; margin-top: 2em; ">');q.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');q.push('<div id="library_folder_toolbar" >');q.push(' <button title="Create New Folder" id="toolbtn_create_folder" class="primary-button" type="button"><span class="fa fa-plus"></span><span class="fa fa-folder-close"></span> folder</button>');q.push(' <button title="Import selected datasets into history" id="toolbtn_bulk_import" class="primary-button" style="display: none; margin-left: 0.5em;" type="button"><span class="fa fa-external-link"></span> to history</button>');q.push(' <div id="toolbtn_dl" class="btn-group" style="margin-left: 0.5em; display: none; ">');q.push(' <button title="Download selected datasets" id="drop_toggle" type="button" class="primary-button dropdown-toggle" data-toggle="dropdown">');q.push(' <span class="fa fa-download"></span> download <span class="caret"></span>');q.push(" </button>");q.push(' <ul class="dropdown-menu" role="menu">');q.push(' <li><a href="#/folders/<%= id %>/download/tgz">.tar.gz</a></li>');q.push(' <li><a href="#/folders/<%= id %>/download/tbz">.tar.bz</a></li>');q.push(' <li><a href="#/folders/<%= id %>/download/zip">.zip</a></li>');q.push(" </ul>");q.push(" </div>");q.push("</div>");q.push('<ol class="breadcrumb">');q.push(' <li><a title="Return to the list of libraries" href="#">Libraries</a></li>');q.push(" <% _.each(path, function(path_item) { %>");q.push(" <% if (path_item[0] != id) { %>");q.push(' <li><a title="Return to this folder" href="#/folders/<%- path_item[0] %>"><%- path_item[1] %></a></li> ');q.push("<% } else { %>");q.push(' <li class="active"><span title="You are in this folder"><%- path_item[1] %></span></li>');q.push(" <% } %>");q.push(" <% }); %>");q.push("</ol>");q.push('<table id="folder_table" class="grid table table-condensed">');q.push(" <thead>");q.push(' <th class="button_heading"></th>');q.push(' <th style="text-align: center; width: 20px; "><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>');q.push(" <th>name</th>");q.push(" <th>data type</th>");q.push(" <th>size</th>");q.push(" <th>date (UTC)</th>");q.push(" </thead>");q.push(" <tbody>");q.push(' <td><a href="#<% if (upper_folder_id !== 0){ print("folders/" + upper_folder_id)} %>" title="Go to parent folder" class="btn_open_folder btn btn-default btn-xs">..<a></td>');q.push(" <td></td>");q.push(" <td></td>");q.push(" <td></td>");q.push(" <td></td>");q.push(" <td></td>");q.push(" </tr>");q.push(" <% _.each(items, function(content_item) { %>");q.push(' <% if (content_item.get("type") === "folder") { %>');q.push(' <tr class="folder_row light" id="<%- content_item.id %>">');q.push(" <td>");q.push(' <span title="Folder" class="fa fa-folder-o"></span>');q.push(" </td>");q.push(" <td></td>");q.push(" <td>");q.push(' <a href="#folders/<%- content_item.id %>"><%- content_item.get("name") %></a>');q.push(' <% if (content_item.get("item_count") === 0) { %>');q.push(' <span class="muted">(empty folder)</span>');q.push(" <% } %>");q.push(" </td>");q.push(" <td>folder</td>");q.push(' <td><%= _.escape(content_item.get("item_count")) %> item(s)</td>');q.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');q.push(" </tr>");q.push(" <% } else { %>");q.push(' <tr class="dataset_row light" id="<%- content_item.id %>">');q.push(" <td>");q.push(' <span title="Dataset" class="fa fa-file-o"></span>');q.push(" </td>");q.push(' <td style="text-align: center; "><input style="margin: 0;" type="checkbox"></td>');q.push(' <td><a href="#" class="library-dataset"><%- content_item.get("name") %><a></td>');q.push(' <td><%= _.escape(content_item.get("data_type")) %></td>');q.push(' <td><%= _.escape(content_item.get("readable_size")) %></td>');q.push(' <td><%= _.escape(content_item.get("time_updated")) %></td>');q.push(" </tr>");q.push(" <% } %> ");q.push(" <% }); %>");q.push(" ");q.push(" </tbody>");q.push("</table>");q.push("</div>");return q.join("")},templateDatasetModal:function(){var q=[];q.push('<div class="modal_table">');q.push(' <table class="table table-striped table-condensed">');q.push(" <tr>");q.push(' <th scope="row" id="id_row" data-id="<%= _.escape(item.get("ldda_id")) %>">Name</th>');q.push(' <td><%= _.escape(item.get("name")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Data type</th>');q.push(' <td><%= _.escape(item.get("data_type")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Genome build</th>');q.push(' <td><%= _.escape(item.get("genome_build")) %></td>');q.push(" </tr>");q.push(' <th scope="row">Size</th>');q.push(" <td><%= _.escape(size) %></td>");q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Date uploaded (UTC)</th>');q.push(' <td><%= _.escape(item.get("date_uploaded")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Uploaded by</th>');q.push(' <td><%= _.escape(item.get("uploaded_by")) %></td>');q.push(" </tr>");q.push(' <tr scope="row">');q.push(' <th scope="row">Data Lines</th>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_data_lines")) %></td>');q.push(" </tr>");q.push(' <th scope="row">Comment Lines</th>');q.push(' <% if (item.get("metadata_comment_lines") === "") { %>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_comment_lines")) %></td>');q.push(" <% } else { %>");q.push(' <td scope="row">unknown</td>');q.push(" <% } %>");q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Number of Columns</th>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_columns")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Column Types</th>');q.push(' <td scope="row"><%= _.escape(item.get("metadata_column_types")) %></td>');q.push(" </tr>");q.push(" <tr>");q.push(' <th scope="row">Miscellaneous information</th>');q.push(' <td scope="row"><%= _.escape(item.get("misc_blurb")) %></td>');q.push(" </tr>");q.push(" </table>");q.push(' <pre class="peek">');q.push(" </pre>");q.push("</div>");return q.join("")},templateHistorySelectInModal:function(){var q=[];q.push('<span id="history_modal_combo" style="width:90%; margin-left: 1em; margin-right: 1em; ">');q.push("Select history: ");q.push('<select id="dataset_import_single" name="dataset_import_single" style="width:50%; margin-bottom: 1em; "> ');q.push(" <% _.each(histories, function(history) { %>");q.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');q.push(" <% }); %>");q.push("</select>");q.push("</span>");return q.join("")},templateBulkImportInModal:function(){var q=[];q.push('<span id="history_modal_combo_bulk" style="width:90%; margin-left: 1em; margin-right: 1em; ">');q.push("Select history: ");q.push('<select id="dataset_import_bulk" name="dataset_import_bulk" style="width:50%; margin-bottom: 1em; "> ');q.push(" <% _.each(histories, function(history) { %>");q.push(' <option value="<%= _.escape(history.get("id")) %>"><%= _.escape(history.get("name")) %></option>');q.push(" <% }); %>");q.push("</select>");q.push("</span>");return q.join("")},templateProgressBar:function(){var q=[];q.push('<div class="import_text">');q.push("Importing selected datasets to history <b><%= _.escape(history_name) %></b>");q.push("</div>");q.push('<div class="progress">');q.push(' <div class="progress-bar progress-bar-import" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 00%;">');q.push(' <span class="completion_span">0% Complete</span>');q.push(" </div>");q.push("</div>");q.push("");return q.join("")},templateNewFolderInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_folder_modal">');tmpl_array.push("<form>");tmpl_array.push('<input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push('<input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push("</form>");tmpl_array.push("</div>");return tmpl_array.join("")},events:{"click #select-all-checkboxes":"selectAll","click #toolbtn_bulk_import":"modalBulkImport","click #toolbtn_dl":"bulkDownload","click #toolbtn_create_folder":"createFolderFromModal","click .library-dataset":"showDatasetDetails","click .dataset_row":"selectClickedRow"},render:function(q){$("#center").css("overflow","auto");view=this;var s=this;var r=new e({id:q.id});r.url=r.attributes.urlRoot+q.id+"/contents";r.fetch({success:function(t){for(var v=0;v<r.attributes.folder.models.length;v++){var u=r.attributes.folder.models[v];if(u.get("type")==="file"){u.set("readable_size",s.size_to_string(u.get("file_size")))}}var x=r.full_path;var y;if(x.length===1){y=0}else{y=x[x.length-2][0]}var w=_.template(s.templateFolder(),{path:r.full_path,items:r.attributes.folder.models,id:q.id,upper_folder_id:y});s.$el.html(w)},error:function(){m.error("An error occured :(")}})},size_to_string:function(q){var r="";if(q>=100000000000){q=q/100000000000;r="TB"}else{if(q>=100000000){q=q/100000000;r="GB"}else{if(q>=100000){q=q/100000;r="MB"}else{if(q>=100){q=q/100;r="KB"}else{q=q*10;r="b"}}}}return(Math.round(q)/10)+r},showDatasetDetails:function(t){t.preventDefault();var u=$(t.target).parent().parent().parent().attr("id");if(typeof u==="undefined"){u=$(t.target).parent().attr("id")}if(typeof u==="undefined"){u=$(t.target).parent().parent().attr("id")}var s=new i();var r=new o();s.id=u;var q=this;s.fetch({success:function(v){r.fetch({success:function(w){q.renderModalAfterFetch(v,w)},error:function(){m.error("An error occured during fetching histories:(");q.renderModalAfterFetch(v)}})},error:function(){m.error("An error occured during loading dataset details :(")}})},renderModalAfterFetch:function(v,s){var t=this.size_to_string(v.get("file_size"));var u=_.template(this.templateDatasetModal(),{item:v,size:t});var r=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Dataset Details",body:u,buttons:{Import:function(){r.importCurrentIntoHistory()},Download:function(){r.downloadCurrent()},Close:function(){r.modal.hide()}}});$(".peek").html(v.get("peek"));if(typeof history.models!==undefined){var q=_.template(this.templateHistorySelectInModal(),{histories:s.models});$(this.modal.elMain).find(".buttons").prepend(q);if(r.lastSelectedHistory.length>0){$(this.modal.elMain).find("#dataset_import_single").val(r.lastSelectedHistory)}}},downloadCurrent:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var q=[];q.push($("#id_row").attr("data-id"));var r="/api/libraries/datasets/download/uncompressed";var s={ldda_ids:q};folderContentView.processDownload(r,s);this.modal.enableButton("Import");this.modal.enableButton("Download")},importCurrentIntoHistory:function(){this.modal.disableButton("Import");this.modal.disableButton("Download");var s=$(this.modal.elMain).find("select[name=dataset_import_single] option:selected").val();this.lastSelectedHistory=s;var q=$("#id_row").attr("data-id");var t=new b();var r=this;t.url=t.urlRoot+s+"/contents";t.save({content:q,source:"library"},{success:function(){m.success("Dataset imported");r.modal.enableButton("Import");r.modal.enableButton("Download")},error:function(){m.error("An error occured! Dataset not imported. Please try again.");r.modal.enableButton("Import");r.modal.enableButton("Download")}})},selectAll:function(r){var q=r.target.checked;that=this;$(":checkbox").each(function(){this.checked=q;$row=$(this.parentElement.parentElement);(q)?that.makeDarkRow($row):that.makeWhiteRow($row)});this.checkTools()},selectClickedRow:function(r){var t="";var q;var s;if(r.target.localName==="input"){t=r.target;q=$(r.target.parentElement.parentElement);s="input"}else{if(r.target.localName==="td"){t=$("#"+r.target.parentElement.id).find(":checkbox")[0];q=$(r.target.parentElement);s="td"}}if(t.checked){if(s==="td"){t.checked="";this.makeWhiteRow(q)}else{if(s==="input"){this.makeDarkRow(q)}}}else{if(s==="td"){t.checked="selected";this.makeDarkRow(q)}else{if(s==="input"){this.makeWhiteRow(q)}}}this.checkTools()},makeDarkRow:function(q){q.removeClass("light");q.find("a").removeClass("light");q.addClass("dark");q.find("a").addClass("dark");q.find("span").removeClass("fa-file-o");q.find("span").addClass("fa-file")},makeWhiteRow:function(q){q.removeClass("dark");q.find("a").removeClass("dark");q.addClass("light");q.find("a").addClass("light");q.find("span").addClass("fa-file-o");q.find("span").removeClass("fa-file")},checkTools:function(){var q=$("#folder_table").find(":checked");if(q.length>0){$("#toolbtn_bulk_import").show();$("#toolbtn_dl").show()}else{$("#toolbtn_bulk_import").hide();$("#toolbtn_dl").hide()}},modalBulkImport:function(){var r=this;var q=new o();q.fetch({success:function(s){var t=_.template(r.templateBulkImportInModal(),{histories:s.models});r.modal=Galaxy.modal;r.modal.show({closing_events:true,title:"Import into History",body:t,buttons:{Import:function(){r.importAllIntoHistory()},Close:function(){r.modal.hide()}}})},error:function(){m.error("An error occured :(")}})},importAllIntoHistory:function(){this.modal.disableButton("Import");var s=$("select[name=dataset_import_bulk] option:selected").val();var w=$("select[name=dataset_import_bulk] option:selected").text();var y=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){y.push(this.parentElement.parentElement.id)}});var x=_.template(this.templateProgressBar(),{history_name:w});$(this.modal.elMain).find(".modal-body").html(x);var t=100/y.length;this.initProgress(t);var q=[];for(var r=y.length-1;r>=0;r--){library_dataset_id=y[r];var u=new b();var v=this;u.url=u.urlRoot+s+"/contents";u.content=library_dataset_id;u.source="library";q.push(u)}this.chainCall(q)},chainCall:function(r){var q=this;var s=r.pop();if(typeof s==="undefined"){m.success("All datasets imported");this.modal.hide();return}var t=$.when(s.save({content:s.content,source:s.source})).done(function(u){q.updateProgress();responses.push(u);q.chainCall(r)})},initProgress:function(q){this.progress=0;this.progressStep=q},updateProgress:function(){this.progress+=this.progressStep;$(".progress-bar-import").width(Math.round(this.progress)+"%");txt_representation=Math.round(this.progress)+"% Complete";$(".completion_span").text(txt_representation)},download:function(q,u){var s=[];$("#folder_table").find(":checked").each(function(){if(this.parentElement.parentElement.id!=""){s.push(this.parentElement.parentElement.id)}});var r="/api/libraries/datasets/download/"+u;var t={ldda_ids:s};this.processDownload(r,t,"get")},processDownload:function(r,s,t){if(r&&s){s=typeof s=="string"?s:$.param(s);var q="";$.each(s.split("&"),function(){var u=this.split("=");q+='<input type="hidden" name="'+u[0]+'" value="'+u[1]+'" />'});$('<form action="'+r+'" method="'+(t||"post")+'">'+q+"</form>").appendTo("body").submit().remove();m.info("Your download will begin soon")}},createFolderFromModal:function(){event.preventDefault();event.stopPropagation();var q=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Folder",body:this.templateNewFolderInModal(),buttons:{Create:function(){q.create_new_folder_event()},Close:function(){q.modal.hide();q.modal=null}}})},create_new_folder_event:function(){var q=this.serialize_new_folder();if(this.validate_new_folder(q)){var s=new c();url_items=Backbone.history.fragment.split("/");current_folder_id=url_items[url_items.length-1];s.url=s.urlRoot+"/"+current_folder_id;var r=this;s.save(q,{success:function(t){r.modal.hide();m.success("Folder created");r.render({id:current_folder_id})},error:function(){m.error("An error occured :(")}})}else{m.error("Folder's name is missing")}return false},serialize_new_folder:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val()}},validate_new_folder:function(q){return q.name!==""}});var a=Backbone.View.extend({el:"#center",events:{"click #create_new_library_btn":"show_library_modal"},modal:null,collection:null,initialize:function(){var q=this;this.collection=new n();this.collection.fetch({success:function(r){q.render()},error:function(s,r){if(r.statusCode().status===403){m.info("Please log in first. Redirecting to login page in 3s.");setTimeout(that.redirectToLogin,3000)}else{m.error("An error occured. Please try again.")}}});$("#center").css("overflow","auto")},render:function(r){var s=this.templateLibraryList();var t=null;var q=false;var u=null;if(typeof r!=="undefined"){q=typeof r.with_deleted!=="undefined"?r.with_deleted:false;u=typeof r.models!=="undefined"?r.models:null}if(this.collection!==null&&u===null){if(q){t=this.collection.models}else{t=this.collection.where({deleted:false})}}else{if(u!==null){t=u}else{t=[]}}this.$el.html(s({libraries:t,order:this.collection.sort_order}))},sortLibraries:function(r,q){if(r==="name"){if(q==="asc"){this.collection.sort_order="asc";this.collection.comparator=function(t,s){if(t.get("name").toLowerCase()>s.get("name").toLowerCase()){return 1}if(s.get("name").toLowerCase()>t.get("name").toLowerCase()){return -1}return 0}}else{if(q==="desc"){this.collection.sort_order="desc";this.collection.comparator=function(t,s){if(t.get("name").toLowerCase()>s.get("name").toLowerCase()){return -1}if(s.get("name").toLowerCase()>t.get("name").toLowerCase()){return 1}return 0}}}this.collection.sort()}},templateLibraryList:function(){tmpl_array=[];tmpl_array.push('<div class="library_container" style="width: 90%; margin: auto; margin-top: 2em; overflow: auto !important; ">');tmpl_array.push('<h3>Data Libraries Beta Test. This is work in progress. Please report problems & ideas via <a href="mailto:galaxy-bugs@bx.psu.edu?Subject=DataLibrariesBeta_Feedback" target="_blank">email</a> and <a href="https://trello.com/c/nwYQNFPK/56-data-library-ui-progressive-display-of-fol…" target="_blank">Trello</a>.</h3>');tmpl_array.push('<div id="library_toolbar">');tmpl_array.push(' <button title="Create New Library" id="create_new_library_btn" class="primary-button" type="button"><span class="fa fa-plus"></span> New Library</button>');tmpl_array.push("</div>");tmpl_array.push("<% if(libraries.length === 0) { %>");tmpl_array.push("<div>I see no libraries. Why don't you create one?</div>");tmpl_array.push("<% } else{ %>");tmpl_array.push('<table class="grid table table-condensed">');tmpl_array.push(" <thead>");tmpl_array.push(' <th><a title="Click to reverse order" href="#sort/name/<% if(order==="desc"||order===null){print("asc")}else{print("desc")} %>">name</a><span title="Sorted alphabetically" class="fa fa-sort-alpha-<%- order %>"></span></th>');tmpl_array.push(" <th>description</th>");tmpl_array.push(" <th>synopsis</th> ");tmpl_array.push(" </thead>");tmpl_array.push(" <tbody>");tmpl_array.push(" <% _.each(libraries, function(library) { %>");tmpl_array.push(" <tr>");tmpl_array.push(' <td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>');tmpl_array.push(' <td><%= _.escape(library.get("description")) %></td>');tmpl_array.push(' <td><%= _.escape(library.get("synopsis")) %></td>');tmpl_array.push(" </tr>");tmpl_array.push(" <% }); %>");tmpl_array.push(" </tbody>");tmpl_array.push("</table>");tmpl_array.push("<% }%>");tmpl_array.push("</div>");return _.template(tmpl_array.join(""))},templateNewLibraryInModal:function(){tmpl_array=[];tmpl_array.push('<div id="new_library_modal">');tmpl_array.push(" <form>");tmpl_array.push(' <input type="text" name="Name" value="" placeholder="Name">');tmpl_array.push(' <input type="text" name="Description" value="" placeholder="Description">');tmpl_array.push(' <input type="text" name="Synopsis" value="" placeholder="Synopsis">');tmpl_array.push(" </form>");tmpl_array.push("</div>");return tmpl_array.join("")},redirectToHome:function(){window.location="../"},redirectToLogin:function(){window.location="/user/login"},show_library_modal:function(r){r.preventDefault();r.stopPropagation();var q=this;this.modal=Galaxy.modal;this.modal.show({closing_events:true,title:"Create New Library",body:this.templateNewLibraryInModal(),buttons:{Create:function(){q.create_new_library_event()},Close:function(){q.modal.hide()}}})},create_new_library_event:function(){var s=this.serialize_new_library();if(this.validate_new_library(s)){var r=new f();var q=this;r.save(s,{success:function(t){q.collection.add(t);q.modal.hide();q.clear_library_modal();q.render();m.success("Library created")},error:function(){m.error("An error occured :(")}})}else{m.error("Library's name is missing")}return false},clear_library_modal:function(){$("input[name='Name']").val("");$("input[name='Description']").val("");$("input[name='Synopsis']").val("")},serialize_new_library:function(){return{name:$("input[name='Name']").val(),description:$("input[name='Description']").val(),synopsis:$("input[name='Synopsis']").val()}},validate_new_library:function(q){return q.name!==""}});var p=Backbone.Router.extend({routes:{"":"libraries","sort/:sort_by/:order":"sort_libraries","folders/:id":"folder_content","folders/:folder_id/download/:format":"download"}});var g=Backbone.View.extend({initialize:function(){galaxyLibraryview=new a();library_router=new p();folderContentView=new l();library_router.on("route:libraries",function(){galaxyLibraryview.render()});library_router.on("route:sort_libraries",function(r,q){galaxyLibraryview.sortLibraries(r,q);galaxyLibraryview.render()});library_router.on("route:folder_content",function(q){folderContentView.render({id:q})});library_router.on("route:download",function(q,r){if($("#center").find(":checked").length===0){library_router.navigate("folders/"+q,{trigger:true,replace:true})}else{folderContentView.download(q,r);library_router.navigate("folders/"+q,{trigger:false,replace:true})}});Backbone.history.start({pushState:false})}});return{GalaxyApp:g}});
\ No newline at end of file
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/scripts/packed/mvc/annotations.js
--- a/static/scripts/packed/mvc/annotations.js
+++ b/static/scripts/packed/mvc/annotations.js
@@ -1,1 +1,1 @@
-var AnnotationEditor=Backbone.View.extend(LoggableMixin).extend(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;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(b){a.$annotation().text(b);a.model.save({annotation:b},{silent:true}).fail(function(){a.$annotation().text(a.model.previous("annotation"))})}});return this},_template:function(){var a=this.model.get("annotation");return['<label class="prompt">',_l("Annotation"),"</label>",'<div class="annotation" title="',_l("Edit annotation"),'">',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("")}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"annotation-display",initialize:function(b){b=b||{};this.tooltipConfig=b.tooltipConfig||{placement:"bottom"};this.listenTo(this.model,"change:annotation",function(){this.render()});this.hiddenUntilActivated(b.$activator,b)},render:function(){var b=this;this.$el.html(this._template());this.$el.find("[title]").tooltip(this.tooltipConfig);this.$annotation().make_text_editable({use_textarea:true,on_finish:function(c){b.$annotation().text(c);b.model.save({annotation:c},{silent:true}).fail(function(){b.$annotation().text(b.model.previous("annotation"))})}});return this},_template:function(){var b=this.model.get("annotation");return['<label class="prompt">',_l("Annotation"),"</label>",'<div class="annotation" title="',_l("Edit annotation"),'">',b,"</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:a}});
\ No newline at end of file
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var e=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(f){a.HDABaseView.prototype.initialize.call(this,f);this.hasUser=f.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=f.tagsEditorShown||false;this.annotationEditorShown=f.annotationEditorShown||false},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var h=this.model.get("purged"),f=this.model.get("deleted"),g={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(f||h){g.disabled=true;if(h){g.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(f){g.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){g.disabled=true;g.title=_l("This dataset must finish uploading before it can be edited")}}g.faIcon="fa-pencil";return faIconButton(g)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var f=this,g={title:_l("Delete"),classes:"dataset-delete",onclick:function(){f.$el.find(".icon-btn.dataset-delete").trigger("mouseout");f.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){g={title:_l("Dataset is already deleted"),disabled:true}}g.faIcon="fa-times";return faIconButton(g)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var f=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(f))){return null}if(_.isObject(f[0])){return this._render_visualizationsFrameworkButton(f)}if(!this.urls.visualization){return null}var h=this.model.get("dbkey"),l=this.urls.visualization,i={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(h){m.dbkey=h}var g=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});function j(n){if(n==="trackster"){return b(l,m,h)}return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}function k(n){return n.charAt(0).toUpperCase()+n.slice(1)}if(f.length===1){g.attr("data-original-title",_l("Visualize in ")+_l(k(f[0])));g.click(j(f[0]))}else{_.each(f,function(n){i[_l(k(n))]=j(n)});make_popupmenu(g,i)}return g},_render_visualizationsFrameworkButton:function(f){if(!(this.model.hasData())||!(f&&!_.isEmpty(f))){return null}var h=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(f.length===1){var g=f[0];h.attr("data-original-title",_l("Visualize in ")+g.html);h.attr("href",g.href)}else{var i=[];_.each(f,function(j){j.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:j.href});return false}return true};i.push(j);return false});PopupMenu.create(h,i)}return h},_buildNewRender:function(){var f=a.HDABaseView.prototype._buildNewRender.call(this);f.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));f.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return f},_render_body_failed_metadata:function(){var g=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),f=$("<span/>").text(". "+_l("You may be able to")+" ").append(g),h=a.HDABaseView.prototype._render_body_failed_metadata.call(this);h.find(".warningmessagesmall strong").append(f);return h},_render_body_error:function(){var f=a.HDABaseView.prototype._render_body_error.call(this);f.find(".dataset-actions .left").prepend(this._render_errButton());return f},_render_body_ok:function(){var f=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return f}this.makeDbkeyEditLink(f);if(this.hasUser){f.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(f);this._renderAnnotation(f)}return f},_renderTags:function(f){var g=this;this.tagsEditor=new TagsEditor({model:this.model,el:f.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){g.tagsEditorShown=true},onhide:function(){g.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(f.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(f){var g=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:f.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){g.annotationEditorShown=true},onhide:function(){g.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(f.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var f=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);g.find(".dataset-dbkey .value").replaceWith(f)}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(f){this.model.undelete();return false},"click .dataset-unhide":function(f){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(f){this.model.purge();return false},toString:function(){var f=(this.model)?(this.model+""):("(no model)");return"HDAView("+f+")"}});function b(f,h,g){return function(){var i={};if(g){i["f-dbkey"]=g}$.ajax({url:f+"/list_tracks?"+$.param(i),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(j){var k=window.parent;k.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){k.Galaxy.modal.hide()},"View in saved visualization":function(){k.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:j,buttons:{Cancel:function(){k.Galaxy.modal.hide()},"Add to visualization":function(){$(k.document).find("input[name=id]:checked").each(function(){k.Galaxy.modal.hide();var l=$(this).val();h.id=l;k.Galaxy.frame.add({title:"Trackster",type:"url",content:f+"/trackster?"+$.param(h)})})}}})},"View in new visualization":function(){k.Galaxy.modal.hide();var l=f+"/trackster?"+$.param(h);k.Galaxy.frame.add({title:"Trackster",type:"url",content:l})}}})}});return false}}return{HDAEditView:e}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/tags","mvc/annotations"],function(f,b,a,e){var g=b.HDABaseView.extend(LoggableMixin).extend({initialize:function(h){b.HDABaseView.prototype.initialize.call(this,h);this.hasUser=h.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=h.tagsEditorShown||false;this.annotationEditorShown=h.annotationEditorShown||false},_render_titleButtons:function(){return b.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===f.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var j=this.model.get("purged"),h=this.model.get("deleted"),i={title:_l("Edit attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(h||j){i.disabled=true;if(j){i.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(h){i.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===f.HistoryDatasetAssociation.STATES.UPLOAD){i.disabled=true;i.title=_l("This dataset must finish uploading before it can be edited")}}i.faIcon="fa-pencil";return faIconButton(i)},_render_deleteButton:function(){if((this.model.get("state")===f.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===f.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var h=this,i={title:_l("Delete"),classes:"dataset-delete",onclick:function(){h.$el.find(".icon-btn.dataset-delete").trigger("mouseout");h.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),disabled:true}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==f.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,classes:"dataset-report-error-btn",target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,classes:"dataset-rerun-btn",target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var h=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(h))){return null}if(_.isObject(h[0])){return this._render_visualizationsFrameworkButton(h)}if(!this.urls.visualization){return null}var j=this.model.get("dbkey"),n=this.urls.visualization,k={},o={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(j){o.dbkey=j}var i=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});function l(p){if(p==="trackster"){return c(n,o,j)}return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:n+"/"+p+"?"+$.param(o)})}}function m(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(h.length===1){i.attr("data-original-title",_l("Visualize in ")+_l(m(h[0])));i.click(l(h[0]))}else{_.each(h,function(p){k[_l(m(p))]=l(p)});make_popupmenu(i,k)}return i},_render_visualizationsFrameworkButton:function(h){if(!(this.model.hasData())||!(h&&!_.isEmpty(h))){return null}var j=faIconButton({title:_l("Visualize"),classes:"dataset-visualize-btn",faIcon:"fa-bar-chart-o"});if(h.length===1){var i=h[0];j.attr("data-original-title",_l("Visualize in ")+i.html);j.attr("href",i.href)}else{var k=[];_.each(h,function(l){l.func=function(){if(Galaxy.frame.active){Galaxy.frame.add({title:"Visualization",type:"url",content:l.href});return false}return true};k.push(l);return false});PopupMenu.create(j,k)}return j},_buildNewRender:function(){var h=b.HDABaseView.prototype._buildNewRender.call(this);h.find(".dataset-deleted-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-undelete">here</a> to undelete it or <a href="javascript:void(0);" class="dataset-purge">here</a> to immediately remove it from disk'));h.find(".dataset-hidden-msg").append(_l('Click <a href="javascript:void(0);" class="dataset-unhide">here</a> to unhide it'));return h},_render_body_failed_metadata:function(){var i=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),h=$("<span/>").text(". "+_l("You may be able to")+" ").append(i),j=b.HDABaseView.prototype._render_body_failed_metadata.call(this);j.find(".warningmessagesmall strong").append(h);return j},_render_body_error:function(){var h=b.HDABaseView.prototype._render_body_error.call(this);h.find(".dataset-actions .left").prepend(this._render_errButton());return h},_render_body_ok:function(){var h=b.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return h}this.makeDbkeyEditLink(h);if(this.hasUser){h.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(h);this._renderAnnotation(h)}return h},_renderTags:function(h){var i=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:h.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.tagsEditorShown=true},onhide:function(){i.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(h){var i=this;this.annotationEditor=new e.AnnotationEditor({model:this.model,el:h.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.annotationEditorShown=true},onhide:function(){i.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(i){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){var h=$('<a class="value">?</a>').attr("href",this.urls.edit).attr("target",this.linkTarget);i.find(".dataset-dbkey .value").replaceWith(h)}},events:_.extend(_.clone(b.HDABaseView.prototype.events),{"click .dataset-undelete":function(h){this.model.undelete();return false},"click .dataset-unhide":function(h){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function d(h){this.model.purge();return false},toString:function(){var h=(this.model)?(this.model+""):("(no model)");return"HDAView("+h+")"}});function c(h,j,i){return function(){var k={};if(i){k["f-dbkey"]=i}$.ajax({url:h+"/list_tracks?"+$.param(k),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(l){var m=window.parent;m.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){m.Galaxy.modal.hide()},"View in saved visualization":function(){m.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:l,buttons:{Cancel:function(){m.Galaxy.modal.hide()},"Add to visualization":function(){$(m.document).find("input[name=id]:checked").each(function(){m.Galaxy.modal.hide();var n=$(this).val();j.id=n;m.Galaxy.frame.add({title:"Trackster",type:"url",content:h+"/trackster?"+$.param(j)})})}}})},"View in new visualization":function(){m.Galaxy.modal.hide();var n=h+"/trackster?"+$.param(j);m.Galaxy.frame.add({title:"Trackster",type:"url",content:n})}}})}});return false}}return{HDAEditView:g}});
\ No newline at end of file
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel"],function(c,a,b){var d=b.ReadOnlyHistoryPanel.extend({HDAViewClass:a.HDAEditView,initialize:function(e){e=e||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=e.selecting||false;this.annotationEditorShown=e.annotationEditorShown||false;this.tagsEditorShown=e.tagsEditorShown||false;b.ReadOnlyHistoryPanel.prototype.initialize.call(this,e)},_setUpModelEventHandlers:function(){b.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(e){this.model.fetch()},this)},renderModel:function(){var e=$("<div/>");e.append(d.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(e).text(this.emptyMsg);if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(e);this._renderAnnotation(e)}e.find(".history-secondary-actions").prepend(this._renderSelectButton());e.find(".history-dataset-actions").toggle(this.selecting);e.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(e);this.renderHdas(e);return e},_renderTags:function(e){var f=this;this.tagsEditor=new TagsEditor({model:this.model,el:e.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){f.toggleHDATagEditors(true,f.fxSpeed)},onhide:function(){f.toggleHDATagEditors(false,f.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(e.find(".history-secondary-actions"))})},_renderAnnotation:function(e){var f=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:e.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){f.toggleHDAAnnotationEditors(true,f.fxSpeed)},onhide:function(){f.toggleHDAAnnotationEditors(false,f.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(e.find(".history-secondary-actions"))})},_renderSelectButton:function(e){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(e){e=e||this.$el;b.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,e);if(!this.model){return}this._setUpDatasetActionsPopup(e);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var f=this;e.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(g){var h=f.model.get("name");if(g&&g!==h){f.$el.find(".history-name").text(g);f.model.save({name:g}).fail(function(){f.$el.find(".history-name").text(f.model.previous("name"))})}else{f.$el.find(".history-name").text(h)}}})},_setUpDatasetActionsPopup:function(e){var f=this;(new PopupMenu(e.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.hide;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Unhide datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.unhide;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Delete datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype["delete"];f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Undelete datasets"),func:function(){var g=c.HistoryDatasetAssociation.prototype.undelete;f.getSelectedHdaCollection().ajaxQueue(g)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var g=c.HistoryDatasetAssociation.prototype.purge;f.getSelectedHdaCollection().ajaxQueue(g)}}}]))},_handleHdaDeletionChange:function(e){if(e.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[e.id])}},_handleHdaVisibleChange:function(e){if(e.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[e.id])}},_createHdaView:function(f){var e=f.get("id"),g=new this.HDAViewClass({model:f,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[e],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(g);return g},_setUpHdaListeners:function(f){var e=this;b.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,f);f.on("selected",function(g){var h=g.model.get("id");e.selectedHdaIds=_.union(e.selectedHdaIds,[h])});f.on("de-selected",function(g){var h=g.model.get("id");e.selectedHdaIds=_.without(e.selectedHdaIds,h)})},toggleHDATagEditors:function(e){var f=arguments;_.each(this.hdaViews,function(g){if(g.tagsEditor){g.tagsEditor.toggle.apply(g.tagsEditor,f)}})},toggleHDAAnnotationEditors:function(e){var f=arguments;_.each(this.hdaViews,function(g){if(g.annotationEditor){g.annotationEditor.toggle.apply(g.annotationEditor,f)}})},removeHdaView:function(f){if(!f){return}var e=this;f.$el.fadeOut(e.fxSpeed,function(){f.off();f.remove();delete e.hdaViews[f.model.id];if(_.isEmpty(e.hdaViews)){e.$emptyMessage().fadeIn(e.fxSpeed,function(){e.trigger("empty-history",e)})}})},events:_.extend(_.clone(b.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":function(f){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(e){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(e);_.each(this.hdaViews,function(f){f.showSelector(e)});this.selectedHdaIds=[]},hideSelectors:function(e){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(e);_.each(this.hdaViews,function(f){f.hideSelector(e)});this.selectedHdaIds=[]},toggleSelectors:function(e){if(!this.selecting){this.showSelectors(e)}else{this.hideSelectors(e)}},selectAllDatasets:function(e){_.each(this.hdaViews,function(f){f.select(e)})},deselectAllDatasets:function(e){_.each(this.hdaViews,function(f){f.deselect(e)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(e){return e.selected})},getSelectedHdaCollection:function(){return new c.HDACollection(_.map(this.getSelectedHdaViews(),function(e){return e.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:d}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-edit","mvc/history/readonly-history-panel","mvc/tags","mvc/annotations"],function(e,b,d,a,c){var f=d.ReadOnlyHistoryPanel.extend({HDAViewClass:b.HDAEditView,initialize:function(g){g=g||{};this.selectedHdaIds=[];this.tagsEditor=null;this.annotationEditor=null;this.selecting=g.selecting||false;this.annotationEditorShown=g.annotationEditorShown||false;this.tagsEditorShown=g.tagsEditorShown||false;d.ReadOnlyHistoryPanel.prototype.initialize.call(this,g)},_setUpModelEventHandlers:function(){d.ReadOnlyHistoryPanel.prototype._setUpModelEventHandlers.call(this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);this.model.hdas.on("change:deleted",this._handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this._handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(g){this.model.fetch()},this)},renderModel:function(){var g=$("<div/>");g.append(f.templates.historyPanel(this.model.toJSON()));this.$emptyMessage(g).text(this.emptyMsg);if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(g);this._renderAnnotation(g)}g.find(".history-secondary-actions").prepend(this._renderSelectButton());g.find(".history-dataset-actions").toggle(this.selecting);g.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(g);this.renderHdas(g);return g},_renderTags:function(g){var h=this;this.tagsEditor=new a.TagsEditor({model:this.model,el:g.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDATagEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDATagEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".history-secondary-actions"))})},_renderAnnotation:function(g){var h=this;this.annotationEditor=new c.AnnotationEditor({model:this.model,el:g.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.toggleHDAAnnotationEditors(true,h.fxSpeed)},onhide:function(){h.toggleHDAAnnotationEditors(false,h.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".history-secondary-actions"))})},_renderSelectButton:function(g){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(g){g=g||this.$el;d.ReadOnlyHistoryPanel.prototype._setUpBehaviours.call(this,g);if(!this.model){return}this._setUpDatasetActionsPopup(g);if((!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var h=this;g.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(i){var j=h.model.get("name");if(i&&i!==j){h.$el.find(".history-name").text(i);h.model.save({name:i}).fail(function(){h.$el.find(".history-name").text(h.model.previous("name"))})}else{h.$el.find(".history-name").text(j)}}})},_setUpDatasetActionsPopup:function(g){var h=this;(new PopupMenu(g.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.hide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Unhide datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.unhide;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Delete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype["delete"];h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Undelete datasets"),func:function(){var i=e.HistoryDatasetAssociation.prototype.undelete;h.getSelectedHdaCollection().ajaxQueue(i)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var i=e.HistoryDatasetAssociation.prototype.purge;h.getSelectedHdaCollection().ajaxQueue(i)}}}]))},_handleHdaDeletionChange:function(g){if(g.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[g.id])}},_handleHdaVisibleChange:function(g){if(g.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[g.id])}},_createHdaView:function(h){var g=h.get("id"),i=new this.HDAViewClass({model:h,linkTarget:this.linkTarget,expanded:this.storage.get("expandedHdas")[g],selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger,tagsEditorShown:(this.tagsEditor&&!this.tagsEditor.hidden),annotationEditorShown:(this.annotationEditor&&!this.annotationEditor.hidden)});this._setUpHdaListeners(i);return i},_setUpHdaListeners:function(h){var g=this;d.ReadOnlyHistoryPanel.prototype._setUpHdaListeners.call(this,h);h.on("selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.union(g.selectedHdaIds,[j])});h.on("de-selected",function(i){var j=i.model.get("id");g.selectedHdaIds=_.without(g.selectedHdaIds,j)})},toggleHDATagEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(g){var h=arguments;_.each(this.hdaViews,function(i){if(i.annotationEditor){i.annotationEditor.toggle.apply(i.annotationEditor,h)}})},removeHdaView:function(h){if(!h){return}var g=this;h.$el.fadeOut(g.fxSpeed,function(){h.off();h.remove();delete g.hdaViews[h.model.id];if(_.isEmpty(g.hdaViews)){g.$emptyMessage().fadeIn(g.fxSpeed,function(){g.trigger("empty-history",g)})}})},events:_.extend(_.clone(d.ReadOnlyHistoryPanel.prototype.events),{"click .history-select-btn":function(g){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets","click .history-deselect-all-datasets-btn":"deselectAllDatasets"}),updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},showSelectors:function(g){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(g);_.each(this.hdaViews,function(h){h.showSelector(g)});this.selectedHdaIds=[]},hideSelectors:function(g){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(g);_.each(this.hdaViews,function(h){h.hideSelector(g)});this.selectedHdaIds=[]},toggleSelectors:function(g){if(!this.selecting){this.showSelectors(g)}else{this.hideSelectors(g)}},selectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.select(g)})},deselectAllDatasets:function(g){_.each(this.hdaViews,function(h){h.deselect(g)})},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(g){return g.selected})},getSelectedHdaCollection:function(){return new e.HDACollection(_.map(this.getSelectedHdaViews(),function(g){return g.model}),{historyId:this.model.id})},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});return{HistoryPanel:f}});
\ No newline at end of file
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/scripts/packed/mvc/tags.js
--- a/static/scripts/packed/mvc/tags.js
+++ b/static/scripts/packed/mvc/tags.js
@@ -1,1 +1,1 @@
-var TagsEditor=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(a){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(a.$activator,a)},render:function(){var a=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return a._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var a=this.model.get("tags");if(!_.isArray(a)||_.isEmpty(a)){return""}return a.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var a=this;this.$input().on("change",function(b){a.model.save({tags:b.val},{silent:true});if(b.added){a._addNewTagToTagsUsed(b.added.text+"")}})},_addNewTagToTagsUsed:function(a){var b=Galaxy.currUser.get("tags_used");if(!_.contains(b,a)){b.push(a);b.sort();Galaxy.currUser.set("tags_used",b)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});
\ No newline at end of file
+define([],function(){var a=Backbone.View.extend(LoggableMixin).extend(HiddenUntilActivatedViewMixin).extend({tagName:"div",className:"tags-display",initialize:function(b){this.listenTo(this.model,"change:tags",function(){this.render()});this.hiddenUntilActivated(b.$activator,b)},render:function(){var b=this;this.$el.html(this._template());this.$input().select2({placeholder:"Add tags",width:"100%",tags:function(){return b._getTagsUsed()}});this._setUpBehaviors();return this},_template:function(){return['<label class="prompt">',_l("Tags"),"</label>",'<input class="tags-input" value="',this.tagsToCSV(),'" />'].join("")},tagsToCSV:function(){var b=this.model.get("tags");if(!_.isArray(b)||_.isEmpty(b)){return""}return b.sort().join(",")},$input:function(){return this.$el.find("input.tags-input")},_getTagsUsed:function(){return Galaxy.currUser.get("tags_used")},_setUpBehaviors:function(){var b=this;this.$input().on("change",function(c){b.model.save({tags:c.val},{silent:true});if(c.added){b._addNewTagToTagsUsed(c.added.text+"")}})},_addNewTagToTagsUsed:function(b){var c=Galaxy.currUser.get("tags_used");if(!_.contains(c,b)){c.push(b);c.sort();Galaxy.currUser.set("tags_used",c)}},remove:function(){this.$input.off();this.stopListening(this.model);Backbone.View.prototype.remove.call(this)},toString:function(){return["TagsEditor(",this.model+"",")"].join("")}});return{TagsEditor:a}});
\ No newline at end of file
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1292,15 +1292,16 @@
.library_table th{border-bottom:2px solid #5f6990 !important}
.library_table a{color:#0A143D}.library_table a:hover{color:maroon}
tr.light td{background-color:white;color:black}
-tr.light:hover td{background-color:#A2A9C8}
-tr.dark td{background-color:#8389a1;color:white}
-tr.dark:hover td{background-color:#bbbfd0;color:white}
+tr.light:hover td{background-color:#f5e8cc}
+tr.dark td{background-color:#d6b161;color:white}
+tr.dark:hover td{background-color:#ebd4a4;color:white}
a.dark{color:white}
.modal_table tr{border-bottom:1px solid #5f6990 !important}
.modal_table th{border:none !important}
.modal_table td{border:none !important}
th.button_heading{width:2em}
#library_folder_toolbar{margin-bottom:1em}
+#library_toolbar{margin-bottom:1em}
img.expanderIcon{padding-right:4px}
input.datasetCheckbox,li,ul{padding:0;margin:0}
.rowTitle{padding:2px}
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/style/blue/library.css
--- a/static/style/blue/library.css
+++ b/static/style/blue/library.css
@@ -10,15 +10,16 @@
.library_table th{border-bottom:2px solid #5f6990 !important}
.library_table a{color:#0A143D}.library_table a:hover{color:maroon}
tr.light td{background-color:white;color:black}
-tr.light:hover td{background-color:#A2A9C8}
-tr.dark td{background-color:#8389a1;color:white}
-tr.dark:hover td{background-color:#bbbfd0;color:white}
+tr.light:hover td{background-color:#f5e8cc}
+tr.dark td{background-color:#d6b161;color:white}
+tr.dark:hover td{background-color:#ebd4a4;color:white}
a.dark{color:white}
.modal_table tr{border-bottom:1px solid #5f6990 !important}
.modal_table th{border:none !important}
.modal_table td{border:none !important}
th.button_heading{width:2em}
#library_folder_toolbar{margin-bottom:1em}
+#library_toolbar{margin-bottom:1em}
img.expanderIcon{padding-right:4px}
input.datasetCheckbox,li,ul{padding:0;margin:0}
.rowTitle{padding:2px}
diff -r fd27b9e4cda804e3bfbb9d94f076539ec1465ce5 -r 4904f18e1cb0aaeb4ed2fb838eea3a40a682e231 static/style/src/less/library.less
--- a/static/style/src/less/library.less
+++ b/static/style/src/less/library.less
@@ -52,17 +52,16 @@
}
tr.light:hover td
{
- background-color: #A2A9C8;
- // color: #8389a1;
+ background-color: #f5e8cc;
}
tr.dark td
{
- background-color: #8389a1;
+ background-color: #d6b161;
color: white;
}
tr.dark:hover td
{
- background-color: #bbbfd0;
+ background-color: #ebd4a4;
color: white;
}
a.dark
@@ -70,8 +69,6 @@
color: white;
}
-
-
.modal_table{
tr {
border-bottom: 1px solid #5f6990 !important;
@@ -84,15 +81,6 @@
}
}
-
-
-
-
-
-
-
-
-
th.button_heading
{
width: 2em;
@@ -101,6 +89,9 @@
#library_folder_toolbar {
margin-bottom: 1em;
}
+#library_toolbar {
+ margin-bottom: 1em;
+}
img.expanderIcon {
padding-right: 4px;
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.
1
0