Entering text when copying content from a web page

I came across a site that enters the line "Read more:" at the end of any text that you select and copy from it.

I had never seen this before and without seriously digging into my code, I can’t find a code that does this.

Does anyone know how to do this?

Example: http://peaceful-parenting.suite101.com/article.cfm/how_to_keep_kids_from_climbing_on

Copy the paragraph of the text and paste it into another application, after which the line "read more" appears.

+17
javascript clipboard
Jul 29 '09 at 21:14
source share
2 answers

Suite101 uses a third-party service called Tynt .

Tynt's code snippet is located at http://tcr.tynt.com/javascripts/Tracer.js

I have researched the source for you (with some help, an online JavaScript decoder ).

So here is what happens:

  • code is activated on events such as mouseup, mousedown, and copy (in the startListeningForTraces function)
  • If the user has selected a range of text, then he:
    • Creates HTML for attribution links plus an additional CC license URL
    • Adds this HTML to the selection, placing it at the zero size of the <div> (so that it is invisible on the screen)
    • reports that it was copied back to the Tynt servers.

Tynt code does a great job to make this work seamlessly in browsers.

+37
Jul 30 '09 at 19:18
source share

This seems to be tynt.com, which is a kind of indicator for copying text from their page.

From tynt.com

Tracer automatically adds a link to your site when content is copied and pasted. For more information: http://tracer.tynt.com/features-and-benefits-of-tracer#ixzz0MgaE6z6y licensed under Creative Commons: attribution No Derivatives

Heck ... he just added a link to the link and CC license material to the text that I copied from tynt.com.

+3
Jul 29 '09 at 21:31
source share



All Articles