diff --git a/client/galaxy/scripts/mvc/tool/tool-webhooks.js b/client/galaxy/scripts/mvc/tool/tool-webhooks.js new file mode 100644 index 00000000000..c6cf2b538ea --- /dev/null +++ b/client/galaxy/scripts/mvc/tool/tool-webhooks.js @@ -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('

name: <%= name %>
path: <%= path %>

'), + + 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) $('