mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
add very basic plugin system (for tools)
This commit is contained in:
committed by
Evgeny Anatskiy
parent
1f7a413531
commit
adc92fd317
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
Webhooks
|
||||
**/
|
||||
define([], function() {
|
||||
var galaxyRoot = typeof Galaxy != 'undefined' ? Galaxy.root : '/';
|
||||
|
||||
var WebhookModel = Backbone.Model.extend({
|
||||
urlRoot: galaxyRoot + 'api/webhooks/toolview',
|
||||
defaults: {
|
||||
name: '',
|
||||
path: ''
|
||||
}
|
||||
});
|
||||
|
||||
var WebhookView = Backbone.View.extend({
|
||||
el: '#webhook-toolview',
|
||||
webhookTemplate: _.template('<p>name: <%= name %><br>path: <%= path %></p>'),
|
||||
|
||||
initialize: function() {
|
||||
var me = this;
|
||||
this.model = new WebhookModel;
|
||||
this.model.fetch({
|
||||
success: function() {
|
||||
me.render();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var webhookContent = this.model.toJSON();
|
||||
if (webhookContent.css_styles) $('<style/>').text(webhookContent.css_styles).appendTo('head');
|
||||
this.$el.html(this.webhookTemplate(webhookContent));
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
WebhookView: WebhookView
|
||||
};
|
||||
});
|
||||
@@ -1,2 +1,2 @@
|
||||
name: Plugin 2
|
||||
type: mainview
|
||||
type: toolview
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
#webhook-toolview {border:1px solid #ccc;border-radius:3px;padding:10px;}
|
||||
#webhook-toolview p {margin-bottom:0;}
|
||||
Reference in New Issue
Block a user