first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
jQuery(document).ready(function () {
//var radio = jQuery('#woocommerce_bluemedia_testmode');
function api_fields_logic(radio_val) {
switch (radio_val) {
case 'yes':
setupView(true);
break;
default:
setupView(false);
break;
}
}
//api_fields_logic(jQuery('input[type=radio][name=woocommerce_bluemedia_testmode]:checked').val());
jQuery('input[type=radio][name=woocommerce_bluemedia_testmode]').on('change', function () {
api_fields_logic(jQuery(this).val());
});
function setupView(isChecked) {
if (true === isChecked) {
jQuery('#woocommerce_bluemedia_service_id').addClass('bm-disabled').prop("disabled", true);
jQuery('#woocommerce_bluemedia_private_key').addClass('bm-disabled').prop("disabled", true);
jQuery('#woocommerce_bluemedia_test_service_id').addClass('bm-disabled').prop("disabled", false);
jQuery('#woocommerce_bluemedia_test_private_key').addClass('bm-disabled').prop("disabled", false);
} else {
jQuery('#woocommerce_bluemedia_service_id').removeClass('bm-disabled').prop("disabled", false);
jQuery('#woocommerce_bluemedia_private_key').removeClass('bm-disabled').prop("disabled", false);
jQuery('#woocommerce_bluemedia_test_service_id').removeClass('bm-disabled').prop("disabled", true);
jQuery('#woocommerce_bluemedia_test_private_key').removeClass('bm-disabled').prop("disabled", true);
}
}
jQuery('.bm_ga_help_modal').click(function (e) {
e.preventDefault()
jQuery('.bm-modal-content').show();
jQuery('body').toggleClass('bm-modalbackground');
jQuery('.bm-modal-overlay').toggleClass('active');
});
jQuery('.bm-modal-content .bm-close').click(function () {
jQuery('.bm-modal-content').hide();
jQuery('body').toggleClass('bm-modalbackground');
jQuery('.bm-modal-overlay').toggleClass('active');
});
});

View File

@@ -0,0 +1,163 @@
function addCurrentClass(el) {
var canContinue = false;
const current_payment_block = el.closest('#payment');
const elements = current_payment_block.querySelectorAll(".bm-payment-channel-item > label > input[type='radio']");
const bank_group_wrap = current_payment_block.querySelector(".bm-group-expandable-wrapper");
const bank_group_radio = current_payment_block.querySelector("#bm-gateway-bank-group");
if (elements) {
elements.forEach((element) => {
if (element.checked) {
let closestItem = element.closest(".bm-payment-channel-item");
if (closestItem && closestItem.classList) {
closestItem.classList.toggle("selected");
canContinue = closestItem.classList.contains("selected");
}
if (!canContinue) {
element.checked = false
}
// hide list of "PRZELEW INTERNETOWY"
if (!isChild(element, current_payment_block.querySelector("div.bm-group-expandable-wrapper"))) {
if (bank_group_wrap && bank_group_wrap.classList) {
bank_group_wrap.classList.remove('active');
}
if (bank_group_radio && bank_group_radio.checked) {
bank_group_radio.checked = !bank_group_radio.checked;
}
}
}
current_payment_block.querySelectorAll(".bm-payment-channel-item > label > input[type='radio']").forEach((element) => {
if (element.checked === false) {
element.closest(".bm-payment-channel-item").classList.remove("selected");
}
})
});
}
if (canContinue) {
BmActivateNewOrderButton()
} else {
BmDeactivateNewOrderButton()
}
}
jQuery(document).ready(function () {
if (typeof window.blueMedia !== 'undefined') {
if (typeof blue_media_ga4_tasks !== 'undefined' && typeof blueMedia.ga4TrackingId !== 'undefined') {
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', blueMedia.ga4TrackingId);
let events = JSON.parse(blue_media_ga4_tasks)[0].events;
//console.log(events);
events.forEach((event) => {
gtag('event', event.name,
{
'items': event.params.items
}
)
});
}
}
})
function blueMediaRadioShow() {
jQuery('.payment_box.payment_method_bluemedia .payment_box.payment_method_bacs').css('display', 'block');
}
function blueMediaRadioHide() {
jQuery('.payment_box.payment_method_bluemedia .payment_box.payment_method_bacs').css('display', 'none');
};
function blueMediaRadioTest() {
if (jQuery('#payment_method_bluemedia').is(':checked')) {
blueMediaRadioShow();
}
};
document.addEventListener('click', function (e) {
e = e || window.event;
var target = e.target || e.srcElement;
const bank_group_wrap = document.querySelector(".bm-group-expandable-wrapper");
// click on PRZELEW INTERNETOWY
if (target.hasAttribute('id') && target.getAttribute('id') == 'bm-gateway-bank-group') {
if (target.checked) {
BmSelectGroupedLi()
document.querySelectorAll(".bm-group-expandable-wrapper").forEach((element) => {
if (element && element.classList) {
element.classList.add('active');
}
});
document.querySelectorAll(".bm-payment-channel-item > label > input[type='radio']").forEach((element) => {
if (element.checked) {
let closestItem = element.closest(".bm-payment-channel-item");
if (closestItem && closestItem.classList) {
closestItem.classList.remove("selected");
}
element.checked = !element.checked;
BmDeactivateNewOrderButton()
}
})
}
} else {
//console.log(target.getAttribute('class'));
if (target.hasAttribute('class') && target.getAttribute('class') !== 'bm-payment-channel-group-in-group') {
//console.log(target.getAttribute('class'));
BmDeselectGroupedLi()
}
}
});
function isChild(obj, parentObj) {
while (obj != undefined && obj != null && obj.tagName.toUpperCase() != 'BODY') {
if (obj == parentObj) {
return true;
}
obj = obj.parentNode;
}
return false;
}
function BmDeactivateNewOrderButton() {
jQuery("#place_order").prop("disabled", true); // Deaktywuj przycisk
}
function BmActivateNewOrderButton() {
jQuery("#place_order").prop("disabled", false); // Deaktywuj przycisk
}
function BmSelectGroupedLi() {
jQuery('.bm-payment-channel-group-item').addClass('bm-selected-group')
}
function BmDeselectGroupedLi() {
jQuery('.bm-payment-channel-group-item').removeClass('bm-selected-group')
}

