' +
'
' +
globalize.translate(
"ListItemPremiereSub",
item.planType,
item.expDate,
item.store
) +
"
" +
'
' +
globalize.translate(
"Stripe" === item.store
? item.autoRenew
? "LabelClickToCancel"
: "LabelAlreadyCancelled"
: "LabelCancelInfo",
item.store
) +
"
" +
"
" +
("" + tagName + ">")
);
});
}
function cancelSub(e) {
console.log("Cancel ");
let feature = this.getAttribute("data-feature"),
key = this.getAttribute("data-key");
confirm({
title: globalize.translate("HeaderCancelSub"),
text: globalize.translate("MessageConfirmSubCancel"),
confirmText: globalize.translate("ButtonCancelSub"),
cancelText: globalize.translate("ButtonDontCancelSub"),
primary: "cancel",
}).then(function () {
console.log("after confirm");
var postData = "key=" + key + "&feature=" + feature;
fetch("https://mb3admin.com/admin/service/stripe/requestSubCancel", {
method: "POST",
body: postData,
headers: { "Content-Type": "application/x-www-form-urlencoded" },
}).then(
function (response) {
showAlert({
text: globalize.translate("MessageSubCancelReqSent"),
title: globalize.translate("HeaderConfirmation"),
});
},
function (response) {
showAlert({
text: globalize.translate(
"MessageSubCancelError",
"cancel@emby.media"
),
});
}
);
});
}
function retrieveSupporterKey(e) {
prompt({
title: globalize.translate("HeaderForgotKey"),
label: globalize.translate("LabelEmail"),
description: globalize.translate("LabelSupporterEmailAddress"),
confirmText: globalize.translate("ButtonRetrieveKey"),
}).then(retrieveSupporterKeyFromEmail);
}
function retrieveSupporterKeyFromEmail(email) {
loading.show();
var url =
"https://mb3admin.com/admin/service/supporter/retrievekey?email=" + email;
console.log(url),
fetch(url, { method: "POST" })
.then(function (response) {
return response.json();
})
.then(function (result) {
loading.hide(),
result.Success
? showToast(
globalize.translate("MessageKeyEmailedTo").replace("{0}", email)
)
: showAlert(result.ErrorMessage),
console.log(result);
});
}
function updateSupporterKey(e) {
loading.show();
let form = this,
key = form.querySelector(".txtSupporterKey").value;
var info = { SupporterKey: key };
return (
ApiClient.updatePluginSecurityInfo(info).then(
function () {
loading.hide(),
key
? showAlert({
text: globalize.translate("MessageKeyUpdated"),
title: globalize.translate("HeaderConfirmation"),
})
: showAlert({
text: globalize.translate("MessageKeyRemoved"),
title: globalize.translate("HeaderConfirmation"),
}),
connectionManager.resetRegistrationInfo(ApiClient),
load(form.closest(".page"));
},
function () {
loading.hide(),
connectionManager.resetRegistrationInfo(ApiClient),
load(form.closest(".page"));
}
),
e.preventDefault(),
!1
);
}
function onSupporterLinkClick(e) {
registrationServices.showPremiereInfo(),
e.preventDefault(),
e.stopPropagation();
}
function View(view, params) {
BaseSettingsView.apply(this, arguments),
view
.querySelector(".supporterKeyForm")
.addEventListener("submit", updateSupporterKey),
view
.querySelector(".btnForgotKey")
.addEventListener("click", retrieveSupporterKey),
(view.querySelector(".benefits").innerHTML = globalize.translate(
"HeaderSupporterBenefit",
'