Hi,
Well, after spending considerable time this weekend making modifications to RTE 3, I'd like to post my findings.
First, I'd like to say, well done on such an extensive project. I've been aware of this project for some time and I know it's taken you months to complete, with many highs and lows! The fact is, so many projects start with good intent, but end before being completed. All-in-all, this is a great achievement and a great, comprehensive piece of work. When I showed my best friend your 'control', and the amount of files and code I would have to understand to make the kind of modifications I wanted, he thought I was crazy and was impressed with the shear size of the project! With that said, here is a summary of my goals for implementing and changing RTE:
- Make RTE easy to implement in hundreds of places on our intranet, each with their own configs.
- Reduce the amound of files that need to be copied among the different implementations.
- Clean the file structure, allowing RTE to run from it's own separate directory.
- Allow RTE to be implemented in more than 1 asp file in the same directory, with the possibility to have different configurations.
My modifications achieved all of the above. The last remaining frontier was implementing RTE more than once in the same asp file. But for my purposes, this is not yet important. My design modifications included:
- All common code is located in virtual=/rte/*.* common code includes all the images, in virtual=/rte/images/*.* directory. Since I will use the same images/style/toolbar/upload/iframes and many popups throughout all implementations of RTE, that directory contains a scaled down setup file (things like file upload directories are removed as each implementation can upload to different paths!). The directory with common code has about 25 files, excluding the images. I removed all sub directories from RTE and renamed almost all the files (the RTE_ prefix is no longer necessary since all RTE files are in their own separate directory with no other files!).
- All other code is located in "current directory"/"user specified RTE directory". eg: if I implement RTE3 in /test/ I copy 13 files into /test/rte. If I implement RTE3 in a different asp file (in the same directory) with a different config, I copy the 13 RTE3 files to /test/rte1 or any other location I define! These 13 files import/depend on the setup file in the same directory. The 13 files that need this setup file include file_browser, image_browser (a new file almost exactly the same as file_browser, I will explain why I needed it later!), popup_(adv_image/file_atch/image/open_file/save_file) etc.
- I added a few new variables. eg. strRTEpath = "rte/" located in setup, simply holds the sub directory I copied the current implementation to. strFullFileUploadPath = http://nitro/pinteq/faq/downloads/files/ and strFullImageUploadPath = http://nitro/pinteq/faq/downloads/images/. These 2 variables are quite important. I had a problem with your variable strFullURLpathToRTEfiles. My variable strFileUploadPath is defined as "../../../faq/downloads/files", when used in conjunction with strFullURLpathToRTEfiles, it produces a path like this http://nitro/pinteq/admin/faq/../../../faq/downloads/files/. Of course the file 'file_browser.asp' uses your variable, that was easy to change to my variable, but it couldn't implement my 'new' image path variable, so I created a duplicate called 'image_browser.asp'.
My conclusion
I understand that most people will only use RTE3 once or twice in their project. Even you only use it once on the forum and it's propably not a priority to make it easy to implement in more than one asp file. So I undertook a mommoth task this weekend! It took me 2 full days to implement, test and change the design. The result is RTE3 is much easier to implement in multiple locations with different configs, and it doesn't clutter the base folder! If I ever want to remove it, I just delete the directory. A side benefit of this is cache, I can set the 'common' directory cache to a few days. Since it's content won't change and the files in the 'common' directory are used in all implementations.
Best regards and a job well done on the best HTML Rich Text editor in the world!