Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a simple editor that can save in HTML
Message
From
04/04/2009 13:47:42
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01390236
Message ID:
01393274
Views:
136
>Smart construction. Can you give technical details (that is, a code example and some docu)?

sorry for coming back to this so late.

One sample is the task pane, which is in xsource.zip, search for vfps: in the project. Another ingredient is from West Wind about using the webbrowser control, eg here http://www.west-wind.com/presentations/shellapi/shellapi.asp

There are several things you find from RickStrahl. One thing you can do and that is shown there is implement the interface to webrowser events:

DEFINE CLASS WebBrowserEvents as Custom

IMPLEMENTS DWebBrowserEvents2 IN "SHDOCVW.DLL"

… implementation of event methods here

ENDDEFINE

It's perhaps not even needed. Such web html editors are rather self contained, they mostly do everything in javascript and their save or send button is a html form submit. At that point the beforenavigate2 method is in effect and you can read from the innerhtml or from postcode what the edited html is.

With tinyMCE you setup a littel HTML with the editor embedded. I changed the editor html form to action="vfps://savehtml". And here's the main lines I needed to get at the TimyMCE saved html code

LPARAMETERS pdisp, url, flags, targetframename, postdata, headers, cancel

If url="vfps://"
do case
case "//savehtml" $ url
Cancel = .t.

Local lcHTML, lcURL, lnRecno
lcHTML = Strconv(Strconv(strextract(postdata,"=","loadfile=",1,3),15),16)

If NOT lcHTML = Thisfrom.cPreviousHTML
...
Replace mEditedHTML with lcHTML in curHTML
Endif
case ...
endcase
Endif

This is of course not the full code needed and while the integration of TinyMCE works for me, there are quite a few things to do to make it feature complete and support every tool this editor has. I wanted to take a look at FCKEditor anyway, as it should even be simple with the AFP code provided. I plan to look at this tomorrow, as I tend to skip TinyMCE. If you like I'll report back on this.

Bye, Olaf.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform