Ticket #7 (closed New Feature: fixed)

Opened 21 months ago

Last modified 21 months ago

New sample file

Reported by: alfonso@… Owned by: alfonso@…
Priority: Normal Milestone: FCKeditor 2.4
Component: General Version:
Keywords: Cc:

Description

Based on https://sourceforge.net/tracker/index.php?func=detail&aid=1456343&group_id=75348&atid=543655 (the file provided doesn't work with the current version, and instead of a testcase I think that a sample describes much better its use)

I've cleaned up, removed bad code and so this sample provides a simple example about how to properly use the API instead of having in a tracker a bad example of directly accessing the iframe contents.

It might also be the a partial answer to some questions about how to load initially the editor in source mode (but that could be another file using just the proper events)

Attachments

sample12.html (4.6 kB) - added by alfonso@… 21 months ago.
file for /fckeditor/_samples/html/sample12.html
sample13.html (5.0 kB) - added by FredCK 21 months ago.

Change History

Changed 21 months ago by alfonso@…

file for /fckeditor/_samples/html/sample12.html

Changed 21 months ago by FredCK

Should we really add this one to the package? I still find it a little bit confusing, but actually much better than the proposed one in the tracker. I think we would benefit more on updating the tracker, appending your sample there.

Regarding this one, it would be nice if we would implement something in the API that automatically switches the editor in a textarea. Maybe something available only if ReplaceTextarea() has been used to create the editor instance (otherwise we would have problems with the hidden field).

Changed 21 months ago by alfonso@…

I also have my doubts about the best way to put this sample, but I think that having several samples about different features and how to use them can help the people that want to learn and use as soon as possible the editor. If they think that some feature isn't possible they can go and use another editor, but if they have some easy samples they can try to understand how it's done. The sample doesn't have to be a complex page, just something that the user can check and it can bring him some new ideas. Another sample that I want to setup is to simulate the partial editing of a full page because some people doesn't seem to understand that it's very easy.

If we are willing to add something to the API I think that it would be enough to add just a SetVisibility(bVisible) method that hides/shows the highest level iframe, so the user calls first the ReplaceTextarea and then he takes care of showing/hiding the textarea or editor and updating the value of each element properly.

Another option (non exclusive to the previous ones, we can have all of them) would be to have a way to load the editor directly in source mode without the code being parsed by the browser. This one is of course the one that would take most job.

Changed 21 months ago by FredCK

Changed 21 months ago by FredCK

  • owner set to alfonso@…
  • milestone set to FCKeditor 2.4

I've completely reviewed the proposed sample and created a new one. I've removed code that was not related to the task the sample is proposed to solve, simplifying it. I've also commented it and uniformed to our coding style standards. It has been renamed to sample13 as sample12 is already committed in the SVN and is related to the enter key handler.

Alfonso, fell free to make the necessary changes to this file and commit it to the SVN. Remember that the samples list must also be updated. Thanks ;)

Changed 21 months ago by alfonso@…

  • status changed from new to closed
  • resolution set to fixed

I've fixed two typos and I have added it to SVN. The strange thing is that trying to test any sample in IE or Firefox I got an error but it did seems to work fine afterwards, so I don't know what's the problem. Maybe the SVN version wasn't ready to be tested?

Note: See TracTickets for help on using tickets.