diff --git a/client/galaxy/scripts/mvc/history/options-menu.js b/client/galaxy/scripts/mvc/history/options-menu.js index e2393347daa..48d68c1fe30 100644 --- a/client/galaxy/scripts/mvc/history/options-menu.js +++ b/client/galaxy/scripts/mvc/history/options-menu.js @@ -141,30 +141,9 @@ var menu = [ } ]; - // Webhooks +Webhooks.addToHistoryMenu(_l, menu); -var webhooks = new Webhooks.Webhooks(); -webhooks.url = Galaxy.root + 'api/webhooks/history-menu/all'; -webhooks.fetch({ - async: false, // slows down History Panel loading - success: function() { - if (webhooks.length > 0) { - menu.push({ - html : _l( 'Webhooks' ), - header : true - }); - - $.each(webhooks.models, function(index, model) { - var webhook = model.toJSON(); - menu.push({ - html : _l( webhook.config.title ), - anon : true - }); - }); - } - } -}); function buildMenu( isAnon, purgeAllowed, urlRoot ){ return _.clone( menu ).filter( function( menuOption ){ diff --git a/client/galaxy/scripts/mvc/tool/tool-form.js b/client/galaxy/scripts/mvc/tool/tool-form.js index 001f21c0e27..d3f283b841f 100644 --- a/client/galaxy/scripts/mvc/tool/tool-form.js +++ b/client/galaxy/scripts/mvc/tool/tool-form.js @@ -85,7 +85,7 @@ define([ 'utils/utils', 'mvc/ui/ui-misc', 'mvc/ui/ui-modal', 'mvc/tool/tool-form if ( response.jobs && response.jobs.length > 0 ) { self.$el.append( $( '
', { id: 'webhook-view' } ) ); var WebhookApp = new Webhooks.WebhookView({ - urlRoot: Galaxy.root + 'api/webhooks/tools' + urlRoot: Galaxy.root + 'api/webhooks/tool' }); } diff --git a/client/galaxy/scripts/mvc/webhooks.js b/client/galaxy/scripts/mvc/webhooks.js index 790ac2a1ede..55b3c938b29 100644 --- a/client/galaxy/scripts/mvc/webhooks.js +++ b/client/galaxy/scripts/mvc/webhooks.js @@ -5,7 +5,7 @@ define([], function() { var WebhookModel = Backbone.Model.extend({ defaults: { - activate: true + activate: false } }); @@ -30,29 +30,73 @@ define([], function() { render: function() { var webhook = this.model.toJSON(); - - if (webhook.type == 'masthead' && webhook.activate) { - // There must be a better way to make sure Galaxy is fully loaded - $(document).ready(function() { - Galaxy.page.masthead.collection.add({ - id : webhook.name, - icon : (typeof webhook.config.icon != 'undefined') ? webhook.config.icon : '', - url : (typeof webhook.config.url != 'undefined') ? webhook.config.url : '', - tooltip : (typeof webhook.config.tooltip != 'undefined') ? webhook.config.tooltip : '', - // visible : webhook.activate - }); - }); + if (webhook.activate) { + this.$el.html('
'); + if (webhook.styles) $('