Faking a comment-reply system.
Instructions
Copy some portion of a comment, then paste into the comment field. What you paste should be wrapped in some HTML tags. Add your commentary below.Explanation
I'm trying to devise a way to make it easy to attribute and link back to a comment you're responding to.
The current approach hijacks the Copy action when you have a section of a comment body selected. It prepends an attribution like "Matthew said:", then wraps the selected text in some HTML tags. This becomes apparent when you paste.
I've also altered the CSS to display the tag-wrapped body in a way that makes it apparent that we're simulating a block quote.
Amusing technical note. As Blogger forbids the BLOCKQUOTE tag, I'm using a double STRONG tag instead. Then the formatting uses a very specific CSS selector:
.comment-body > p > strong > strong
49 Comments:
Stolen from a VP comment
I didn't say anything about expecting anybody to listen to me.
I would point out, however, that the term Second World does not have such an established meaning, as evidenced by the confusion it has caused here.
As it happens in the late 60's and early 70's I lived in the boonies of southern Mexico, but also spent some time in a state capital. Moving into the mid 70's I lived in the boonies outside of Huelva, which it shares with Jerez, but also spent some time in Malaga and Seville.
I have also lived extensively in the boonies of northern NY and southern Vermont and my experience is that once you've seen one backwater shithole where people shit in a hole in the ground you've pretty much seen 'em all. And they exist everywhere.
automatthew said:
I would point out, however, that the term Second World does not have such an established meaning, as evidenced by the confusion it has caused here.
As it happens in the late 60's and early 70's I lived in the boonies of southern Mexico, but also spent some time in a state capital. Moving into the mid 70's I lived in the boonies outside of Huelva, which it shares with Jerez, but also spent some time in Malaga and Seville.
automatthew said:
As it happens in the late 60's and early 70's I lived in the boonies of southern Mexico, but also spent some time in a state capital. Moving into the mid 70's I lived in the boonies outside of Huelva, which it shares with Jerez, but also spent some time in Malaga and Seville.
tested with Palemoon on Mac.
mk said:
automatthew said:
Testing when you select the attribution and quote.
As it happens in the late 60's and early 70's I lived in the boonies of southern Mexico, but also spent some time in a state capital. Moving into the mid 70's I lived in the boonies outside of Huelva, which it shares with Jerez, but also spent some time in Malaga and Seville.
mk said:
automatthew said:
As it happens in the late 60's and early 70's I lived in the boonies of southern Mexico, but also spent some time in a state capital. Moving into the mid 70's I lived in the boonies outside of Huelva, which it shares with Jerez, but also spent some time in Malaga and Seville.
WHat?
@38
"Of course, it's illegal to discriminate. Genoism. But no one pays attention to the law..."
@48
You've probably seen this many times, but http://readwrite.com/2014/01/24/github-meritocracy-rug
automatthew said:
@38
"Of course, it's illegal to discriminate. Genoism. But no one pays attention to the law..."
@48
You've probably seen this many times, but http://readwrite.com/2014/01/24/github-meritocracy-rug
automatthew said:
As it happens in the late 60's and early 70's I lived in the boonies of southern Mexico, but also spent some time in a state capital. Moving into the mid 70's I lived in the boonies outside of Huelva, which it shares with Jerez, but also spent some time in Malaga and Seville.
It game me two "strong" tags.
automatthew said:
tolen from a VP comment
I didn't say anything about expecting anybody to listen to me.
Difster VFM #109 said:
It game me two "strong" tags.
Yeah, that's how I'm faking a blockquote.
I did just as you said - and I'm not smart enough to understand the rest of what you guys are talking about................but...........THIS IS COOL!! CAN WE KEEP THIS?
PLEASE?
Lulabelle (68) said:
THIS IS COOL!! CAN WE KEEP THIS?
Probably, but it's rough and still needs some fine tuning.
e.g. copying from a comment will ALWAYS include the HTML tags. Which could be disconcerting if you want to use the copied text elsewhere.
Hmm. What happens when I copy a comment and paste it into my comment archives?
Let me check.
Uh-oh. That's ugly. I now do not like this.......I think.
Lulabelle (68) said:
Uh-oh. That's ugly. I now do not like this.......I think.
Perhaps I could have a toggle button in the comment header that enables/disables the feature. It's one extra step, and an ugly one, but avoids the surprise.
How about this:
automatthew said:
Stolen from a VP comment
I didn't say anything about expecting anybody to listen to me.
I would point out, however, that the term Second World does not have such an established meaning, as evidenced by the confusion it has caused here.
automatthew said:
Lulabelle (68) said:
Uh-oh. That's ugly. I now do not like this.......I think.
Perhaps I could have a toggle button in the comment header that enables/disables the feature. It's one extra step, and an ugly one, but avoids the surprise.
Or you could just add a key command, like CTRL-ALT-C to copy plain text.
automatthew said:
Perhaps I could have a toggle button in the comment header that enables/disables the feature. It's one extra step, and an ugly one, but avoids the surprise.
That would be awesome! Or what rycamor said........otherwise, I have to delete all the extraneous .........um........whatever-that-is........text from the quote.
rycamor said:
Or you could just add a key command, like CTRL-ALT-C to copy plain text.
I spent about an hour trying to do that the opposite way, having the Decorated Reply Copy only happen when the Shift key was held down. It doesn't appear to be easy.
To elaborate, browsers can't directly tell you what keys are held down. You have to intercept "keydown" and "keyup" events. All of them.
When intercepting, you can choose to allow them to pass on, or to hoard them to yourself. But apparently you can't decide whether to pass or hoard based on the exact key pressed.
I suspect there's a way to manage this, but I couldn't figure it quickly.
rycamor, in case you didn't already know, the major problem I'm working around here is that Blogger comment form is in a cross-domain iframe.
automatthew said:
rycamor, in case you didn't already know, the major problem I'm working around here is that Blogger comment form is in a cross-domain iframe.
Oh hell...
automatthew said:
It doesn't appear to be easy.
A test comment from Chrome in FreeBSD 10.1, with text copied from comment #20.
A test with text copied from another part of the page. Works fine, just copies as normal.
Copy some portion of a comment, then paste into the comment field.
automatthew said:
I would point out, however, that the term Second World does not have such an established meaning, as evidenced by the confusion it has caused here.
This is text copied from #2, which had been copied from #1. Looks like it links to #2, which is fine. Linking back to the actual original would be pretty tough, if not impossible.
Cail Corishev said:
This is text copied from #2, which had been copied from #1. Looks like it links to #2, which is fine. Linking back to the actual original would be pretty tough, if not impossible.
It still works!
Cail Corishev said:
This is text copied from #2, which had been copied from #1. Looks like it links to #2, which is fine. Linking back to the actual original would be pretty tough, if not impossible.
Test.
Copy hijack failed on IE11.
Well crap.
I have no access to any Windows boxes, nor do I plan to play with the MS IE VM images. If somebody who groks JS and the DOM and cares about IE wishes to pitch in, I'll accept help.
automatthew said:
I have no access to any Windows boxes, nor do I plan to play with the MS IE VM images. If somebody who groks JS and the DOM and cares about IE wishes to pitch in, I'll accept help.
Of course, you do need to copy something.
works in PaleMoon.
automatthew said:
I have no access to any Windows boxes, nor do I plan to play with the MS IE VM images. If somebody who groks JS and the DOM and cares about IE wishes to pitch in, I'll accept help.
This is a test on Windows 10, with Microsoft Edge.
Holmwood said:
This is a test on Windows 10, with Microsoft Edge.
Windows 10, Chrome.
Thanks, Holmwood.
Holmwood said:
automatthew said:
I have no access to any Windows boxes, nor do I plan to play with the MS IE VM images. If somebody who groks JS and the DOM and cares about IE wishes to pitch in, I'll accept help.
This is a test on Windows 10, with Microsoft Edge.
Win 7, Pale Moon.
SirHamster (#201) said:
Holmwood said:
automatthew said:
I have no access to any Windows boxes, nor do I plan to play with the MS IE VM images. If somebody who groks JS and the DOM and cares about IE wishes to pitch in, I'll accept help.
This is a test on Windows 10, with Microsoft Edge.
Win 7, Pale Moon.
Linux Mint, FF whatever the current version is
So, nesting doesn't work, but the blockquote does
Here's Linux Mint 17.2 with chrome:
SirHamster (#201) said:
This is text copied from #2, which had been copied from #1. Looks like it links to #2, which is fine. Linking back to the actual original would be pretty tough, if not impossible.
I have also lived extensively in the boonies of northern NY and southern Vermont and my experience is that once you've seen one backwater shithole where people shit in a hole in the ground you've pretty much seen 'em all.
Opera on Linux Mint.
Chokes completely on trying to log in to google, throws garbage on the screen and insults your mother. But going back to the source page shows me logged in, so I'll post it
Opera does not show the block quote. I will try again, without the google interlude between copy and paste.
Danby said:
I have also lived extensively in the boonies of northern NY and southern Vermont and my experience is that once you've seen one backwater shithole where people shit in a hole in the ground you've pretty much seen 'em all.
Well, that worked.
automatthew said:
I would point out, however, that the term Second World does not have such an established meaning, as evidenced by the confusion it has caused here.
Testing...
Danby said:
SirHamster (#201) said:
Holmwood said:
automatthew said:
I have no access to any Windows boxes, nor do I plan to play with the MS IE VM images. If somebody who groks JS and the DOM and cares about IE wishes to pitch in, I'll accept help.
This is a test on Windows 10, with Microsoft Edge.
Win 7, Pale Moon.
Linux Mint, FF whatever the current version is
SUPER NESTING.
Firefox 40.0.2, Mac running Yosemite.
Cool. It's just getting them to properly nest inside each other, but all the links appear to work.
Arch Linux.
Danby said:
I have also lived extensively in the boonies of northern NY and southern Vermont and my experience is that once you've seen one backwater shithole where people shit in a hole in the ground you've pretty much seen 'em all.
Sweet!
1. automatthew July 27, 2015 at 2:11 PM
I have also lived extensively in the boonies of northern NY and southern Vermont and my experience is that once you've seen one backwater shithole where people shit in a hole in the ground you've pretty much seen 'em all. And they exist everywhere.
some clown actually said this? hell, northern NY is nice.
copy hijack fails on Win8 / PaleMoon
47. bob k. mando August 28, 2015 at 5:20 AM
1. automatthew July 27, 2015 at 2:11 PM
I have also lived extensively in the boonies of northern NY and southern Vermont and my experience is that once you've seen one backwater shithole where people shit in a hole in the ground you've pretty much seen 'em all. And they exist everywhere.
bob, try again but don't copy the header of the comment. It looks like the copy hijack fails when you do, since it was working for me earlier.
In fact:
bob k. mando said:
1. automatthew July 27, 2015 at 2:11 PM
I have also lived extensively in the boonies of northern NY and southern Vermont and my experience is that once you've seen one backwater shithole where people shit in a hole in the ground you've pretty much seen 'em all. And they exist everywhere.
If I don't grab the header of your comment, it works fine.
Post a Comment
NO ANONYMOUS COMMENTS. Anonymous comments will be deleted.
DO NOT RESPOND TO ANONYMOUS COMMENTS. You will be punished.
Rules of the blog