Ticket #118 (closed New Feature: fixed)

Opened 8 years ago

Last modified 8 years ago

Make the SelectAll command work in Source mode

Reported by: alfonsoml Owned by: alfonsoml
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

There's no reason why it should work if we just select the content of the textarea instead of trying to call the ExecCommand in source mode.

Change History

comment:1 Changed 8 years ago by alfonsoml

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in [152]

comment:2 Changed 8 years ago by fredck

  • Status changed from closed to reopened
  • Resolution fixed deleted

The implementation seams ok Alfonso. I would just have something to say about the place it has been done.

The editor code is separated by "components". Each one is specialized and, whenever possible, independent from each other. Then we have some "glue" components, that place everything togheter to make it run. The "FCK" object (note it is an object) is one of them.

This way of coding has been actually introduced recently and so this approach may be verified mainly on "new entries" in the code. The FCKEditingArea class (not it is a class) is one of them.

The FCKEditingArea class has a very specific task. It must render a editing area and its contents. It doesn't really do nothing with it.

In the other hand we have "Commands". We don't have interfaces on JavaScript, but this is a case where they would be applied. A set of objects that has the same design.

The commands, are the objects specialized on executing the code for a specific action. They are part of that "glue" too.

As you have well done, a specific command would be required for SelectAll, but its implementation doesn't need to be done in the FCKeditingArea, and can be done directly on FCKSelectAllCommand.prototype.Execute.

Maybe I'm wrong?!

comment:3 Changed 8 years ago by fredck

It seams that the IE implementation can be simple as:

textarea.createTextRange().execCommand( 'SelectAll' ) ;

Looking at MS's docs, execCommand is a method of document, controlRange and TextRange.

comment:4 Changed 8 years ago by anonymous

As you have well done, a specific command would be required for SelectAll, but its implementation doesn't need to be done in the FCKeditingArea, and can be done directly on FCKSelectAllCommand.prototype.Execute.

Maybe I'm wrong?!

I did coded that way, but I thought of FCKeditingArea as an object that could encapsulate such methods abstracting the implementation details, but I'll change it to leave it just as a command.

I'll review also to use

textarea.createTextRange().execCommand( 'SelectAll' ) ;

comment:5 Changed 8 years ago by alfonsoml

  • Status changed from reopened to closed
  • Resolution set to fixed

I've commited the new changes in [172]

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy