-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
84c8c52
commit 04aeb7d
Showing
77 changed files
with
9,355 additions
and
6,452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
repos: | ||
# Websec hook is MANDATORY, DO NOT comment it. | ||
- repo: https://github.com/mercadolibre/fury_websec-git-hooks | ||
rev: v1.0.5 | ||
hooks: | ||
- id: pre_commit_hook | ||
stages: [commit] | ||
- id: post_commit_hook | ||
stages: [post-commit] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
/*jshint multistr: true */ | ||
|
||
const payment_mercado_pago_basic = { | ||
initScreen: function () { | ||
if (!this.hasConfigurations()) { | ||
this.removeElements(); | ||
return; | ||
} | ||
this.setInputMaxLength(); | ||
this.setTitleDescriptionStyle(); | ||
this.setHide(); | ||
this.makeCollapsibleAdvancedConfig(); | ||
}, | ||
hasConfigurations: function () { | ||
const settings_table = document.querySelector("table.form-table"); | ||
return settings_table.hasChildNodes(); | ||
}, | ||
removeElements: function () { | ||
const settings_table = document.querySelector("table.form-table"); | ||
settings_table.previousElementSibling.remove(); | ||
settings_table.previousElementSibling.remove(); | ||
settings_table.nextElementSibling.remove(); | ||
}, | ||
setTitleDescriptionStyle: function () { | ||
//update form_fields label | ||
var label = document.querySelectorAll("th.titledesc"); | ||
for (var j = 0; j < label.length; j++) { | ||
label[j].id = "mp_field_text"; | ||
if ( | ||
label[j] && | ||
label[j].children[0] && | ||
label[j].children[0].children[0] | ||
) { | ||
label[j].children[0].children[0].style.position = "relative"; | ||
label[j].children[0].children[0].style.fontSize = "22px"; | ||
} | ||
} | ||
}, | ||
setInputMaxLength: function () { | ||
// Add max length to title input | ||
let titleInput = document.querySelectorAll(".limit-title-max-length"); | ||
titleInput.forEach((element) => { | ||
element.setAttribute("maxlength", "65"); | ||
}); | ||
}, | ||
setHide: function () { | ||
document.querySelector(".wc-admin-breadcrumb").style.display = "none"; | ||
if (document.querySelector(".mp-header-logo") !== null) { | ||
document.querySelector(".mp-header-logo").style.display = "none"; | ||
} else { | ||
var pElement = document.querySelectorAll("#mainform > p"); | ||
pElement[0] !== undefined ? (pElement[0].style.display = "none") : null; | ||
} | ||
|
||
var h2s = document.querySelectorAll("h2"); | ||
h2s[4] !== undefined ? (h2s[4].style.display = "none") : null; | ||
|
||
document.querySelectorAll(".hidden-field-mp-desc").forEach((element) => { | ||
element.closest("tr").style.display = "none"; | ||
}); | ||
}, | ||
makeCollapsibleOptions: function (id_plus, id_less) { | ||
return ( | ||
'<span class="mp-btn-collapsible" id="' + | ||
id_plus + | ||
'" style="display:block">+</span>\ | ||
<span class="mp-btn-collapsible" id="' + | ||
id_less + | ||
'" style="display:none">-</span>' | ||
); | ||
}, | ||
makeCollapsibleAdvancedConfig: function () { | ||
//collpase Configuración Avanzada | ||
var collapse_title_2 = document.querySelector( | ||
"#woocommerce_woo-mercado-pago-credits_checkout_payments_advanced_title" | ||
); | ||
var collapse_table_2 = document.querySelector( | ||
"#woocommerce_woo-mercado-pago-credits_checkout_payments_advanced_description" | ||
).nextElementSibling; | ||
var collapse_description_2 = document.querySelector( | ||
"#woocommerce_woo-mercado-pago-credits_checkout_payments_advanced_description" | ||
); | ||
collapse_table_2.style.display = "none"; | ||
collapse_description_2.style.display = "none"; | ||
collapse_title_2.style.cursor = "pointer"; | ||
|
||
collapse_title_2.innerHTML += this.makeCollapsibleOptions( | ||
"header_plus_2", | ||
"header_less_2" | ||
); | ||
|
||
var header_plus_2 = document.querySelector("#header_plus_2"); | ||
var header_less_2 = document.querySelector("#header_less_2"); | ||
|
||
collapse_title_2.onclick = function () { | ||
if (collapse_table_2.style.display === "none") { | ||
collapse_table_2.style.display = "block"; | ||
collapse_description_2.style.display = "block"; | ||
header_less_2.style.display = "block"; | ||
header_plus_2.style.display = "none"; | ||
} else { | ||
collapse_table_2.style.display = "none"; | ||
collapse_description_2.style.display = "none"; | ||
header_less_2.style.display = "none"; | ||
header_plus_2.style.display = "block"; | ||
} | ||
}; | ||
}, | ||
}; | ||
|
||
window.addEventListener("load", function () { | ||
payment_mercado_pago_basic.initScreen(); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.