-
Notifications
You must be signed in to change notification settings - Fork 846
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
Removing jQuery from 7 more functions. #1105
Conversation
Adding work done while waitting for the last pull request to be accepted
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.
Sorry it took a while to get to this one. It looks really good, with only minor tweaks needed.
fetchWithCSRF('/comments/' + li.getAttribute('data-shortid') + '/disown', { | ||
method: 'post' | ||
}) | ||
.then(response => response.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.
elsewhere you do response => response.text().then(text => ...
Is there a reason this one's different?
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.
Honestly, this is easier for me to read,
.then(response => response.text())
.then(text => replace(li, text));
with each line independent of the other. If I was doing a cleanup commit I would convert them all to this formant. But I will shift it back to the other format.
} | ||
|
||
// Inserts "> " on quoted text. | ||
let sel = document.getSelection().toString() || ''; |
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.
let sel = document.getSelection().toString() || ''; | |
let sel = document.getSelection().toString(); |
getSelection
always returns an object which returns here ''
if nothing is selected
let sel = document.getSelection().toString() || ''; | ||
if (sel != "") { | ||
sel = sel.split("\n").map(s => "> " + s + '\n').join(''); | ||
sel += "\n"; |
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.
sel += "\n"; | |
sel += "\n\n"; |
We previously added two newlines after quoted text.
e32f0be
to
bd35588
Compare
Things amended to no longer require jQuery:
Bug Fixes
This leaves less than 1/2 dozen things to be replaced before we can remove the jQuery library.