Skip to content

week -3 task to be reviewed #3

Open
amanrajs wants to merge 6 commits into
masterfrom
week-3
Open

week -3 task to be reviewed #3
amanrajs wants to merge 6 commits into
masterfrom
week-3

Conversation

@amanrajs
Copy link
Copy Markdown
Owner

No description provided.

Comment thread Week-3/scripts/Render.js Outdated
}
}
function setLeftContent(fullContainer,container){
let url = `https://newsapi.org/v2/top-headlines?country=in&apiKey=ac1fd7a9fc1342abb913e554a9525d85&pageSize=20`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move url to constant file

Comment thread Week-3/scripts/constants.js Outdated
@@ -0,0 +1,17 @@
const defaultContent='Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
const defaultDescription='created at 21 July 2019""created at 21 July 2019';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can use single const declaration

Comment thread Week-3/scripts/Utility.js Outdated
window.localStorage.setItem(emailid, JSON.stringify(emailid));
alert(emailSubscribedMessage);
}
else{
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally if else block is indented as below example

if(condition) {
  //code
} else if(condition) {
  //code
} else {
  //code
}

Comment thread Week-3/scripts/Utility.js Outdated
popup.appendChild(descriptionPopup);
fullContainer.style.opacity = '0.3';
}
else if(clickEvent.srcElement.id === 'closePopup'){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally if else block is indented as below example

if(condition) {
  //code
} else if(condition) {
  //code
} else {
  //code
}

Comment thread Week-3/scripts/Update_View.js Outdated
btn.heading=contentHead;
}
else{
btn.data=data.articles[index].description;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally if else block is indented as below example

if(condition) {
  //code
} else if(condition) {
  //code
} else {
  //code
}

Comment thread Week-3/scripts/Render.js Outdated
})
.catch(function(error) {
});
fullContainer.appendChild(container);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt be this line inside the success?

Comment thread Week-3/scripts/Render.js Outdated
.catch(function(error) {
});
fullContainer.appendChild(container);
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this assignment trainer asked to keep in header only

Comment thread Week-3/scripts/Render.js Outdated
@@ -0,0 +1,41 @@
function setRightContent(article_data,fullContainer,container){
let rightContainer = document.createElement('div'),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for this function

Comment thread Week-3/scripts/Render.js Outdated
}
}
function setLeftContent(fullContainer,container){
let url = `https://newsapi.org/v2/top-headlines?country=in&apiKey=ac1fd7a9fc1342abb913e554a9525d85&pageSize=20`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for this function

Comment thread Week-3/scripts/Update_View.js Outdated
function changeContent(val,fullContainer,container){
let data=fullContainer.data;
let similar=0;
container.innerHTML = '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for this function

Comment thread Week-3/scripts/Render.js Outdated
.catch(function(error) {
});
fullContainer.appendChild(container);
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this assignment trainer asked to keep in header only

Comment thread Week-3/scripts/Render.js
@@ -0,0 +1,10 @@
function setLeftContent(fullContainer,container,newsUrl){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for the file

@@ -0,0 +1,78 @@
function changeContent(container,fullContainer){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for the file

Comment thread Week-3/scripts/Utility.js Outdated
@@ -0,0 +1,40 @@
function clicked(clickEvent,fullContainer,popup){
return clickEvent => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix indentation for the file

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mnhaque
Copy link
Copy Markdown

mnhaque commented Aug 10, 2019

looks good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants