fix deprecations

This commit is contained in:
Rimian Perkins 2019-08-28 18:24:55 +10:00
parent e539c34653
commit 9b2ca50671
2 changed files with 39 additions and 36 deletions

View File

@ -179,11 +179,11 @@ export default Ember.Component.extend({
didInsertElement() {
this._super();
this.get("card").mount("#card-element");
Ember.$(document).on("click", Ember.run.bind(this, this.documentClick));
jQuery(document).on("click", Ember.run.bind(this, this.documentClick));
},
willDestroyElement() {
Ember.$(document).off("click", Ember.run.bind(this, this.documentClick));
jQuery(document).off("click", Ember.run.bind(this, this.documentClick));
},
documentClick(e) {

View File

@ -6,40 +6,43 @@ export default {
const siteSettings = container.lookup("site-settings:main");
withPluginApi("0.8.12", api => {
api.decorateCooked($post => {
const $form = $post.find(".stripe-checkout");
if ($form.length) {
const $input = $form.find("input");
var s = document.createElement("script");
s.src = "https://checkout.stripe.com/checkout.js";
s.setAttribute("class", "stripe-button");
s.setAttribute(
"data-key",
siteSettings.discourse_donations_public_key
);
s.setAttribute("data-amount", $input.attr("amount"));
s.setAttribute(
"data-name",
siteSettings.discourse_donations_shop_name
);
s.setAttribute("data-description", $form.attr("content"));
s.setAttribute("data-image", $form.attr("image") || "");
s.setAttribute("data-locale", "auto");
s.setAttribute(
"data-zip-code",
siteSettings.discourse_donations_zip_code
);
s.setAttribute(
"data-billing-address",
siteSettings.discourse_donations_billing_address
);
s.setAttribute(
"data-currency",
siteSettings.discourse_donations_currency
);
$form.append(s);
}
});
api.decorateCooked(
$post => {
const $form = $post.find(".stripe-checkout");
if ($form.length) {
const $input = $form.find("input");
var s = document.createElement("script");
s.src = "https://checkout.stripe.com/checkout.js";
s.setAttribute("class", "stripe-button");
s.setAttribute(
"data-key",
siteSettings.discourse_donations_public_key
);
s.setAttribute("data-amount", $input.attr("amount"));
s.setAttribute(
"data-name",
siteSettings.discourse_donations_shop_name
);
s.setAttribute("data-description", $form.attr("content"));
s.setAttribute("data-image", $form.attr("image") || "");
s.setAttribute("data-locale", "auto");
s.setAttribute(
"data-zip-code",
siteSettings.discourse_donations_zip_code
);
s.setAttribute(
"data-billing-address",
siteSettings.discourse_donations_billing_address
);
s.setAttribute(
"data-currency",
siteSettings.discourse_donations_currency
);
$form.append(s);
}
},
{ id: "discourse-donations" }
);
if (siteSettings.discourse_donations_cause_category) {
api.decorateWidget("category-header-widget:after", helper => {