function BlockContent(classe,where){
if($("#custom-blocks").length ==0){
$("#main").append('
');
}
$("#custom-blocks").append('');
}
setTimeout(function()
{
$('a:contains("Apoio Pedagógico")').attr('href', 'https://lojaviena.com.br/editoraviena/pagina/0FPENPNJ/Apoio-Pedagogico-Colecao-Idiomas.html');
}, 600);
var changeLayoutRodape = {
$divMethods : '',
newStructure : [],
init : function($div){
$div = $('.pay-methods.clearfix');
if ($div.length) {
this.setDiv($div);
this.setNewStructure();
this.changeStructure();
this.cleanDiv();
this.ReconstrutcDiv();
}
},
setDiv : function($div){
this.$divMethods = $div;
},
changeStructure : function(){
var self = this,
intesToMove = $.grep(self.newStructure['Outras Formas'], function(a){
var img = $(a).find('img').attr('title');
if(img != 'PagSeguro'){
return a;
}
});
$.each(intesToMove, function(index,val){
if(typeof changeLayoutRodape.newStructure['Crédito'] == 'undefined'){
changeLayoutRodape.newStructure['Crédito'] = [];
}
changeLayoutRodape.newStructure['Crédito'].push(val);
});
self.newStructure['Outras Formas'] = $.grep(self.newStructure['Outras Formas'], function(a){
var img = $(a).find('img').attr('title');
if(img == 'PagSeguro'){
return a;
}
});
},
setNewStructure : function(){
let obj = {},
tempoArray = [],
$divMethods = this.$divMethods;
$divMethods.children().each(function(){
let $divAtual = $(this),
tipo = '';
if($divAtual.hasClass('clear')){
tempoArray = [];
tipo = $divAtual;
obj[$(tipo).text()] = tempoArray;
} else {
tempoArray.push($divAtual.clone());
}
});
this.newStructure = obj;
return true;
},
cleanDiv : function(){
this.$divMethods.empty();
},
ReconstrutcDiv : function(){
self = this;
let newDiv = '';
$.each(this.newStructure,function(index,val){
newDiv = $('');
$(newDiv).append('' + index + '
');
$.each(val,function(index,val){
$(newDiv).append($(val));
});
self.$divMethods.append(newDiv);
});
}
};
var intervalId = null;
var count_interval = 0;
var h2Relacionados = null;
var trocaLabel = function(){
if(count_interval <= 500) {//5 segundos
count_interval++;
$h2Relacionados = $('#produto-gabarito > div.options-box > div.panel-head.title > h2');
if ($h2Relacionados == null || $h2Relacionados.length > 0) {
$h2Relacionados.each(function() {
$(this).text($(this).text().replace('relacionados','Relacionados'));
});
clearInterval(intervalId);
}
} else {
clearInterval(intervalId);
}
};
function changeDefaultSelecOptionOrderBY(){
if($('#select-order-by').length){
const $optionsSelectOrderBy = $('#select-order-by').children();
var defaultAZ = 0;
var optionPadrao = '';
$optionsSelectOrderBy.each(function() {
if($( this ).attr('selected') == 'selected' && $( this ).text() == 'Padrão' ){
defaultAZ = 1;
optionPadrao = $( this );
$( this ).remove();
} else if ($( this ).text() == 'Padrão'){
optionPadrao = $( this );
$( this ).remove();
}
if (defaultAZ == 1) {
if ($( this ).text() == 'A - Z') {
$( this ).attr('selected','selected');
}
}
});
optionPadrao.removeAttr('selected')
$('#select-order-by').append(optionPadrao);
}
}
$(document).ready(function(){
//if (document.URL.indexOf('/produtos-detalhes/') > 0) {
// setTimeout(function(){
//
// $('#produto-descricao').insertAfter('#innerQuantidades');
//
// if ($("#produto-gabarito").length > 0){
// $('#produto-gabarito').insertAfter('#innerObservacoes');
// }
//
// $('#produto-resumo').after(`
//
//
// Consulte-nos
//
// `);
// }, 2000);
// }
if(location.href.indexOf('contato') > -1) {
$('#main').remove();
}
$('.phone-store').append('(14) 2108-1155');
setTimeout(function() {$("a:contains('Verb List')").attr("href", "https://tabelas.vienaeditora.com.br/");}, 800);
/* Apaga o link seja um autor que estava aparecendo em Coleções */
setTimeout(function(){
$("#footer > div:nth-child(2) > div > div.col-11.col-links.criado")
let teste = $("#footer > div:nth-child(2) > div > div.col-11.col-links.criado").find('a[href$="/editoraviena/pagina/0RRMODOJ/Seja-um-Autor.html"]').remove();
}, 1000);
//$(".contact > li:first").after("WhatsApp (14) 99735-4314");
$(".wrapper-menu > .menu-header.clearfix > li:nth-child(1)").hide();
//receber novidades resumo
$(".panel-body.options-box.resumo > div > label").hide();
//OCULTAR 'CONTATO'
$(".col-links > .links-list > a:contains('Contato')").hide();
var URL_BASE = location.protocol + '//' + location.host;
changeLayoutRodape.init();
changeDefaultSelecOptionOrderBY();
intervalId = setInterval(trocaLabel, 100);
$produtoQuantidade = $('#innerQuantidades > .options-box > .panel-head.title h2');
$produtoQuantidade.text($produtoQuantidade.text().replace('(Unitário) ',''));
if ($('#produto-gabarito div.panel-head.title h2').length) {
$('#produto-gabarito div.panel-head.title h2').text('Arquivos relacionados');
}
$('.menu-header.clearfix li ul').each(function(index,val)
{
const temp = $(val).find('li');
if(temp.length == 1)
{
temp.parent().parent().parent().parent().parent().remove();
}
});
// checkPosition();
$("div.col-11.col-faq").remove();
$("div.col-3.col-page > div.static-page.box > h1.title-page").remove();
//OCULTAR REDES SOCIAS E CONTATOS RODAPE
$(".col-items").hide();
//WHATSAPP
$("#telContatoHeader").attr("href", "#");
//ENAIXAR O REDES SOCIAS TO HEADER
$(".item.first.social-item > h2").remove()
var fb = $(".item.first.social-item");
$(".row.wrapper > .col-8 > .user-actions.clearfix.phone-store > #telContatoHeader").after(fb);
//ADICIONAR COLUNA COLEÇÕES E EDITORA VIENA
var copiar = $(".col-11.col-links").clone();
$(".col-11.col-links").after(copiar);
$(".col-11.col-links:nth-child(1)").addClass("origem");
$(".col-11.col-links:nth-child(2)").addClass("criado");
$(".col-11.col-links.origem > H2").html("EDITORA VIENA");
$(".col-11.col-links.criado > H2").html("COLEÇÕES");
/* Limpa as listas */
setTimeout(function(){
$("#footer > div:nth-child(2) > div > div.col-11.col-links.origem > div").html('');
$("#footer > div:nth-child(2) > div > div.col-11.col-links.criado > div").html('');
let editoraList = `
Editora Viena | 30 Anos
Conteúdo Eixo Técnico
Apoio Pedagógico
Placement Tests
Verb List
Seja um Autor
`
let colecoesList = `
Coleção 4Teens
Coleção Special Kids
Conteúdo Eixo Técnico
Coleção My Journey
Coleção Happy Journey
Coleção NewFast English
`
$('#footer > div:nth-child(2) > div > div.col-11.col-links.origem > div').append(editoraList);
$("#footer > div:nth-child(2) > div > div.col-11.col-links.criado > div").append(colecoesList);
}, 1000);
var filtraPorIdRodape = function (id,array) {
return $link = $(array).filter(function(index,el){
var href_array = $(el).attr('href').split('/');
if (href_array.indexOf('pagina') > 0) {
return id === href_array[3];
}
});
};
//formatar coluna editoraviena
var $editoraviena = $('.links-list').first();
var links = $editoraviena.find('a').filter(function(index,el){$el = $(el);return $el.css('display') == 'block'});
var rodape_editora_links_fixos = [];
filtraPorIdRodape('8GMJOPNJ',links).length > 0 ? rodape_editora_links_fixos.push(filtraPorIdRodape('8GMJOPNJ',links).detach()) : false;
filtraPorIdRodape('0GQNMPNJ',links).length > 0 ? rodape_editora_links_fixos.push(filtraPorIdRodape('0GQNMPNJ',links).detach()) : false;
rodape_editora_links_fixos.push($('Placement Tests'));
rodape_editora_links_fixos.push($('Verb List'));
//filtraPorIdRodape('8POORFOJ',links).length > 0 ? rodape_editora_links_fixos.push(filtraPorIdRodape('8POORFOJ',links).detach()) : false;
filtraPorIdRodape('0RRMODOJ',links).length > 0 ? rodape_editora_links_fixos.push(filtraPorIdRodape('0RRMODOJ',links).detach()) : false;
filtraPorIdRodape('8HRGMPNJ',links).length > 0 ? rodape_editora_links_fixos.push(filtraPorIdRodape('8HRGMPNJ',links).detach()) : false;
filtraPorIdRodape('0QPFOPNJ',links).length > 0 ? rodape_editora_links_fixos.push(filtraPorIdRodape('0QPFOPNJ',links).detach()) : false;
$editoraviena.prepend(rodape_editora_links_fixos);
});