Would it be possible to add an option to disable the cleanup function when toggling from Source to WYSIWYG mode?
As it is now all html,meta and body tags are removed even when the preseve source code option is true.
cheers
sf_tex
As it is now all html,meta and body tags are removed even when the preseve source code option is true.
cheers
sf_tex

Re: New Feature: Preserve html,meta,body tags
I'd be interested in anyone else's solutions to this problem as well.
Re: New Feature: Preserve html,meta,body tags
Re: New Feature: Preserve html,meta,body tags
I have a customer that would like to preserve what she typed in source mode exactly for readability issues. She puts in capitalization, and more importantly white space. It is saved into the database correctly when saved from source mode; however, as soon as the editor reloads it or switches from source mode back to wysiwyg mode, the white space and the capitalizations are gone.
I'm using this as the test code
<Div claSS="fck-test-source-mode"> here is the test </diV>
Re: New Feature: Preserve html,meta,body tags
<html> <head> <script type="text/javascript"> window.onload = function() { alert(document.body.innerHTML) } ; </script> </head> <body> <Div claSS="fck-test-source-mode"> here is the test </diV> </body> </html>And now explain how a browser based editor will be able to know how the original code looked like.
Re: New Feature: Preserve html,meta,body tags
Re: New Feature: Preserve html,meta,body tags
Re: New Feature: Preserve html,meta,body tags
then when puling back from database convert ascii code back to a-z,1-9, etc... then send string back to the fckeditor.value ((fckeditor needs to be in source mode))
note code is completely wrong, just giving idea perhaps.
turn fckeditor to source mode
retive fckeditor.value
some loop
databasestring = databasestring + asciicode(subtring(loop,fckeditor.value),0)
end loop
save databasestring to database
retrive databasestring from database
turn fckeditor to source mode
some loop
fckeditor.value = fckeditor.value + asciicode(substring(loop,databasestring),1)
end loop
scince "space" has an ascii code number and so do "hard returns / carriage returns" the white space and line breaks should be kept atleast in how am thinking.
Re: New Feature: Preserve html,meta,body tags
Re: New Feature: Preserve html,meta,body tags
Re: New Feature: Preserve html,meta,body tags
But as you all have already noticed, fckeditor had a tendency to encode html brackets for 'safe viewing'...
I added the following php code to the submit (receiving) page:
$findThese = array('color="', '">', '<br />' , 'href="' , "/>", ">", "<"); $replaceWith = array('color="', '">', '<BR>' , 'href="' , '>', '>', '<'); $inputString= $postedValue; $outputString = str_replace($findThese, $replaceWith, $inputString);that handles all the html tags that would be used on my pages... but you might have more yourself. just add them into the arrays I've defined above. the order does make a difference though.
works like a charm.
-Dave
Re: New Feature: Preserve html,meta,body tags
add the following to your fckeditor\_samples\php\sampleposteddata.php file right after the following line:
here's the code:
<?php $findThese = array('" maxlength=', '" align=', '" src=', '" alt=', '" align=', 'width="', '" width=', 'cellpadding="', '" cellpadding', 'cellspacing="', 'cols="', '" type=', '" size=', 'maxlength="', 'size="', 'border="', '" border=', 'summary="', '" summary=', 'align="', '" cols=', 'rows="', 'name="', 'type="', '" name=', '" value=', 'alt=""', 'alt="', '" checked', 'checked="', 'color="', '">', '<br />' , 'href="' , '/>', '>', '<', '"button"', 'style="', 'value="', '&nbsp;', 'src="', '" >'); $replaceWith = array('" maxlength=', '" align=', '" src=', '" alt=', '" align=', 'width="', '" width=', 'cellpadding="', '" cellpadding', 'cellspacing="', 'cols="', '" type=', '" size=', 'maxlength="', 'size="', 'border="', '" border=', 'summary="', '" summary=', 'align="', '" cols=', 'rows="', 'name="', 'type="', '" name=', '" value=', 'alt=""', 'alt="', '" checked', 'checked="', 'color="', '">', '<BR>' , 'href="' , '>', '>', '<', '"button"', 'style="', 'value="', ' ', 'src="', '">'); $inputString= $postedValue; $outputString = str_replace($findThese, $replaceWith, $inputString); ?>this is working for me. hope it helps
-Dave