ALL BLOG POSTS AND COMMENTS COPYRIGHT (C) 2003-2018 VOX DAY. ALL RIGHTS RESERVED. REPRODUCTION WITHOUT WRITTEN PERMISSION IS EXPRESSLY PROHIBITED.

Monday, July 27, 2015

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:

Blogger Matthew July 27, 2015 at 2:11 PM  

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.

Blogger Matthew July 27, 2015 at 2:11 PM  

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.

Anonymous mk July 27, 2015 at 2:17 PM  

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.

Anonymous Anonymous July 27, 2015 at 2:18 PM  

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.

Anonymous Anonymous July 27, 2015 at 2:19 PM  

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?

Blogger Matthew July 27, 2015 at 2:24 PM  

@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

Blogger Matthew July 27, 2015 at 2:24 PM  

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

Anonymous Difster VFM #109 July 27, 2015 at 2:25 PM  

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.

Anonymous Lulabelle (68) July 27, 2015 at 2:27 PM  

automatthew said:
tolen from a VP comment

I didn't say anything about expecting anybody to listen to me.

Blogger Matthew July 27, 2015 at 2:28 PM  

Difster VFM #109 said:
It game me two "strong" tags.


Yeah, that's how I'm faking a blockquote.

Anonymous Lulabelle (68) July 27, 2015 at 2:28 PM  

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?

Blogger Matthew July 27, 2015 at 2:29 PM  

Lulabelle (68) said:
THIS IS COOL!! CAN WE KEEP THIS?


Probably, but it's rough and still needs some fine tuning.

Blogger Matthew July 27, 2015 at 2:30 PM  

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.

Anonymous Lulabelle (68) July 27, 2015 at 2:37 PM  

Hmm. What happens when I copy a comment and paste it into my comment archives?
Let me check.

Anonymous Lulabelle (68) July 27, 2015 at 2:39 PM  

Uh-oh. That's ugly. I now do not like this.......I think.

Blogger Matthew July 27, 2015 at 3:56 PM  

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.

Blogger rycamor July 27, 2015 at 4:46 PM  

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.


Blogger rycamor July 27, 2015 at 4:47 PM  

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.

Anonymous Lulabelle (68) July 27, 2015 at 5:24 PM  

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.

Blogger Matthew July 27, 2015 at 6:26 PM  

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.

Blogger Matthew July 27, 2015 at 6:29 PM  

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.

Blogger Matthew July 27, 2015 at 6:30 PM  

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.

Blogger rycamor July 28, 2015 at 10:13 AM  

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...

Blogger Unknown July 28, 2015 at 2:48 PM  

automatthew said:
It doesn't appear to be easy.


A test comment from Chrome in FreeBSD 10.1, with text copied from comment #20.

Blogger Unknown July 28, 2015 at 2:49 PM  

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.

Blogger Unknown July 28, 2015 at 2:52 PM  

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.

Blogger Matthew August 27, 2015 at 12:15 PM  

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!

Blogger SirHamster August 27, 2015 at 12:22 PM  

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.

Blogger SirHamster August 27, 2015 at 12:23 PM  

Copy hijack failed on IE11.

Blogger Matthew August 27, 2015 at 12:43 PM  

Well crap.

Blogger Matthew August 27, 2015 at 12:45 PM  

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.

Anonymous vfm August 27, 2015 at 12:46 PM  

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.

Blogger Matthew August 27, 2015 at 12:47 PM  

works in PaleMoon.

Anonymous Holmwood August 27, 2015 at 1:58 PM  

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.

Anonymous Holmwood August 27, 2015 at 2:00 PM  

Holmwood said:
This is a test on Windows 10, with Microsoft Edge.


Windows 10, Chrome.

Blogger Matthew August 27, 2015 at 2:43 PM  

Thanks, Holmwood.

Blogger SirHamster August 27, 2015 at 3:55 PM  

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.

Blogger Danby August 27, 2015 at 8:19 PM  

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

Blogger Danby August 27, 2015 at 8:21 PM  

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.

Blogger Danby August 27, 2015 at 8:27 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.

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

Blogger Danby August 27, 2015 at 8:29 PM  

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.

Blogger Danby August 27, 2015 at 8:29 PM  

Well, that worked.

Blogger Unknown August 27, 2015 at 9:35 PM  

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...

Blogger Cee August 27, 2015 at 11:56 PM  

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.

Blogger Cee August 27, 2015 at 11:57 PM  

Cool. It's just getting them to properly nest inside each other, but all the links appear to work.

Blogger Shimshon August 28, 2015 at 1:01 AM  

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!

Anonymous Anonymous 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.

some clown actually said this? hell, northern NY is nice.

Anonymous Anonymous August 28, 2015 at 5:22 AM  

copy hijack fails on Win8 / PaleMoon

Blogger Cee August 28, 2015 at 3:39 PM  

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

<< Home

Newer Posts Older Posts