Skip to content

Commit

Permalink
Merge pull request #288 from PluginAndPartners/master
Browse files Browse the repository at this point in the history
New release 5.3.0
  • Loading branch information
lira authored Aug 12, 2021
2 parents 069f43b + a2b5e9b commit 15ee995
Show file tree
Hide file tree
Showing 39 changed files with 4,737 additions and 3,149 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.3.0] - 2021-08-10

### Changed

- Credentials order on painel

### Added

- The seller can change checkout names

## [5.2.1] - 2021-07-28

### Changed
Expand Down
33 changes: 25 additions & 8 deletions assets/js/basic_config_mercadopago.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,34 @@ window.addEventListener('load', function() {
table[k].id = 'mp_table_' + k;
}

// Remove title and description label necessary for custom
document.querySelector('.hidden-field-mp-title').setAttribute('type', 'hidden');
document.querySelector('.hidden-field-mp-desc').setAttribute('type', 'hidden');
var removeLabel = document.querySelectorAll('#mp_table_0');
removeLabel[0].children[0].children[0].style.display = 'none';
removeLabel[0].children[0].children[1].style.display = 'none';
// Add max length to title input

let titleInput = this.document.querySelectorAll('.limit-title-max-length');

titleInput.forEach(
(element) => {
element.setAttribute('maxlength', '65');
}
);

// Remove title and description row if necessary.

document.querySelectorAll('.hidden-field-mp-title').forEach(
(element) => {
element.closest('tr').style.display = 'none';
}
);

document.querySelectorAll('.hidden-field-mp-desc').forEach(
(element) => {
element.closest('tr').style.display = 'none';
}
);

//clone save button
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_btn_save');
if (document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod') !== null) {
document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod').nextElementSibling.append(cloneSaveButton.cloneNode(true));
if (document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_credential_description_test') !== null) {
document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_credential_description_test').nextElementSibling.append(cloneSaveButton.cloneNode(true));
}

if (document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_options_title') !== null) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/basic_config_mercadopago.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 25 additions & 8 deletions assets/js/custom_config_mercadopago.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,35 @@ window.addEventListener('load', function() {
table[k].id = 'mp_table_' + k;
}

// Remove title and description label necessary for custom
document.querySelector('.hidden-field-mp-title').setAttribute('type', 'hidden');
document.querySelector('.hidden-field-mp-desc').setAttribute('type', 'hidden');
var removeLabel = document.querySelectorAll('#mp_table_0');
removeLabel[0].children[0].children[0].style.display = 'none';
removeLabel[0].children[0].children[1].style.display = 'none';
// Add max length to title input

let titleInput = this.document.querySelectorAll('.limit-title-max-length');

titleInput.forEach(
(element) => {
element.setAttribute('maxlength', '85');
}
);

// Remove title and description row if necessary.

document.querySelectorAll('.hidden-field-mp-title').forEach(
(element) => {
element.closest('tr').style.display = 'none';
}
);

document.querySelectorAll('.hidden-field-mp-desc').forEach(
(element) => {
element.closest('tr').style.display = 'none';
}
);

//clone save button
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_btn_save');

if (document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod') !== null) {
document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod').nextElementSibling.append(cloneSaveButton.cloneNode(true));
if (document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_credential_description_test') !== null) {
document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_credential_description_test').nextElementSibling.append(cloneSaveButton.cloneNode(true));
}

if (document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_custom_options_title') !== null) {
Expand Down
Loading

0 comments on commit 15ee995

Please sign in to comment.