Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

What are the Essential JavaScript files?


Go to End


2 Posts   2094 Views

Avatar
denbear

Community Member, 7 Posts

18 July 2009 at 2:51pm

I'm in the process of building my third website with SilverStripe. Love the product, but I'm wondering how I can reduce the total number of files from the whole package. The JSParty directory contains over 1800 files. I can see that I could go into jsparty/tiny_mce2/langs and remove 50 of the language files. I need only English. There's lots of other files, but there's no way I'm aware of to determine what is and what is not essential to the operation of the CMS. Which JavaScript files does the CMS require?

Hmm...think that Firebug might be helpful in answering this question.

I'm using JQuery, but I'm using the latest version that's stored on Google's CDN -- http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js. If other libraries like Prototype are essential, where would I find references to the library in the CMS code, so I could point to the CDN?

Hmm...more thoughts about Firebug and an HTTP analyzer.

But, before I dig into Firebug and HTTPFox and start tracing and noting JavaScript calls or selectively removing files and seeing if something breaks, maybe there's some documentation or a previous forum post I could use as a starting point? I did do some searching on the forum, but I did not find any helpful results from my keyword searches. "Essential files, Minimal Install, JSParty file reduction"

Avatar
Willr

Forum Moderator, 5523 Posts

19 July 2009 at 12:55am

Well JS in SilverStripe is broken down into 2 parts. On the front end side prototype / behavior are both required by default for form validation. You can disable automatic JS validation and opt for your own solution (as like userforms which uses the jquery validate plugin) so then there is nothing loading from jsparty/

In the CMS it gets a bit tricky as it is in the process of being rewritten it uses various things from various libraries. Lots of the jquery plugins in jsparty/ are actually currently not used.

All the lang js files are there for translation purposes you could remove this if you wish, but it would be at your own risk.

where would I find references to the library in the CMS code,

Do a search for Requirements::javascript( or <% require javascript( as these are the 2 calls which will likely see files being included