Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Piterden
Copy link
Contributor

Code makes same things if we suppose there is only one <img> inside target <div>

Code makes same things if we suppose there is only one `<img>` inside target `<div>`
@Piterden Piterden marked this pull request as ready for review January 15, 2022 06:41
@@ -28,37 +28,54 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/*globals $:false, document:false, window:false */
document.addEventListener('DOMContentReady', function () {
Copy link
Owner

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"

Suggested change
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 () {
Copy link
Owner

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"

Suggested change
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';
Copy link
Owner

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"

Suggested change
$tail.innerText = 'Oops, an error :( Please, try to reload the page';
$tail.innerText = "Oops, an error :( Please, try to reload the page";

}
}
);
function needMore () {
Copy link
Owner

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 ·

Suggested change
function needMore () {
function needMore() {

);

window.addEventListener('scroll', changeHandler);
window.addEventListener('resize', changeHandler);
Copy link
Owner

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"

Suggested change
window.addEventListener('resize', changeHandler);
window.addEventListener("resize", changeHandler);

'Content-Type': 'text/xml',
},
})
.then(function (res) { return res.text(); })
Copy link
Owner

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();⏎·······

Suggested change
.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');
Copy link
Owner

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"

Suggested change
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');
Copy link
Owner

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"

Suggested change
var $newBox = fragment.getElementById('talks');
var $newBox = fragment.getElementById("talks");

}
);

window.addEventListener('scroll', changeHandler);
Copy link
Owner

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"

Suggested change
window.addEventListener('scroll', changeHandler);
window.addEventListener("scroll", changeHandler);

}
$box.dataset.more = $newBox.dataset.more;
$tail.style.display = 'none';
Copy link
Owner

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"

Suggested change
$tail.style.display = 'none';
$tail.style.display = "none";


if (data) {
var parser = new DOMParser();
var $fragment = parser.parseFromString(data, 'text/xml');
Copy link
Owner

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"

Suggested change
var $fragment = parser.parseFromString(data, 'text/xml');
var $fragment = parser.parseFromString(data, "text/xml");

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

Successfully merging this pull request may close these issues.

None yet

3 participants