Project Description
CollectAndCrop helps with combining and minifying javascript and css files in Sharepoint.

CollectAndCrop is a javascript and css minimizer for SharePoint 2007.

CollectAndCrop is a webcontrol for use in Sharepoint masterpages or page layouts.
It is build as a VS2008 + WSPBuilder project.

This project uses jsmin from Douglas Crockford (www.crockford.com) and the Yahoo! UI Library: YUI Compressor for .Net

Before
// master page or page layout
<script type="text/javascript" src="/Style Library/js/file1.js">
<script type="text/javascript" src="/Style Library/js/file2.js">
<script type="text/javascript" src="/Style Library/js/file3.js">

// rendered html
<script type="text/javascript" src="/Style Library/js/file1.js">
<script type="text/javascript" src="/Style Library/js/file2.js">
<script type="text/javascript" src="/Style Library/js/file3.js">


After
// master page or page layout
<%@ Register TagPrefix="OSC" Namespace="Ordina.SharePoint.CollectAndCrop" Assembly="CollectAndCrop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c7814f5e8ba6021e" %>
...
<OSC:CollectAndCropControl runat="server" ID="123" Active="true" CacheSeconds="300" Files="/Style Library/js/"></OSC:CollectAndCropControl>

// rendered html
<script type="text/javascript" src="/Style Library/combined123.js">


Last edited Apr 9, 2010 at 1:03 PM by JaapDijkma, version 14