Forum Moderators: open

Message Too Old, No Replies

How to add : Read more at [link] auto paste if article is copied

In some news websites when I try to copy an article a link of the article i

         

abdobasha2004

9:28 am on Oct 23, 2009 (gmt 0)

10+ Year Member



In some news websites when I try to copy an article a link of the article is auto pasted when I paste it
like if i copy :
"In the story so far, billionaire New York hedge fund proprietor Raj Rajaratnam has been charged, "

when I paste it gives me :

"In the story so far, billionaire New York hedge fund proprietor Raj Rajaratnam has been charged,
Read more at : whatever.com ... "

Lexur

12:42 pm on Oct 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Nice one.

abdobasha2004

12:57 pm on Oct 23, 2009 (gmt 0)

10+ Year Member



so any one knows the solution
I will be very grateful

rocknbil

3:18 pm on Oct 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nice one.

Agreed, that's a great anti- copy theft idea! Off to code one up myself . . .

abdobasha2004

4:02 am on Oct 24, 2009 (gmt 0)

10+ Year Member



It seems all like it
but nobody knows how !
ok I ll search and if find any solution I ll post it here

Fotiman

1:09 pm on Oct 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's quite easy to do when the browser is Firefox, though I've not been able to find a working solution for IE or Chrome. Perhaps someone can use this as a starting point:

<html>
<head>
<title>Using addRange to modify user selection</title>
<style type="text/css">
#addedMsg {
display: none;
}
</style>
</head>
<body>
Select any text. A key listener has been added to the window that
listens for the mouseup event, and appends a range to the
window selection. Note, the text area below makes it easier to test. Also,
because the listener is only listening for the mouseup event, it won't work
if the user selects text using another method (like with their browser's
"select all" method).
<script type="text/javascript" src="http://yui.yahooapis.com/2.8.0r4/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript">
(function () {
function modifySelectionText() {
var startNode = document.getElementById("addedMsg"),
endOffset = startNode.childNodes.length,
userSelection,
range;
if (window.getSelection) {
// This will work for Firefox
userSelection = window.getSelection();
// Append a range
range = document.createRange();
range.setStart(startNode, 0);
range.setEnd(startNode, endOffset);
userSelection.addRange(range);
}
else if (document.selection) {
// For IE, though not sure how to modify the selected text
userSelection = document.selection.createRange();
}
}
YAHOO.util.Event.on(document.body, 'mouseup', function () {
modifySelectionText();
});
})();
</script>
<form action="#">
<div>
<textarea rows="5" cols="50"></textarea>
</div>
<div id="addedMsg">This has been added</div>
</form>
</body>
</html>

Lexur

6:56 am on Oct 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No IE experts here?

Lexur

6:57 am on Oct 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



[Duplicate post - Please delete it]

swa66

10:17 am on Oct 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This sounds a lot like what tynt tracer (being renamed to tynt insight) does. Take care with patents if you live in a part of the world that recognizes software patents.