Side navigation
#6691 closed feature (invalid)
Opened June 18, 2010 01:00PM UTC
Closed April 16, 2011 04:24PM UTC
Feature request: Text Selection
Reported by: | vitorhsb | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | misc | Version: | 1.4.2 |
Keywords: | text selection support | Cc: | |
Blocked by: | Blocking: |
Description
Hi everyone,
what do you think about adding the feature to retrieve/replace the text selected in a page? This would be just like retrieving/replacing text for a jQuery object, by using the text() and text("example text") accordingly, but it would only affect the selected text.
I know that there is a short code for retrieving the text (which involves verifying the suitable javascript method based on the browser) but having it with a simple jQuery shortcut it would be nice... Also, a replace text function would be awesome.
Thanks.
/************** retrieve selected text in a page *******************/
function getSelText() {
var SelText = '';
if (window.getSelection) {
SelText = window.getSelection();
} else if (document.getSelection) {
SelText = document.getSelection();
} else if (document.selection) {
SelText = document.selection.createRange().text;
}
return SelText;
}
Attachments (0)
Change History (3)
Changed August 09, 2010 02:23AM UTC by comment:1
component: | support → misc |
---|
Changed October 27, 2010 05:48PM UTC by comment:2
milestone: | 1.4.3 → 1.5 |
---|---|
priority: | → low |
status: | new → open |
I think this might be a great plugin, but adding as a valid request.
Changed April 16, 2011 04:24PM UTC by comment:3
resolution: | → invalid |
---|---|
status: | open → closed |
Yeah, this will be a fine plugin.