View File

@@ -0,0 +1,225 @@
.bm-settings-banner {
border: 1px solid #c3c4c7;
position: relative;
font-size: 15px;
padding: 10px;
margin: 5px 0 15px;
background-color: white;
&-title {
padding: 5px;
background: #f0f0f1;
font-size: 15px;
font-weight: bold;
margin: 0px 0px 15px 0px;
}
&-row {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
margin: 0px 0px 15px 0px;
.bm-settings-banner-image {
width: 100px;
height: 100%;
margin: 0px 70px 0px 0px;
}
span a,
span span a {
text-decoration: none;
color: #0068B4;
}
.banner-txt {
margin-right: 55px;
height: 40px;
> a span ,
> span:last-child {
padding-left: 25px;
}
&-icon {
font-size: 15px;
margin: 0px 15px 0px 0px;
font-weight: bolder;
}
}
}
&-row-iconBox {
display: flex;
flex-direction: row;
justify-content: space-around;
margin: 0px 0px 15px 0px;
border-top: 1px solid #c3c4c7;
.bm-settings-banner-icon-box {
display: flex;
align-items: center;
justify-content: center;
height: 100px;
margin: 0px 10px 0px 0px;
a {
margin-left: 5px;
text-decoration: none;
color: #0068B4;
}
span {
font-size: 14px;
&:first-child {
align-items: center;
display: flex;
border: 2px solid #0068B4;
border-radius: 50%;
width: 20px;
padding: 10px;
margin: 0px 10px 0px 0px;
height: 20px;
justify-content: center;
}
}
}
}
}
.bm-modalbackground {
position: relative;
}
.bm-modal-content {
padding: 0px 30px 30px 30px;
display: none;
position: fixed;
width: 33.333% !important;
top: 20% !important;
left: 33.3333% !important;
background: white !important;
z-index: 2 !important;
.bm-close {
font-size: 40px;
margin: 5px;
right: 0;
position: absolute;
cursor: pointer;
}
p {
font-weight: bold;
font-size: 15px;
margin: 20px 0px;
}
}
.bm-modal-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.25);
z-index: 1;
&.active {
display: block !important;
}
}
/* label text under the radio buttons start */
label[for=no], label[for=yes] {
top: 37px;
position: absolute;
@media screen and (max-width: 782px) {
top: 46px;
}
}
input#yes[name="woocommerce_bluemedia_testmode"] {
margin-right: 20px;
}
/* label text under the radio buttons end */
.p-info {
margin-left: 234px;
display: block;
}
.woocommerce table.form-table {
th label .woocommerce-help-tip {
margin: 0px 0px 1px 4px !important;
position: relative !important;
right: unset !important;
top: unset !important;
}
}
.bm-settings-channel-list {
.bm-payment-channels-wrapper {
ul.woocommerce-shipping-methods {
> div {
> li {
> ul {
.bm-group-name {
display: block;
font-weight: bolder;
margin-bottom: 5px;
flex: 1 0 100%;
}
> li {
display: flex;
align-items: center;
column-gap: 10px;
.bm-payment-channel-method-logo img {
width: 75px;
}
}
}
}
&.bm-group-przelew-internetowy {
margin-bottom: 1em;
> li > ul {
display: flex;
flex-direction: row;
flex-wrap: wrap;
gap: 10px;
> li {
> .bm-payment-channel-method-logo img {
width: 60px !important;
height: 30px;
object-fit: cover;
}
.bm-inside-expandable-group {
display: none;
}
}
}
}
}
}
}
}
.bm_settings_no_form {
> h2,
> p,
> table {
display: none;
}
}

