Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Style the repository queue properly.
- Loading branch information
Showing
18 changed files
with
153 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,57 @@ | ||
define(["mvc/toolshed/toolshed-model","mvc/toolshed/util"],function(a,b){var c=Backbone.View.extend({el:"#center",defaults:{tool_shed:"https://toolshed.g2.bx.psu.edu/"},initialize:function(b){var c=b.tool_shed.replace(/\//g,"%2f");this.options=_.defaults(this.options||b,this.defaults),this.model=new a.Categories,this.listenTo(this.model,"sync",this.render),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.model.tool_shed=c,this.model.fetch()},render:function(a){this.options=_.extend(this.options,a),this.options.categories=this.model.models;var b=this.templateCategoryList;this.$el.html(b(this.options)),$("#center").css("overflow","auto"),this.bindEvents()},bindEvents:function(){var a=this;require(["libs/jquery/jquery-ui"],function(){$("#search_box").autocomplete({source:function(c,d){var e=a.model.tool_shed.replace(/%2f/g,"/"),f=Galaxy.root+"api/tool_shed/search",g={term:c.term,tool_shed_url:e};$.post(f,g,function(a){console.log(a),result_list=b.shedParser(a),d(result_list)})},minLength:3,select:function(b,c){var d=c.item.value,e=(Galaxy.root+"api/tool_shed/repository",{tool_shed_url:a.model.tool_shed,tsr_id:d},"repository/s/"+a.model.tool_shed+"/r/"+d);Backbone.history.navigate(e,{trigger:!0,replace:!0})}})})},reDraw:function(a){this.$el.empty(),this.model.url=this.model.url+"?tool_shed_url="+this.options.tool_shed,this.initialize(a)},templateCategoryList:_.template(['<div class="unified-panel-header" id="panel_header" unselectable="on">','<div class="unified-panel-header-inner" style="layout: inline;">Categories in <%= tool_shed.replace(/%2f/g, "/") %></div>',"</div>",'<div class="unified-panel-body" id="list_categories">','<div id="standard-search" style="height: 2em; margin: 1em;">','<span class="ui-widget" >','<input class="search-box-input" id="search_box" data-shedurl="<%= tool_shed.replace(/%2f/g, "/") %>" name="search" placeholder="Search repositories by name or id" size="60" type="text" />',"</span>","</div>",'<div style="clear: both; margin-top: 1em;">','<table class="grid">','<thead id="grid-table-header">',"<tr>","<th>Name</th>","<th>Description</th>","<th>Repositories</th>","</tr>","</thead>","<% _.each(categories, function(category) { %>","<tr>","<td>",'<a href="#/category/s/<%= tool_shed %>/c/<%= category.get("id") %>"><%= category.get("name") %></a>',"</td>",'<td><%= category.get("description") %></td>','<td><%= category.get("repositories") %></td>',"</tr>","<% }); %>","</table>","</div>","</div>"].join(""))});return{CategoryView:c}}); | ||
//# sourceMappingURL=../../../maps/mvc/toolshed/categories-view.js.map | ||
define([ "mvc/toolshed/toolshed-model", "mvc/toolshed/util" ], function(toolshed_model, toolshed_util) { | ||
var ToolShedCategories = Backbone.View.extend({ | ||
el: "#center", | ||
defaults: { | ||
tool_shed: "https://toolshed.g2.bx.psu.edu/" | ||
}, | ||
initialize: function(options) { | ||
var shed = options.tool_shed.replace(/\//g, "%2f"); | ||
this.options = _.defaults(this.options || options, this.defaults), this.model = new toolshed_model.Categories(), | ||
this.listenTo(this.model, "sync", this.render), this.model.url = this.model.url + "?tool_shed_url=" + this.options.tool_shed, | ||
this.model.tool_shed = shed, this.model.fetch(); | ||
}, | ||
render: function(options) { | ||
this.options = _.extend(this.options, options), this.options.categories = this.model.models, | ||
this.options.queue = toolshed_util.queueLength(); | ||
var category_list_template = this.templateCategoryList; | ||
this.$el.html(category_list_template(this.options)), $("#center").css("overflow", "auto"), | ||
this.bindEvents(); | ||
}, | ||
bindEvents: function() { | ||
var that = this; | ||
require([ "libs/jquery/jquery-ui" ], function() { | ||
$("#search_box").autocomplete({ | ||
source: function(request, response) { | ||
var shed_url = that.model.tool_shed.replace(/%2f/g, "/"), base_url = Galaxy.root + "api/tool_shed/search", params = { | ||
term: request.term, | ||
tool_shed_url: shed_url | ||
}; | ||
$.post(base_url, params, function(data) { | ||
console.log(data), result_list = toolshed_util.shedParser(data), response(result_list); | ||
}); | ||
}, | ||
minLength: 3, | ||
select: function(event, ui) { | ||
var tsr_id = ui.item.value, new_route = (Galaxy.root + "api/tool_shed/repository", | ||
{ | ||
tool_shed_url: that.model.tool_shed, | ||
tsr_id: tsr_id | ||
}, "repository/s/" + that.model.tool_shed + "/r/" + tsr_id); | ||
Backbone.history.navigate(new_route, { | ||
trigger: !0, | ||
replace: !0 | ||
}); | ||
} | ||
}); | ||
}); | ||
}, | ||
reDraw: function(options) { | ||
this.$el.empty(), this.model.url = this.model.url + "?tool_shed_url=" + this.options.tool_shed, | ||
this.initialize(options); | ||
}, | ||
templateCategoryList: _.template([ '<div class="unified-panel-header" id="panel_header" unselectable="on">', '<div class="unified-panel-header-inner" style="layout: inline;">Categories in <%= tool_shed.replace(/%2f/g, "/") %></div>', '<div class="unified-panel-header-inner" style="position: absolute; right: 5px; top: 0px;"><a href="#/queue">Repository Queue (<%= queue %>)</a></div>', "</div>", '<div class="unified-panel-body" id="list_categories">', '<div id="standard-search" style="height: 2em; margin: 1em;">', '<span class="ui-widget" >', '<input class="search-box-input" id="search_box" data-shedurl="<%= tool_shed.replace(/%2f/g, "/") %>" name="search" placeholder="Search repositories by name or id" size="60" type="text" />', "</span>", "</div>", '<div style="clear: both; margin-top: 1em;">', '<table class="grid">', '<thead id="grid-table-header">', "<tr>", "<th>Name</th>", "<th>Description</th>", "<th>Repositories</th>", "</tr>", "</thead>", "<% _.each(categories, function(category) { %>", "<tr>", "<td>", '<a href="#/category/s/<%= tool_shed %>/c/<%= category.get("id") %>"><%= category.get("name") %></a>', "</td>", '<td><%= category.get("description") %></td>', '<td><%= category.get("repositories") %></td>', "</tr>", "<% }); %>", "</table>", "</div>", "</div>" ].join("")) | ||
}); | ||
return { | ||
CategoryView: ToolShedCategories | ||
}; | ||
}); |
Oops, something went wrong.