Opened 13 years ago
Closed 12 years ago
#7822 closed New Feature (invalid)
Fake image for protectedSource
Reported by: | datalink | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Core : Parser | Version: | |
Keywords: | Cc: |
Description
For old fckeditor I've written a plugin to change proteted source to fake images (code icon). That was working without any problems. Now I migrate my little system to ckeditor and want this feature too. But it seems not possible to handle this with a plugin in new editor version (see ticket 7563). I think it has to be a core feature that it works.
Can you provide a methode to set a fake image that doesn't validate protected source to html? There are different problems to handle it with
new CKEDITOR.htmlParser.element( 'img', attributes );
Examples:
With htmlParser.element... ckeditor changes source from
<?PHP echo 'test'; ?>
to
<?php echo=""></?php>
or
<p></p> <script>alert('test');</script> <p></p>
to
<p></p> <p> <script>alert('test');</script> </p> <p></p>
Fake images are right and displayed, but source not. There should be another way equivalent to htmlParser.element()
It would be very nice to have fake images for protected source in a future version.
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Status: | new → confirmed |
---|
I agree, it would be nice to have something like default line-height icon <code>....</code>
informing that there is something here in wysiwyg.
There is just one problem I see here:
Docs say that "protectedSource must not be available in the WYSIWYG mode for editing".
Adding icon would IMO result in possibility to delete code represented by image what is not in accordance with docs.
Comments anyone?
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | confirmed → closed |
As discussed with @fredck - protectedSource was created for developers that wish to hide certain tags in wysiwyg.
For this case a dedicated plugin should be created that based on some regex replaces code with image in wysiwyg mode (just like flash). I have opened new ticket for it - #9280.
I think that for code from http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.protectedSource CKEditor should show something in WYSIWYG mode. Now this code (from protected source) is hidden in WYSIWYG mode. I think this can be confusing for users , because they don't see this in CKEditor and after sending a form (saving data) they get more code/data.
Ideally CKEditor should show this code but without possibility of editing. Another (possibly simpler) solution is to use some fake image like in Flash plugin. In this way user will know that there is some information but can't editing it.