Skip to content

Commit

Permalink
fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowtami committed Oct 23, 2023
1 parent e6f85ba commit 7d21ccb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 45 deletions.
40 changes: 0 additions & 40 deletions blocks/columns/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ export default function decorate(block) {
// setup image columns
[...block.children].forEach((row) => {
[...row.children].forEach((col) => {
/*row.children[0].setAttribute('class', 'col recent-posts');
row.children[1].setAttribute('class', 'col recent-posts');
let colPTags = col.querySelector('p');*/

const pic = col.querySelector('picture');
if (pic) {
const picWrapper = pic.closest('div');
Expand All @@ -19,40 +15,4 @@ export default function decorate(block) {
}
});
});

const section = document.getElementsByClassName('section columns-container');
const html = section[0].innerHTML;
section[0].setAttribute('class','section columns-container outer');
const column = document.getElementsByClassName('columns-wrapper');
for(let i = 0; i < column.length; i++) {
if(column[i].children[0].classList.contains('columns-2-cols') && !column[i].children[0].classList.contains('posts')){
column[i].children[0].setAttribute('class','columns block columns-2-cols posts');
const post = column[i].children[0].children;
console.log(post);
for(let j = 0; j < post.length; j++) {
post[j].setAttribute('class','post');
//console.log(post[j].children);
const divtag = post[j].children;
for(let l = 0; l < divtag.length; l++){
const postFirstChild = divtag[l].getElementsByTagName('p');

for(let k = 0; k < postFirstChild.length; k++) {
if(k==0){
postFirstChild[1].children[1].outerHTML='<h3 class="entry-title">'+postFirstChild[1].children[1].outerHTML+'</h3>';
//console.log(postFirstChild[1].children[1]);
postFirstChild[1].outerHTML= '<div class="text">'+postFirstChild[1].innerHTML +'<p class="intro">'+postFirstChild[2].innerHTML+'</p>'+'</div>'
postFirstChild[2].innerHTML='';
postFirstChild[0].outerHTML='<h2 class="title">'+postFirstChild[0].innerHTML+'</h2>';
}
}
}

}


column[i].setAttribute('class','col recent-posts');
//console.log('col>'+col);
}
}

}
10 changes: 5 additions & 5 deletions blocks/contactus/contactus.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export default function decorate() {
if (i === 0) {

Check failure on line 11 in blocks/contactus/contactus.js

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 4 spaces but found 8
const ContactUsTitle = pTags[i].outerHTML.replace(/<p>/g, '<h2>');
innerElements += ContactUsTitle.replace(/<\/p>/g, '</h2>');
} else if (i === 1) {
innerElements +=pTags[i].outerHTML;
} else if (i === 3) {
phone = pTags[2].outerHTML.replace(/<p>/g, '<a class="phone" href="tel:' +pTags[2].innerHTML.trim()+ '">');
} else if (i === 1) {
innerElements += pTags[i].outerHTML;
} else if (i === 3) {
phone = pTags[2].outerHTML.replace(/<p>/g, '<a class="phone" href="tel:' + pTags[2].innerHTML.trim() + '">');
phone.replace(/<\/p>/g, '</a>');
pTags[i].innerHTML = '<div class="buttons">' + phone + pTags[i].innerHTML +'</div>';
pTags[i].innerHTML = '<div class="buttons">' + phone + pTags[i].innerHTML + '</div>';
const button = pTags[i].outerHTML.replace(/<p>/g, '');
innerElements += button.replace(/<\/p>/g, '');
}
Expand Down

0 comments on commit 7d21ccb

Please sign in to comment.