Loading ...
Sorry, an error occurred while loading the content.
 

Re: Opera _getSelection reversal

Expand Messages
  • stein.dave@ymail.com
    Ah thanks. Sorry I double posted - must have left window open or something. Good answer :)
    Message 1 of 3 , Aug 4, 2009
      Ah thanks. Sorry I double posted - must have left window open or something. Good answer :)

      --- In ydn-javascript@yahoogroups.com, Dav Glass <davglass@...> wrote:
      >
      > I am already working with Opera on this, it depends on the version of
      > Opera you are using. For a while they only supported part of the IE case
      > and part of the W3C case.. They are moving away from the IE case, but
      > not fully yet..
      >
      > Dav
      >
      > On Tue, 04 Aug 2009, stein.dave@... wrote:
      >
      > > Hey I noticed the editors selection detection has a couple lines like this:
      > >
      > > if (this._getDoc().selection) {
      > > _sel = this._getDoc().selection;
      > > } else {
      > > _sel = this._getWindow().getSelection();
      > > }
      > >
      > > I recently learned this is reversed.
      > > http://www.quirksmode.org/dom/range_intro.html
      > >
      > > So you are retrieving a textrange object instead of selection object. Obviously if I overwrite the _getSelection function it will mess up the editor. But essentially (working out the related kinks and )flipping it to :
      > >
      > > if (this._getWindow().getSelection) {
      > > _sel = this._getWindow().getSelection();
      > > } else {
      > > _sel = this._getDoc().selection;
      > > }
      > >
      > > will give _sel the actual selection along with getRangeAt and other useful functions (like Mozilla)
      > >
      > >
      >
      > --
      > Dav Glass
      > davglass@...
      > blog.davglass.com
      >
      >
      > + Windows: n. - The most successful computer virus, ever. +
      > + A computer without a Microsoft operating system is like a dog
      > without bricks tied to its head +
      > + A Microsoft Certified Systems Engineer is to computing what a
      > McDonalds Certified Food Specialist is to fine cuisine +
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.