From cf1fde577e9b918bacfe2d78d9f2b632a81ee20b 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 +++++++ client/galaxy/scripts/mvc/webhooks.js | 102 ++++++++++++++++++ .../webhooks/plugin2/config/plugin2.yml | 2 +- .../plugins/webhooks/plugin2/static/style.css | 2 + lib/galaxy/webapps/galaxy/api/webhooks.py | 24 ++++- lib/galaxy/webapps/galaxy/buildapp.py | 16 +++ lib/galaxy/webhooks/__init__.py | 26 +++-- static/maps/mvc/tool/tool-webhooks.js.map | 1 + static/scripts/bundled/login.bundled.js | 2 +- static/scripts/bundled/login.bundled.js.map | 2 +- static/scripts/mvc/tool/tool-webhooks.js | 2 + 11 files changed, 206 insertions(+), 13 deletions(-) create mode 100644 client/galaxy/scripts/mvc/tool/tool-webhooks.js create mode 100644 client/galaxy/scripts/mvc/webhooks.js create mode 100644 config/plugins/webhooks/plugin2/static/style.css create mode 100644 static/maps/mvc/tool/tool-webhooks.js.map create mode 100644 static/scripts/mvc/tool/tool-webhooks.js 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) $('