Untitled
unknown
plain_text
3 years ago
12 kB
16
Indexable
try {
var ao06_mainLoad = setInterval(function () {
if (jQuery('.navigator > div > div > a:nth-child(1)').length > 0) {
lanzarTest();
console.log('lanzado')
clearInterval(ao06_mainLoad)
}
}, 200);
}
catch {
console.log('Error - TryCatch');
}
function trackGAEvent(eventCategory, eventAction, eventLabel) {
if ('ga' in window) {
ga.getAll()[0].send('event', {
eventCategory: eventCategory,
eventAction: eventAction,
eventLabel: eventLabel,
});
}
}
//Metrica GA
window.sendMetricGA = function (categoria, accion, etiqueta) {
trackerName = ga.getAll().map(tracker => tracker.get('name'))[0];
ga(trackerName + '.send', 'event', categoria, accion, etiqueta);
}
window.lanzarTest = function () {
if (window.location.pathname.indexOf('multifeed') != -1) {
window.applyChangesMultifeed();
}
else if (window.location.pathname.indexOf('parents_area') != -1) {
window.applyChangesParentsArea();
}
}
window.eg_overlay = (window.location.pathname.indexOf('/es') != -1 ? window.eg_overlay_es : window.eg_overlay_en);
// window.mk_lang = (window.location.pathname.indexOf('/es') != -1 ? 'es' : 'en');
window.mk_lang = (document.querySelector('#menu-button').innerText=='ES'?'es':'en');
window.style = `<style id='mk_style'>
.pagination{
margin-top: 1rem;
}
.mk-section-opt-landing:hover{
cursor: pointer;
background:rgb(227 230 242);
}
.mk-section-opt-landing{
background: #F2F4FC;
border-radius: 8px;
border: solid 3px transparent;
gap: 8px;
padding: 0.75rem 1rem;
width: 100%;
max-width:31rem;
}
.leading-tight{
align-items:center;
}
.mk-section-parentsArea{
display: flex;
align-items: center;
}
.mk-section-dbbt{
width:100%;
margin-left:0px!important;
margin-top: 0.5em;
}
.text-presentation{
color: #0C123B;
}
.mkdiv-selected{
border-radius: 10px;
border: solid 3px #455DF5;
}
.mk-outer-div{
margin-top:0px!important;
width: 100%;
max-width: 31em;
}
.title{
padding-left: 0.4em;
padding-right: 0.4em;
margin-top:0em;
}
.title-presentation {
font-size: 20px;
line-height: 20px;
}
.leading-tight{
margin-left: 1em;
margin-right: 1em;
max-width: 100%;
}
@media screen and (max-width:640px){
.mk-section-opt-landing{
width:100%;
}
}
</style>`;
if (jQuery('#mk_style').length == 0) {
jQuery(window.style).appendTo(jQuery('head'));
}
window.applyChangesMultifeed = function () {
try {
var multifeed = setInterval(function () {
if (window.location.pathname.indexOf('/multifeed') != -1 && jQuery('.mk-section-opt-landing').length == 0) {
window.applyCssMultifeed();
window.applyTextosMultifeed();
window.applyListenersMultifeed();
clearInterval(multifeed);
}
}, 1000);
}
catch {
console.log('Error- Try Catch')
}
}
window.applyTextosMultifeed = function () {
console.log('textos')
if (window.mk_lang == 'es') {
jQuery('.title').text(' ¿Cuántos años tiene tu hijo/a? ');
jQuery('.leading-tight> div:nth-child(1)>p').text('3 o menos')
jQuery('.leading-tight> div:nth-child(2)>p').text('4-6 años')
jQuery('.leading-tight> div:nth-child(3)>p').text('7 o más')
} else {
jQuery('.title').text('How old is your kid?');
jQuery('.leading-tight> div:nth-child(1)>p').text('3 & below')
jQuery('.leading-tight> div:nth-child(2)>p').text('4-5')
jQuery('.leading-tight> div:nth-child(3)>p').text('7 & above')
}
// jQuery('.title').css({'padding-left': '0.4em', 'padding-right':'0.4em'});
}
window.applyListenersMultifeed = function () {
console.log('applyListenerMultifeed()');
languageMetrics();
jQuery(document).off("mousedown", "div.mx-auto.mt-4.leading-tight > .items-center");
jQuery(document).on("mousedown", "div.mx-auto.mt-4.leading-tight > .items-center", function () {
jQuery('div.mx-auto.mt-4.leading-tight > .items-center').removeClass('mkdiv-selected')
jQuery(this).addClass('mkdiv-selected')
});
jQuery(document).off("mousedown", ".leading-tight> div:nth-child(1)");
jQuery(document).on("mousedown", ".leading-tight> div:nth-child(1)", function () {
trackGAEvent('body button', 'click button', 'personalization age 2-3');
})
jQuery(document).off("mousedown", ".leading-tight> div:nth-child(2)");
jQuery(document).on("mousedown", ".leading-tight> div:nth-child(2)", function () {
trackGAEvent('body button', 'click button', 'personalization age 4-5');
})
jQuery(document).off("mousedown", ".leading-tight> div:nth-child(3)");
jQuery(document).on("mousedown", ".leading-tight> div:nth-child(3)", function () {
trackGAEvent('body button', 'click button', 'personalization age 6-8');
})
}
window.applyCssMultifeed = function () {
jQuery('div.mx-auto.mt-4.leading-tight > .items-center').addClass('mk-section-opt-landing');
}
// Select the node that will be observed for mutations
window.targetNode = document.querySelector('.leading-tight>div');
// Options for the observer (which mutations to observe)
window.config = { attributes: true };
// Callback function to execute when mutations are observed
window.callback = (mutationList, observer) => {
for (const mutation of mutationList) {
if (mutation.type === 'attributes') {
if (targetNode.style == "display: none;") {
applyChangesParentsArea();
}
}
}
};
// Create an observer instance linked to the callback function
window.observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer.observe(targetNode, config);
// Later, you can stop observing
//observer.disconnect();
window.applyChangesParentsArea = function () {
var textosCards = [];
var cards = document.querySelectorAll('.text-presentation');
for (let i = 0; i < cards.length; i++) {
textosCards[i] = cards[i].innerText;
}
jQuery('.leading-tight>div').css({ display: 'none' });
try {
var parentsArea = setInterval(function () {
if (window.location.pathname.indexOf('/parentsArea') != -1 || jQuery('.mk-section-opt-landing').length == 0) {
var myHtml = `
<div class="mk-outer-div flex flex-col justify-between space-x-8 text-center">
<div class="space-y-2 mk-section-dbbt">
<div class='mk-section-parentsArea'>
<img class=" md:max-w-md landscape:max-w-xs" alt="A green check arrow." src="https://lingokids-api-assets-production.imgix.net/web/images/rocket.svg">
<p class="text-presentation">
`+ textosCards[0] + `
</p>
</div>
<div class='mk-section-parentsArea'>
<img class=" md:max-w-md landscape:max-w-xs" alt="A green check arrow." src="https://lingokids-api-assets-production.imgix.net/web/images/collaboration.svg">
<p class="text-presentation">
`+ textosCards[1] + `
</p>
</div>
</div>
<div class="flex flex-col space-y-2 mk-section-dbbt">
<div class='mk-section-parentsArea'>
<img class=" md:max-w-md landscape:max-w-xs" alt="A green check arrow." src="https://lingokids-api-assets-production.imgix.net/web/images/messages.svg">
<p class="text-presentation">
`+ textosCards[2] + `
</p>
</div>
<div class='mk-section-parentsArea'>
<img class=" md:max-w-md landscape:max-w-xs" alt="A green check arrow." src="https://lingokids-api-assets-production.imgix.net/web/images/cube-scan.svg">
<p class="text-presentation">
`+ textosCards[3] + `
</p>
</div>
</div>
</div>`;
window.applyTextosParentsArea();
jQuery(myHtml).appendTo(jQuery('.leading-tight'));
jQuery('.mk-section-parentsArea').addClass('mk-section-opt-landing');
jQuery(document).off("mousedown", ".leading-tight> div:nth-child(1)");
jQuery(document).off("mousedown", ".leading-tight> div:nth-child(2)");
jQuery(document).off("mousedown", ".leading-tight> div:nth-child(3)");
jQuery(document).off("mousedown", ".mk-section-dbbt:nth-child(1)> div:nth-child(1)");
jQuery(document).on("mousedown", ".mk-section-dbbt:nth-child(1)> div:nth-child(1)", function () {
sendMetricGA('body button', 'click button', 'personalization skills creativity');
})
jQuery(document).off("mousedown", ".mk-section-dbbt:nth-child(1)> div:nth-child(2)");
jQuery(document).on("mousedown", ".mk-section-dbbt:nth-child(1)> div:nth-child(2)", function () {
sendMetricGA('body button', 'click button', 'personalization skills collaboration');
})
jQuery(document).off("mousedown", ".mk-section-dbbt:nth-child(2)> div:nth-child(1)");
jQuery(document).on("mousedown", ".mk-section-dbbt:nth-child(2)> div:nth-child(1)", function () {
sendMetricGA('body button', 'click button', 'personalization skills communication');
})
jQuery(document).off("mousedown", ".mk-section-dbbt:nth-child(2)> div:nth-child(2)");
jQuery(document).on("mousedown", ".mk-section-dbbt:nth-child(2)> div:nth-child(2)", function () {
sendMetricGA('body button', 'click button', 'personalization skills critical thinking');
})
jQuery(document).off("mousedown", '.mk-section-parentsArea');
jQuery(document).on("mousedown", '.mk-section-parentsArea', function () {
if (jQuery(this).hasClass('mkdiv-selected')) {
jQuery(this).removeClass('mkdiv-selected')
}
else {
jQuery(this).addClass('mkdiv-selected')
}
});
clearInterval(parentsArea);
}
}, 200);
}
catch {
console.log('Error- Try Catch')
}
}
window.applyTextosParentsArea = function () {
if (window.mk_lang == 'es') {
jQuery('.title').text(' ¿Qué habilidades te gustaría que practicara tu hijo/a?');
} else {
jQuery('.title').text('Which skills would you like your child to practice?');
}
}
window.applyChangesFinalPage = function (pageFunction) {
try {
var parentsArea = setInterval(function () {
if (window.location.pathname.indexOf('/users/new') != -1) {
if (window.mk_lang == 'es') {
console.log('es');
jQuery('.title').text('Comienza tu aventura de aprendizaje infantil');
} else {
console.log('en');
jQuery('.title').text('Start your child’s learning adventure');
}
jQuery(document).off("mousedown", 'nav > a');
jQuery(document).on("mousedown", 'nav > a', function () {
pageFunction();
});
clearInterval(parentsArea);
}
}, 1000);
}
catch {
conFsole.log('Error- Try Catch')
}
}
function languageMetrics() {
jQuery(document).on('mousedown', '#menu-button', function () {
trackGAEvent('body button', 'click button', 'language selector');
});
jQuery(document).on('mousedown', 'nav > div.relative.inline-block.text-left > div > div.origin-top-right.absolute.right-0.rounded-md.shadow-lg> div > a:nth-child(2)'
, function () {
trackGAEvent('body button', 'click button', 'language selector_en');
});
jQuery(document).on('mousedown', 'nav > div.relative.inline-block.text-left > div > div.origin-top-right.absolute.right-0.rounded-md.shadow-lg> div > a:nth-child(3)'
, function () {
trackGAEvent('body button', 'click button', 'language selector_es');
});
jQuery(document).on('mousedown', '.eg_header > div.relative.inline-block > div.origin-top-right.absolute.rounded-md.shadow-lg.ring-black> div > a:nth-child(2)'
, function () {
trackGAEvent('body button', 'click button', 'language selector_en');
});
jQuery(document).on('mousedown', '.eg_header > div.relative.inline-block > div.origin-top-right.absolute.rounded-md.shadow-lg.ring-black> div > a:nth-child(3)'
, function () {
trackGAEvent('body button', 'click button', 'language selector_es');
});
}
Editor is loading...