Opened 18 years ago
Closed 18 years ago
#118 closed New Feature (fixed)
Make the SelectAll command work in Source mode
Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | Alfonso Martínez de Lizarrondo |
---|---|---|---|
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 (5)
comment:1 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 18 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
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 18 years ago by
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 18 years ago by
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 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
I've commited the new changes in [172]
Fixed in [152]