CKEditor is limited by the restrictions set by the browser it runs off, so any HTML editor based on Gecko should be able to offer at the very least the same features, and the fact is that a native program will have greater control than a javascript app embedded in a browser.
Using the php scripts that I have written gives a very similar effect to using it in a desktop application (see previous article Full HTML wysiwyg file editing Dec 31 09)
vincent_v wrote:Using the php scripts that I have written gives a very similar effect to using it in a desktop application (see previous article Full HTML wysiwyg file editing Dec 31 09)
Vincent
I read you article. Looks like that is quite what I wanted. Have you uploaded your code somewhere? e.g. code.google.com?
Your first problem looks like the one I had when I tried editing a file originally created in dreamweaver. This puts comment tags in line with the key tags I was looking for and sometimes puts two key tags on the same line e.g </head><body>
The original code wouldn't handle that but I've rewritten it so that it does, and put that on the website on about the 20th Jan, so try that version as it may solve your problem. I've also put a line of code in to set the file access permissions on the new file ck_savepage.php creates.
The second one looks a little stranger, but may still be a consequense of the first - perhaps the missing body section has just ended up triggering that error for some reason. Try the updated code first (dated 19 Jan in the ck_editpage.php comments)
I tried to follow your link but got a 404 error on trying to open the ck_editpage.php, so I couldn't see the problems for myself.
I've just looked at your second problem again, Howard. The code is actually doing what it was intended to do but the error message is confusing (I was tring to combine two error messages into one piece of text - yep, laziness, I will change it).
'Upload' is just for data files and javascript, and will reject any htm or html (unless you change the filters).
Html files are only 'uploaded' using ckeditor's 'file save' function (floppy disc icon), but these must only be .htm or .html (unless you change the filter).
I didn't think it was safe to allow people to arbitrarily upload the main html files,but you can easily allow that it you wish by changing the following statement in ck_uploadfile.php from:
I noticed running the generated code thru w3c validation, I got a slew of errors. Tracked it back to generating xhtml, when I specify html.
Changing the front end of ck_editpage does not do the trick. Further down it again uses xhtml. But further down yet, it writes the /> that ruins the validation.
Might be nice for a further version to read from the website the doctype and generate accordingly ?
This is not a show stopper, I just like to pass the w3c validation w/o pulling the /> Possibly easier to change my sites to xhtml doctype.
The other problem I run into (not your doing), is that i really want ck-editpage for a plesk site. Alas, turns out that Plesk is so limited that it is pretty much impossible to use PHP writes (sigh).
Thanks for the great tool. Ckedit does a beautiful job of picking up the CSS.
Anything in the body section of the code is what ckeditor produces. I don't know how, or if, you can alter whether it produces html or xhtml, or how strictly it produces it. The header is actually separate, I don't pass doctype to it (mabe I should?) so perhaps the header docytype needs to be altered to suit what ckeditor generates.
Wondering if it would help if I sent you some before/after validator runs of html - and the source html ?
The problem may be more severe than first reported in that a IE8 customer reported the index.html CSS menu items were mashed together even when running IE8 compat mode. I changed back to the original code (b4 ck_editpage) and he reported all was ok again.
Howard I've made a few tweeks which has fixed a couple of bugs in IE7, the code seems to run OK in IETester set to IE8 - but I haven't tried it on the real IE8 yet. Perhaps you could try this version.
My routine for removing the stripped header information that I pass in to ckeditor when the file is loaded didn't cope with the complex code you have in your html file. I've changed the routine so that it now saves and reloads complex headers reliably. It won't affect how ckeditor itself generates html, so images may still be output in html rather than xhtml.
Indeed, it passes validation now. There are still 30 warnings due to xhtml termination of html doctype. --- Eg, Line 68, Column 13: NET-enabling start-tag requires SHORTTAG YES N4AF<br /> The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML. --- But at least they are just warnings.
Re: CKEditor as desktop HTML editor
Re: CKEditor as desktop HTML editor
Vincent
Re: CKEditor as desktop HTML editor
I read you article. Looks like that is quite what I wanted. Have you uploaded your code somewhere? e.g. code.google.com?
Thanks,
Juergen
Re: CKEditor as desktop HTML editor
http://www.esltd.plus.com/CK_page_editor/
Re: CKEditor as desktop HTML editor
http://blountscreek.org/ck_editpage.php?fname=gmap.htm
Re: CKEditor as desktop HTML editor
Thanks, Howard
Attachments:
Re: CKEditor as desktop HTML editor
1) Security concerns
2) Found PHPEXPLORATOR on sourceforge that does everything I need.
Thanks, Howard
Re: CKEditor as desktop HTML editor
Thanks for giving it a try
Your first problem looks like the one I had when I tried editing a file originally created in dreamweaver. This puts comment tags in line with the key tags I was looking for and sometimes puts two key tags on the same line e.g </head><body>
The original code wouldn't handle that but I've rewritten it so that it does, and put that on the website on about the 20th Jan, so try that version as it may solve your problem. I've also put a line of code in to set the file access permissions on the new file ck_savepage.php creates.
The second one looks a little stranger, but may still be a consequense of the first - perhaps the missing body section has just ended up triggering that error for some reason. Try the updated code first (dated 19 Jan in the ck_editpage.php comments)
I tried to follow your link but got a 404 error on trying to open the ck_editpage.php, so I couldn't see the problems for myself.
Vincent
Re: CKEditor as desktop HTML editor
The code is actually doing what it was intended to do but the error message is confusing (I was tring to combine two error messages into one piece of text - yep, laziness, I will change it).
'Upload' is just for data files and javascript, and will reject any htm or html (unless you change the filters).
Html files are only 'uploaded' using ckeditor's 'file save' function (floppy disc icon), but these must only be .htm or .html (unless you change the filter).
I didn't think it was safe to allow people to arbitrarily upload the main html files,but you can easily allow that it you wish by changing the following statement in ck_uploadfile.php from:
$allowedExtensions = validStyle." ".validScript
." ".validVideo." ".validImage
." ".validAudio." ".validDoc;
to:
$allowedExtensions = validStyle." ".validScript
." ".validVideo." ".validImage
." ".validAudio." ".validDoc." ".validHtml;
Vincent
Re: CKEditor as desktop HTML editor
THANKS Vincent !!!
This is great...
Howard
Re: CKEditor as desktop HTML editor
Thanks Howard
Re: CKEditor as desktop HTML editor
I have some addl comments on ck_editpage.
I noticed running the generated code thru w3c validation, I got a slew of errors.
Tracked it back to generating xhtml, when I specify html.
Changing the front end of ck_editpage does not do the trick. Further down it again uses xhtml.
But further down yet, it writes the /> that ruins the validation.
Might be nice for a further version to read from the website the doctype and
generate accordingly ?
This is not a show stopper, I just like to pass the w3c validation w/o pulling the />
Possibly easier to change my sites to xhtml doctype.
The other problem I run into (not your doing), is that i really want ck-editpage for a plesk site.
Alas, turns out that Plesk is so limited that it is pretty much impossible to use PHP writes (sigh).
Thanks for the great tool. Ckedit does a beautiful job of picking up the CSS.
Howard
Re: CKEditor as desktop HTML editor
Anything in the body section of the code is what ckeditor produces. I don't know how, or if, you can alter whether it produces html or xhtml, or how strictly it produces it. The header is actually separate, I don't pass doctype to it (mabe I should?) so perhaps the header docytype needs to be altered to suit what ckeditor generates.
Vincent
Re: CKEditor as desktop HTML editor
The problem may be more severe than first reported in that a IE8 customer reported the index.html CSS menu items were mashed together even when running IE8 compat mode.
I changed back to the original code (b4 ck_editpage) and he reported all was ok again.
Thanks, Howard
Re: CKEditor as desktop HTML editor
Vincent
Re: CKEditor as desktop HTML editor
I've made a few tweeks which has fixed a couple of bugs in IE7, the code seems to run OK in IETester set to IE8 - but I haven't tried it on the real IE8 yet. Perhaps you could try this version.
Vincent
Re: CKEditor as desktop HTML editor
http://validator.w3.org/
http://n4af.blountscreek.org
http://blountscreek.org/test.html
Re: CKEditor as desktop HTML editor
My routine for removing the stripped header information that I pass in to ckeditor when the file is loaded didn't cope with the complex code you have in your html file. I've changed the routine so that it now saves and reloads complex headers reliably. It won't affect how ckeditor itself generates html, so images may still be output in html rather than xhtml.
Vincent
Re: CKEditor as desktop HTML editor
Thanks for all your efforts !
Indeed, it passes validation now.
There are still 30 warnings due to xhtml termination of html doctype.
---
Eg, Line 68, Column 13: NET-enabling start-tag requires SHORTTAG YES
N4AF<br />
The sequence <FOO /> can be interpreted in at least two different ways, depending on the DOCTYPE of the document. For HTML 4.01 Strict, the '/' terminates the tag <FOO (with an implied '>'). However, since many browsers don't interpret it this way, even in the presence of an HTML 4.01 Strict DOCTYPE, it is best to avoid it completely in pure HTML documents and reserve its use solely for those written in XHTML.
---
But at least they are just warnings.
Thanks, Howard