Commits

Chris Leonello  committed d6ce0f3

Examples in built distribution will now use minified sources. Other changes for examples.

  • Participants
  • Parent commits 2fac192

Comments (0)

Files changed (4)

           <targetfile />
           <mapper type="glob" from="jquery.jqplot.css" to="jquery.jqplot.min.css" />
         </apply>
+
         <echo message="minifing plugin files" />
+
         <apply executable="java" parallel="false" verbose="true" dest="${DIST_DIR}/plugins">
           <fileset dir="${DIST_DIR}/plugins">
             <include name="jqplot.*.js" />
           </filterchain>
         </copy>
         
+        <echo message="doing regex replacements" />
+
         <replaceregexp match="@VERSION" flags="g" replace="${version}r${HG_ID}">
-			<fileset dir="${DIST_DIR}">
-				<include name="jquery.jqplot.js"/>
-				<include name="jquery.jqplot.min.js"/>
-				<include name="jqplot.*.js"/>
-				<include name="jqplot.*.min.js" />
-			</fileset>
-		</replaceregexp>
+    			<fileset dir="${DIST_DIR}">
+    				<include name="jquery.jqplot.js"/>
+    				<include name="jquery.jqplot.min.js"/>
+    				<include name="jqplot.*.js"/>
+    				<include name="jqplot.*.min.js" />
+    			</fileset>
+    		</replaceregexp>
         
         <replaceregexp match="@VERSION" flags="g" replace="${version}r${HG_ID}">
-			<fileset dir="${DIST_DIR}/plugins">
-				<include name="jqplot.*.js"/>
-				<include name="jqplot.*.min.js" />
-			</fileset>
-		</replaceregexp>
+    			<fileset dir="${DIST_DIR}/plugins">
+    				<include name="jqplot.*.js"/>
+    				<include name="jqplot.*.min.js" />
+    			</fileset>
+    		</replaceregexp>
+        
+        <replaceregexp match='jquery.js' replace='jquery.min.js' flags="g">
+          <fileset dir="${DIST_DIR}/examples" includes="*.html" />
+        </replaceregexp>
+        
+        <replaceregexp match='jquery.jqplot.css' replace='jquery.jqplot.min.css' flags="g">
+          <fileset dir="${DIST_DIR}/examples" includes="*.html" />
+        </replaceregexp>
+        
+        <replaceregexp match='jqplot.(\w+).js' replace='jqplot.\1.min.js' flags="g">
+          <fileset dir="${DIST_DIR}/examples" includes="*.html" />
+        </replaceregexp>
+        
+        <replaceregexp match='jquery.jqplot.js' replace='jquery.jqplot.min.js' flags="g">
+          <fileset dir="${DIST_DIR}/examples" includes="*.html" />
+        </replaceregexp>
         
         <delete dir="${DIST_DIR}/plugins/temp" />
         

File examples/.htaccess.remote

 
 # This works for dreamhost (php as fast cgi)
 AddType php-cgi .php .html .htm
+

File examples/area.html

   <link rel="stylesheet" type="text/css" href="examples.css" />
   
   <!-- BEGIN: load jquery -->
-  <script language="javascript" type="text/javascript" src="../src/jquery.js"></script>
+  <script type="text/javascript" src="../src/jquery.js"></script>
   <!-- END: load jquery -->
   
   <!-- BEGIN: load jqplot -->
-  <script language="javascript" type="text/javascript" src="../src/jquery.jqplot.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.barRenderer.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.categoryAxisRenderer.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.highlighter.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.cursor.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.pieRenderer.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.donutRenderer.js"></script>
-<!--  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.funnelRenderer.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.canvasTextRenderer.js"></script>
-  <script language="javascript" type="text/javascript" src="../src/plugins/jqplot.canvasAxisTickRenderer.js"></script>
--->
+  <script type="text/javascript" src="../src/jquery.jqplot.js"></script>
+  <script type="text/javascript" src="../src/plugins/jqplot.barRenderer.js"></script>
+  <script type="text/javascript" src="../src/plugins/jqplot.categoryAxisRenderer.js"></script>
+  <script type="text/javascript" src="../src/plugins/jqplot.highlighter.js"></script>
+  <script type="text/javascript" src="../src/plugins/jqplot.cursor.js"></script>
+  <script type="text/javascript" src="../src/plugins/jqplot.pieRenderer.js"></script>
+  <script type="text/javascript" src="../src/plugins/jqplot.donutRenderer.js"></script>
+
   <!-- END: load jqplot -->
 
 <style type="text/css">
 <script class="code" language="javascript" type="text/javascript">
 $(document).ready(function(){
 
-    l2 = [11, 9, 5, 12, 14];
-    l3 = [4, 8, 5, 3, 6];
-    l4 = [12, 6, 13, 11, 2];
-    l5 = [4, -3, 3, 6, 2, -2];    
+    var l2 = [11, 9, 5, 12, 14];
+    var l3 = [4, 8, 5, 3, 6];
+    var l4 = [12, 6, 13, 11, 2];
+    var l5 = [4, -3, 3, 6, 2, -2];    
 
     
-    plot1b = $.jqplot('chart1b',[l2, l3, l4],{
+    var plot1b = $.jqplot('chart1b',[l2, l3, l4],{
        stackSeries: true,
        showMarker: false,
        seriesDefaults: {
  
 <script class="code" language="javascript" type="text/javascript">
 $(document).ready(function(){   
-    plot1c = $.jqplot('chart1c',[l5],{
+    var plot1c = $.jqplot('chart1c',[l5],{
        stackSeries: true,
        showMarker: false,
        seriesDefaults: {

File examples/nav.inc

 <div class="example-nav">
   <?php
-    $dh  = opendir('./');
-    while (false !== ($filename = readdir($dh))) {
-        if (preg_match('/^[a-z0-9][a-z0-9_\-]+\.html$/i', $filename)) {
-          $files[] = $filename;
+    $tmpnames = scandir('./');
+    
+    foreach( $tmpnames as $value) {
+        if (preg_match('/^[a-z0-9][a-z0-9_\-]+\.html$/i', $value)) {
+          $files[] = $value;
         }
     }
     $fcount = count($files);
     $curfile = end($parts);
     $prevfile = '';
     $nextfile = '';
-    // echo $fcount, $curfile;
     // print_r($files);
     
     for ($i=0; $i<$fcount; $i++) {