mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
add semicolons
This commit is contained in:
parent
2a099b0634
commit
7521e63ef4
2 changed files with 23 additions and 24 deletions
|
@ -1,5 +1,5 @@
|
||||||
function onboardingCallback(authCode, sharedId) {
|
function onboardingCallback(authCode, sharedId) {
|
||||||
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on')
|
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on');
|
||||||
fetch(
|
fetch(
|
||||||
PayPalCommerceGatewayOnboarding.endpoint,
|
PayPalCommerceGatewayOnboarding.endpoint,
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ const checkBoxOnClick = (event) => {
|
||||||
event.target.checked = value;
|
event.target.checked = value;
|
||||||
},1
|
},1
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles the credential input fields.
|
* Toggles the credential input fields.
|
||||||
|
@ -75,7 +75,7 @@ const credentialToggle = (forProduction) => {
|
||||||
document.querySelectorAll(selectors.join()).forEach(
|
document.querySelectorAll(selectors.join()).forEach(
|
||||||
(element) => {element.classList.toggle('show')}
|
(element) => {element.classList.toggle('show')}
|
||||||
)
|
)
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles the visibility of the sandbox/production input fields.
|
* Toggles the visibility of the sandbox/production input fields.
|
||||||
|
@ -112,38 +112,38 @@ const toggleSandboxProduction = (showProduction) => {
|
||||||
if (showProduction) {
|
if (showProduction) {
|
||||||
document.querySelectorAll(productionDisplaySelectors.join()).forEach(
|
document.querySelectorAll(productionDisplaySelectors.join()).forEach(
|
||||||
(element) => {element.style.display = ''}
|
(element) => {element.style.display = ''}
|
||||||
)
|
);
|
||||||
document.querySelectorAll(sandboxDisplaySelectors.join()).forEach(
|
document.querySelectorAll(sandboxDisplaySelectors.join()).forEach(
|
||||||
(element) => {element.style.display = 'none'}
|
(element) => {element.style.display = 'none'}
|
||||||
)
|
);
|
||||||
document.querySelectorAll(productionClassSelectors.join()).forEach(
|
document.querySelectorAll(productionClassSelectors.join()).forEach(
|
||||||
(element) => {element.classList.remove('hide')}
|
(element) => {element.classList.remove('hide')}
|
||||||
)
|
);
|
||||||
document.querySelectorAll(sandboxClassSelectors.join()).forEach(
|
document.querySelectorAll(sandboxClassSelectors.join()).forEach(
|
||||||
(element) => {
|
(element) => {
|
||||||
element.classList.remove('show')
|
element.classList.remove('show');
|
||||||
element.classList.add('hide')
|
element.classList.add('hide');
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
document.querySelectorAll(productionDisplaySelectors.join()).forEach(
|
document.querySelectorAll(productionDisplaySelectors.join()).forEach(
|
||||||
(element) => {element.style.display = 'none'}
|
(element) => {element.style.display = 'none'}
|
||||||
)
|
);
|
||||||
document.querySelectorAll(sandboxDisplaySelectors.join()).forEach(
|
document.querySelectorAll(sandboxDisplaySelectors.join()).forEach(
|
||||||
(element) => {element.style.display = ''}
|
(element) => {element.style.display = ''}
|
||||||
)
|
);
|
||||||
|
|
||||||
document.querySelectorAll(sandboxClassSelectors.join()).forEach(
|
document.querySelectorAll(sandboxClassSelectors.join()).forEach(
|
||||||
(element) => {element.classList.remove('hide')}
|
(element) => {element.classList.remove('hide')}
|
||||||
)
|
);
|
||||||
document.querySelectorAll(productionClassSelectors.join()).forEach(
|
document.querySelectorAll(productionClassSelectors.join()).forEach(
|
||||||
(element) => {
|
(element) => {
|
||||||
element.classList.remove('show')
|
element.classList.remove('show');
|
||||||
element.classList.add('hide')
|
element.classList.add('hide');
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
};
|
||||||
|
|
||||||
const disconnect = (event) => {
|
const disconnect = (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
@ -166,7 +166,7 @@ const disconnect = (event) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
document.querySelector('.woocommerce-save-button').click();
|
document.querySelector('.woocommerce-save-button').click();
|
||||||
}
|
};
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on');
|
const sandboxSwitchElement = document.querySelector('#ppcp-sandbox_on');
|
||||||
|
|
|
@ -15,7 +15,7 @@ const groupToggle = (selector, group) => {
|
||||||
if (! event.target.checked) {
|
if (! event.target.checked) {
|
||||||
group.forEach( (elementToHide) => {
|
group.forEach( (elementToHide) => {
|
||||||
document.querySelector(elementToHide).style.display = 'none';
|
document.querySelector(elementToHide).style.display = 'none';
|
||||||
})
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,7 @@ const groupToggle = (selector, group) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
||||||
const groupToggleSelect = (selector, group) => {
|
const groupToggleSelect = (selector, group) => {
|
||||||
const toggleElement = document.querySelector(selector);
|
const toggleElement = document.querySelector(selector);
|
||||||
|
@ -43,7 +42,7 @@ const groupToggleSelect = (selector, group) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
domElement.style.display = 'none';
|
domElement.style.display = 'none';
|
||||||
})
|
});
|
||||||
toggleElement.addEventListener(
|
toggleElement.addEventListener(
|
||||||
'change',
|
'change',
|
||||||
(event) => {
|
(event) => {
|
||||||
|
@ -57,7 +56,7 @@ const groupToggleSelect = (selector, group) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
const disableOptions = (sourceSelector, targetSelector) => {
|
const disableOptions = (sourceSelector, targetSelector) => {
|
||||||
|
|
||||||
|
@ -87,11 +86,11 @@ const disableOptions = (sourceSelector, targetSelector) => {
|
||||||
target.append(option);
|
target.append(option);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
source.on('change',replace);
|
source.on('change',replace);
|
||||||
replace();
|
replace();
|
||||||
}
|
};
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
disableOptions('select[name="ppcp[disable_cards][]"]', 'select[name="ppcp[card_icons][]"]');
|
disableOptions('select[name="ppcp[disable_cards][]"]', 'select[name="ppcp[card_icons][]"]');
|
||||||
|
@ -258,4 +257,4 @@ const disableOptions = (sourceSelector, targetSelector) => {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
})()
|
})();
|
Loading…
Add table
Add a link
Reference in a new issue