View File

@@ -0,0 +1,295 @@
#payment ul.wc_payment_methods {
.payment_method_bluemedia {
img {
width: 100px;
height: 80px;
object-fit: contain;
}
}
> li.wc_payment_method.payment_method_bluemedia {
img {
float: unset !important;
max-height: unset !important;
box-sizing: border-box;
}
> label {
display: inline-flex;
align-items: center;
> img {
margin-left: 15px;
}
}
> .payment_box.payment_method_bluemedia {
.payment_box.payment_method_bacs {
padding: 0;
> .bm-payment-channels-wrapper {
ul.woocommerce-shipping-methods {
display: grid;
grid-template-areas:
"blik"
"carts"
"pbl"
"wallets"
"fr"
"installment";
grid-template-rows: auto;
grid-auto-columns: auto;
> div {
margin: 8px 0;
> li {
> ul {
margin-left: 0;
li.bm-payment-channel {
&-item,
&-group-item {
padding: 5px;
border: 1px solid transparent !important;
&.selected,
&.bm-selected-group {
border: 1px solid #87ca8d !important;
}
> label {
display: flex;
align-items: center;
column-gap: 5px;
cursor: pointer;
font-size: .9em;
text-indent: initial;
min-height: 100px;
@media only screen and (max-width: 375px) {
min-height: 75px;
}
> input {
&[type="radio"] {
cursor: pointer;
margin-left: 0;
max-width: 1.5em;
}
}
.bm-payment-channel-method-logo,
.bm-payment-channel-group-method-logo {
display: initial;
height: unset;
max-width: 90px;
width: 100%;
}
.bm-payment-channel-method-name,
.bm-payment-channel-group-method-name {
word-wrap: break-word;
}
}
> span.bm-payment-channel-method-desc {
display: none;
font-size: .9em;
}
}
&-item {
&.selected {
grid-template-areas: "input label"
". desc";
> span.bm-payment-channel-method-desc {
display: block;
grid-area: desc;
margin-top: 5px;
}
}
}
}
}
}
&.bm-group {
&-blik {
grid-area: blik;
.bm-blik {
&-overlay {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9999;
background-color: rgba(255, 255, 255, 1);
border: #CCC5C5 1px solid;
border-radius: 10px;
box-shadow: 5px 5px 10px;
color: #CCC5C5;
font-size: 33px;
padding: 1.3em;
max-width: 600px;
width: 80vw;
p {
text-align: center;
&::after {
content: "";
display: block;
background-image: url("https://platnosci.bm.pl/pomoc/grafika/509.gif");
background-size: cover;
background-position: center center;
margin: 10px auto 0;
height: 55px;
width: 123px;
}
span {
display: inline-block;
&.bm-blik-overlay-status {
font-weight: bold;
&--success {
color: #0e7b17;
}
&--process {
color: #CCC5C5;
}
&--error {
color: #A7301F;
}
}
}
}
}
&-code-wrapper {
> * {
display: block;
}
input {
margin-right: 0;
width: 100%;
}
}
}
}
&-karta-platnicza,
&-platnosc-karta {
grid-area: carts;
}
&-portfel-elektroniczny,
&-przelew-internetowy {
grid-area: wallets;
}
&-pbl {
grid-area: pbl;
}
&-raty-online {
grid-area: installment;
}
&-szybki-przelew {
grid-area: fr;
}
&-apple-pay {
display: none;
}
&-expandable {
.bm-group-expandable-wrapper {
display: none;
flex-wrap: wrap;
gap: 5px;
&.active {
display: flex;
}
> li {
display: block;
position: relative;
width: auto;
> label {
display: block;
margin: 0;
min-height: unset;
@media only screen and (max-width: 375px) {
min-height: unset;
}
> input {
&[type="radio"] {
display: block !important;
height: 100%;
width: 100%;
margin-right: 0;
position: absolute;
top: 0;
left: 0;
opacity: 0;
z-index: 2;
}
}
.bm-payment-channel-method-logo {
width: 65px;
height: 65px;
object-fit: contain;
margin-left: auto;
margin-right: auto;
min-height: unset;
}
> p {
display: none;
}
}
> span.bm-payment-channel-method-desc {
margin-top: 0 !important;
}
}
}
}
}
}
}
}
}
}
}
}
/* Compatibility with Astra theme - start */
body.theme-astra {
.woocommerce-checkout #payment .payment_method_bluemedia img {
margin: 0;
}
.payment_box.payment_method_bluemedia > .bm-payment-channels-wrapper {
margin-left: 0;
}
.woocommerce .woocommerce-checkout #payment ul.wc_payment_methods li.payment_method_bluemedia ul#shipping_method li {
padding-left: 0;
}
}
/* Compatibility with Astra theme - end */