mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Bad conversion smashed webhooks; restore and fix.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
Webhooks
|
||||
**/
|
||||
|
||||
var WebhookModel = Backbone.Model.extend({
|
||||
defaults: {
|
||||
activate: false
|
||||
}
|
||||
});
|
||||
|
||||
var Webhooks = Backbone.Collection.extend({
|
||||
model: WebhookModel
|
||||
});
|
||||
|
||||
var WebhookView = Backbone.View.extend({
|
||||
el: "#webhook-view",
|
||||
|
||||
initialize: function(options) {
|
||||
var me = this;
|
||||
var toolId = options.toolId || "";
|
||||
var toolVersion = options.toolVersion || "";
|
||||
|
||||
this.$el.attr("tool_id", toolId);
|
||||
this.$el.attr("tool_version", toolVersion);
|
||||
|
||||
this.model = new WebhookModel();
|
||||
this.model.urlRoot = options.urlRoot;
|
||||
this.model.fetch({
|
||||
success: function() {
|
||||
me.render();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var webhook = this.model.toJSON();
|
||||
|
||||
this.$el.html('<div id="' + webhook.name + '"></div>');
|
||||
if (webhook.styles)
|
||||
$("<style/>", { type: "text/css" })
|
||||
.text(webhook.styles)
|
||||
.appendTo("head");
|
||||
if (webhook.script)
|
||||
$("<script/>", { type: "text/javascript" })
|
||||
.text(webhook.script)
|
||||
.appendTo("head");
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
var add = function(options) {
|
||||
var webhooks = new Webhooks();
|
||||
|
||||
webhooks.url = Galaxy.root + options.url;
|
||||
webhooks.fetch({
|
||||
async: options.async ? options.async : true,
|
||||
success: options.callback
|
||||
});
|
||||
};
|
||||
|
||||
export default {
|
||||
Webhooks: Webhooks,
|
||||
WebhookView: WebhookView,
|
||||
add: add
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["mvc/webhooks.js"],"names":[],"mappings":"AAAA","file":"../../scripts/mvc/webhooks.js","sourcesContent":["\"use strict\";"]}
|
||||
{"version":3,"sources":["mvc/webhooks.js"],"names":["WebhookModel","Backbone","Model","extend","defaults","activate","Collection","WebhookView","View","Webhooks","initialize","options","me","this","toolVersion","attr","toolId","model","urlRoot","$el","success","render","webhook","toJSON","html","name","styles","$","type","appendTo","script","add","webhooks","fetch","Galaxy","root","url","async","callback"],"mappings":"oEAIA,IAAIA,aAAeC,SAASC,MAAMC,QAJlCC,UAMQC,UAAU,KADdD,SAAUH,SAAAK,WAAAH,QACNE,MAAAA,eAQJE,YAAcN,SAASO,KAAKL,QAJ5BM,GAAAA,gBAAJC,WAAA,SAAAC,GAQQ,IAAIC,EAAKC,KAJbN,EAAcN,EAASO,QAAY,GAC/BM,EAD+BH,EAAAG,aAAA,GAGnCJ,KAAAA,IAAYK,KAAA,UAAAC,GACRH,KAAID,IAAKG,KAAT,eAAAD,GAEAD,KAAIC,MAAAA,IAAAA,aAMJD,KAAKI,MAAMC,QAAUP,EAAQO,QAJ7BL,KAAKM,MAAIJ,OACTK,QAAA,WAMQR,EAAGS,aAAHT,OAAAA,WACH,IAAAU,EAAAT,KAAAI,MAAAM,SAkBR,OAlCkCV,KAAAM,IAAAK,KAAA,YAAAF,EAAAG,KAAA,YAwB3BH,EAAQI,QAJRC,EAAA,YAAAC,KAAW,aACXN,KAAUA,EAAKL,QAMVY,SAAS,QAJlBP,EAASE,QACLF,EAAAA,aACAK,KAAE,oBAGFL,KAAQQ,EACNA,QAEGD,SAAS,QAGrBhB,QAIDkB,IAAIC,SAAWrB,GAAf,IAAIqB,EAAW,IAAIvB,SAGnBuB,EAASC,IAAMC,OAAAC,KAAAxB,EAAAyB,IACXC,EAAAA,OACAjB,OAAAA,EAAST,OAAQ2B,EAAAA,MAFrBlB,QAAAT,EAAA2B,6BAQA/B,SAAAA,SACAwB,YAAKA,YAALA,IAAKA","file":"../../scripts/mvc/webhooks.js","sourcesContent":["/**\n Webhooks\n**/\n\nvar WebhookModel = Backbone.Model.extend({\n defaults: {\n activate: false\n }\n});\n\nvar Webhooks = Backbone.Collection.extend({\n model: WebhookModel\n});\n\nvar WebhookView = Backbone.View.extend({\n el: \"#webhook-view\",\n\n initialize: function(options) {\n var me = this;\n var toolId = options.toolId || \"\";\n var toolVersion = options.toolVersion || \"\";\n\n this.$el.attr(\"tool_id\", toolId);\n this.$el.attr(\"tool_version\", toolVersion);\n\n this.model = new WebhookModel();\n this.model.urlRoot = options.urlRoot;\n this.model.fetch({\n success: function() {\n me.render();\n }\n });\n },\n\n render: function() {\n var webhook = this.model.toJSON();\n\n this.$el.html('<div id=\"' + webhook.name + '\"></div>');\n if (webhook.styles)\n $(\"<style/>\", { type: \"text/css\" })\n .text(webhook.styles)\n .appendTo(\"head\");\n if (webhook.script)\n $(\"<script/>\", { type: \"text/javascript\" })\n .text(webhook.script)\n .appendTo(\"head\");\n\n return this;\n }\n});\n\nvar add = function(options) {\n var webhooks = new Webhooks();\n\n webhooks.url = Galaxy.root + options.url;\n webhooks.fetch({\n async: options.async ? options.async : true,\n success: options.callback\n });\n};\n\nexport default {\n Webhooks: Webhooks,\n WebhookView: WebhookView,\n add: add\n};\n"]}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
webpackJsonp([4],{116:function(e,t,i){"use strict";(function(e,t){function a(e){return e&&e.__esModule?e:{default:e}}var n=i(0),r=a(n),o=i(42),l=i(4),u=a(l),d=i(43),c=a(d),p=r.default;window.app=function(i,a){window.Galaxy=new o.GalaxyApp(i,a),Galaxy.debug("login app");var n=encodeURI(i.redirect);if(!i.show_welcome_with_login){var l=r.default.param({use_panels:"True",redirect:n});return void(window.location.href=Galaxy.root+"user/login?"+l)}var d=e.View.extend({initialize:function(t){this.page=t,this.model=new e.Model({title:(0,u.default)("Login required")}),this.setElement(this._template())},render:function(){this.page.$("#galaxy_main").prop("src",i.welcome_url)},_template:function(){return'<iframe src="'+i.root+"user/login?"+p.param({redirect:n})+'" frameborder="0" style="width: 100%; height: 100%;"/>'}});p(function(){Galaxy.page=new c.default.View(t.extend(i,{Right:d}))})}}).call(t,i(2),i(1))}},[116]);
|
||||
webpackJsonp([4],{116:function(e,t,i){"use strict";(function(e,t){function a(e){return e&&e.__esModule?e:{default:e}}var n=i(0),r=a(n),o=i(42),l=i(4),u=a(l),d=i(43),c=a(d),p=r.default;window.app=function(i,a){window.Galaxy=new o.GalaxyApp(i,a),Galaxy.debug("login app");var n=encodeURI(i.redirect);if(!i.show_welcome_with_login){var l=r.default.param({use_panels:"True",redirect:n});return void(window.location.href=Galaxy.root+"user/login?"+l)}var d=e.View.extend({initialize:function(t){this.page=t,this.model=new e.Model({title:(0,u.default)("Login required")}),this.setElement(this._template())},render:function(){this.page.$("#galaxy_main").prop("src",i.welcome_url)},_template:function(){return'<iframe src="'+i.root+"user/login?"+p.param({redirect:n})+'" frameborder="0" style="width: 100%; height: 100%;"/>'}});p(function(){Galaxy.page=new c.default.View(t.extend(i,{Right:d}))})}}).call(t,i(1),i(2))}},[116]);
|
||||
//# sourceMappingURL=login.bundled.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,2 +1,2 @@
|
||||
"use strict";
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var WebhookModel=Backbone.Model.extend({defaults:{activate:!1}}),Webhooks=Backbone.Collection.extend({model:WebhookModel}),WebhookView=Backbone.View.extend({el:"#webhook-view",initialize:function(e){var o=this,t=e.toolId||"",s=e.toolVersion||"";this.$el.attr("tool_id",t),this.$el.attr("tool_version",s),this.model=new WebhookModel,this.model.urlRoot=e.urlRoot,this.model.fetch({success:function(){o.render()}})},render:function(){var e=this.model.toJSON();return this.$el.html('<div id="'+e.name+'"></div>'),e.styles&&$("<style/>",{type:"text/css"}).text(e.styles).appendTo("head"),e.script&&$("<script/>",{type:"text/javascript"}).text(e.script).appendTo("head"),this}}),add=function(e){var o=new Webhooks;o.url=Galaxy.root+e.url,o.fetch({async:!e.async||e.async,success:e.callback})};exports.default={Webhooks:Webhooks,WebhookView:WebhookView,add:add};
|
||||
//# sourceMappingURL=../../maps/mvc/webhooks.js.map
|
||||
|
||||
Reference in New Issue
Block a user