The Ubiquity API doesn't provide this, but the DOM API that Ubiquity
uses does. The key is selection.getRangeAt(x) - using different values
of x. selection.rangeCount has the number of ranges (areas that are
selected). So, assuming window is the content window:
var selection = window.getSelection();
var selectedTextParts = [];
for (var i = 0; i < selection.rangeCount; i++) {
var range = selection.getRangeAt(i);
selectedTextParts.push(range.toString());
}
See here for more complex uses, like getting the DOM nodes:
https://ubiquity.mozilla.com/hg/ubiquity-firefox/file/tip/ubiquity/modules/contextutils.js
- Blair
On 30/12/09 2:14 AM, Adamantium wrote:
> How would you do multiple selection in a text ( to be precise,
> selection done using ctrl-select)
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "ubiquity-firefox" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/ubiquity-firefox?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en.