<!--
  This Module creates a javascript library able to replace jquery.js
-->
<module rename-to='jsquery'>
	<inherits name='com.google.gwt.query.jsquery.JsQuery' />

	<entry-point class="com.google.gwt.query.jsquery.client.JsQueryApi" />

    <!-- Minimize JS -->
    <set-property name="compiler.stackMode" value="strip"/>

    <!-- cross-site -->
    <add-linker name="xsiframe"/>

	<!--
	     Hack to put code into the jsquery.nocache.js so as $ is available early
	     and we can handle the $().ready method which is widely used in jquery pages.
	     Otherwise $ wont be available until the async loading of the gwt permutation
	     which happens after the page was ready.
	 -->
    <define-property name="onload" values="default, foo"/>
    <property-provider name="onload">
      <![CDATA[
	    $wnd.JsQuery = {
	      onLoadArray: [],
	      onLoad: function() {
	        for (i in $wnd.JsQuery.onLoadArray)
	          $wnd.JsQuery.onLoadArray[i]();
	      },
	      ready: function(f) {
	        $wnd.JsQuery.onLoadArray.push(f);
	      }
	    };
	    $wnd._$_ = $wnd.$;
	    $wnd.$ = function() {return $wnd.JsQuery;}
        return 'default';
      ]]>
    </property-provider>
</module>

