How to share TinyMCE Javascript source across multiple ASP.Net sites

149 views Asked by At

I'm using the Moxie code TinyMCE text editor (http://www.tinymce.com/) for content entry on a number of sites. At the moment I have the tiny_mce folder sitting in the folder of each site. This means that I have lots of copies of the same .js files.

I think it would be better to have one copy of the tiny_mce folder and reference it for each site - so if I make a change, or upgrade the tiny_mce I only have to do it once. Also, if I make a new site I can reference the same one to save needing to upload or copy another 9Mb of duplicated files onto the server.

I have tried putting the tiny_mce into a folder outside the individual websites and setting it up as a site on localhost that they can see.

I then include the javascript from each site like this:

<script type="text/javascript" src="http://localhost/MCE/tiny_mce/tiny_mce.js"></script>

I'm pretty sure the the file can be found by the site - I've tested with a simple javascript alert box test which works fine - and if I "View Source" and check the link it's using, I can access the tiny_mce.js file - which is the correct file.

However, the tiny_mce doesn't work.

I'm guessing there are some kind of dependencies or configurations that I'm not aware of that are causing a problem, but I'm not sure quite where to start to find out what isn't working. (I don't get any errors, it just doesn't load the tiny_mce)

Has anyone managed to get tiny_mce to share it's source files across multiple sites? Does tiny_mce require the .js files to be inside the root folder of the site in order to work?

1

There are 1 answers

1
Thariama On

Has anyone managed to get tiny_mce to share it's source files across multiple sites?

I have not tried it yet.

Does tiny_mce require the .js files to be inside the root folder of the site in order to work?

No.

Depending on your server system and in case your different website files are stored on one physical server device you could use a hardlink or softlink to the shared tiny_mce_folder (which should be accessible from the net too).