PDA

View Full Version : DHTML Web Editor



wavsyntax
03-05-2007, 11:30 PM
1) CODE TITLE:
DHTML Web Editor
2) AUTHOR NAME/NOTES:
wav syntax
3) DESCRIPTION:
You type your code in the text box below, when you're finished you simply press the "Alt" key on your keyboard and the result of your code will show up instantly in the top frame.
4) URL TO CODE:
http://www.wavsyntax.com/edit.php

mburt
03-06-2007, 12:01 AM
It kind of "flickers", and doesn't work so well in Firefox. I have menus enabled when you press "alt" and they still open. Also, the default text that's in the box is invalid. Should be something like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Title of my page</title>
</head>
<body>

</body>
</html>

Not a bad idea though, I must admit.

wavsyntax
03-06-2007, 01:59 AM
You're absolutely right, I should have included the doctype tag,
It's a common thing I forget to do, as well as the title element.

as far as the flicker is concerned I think I can fix that, I haven't looked at the code in a while but I think the problem with that probably lies in the fact that the function to update the frame might be in both an onkeyup and onkeydown event (I originally planned it that way for a purpose I can no longer remember at this point lol), I'll probably end up fixing that sooner or later...

Hmmm, as far as the alt button not working, think I should make it update via button, which would make it work in any case, the only drawback would be that of simplicity though, I also could hot key it though, somethign like Ctrl+Shift.

I didn't have the Alt key problem though so this is something I wasn't expecting.

I appreciate you taking the time to try it out though and letting me know whether there was anythign wrong with it.
Any further suggestions would be much appreciated.

thetestingsite
03-06-2007, 02:05 AM
I think that this little script/program may have potential; after you update those few things that mburt pointed out. As for the alt key thing, I would place a button on the "editor" somewhere just in case.

wavsyntax
03-06-2007, 05:46 PM
Well, I've decided to fix those bugs a minute ago, I've also added a full screen view as well for the input edit.

Now I just need to find a cross browser method of inserting text at cursor position and replacing selected text, I can do this without a problem in IE but I need to do some Googling before I can do it in FF.

I plan on adding a lot more features to this, like that of my Dynamic Web Studio program, which this script is originally based on.

Preview (http://www.wavsyntax.com/edit.php)
Download (http://www.wavsyntax.com/scripts/DHTMLWE.zip)

jscheuer1
03-06-2007, 06:04 PM
Seems to work pretty well in limited testing in Opera.

djr33
03-06-2007, 10:12 PM
FF seems alright, justs glancing at it.

What does it actually do in the end? Would it allow to save to the server? Perhaps this could be integrated into a CMS.

wavsyntax
03-07-2007, 08:47 PM
FF seems alright, justs glancing at it.

What does it actually do in the end? Would it allow to save to the server? Perhaps this could be integrated into a CMS.

I've thought about giving this script the capability to save files to my server eventually once it becomes more than just a basic text editor with an output frame, if I do I'd allow users to save the code to a file in a folder with the user's visitation number appended to the file so to differentiate each one from the other, and just for security reasons I'll make it so that each file must be a .html file in order to not allow access to PHP by possible destructive users.