From adc92fd31740ebe4fe66bfec32fe14ef5b736c72 Mon Sep 17 00:00:00 2001 From: anatskiy Date: Thu, 18 Aug 2016 20:34:39 +0200 Subject: [PATCH] add very basic plugin system (for tools) --- .../galaxy/scripts/mvc/tool/tool-webhooks.js | 40 +++++++++++++++++++ .../webhooks/plugin2/config/plugin2.yml | 2 +- .../plugins/webhooks/plugin2/static/style.css | 2 + 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 client/galaxy/scripts/mvc/tool/tool-webhooks.js create mode 100644 config/plugins/webhooks/plugin2/static/style.css 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) $('