-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moved to vanilla JS #1359
base: master
Are you sure you want to change the base?
Moved to vanilla JS #1359
Conversation
Code makes same things if we suppose there is only one `<img>` inside target `<div>`
@@ -28,37 +28,54 @@ | |||
* OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*/ | |||
|
|||
/*globals $:false, document:false, window:false */ | |||
document.addEventListener('DOMContentReady', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'DOMContentReady'
with "DOMContentReady"
document.addEventListener('DOMContentReady', function () { | |
document.addEventListener("DOMContentReady", function () { |
@@ -28,20 +28,11 @@ | |||
* OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*/ | |||
|
|||
/*globals $:false, document:false, window:false */ | |||
document.addEventListener('DOMContentReady', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'DOMContentReady'
with "DOMContentReady"
document.addEventListener('DOMContentReady', function () { | |
document.addEventListener("DOMContentReady", function () { |
}) | ||
.then(function (res) { return res.text(); }) | ||
.catch(function (error) { | ||
$tail.innerText = 'Oops, an error :( Please, try to reload the page'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'Oops,·an·error·:(·Please,·try·to·reload·the·page'
with "Oops,·an·error·:(·Please,·try·to·reload·the·page"
$tail.innerText = 'Oops, an error :( Please, try to reload the page'; | |
$tail.innerText = "Oops, an error :( Please, try to reload the page"; |
} | ||
} | ||
); | ||
function needMore () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Delete ·
function needMore () { | |
function needMore() { |
); | ||
|
||
window.addEventListener('scroll', changeHandler); | ||
window.addEventListener('resize', changeHandler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'resize'
with "resize"
window.addEventListener('resize', changeHandler); | |
window.addEventListener("resize", changeHandler); |
'Content-Type': 'text/xml', | ||
}, | ||
}) | ||
.then(function (res) { return res.text(); }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace ·return·res.text();
with ⏎··········return·res.text();⏎·······
.then(function (res) { return res.text(); }) | |
.then(function (res) { |
@@ -28,20 +28,11 @@ | |||
* OF THE POSSIBILITY OF SUCH DAMAGE. | |||
*/ | |||
|
|||
/*globals $:false, document:false, window:false */ | |||
document.addEventListener('DOMContentReady', function () { | |||
var $div = document.getElementById('pulse'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'pulse'
with "pulse"
var $div = document.getElementById('pulse'); | |
var $div = document.getElementById("pulse"); |
if (data) { | ||
var parser = new DOMParser(); | ||
var $fragment = parser.parseFromString(data, 'text/xml'); | ||
var $newBox = fragment.getElementById('talks'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'talks'
with "talks"
var $newBox = fragment.getElementById('talks'); | |
var $newBox = fragment.getElementById("talks"); |
} | ||
); | ||
|
||
window.addEventListener('scroll', changeHandler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'scroll'
with "scroll"
window.addEventListener('scroll', changeHandler); | |
window.addEventListener("scroll", changeHandler); |
} | ||
$box.dataset.more = $newBox.dataset.more; | ||
$tail.style.display = 'none'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'none'
with "none"
$tail.style.display = 'none'; | |
$tail.style.display = "none"; |
|
||
if (data) { | ||
var parser = new DOMParser(); | ||
var $fragment = parser.parseFromString(data, 'text/xml'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace 'text/xml'
with "text/xml"
var $fragment = parser.parseFromString(data, 'text/xml'); | |
var $fragment = parser.parseFromString(data, "text/xml"); |
Code makes same things if we suppose there is only one
<img>
inside target<div>