Opened 13 years ago
Closed 12 years ago
#6691 closed feature (invalid)
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;
}
Change History (3)
comment:1 Changed 13 years ago by
Component: | support → misc |
---|
comment:2 Changed 13 years ago by
Milestone: | 1.4.3 → 1.5 |
---|---|
Priority: | → low |
Status: | new → open |
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | open → closed |
Yeah, this will be a fine plugin.
I think this might be a great plugin, but adding as a valid request.