Changeset 769

Show
Ignore:
Timestamp:
02/14/08 17:28:57 (1 year ago)
Author:
laurentj
Message:

ticket #214: integrate a javascript script to do html wydiwyg editing
added also jquery, and two plugins, date_input and dimensions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build/lib/jManifest.class.php

    r768 r769  
    3434        foreach($script as $nbline=>$line){ 
    3535            $nbline++; 
    36             if(preg_match(';^(cd|sd|dd|\*|!|\*!)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\/.\-_]*)\))?\s*$;m', $line, $m)){ 
     36            if(preg_match(';^(cd|sd|dd|\*|!|\*!|c|\*c)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\/.\-_]*)\))?\s*$;m', $line, $m)){ 
    3737                if($m[1] == 'dd'){ 
    3838                    $currentdestdir = jBuildUtils::normalizeDir($m[2]); 
     
    4545                    jBuildUtils::createDir($distdir.$currentdestdir); 
    4646                }else{ 
     47                    $doPreprocessing = (strpos($m[1],'*') !== false); 
     48                    $doCompression = (strpos($m[1],'c') !== false) || ($stripcomment && (strpos($m[1],'!') === false)); 
     49 
    4750                    if($m[2] == ''){ 
    4851                        throw new Exception ( "$ficlist : file required on line $nbline \n"); 
     
    5457                    $sourcefile = $sourcedir.$currentsrcdir.$m[2]; 
    5558 
    56                     if($m[1]=='*' || $m[1]=='*!'){ 
     59                    if($doPreprocessing){ 
    5760                        if($verbose){ 
    5861                            echo "process  $sourcefile \tto\t$destfile \n"; 
     
    6467                            throw new Exception ( "$ficlist : line $nbline, cannot process file ".$m[2]." (". $e->getMessage() .")\n"); 
    6568                        } 
    66                         if($m[1]=='*' && $stripcomment && preg_match("/\.php$/",$destfile)){ 
    67                             $contents = self::stripPhpComments($contents); 
     69                        if($doCompression) { 
     70                            if( preg_match("/\.php$/",$destfile)) { 
     71                                $contents = self::stripPhpComments($contents); 
     72                            } 
     73                            else if(preg_match("/\.js$/",$destfile)) { 
     74                                $packer = new JavaScriptPacker($contents, 0, true, false); 
     75                                $contents = $packer->pack(); 
     76                            } 
    6877                        } 
    6978                        file_put_contents($destfile,$contents); 
    7079 
    71                     }elseif($m[1]!='!'&& $stripcomment && preg_match("/\.php$/",$destfile)){ 
     80                    }elseif($doCompression && preg_match("/\.php$/",$destfile)){ 
    7281                        if($verbose) 
    7382                            echo "strip comment in  $sourcefile\tto\t".$destfile."\n"; 
     
    7584                        file_put_contents($destfile,self::stripPhpComments($src)); 
    7685 
    77                     }elseif($m[1]!='!'&& $stripcomment && preg_match("/\.js$/",$destfile))
     86                    }elseif($doCompression && preg_match("/\.js$/",$destfile))
    7887                        if($verbose) 
    7988                            echo "compress javascript file ".$destfile."\n"; 
  • trunk/build/lib/jManifest.class.php

    r768 r769  
    3434        foreach($script as $nbline=>$line){ 
    3535            $nbline++; 
    36             if(preg_match(';^(cd|sd|dd|\*|!|\*!)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\/.\-_]*)\))?\s*$;m', $line, $m)){ 
     36            if(preg_match(';^(cd|sd|dd|\*|!|\*!|c|\*c)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\/.\-_]*)\))?\s*$;m', $line, $m)){ 
    3737                if($m[1] == 'dd'){ 
    3838                    $currentdestdir = jBuildUtils::normalizeDir($m[2]); 
     
    4545                    jBuildUtils::createDir($distdir.$currentdestdir); 
    4646                }else{ 
     47                    $doPreprocessing = (strpos($m[1],'*') !== false); 
     48                    $doCompression = (strpos($m[1],'c') !== false) || ($stripcomment && (strpos($m[1],'!') === false)); 
     49 
    4750                    if($m[2] == ''){ 
    4851                        throw new Exception ( "$ficlist : file required on line $nbline \n"); 
     
    5457                    $sourcefile = $sourcedir.$currentsrcdir.$m[2]; 
    5558 
    56                     if($m[1]=='*' || $m[1]=='*!'){ 
     59                    if($doPreprocessing){ 
    5760                        if($verbose){ 
    5861                            echo "process  $sourcefile \tto\t$destfile \n"; 
     
    6467                            throw new Exception ( "$ficlist : line $nbline, cannot process file ".$m[2]." (". $e->getMessage() .")\n"); 
    6568                        } 
    66                         if($m[1]=='*' && $stripcomment && preg_match("/\.php$/",$destfile)){ 
    67                             $contents = self::stripPhpComments($contents); 
     69                        if($doCompression) { 
     70                            if( preg_match("/\.php$/",$destfile)) { 
     71                                $contents = self::stripPhpComments($contents); 
     72                            } 
     73                            else if(preg_match("/\.js$/",$destfile)) { 
     74                                $packer = new JavaScriptPacker($contents, 0, true, false); 
     75                                $contents = $packer->pack(); 
     76                            } 
    6877                        } 
    6978                        file_put_contents($destfile,$contents); 
    7079 
    71                     }elseif($m[1]!='!'&& $stripcomment && preg_match("/\.php$/",$destfile)){ 
     80                    }elseif($doCompression && preg_match("/\.php$/",$destfile)){ 
    7281                        if($verbose) 
    7382                            echo "strip comment in  $sourcefile\tto\t".$destfile."\n"; 
     
    7584                        file_put_contents($destfile,self::stripPhpComments($src)); 
    7685 
    77                     }elseif($m[1]!='!'&& $stripcomment && preg_match("/\.js$/",$destfile))
     86                    }elseif($doCompression && preg_match("/\.js$/",$destfile))
    7887                        if($verbose) 
    7988                            echo "compress javascript file ".$destfile."\n"; 
  • trunk/build/lib/jManifest.class.php

    r768 r769  
    3434        foreach($script as $nbline=>$line){ 
    3535            $nbline++; 
    36             if(preg_match(';^(cd|sd|dd|\*|!|\*!)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\/.\-_]*)\))?\s*$;m', $line, $m)){ 
     36            if(preg_match(';^(cd|sd|dd|\*|!|\*!|c|\*c)?\s+([a-zA-Z0-9\/.\-_]+)\s*(?:\(([a-zA-Z0-9\/.\-_]*)\))?\s*$;m', $line, $m)){ 
    3737                if($m[1] == 'dd'){ 
    3838                    $currentdestdir = jBuildUtils::normalizeDir($m[2]); 
     
    4545                    jBuildUtils::createDir($distdir.$currentdestdir); 
    4646                }else{ 
     47                    $doPreprocessing = (strpos($m[1],'*') !== false); 
     48                    $doCompression = (strpos($m[1],'c') !== false) || ($stripcomment && (strpos($m[1],'!') === false)); 
     49 
    4750                    if($m[2] == ''){ 
    4851                        throw new Exception ( "$ficlist : file required on line $nbline \n"); 
     
    5457                    $sourcefile = $sourcedir.$currentsrcdir.$m[2]; 
    5558 
    56                     if($m[1]=='*' || $m[1]=='*!'){ 
     59                    if($doPreprocessing){ 
    5760                        if($verbose){ 
    5861                            echo "process  $sourcefile \tto\t$destfile \n"; 
     
    6467                            throw new Exception ( "$ficlist : line $nbline, cannot process file ".$m[2]." (". $e->getMessage() .")\n"); 
    6568                        } 
    66                         if($m[1]=='*' && $stripcomment && preg_match("/\.php$/",$destfile)){ 
    67                             $contents = self::stripPhpComments($contents); 
     69                        if($doCompression) { 
     70                            if( preg_match("/\.php$/",$destfile)) { 
     71                                $contents = self::stripPhpComments($contents); 
     72                            } 
     73                            else if(preg_match("/\.js$/",$destfile)) { 
     74                                $packer = new JavaScriptPacker($contents, 0, true, false); 
     75                                $contents = $packer->pack(); 
     76                            } 
    6877                        } 
    6978                        file_put_contents($destfile,$contents); 
    7079 
    71                     }elseif($m[1]!='!'&& $stripcomment && preg_match("/\.php$/",$destfile)){ 
     80                    }elseif($doCompression && preg_match("/\.php$/",$destfile)){ 
    7281                        if($verbose) 
    7382                            echo "strip comment in  $sourcefile\tto\t".$destfile."\n"; 
     
    7584                        file_put_contents($destfile,self::stripPhpComments($src)); 
    7685 
    77                     }elseif($m[1]!='!'&& $stripcomment && preg_match("/\.js$/",$destfile))
     86                    }elseif($doCompression && preg_match("/\.js$/",$destfile))
    7887                        if($verbose) 
    7988                            echo "compress javascript file ".$destfile."\n"; 
  • trunk/build/manifests/jelix-lib.mn

    r768 r769  
    441441  jxbl.xml 
    442442  jxbl.css 
    443  
     443cd lib/jelix-www/wymeditor 
     444c jquery.wymeditor.js 
     445c wym_css_parser.js 
     446c xhtml_parser.js 
     447  GPL-license.txt 
     448  MIT-license.txt 
     449  README 
     450cd lib/jelix-www/wymeditor/lang 
     451c es.js 
     452c fr.js 
     453c de.js 
     454c sv.js 
     455c nl.js 
     456c pl.js 
     457c hu.js 
     458c it.js 
     459c en.js 
     460c ca.js 
     461cd lib/jelix-www/wymeditor/plugins/hovertools 
     462c jquery.wymeditor.hovertools.js 
     463cd lib/jelix-www/wymeditor/plugins/tidy 
     464  tidy.php 
     465c jquery.wymeditor.tidy.js 
     466  wand.png 
     467  README 
     468cd lib/jelix-www/wymeditor/iframe/default 
     469  lbl-pre.png 
     470  lbl-blockquote.png 
     471  lbl-h1.png 
     472  lbl-h2.png 
     473  wymiframe.html 
     474  lbl-h3.png 
     475  lbl-h4.png 
     476  lbl-h5.png 
     477  lbl-h6.png 
     478  wymiframe.css 
     479  lbl-p.png 
     480cd lib/jelix-www/wymeditor/skins 
     481  wymeditor_icon.png 
     482cd lib/jelix-www/wymeditor/skins/default 
     483  screen.css 
     484  icons.png 
     485cd lib/jelix-www/jquery 
     486  GPL-LICENSE.txt 
     487  MIT-LICENSE.txt 
     488  README 
     489! jquery.js 
     490cd lib/jelix-www/jquery/date_input 
     491  README 
     492  date_input.css 
     493c jquery.date_input.js 
     494  LICENCE 
     495! jquery.date_input.nl_NL.js 
     496! jquery.date_input.de_DE.js 
     497! jquery.date_input.pt_PT.js 
     498! jquery.date_input.ru_RU.js 
     499! jquery.date_input.es_ES.js 
     500cd lib/jelix-www/jquery/dimensions 
     501c jquery.dimensions.js 
    444502 
    445503cd lib/clearbricks 
  • trunk/build/manifests/jelix-lib.mn

    r768 r769  
    441441  jxbl.xml 
    442442  jxbl.css 
    443  
     443cd lib/jelix-www/wymeditor 
     444c jquery.wymeditor.js 
     445c wym_css_parser.js 
     446c xhtml_parser.js 
     447  GPL-license.txt 
     448  MIT-license.txt 
     449  README 
     450cd lib/jelix-www/wymeditor/lang 
     451c es.js 
     452c fr.js 
     453c de.js 
     454c sv.js 
     455c nl.js 
     456c pl.js 
     457c hu.js 
     458c it.js 
     459c en.js 
     460c ca.js 
     461cd lib/jelix-www/wymeditor/plugins/hovertools 
     462c jquery.wymeditor.hovertools.js 
     463cd lib/jelix-www/wymeditor/plugins/tidy 
     464  tidy.php 
     465c jquery.wymeditor.tidy.js 
     466  wand.png 
     467  README 
     468cd lib/jelix-www/wymeditor/iframe/default 
     469  lbl-pre.png 
     470  lbl-blockquote.png 
     471  lbl-h1.png 
     472  lbl-h2.png 
     473  wymiframe.html 
     474  lbl-h3.png 
     475  lbl-h4.png 
     476  lbl-h5.png 
     477  lbl-h6.png 
     478  wymiframe.css 
     479  lbl-p.png 
     480cd lib/jelix-www/wymeditor/skins 
     481  wymeditor_icon.png 
     482cd lib/jelix-www/wymeditor/skins/default 
     483  screen.css 
     484  icons.png 
     485cd lib/jelix-www/jquery 
     486  GPL-LICENSE.txt 
     487  MIT-LICENSE.txt 
     488  README 
     489! jquery.js 
     490cd lib/jelix-www/jquery/date_input 
     491  README 
     492  date_input.css 
     493c jquery.date_input.js 
     494  LICENCE 
     495! jquery.date_input.nl_NL.js 
     496! jquery.date_input.de_DE.js 
     497! jquery.date_input.pt_PT.js 
     498! jquery.date_input.ru_RU.js 
     499! jquery.date_input.es_ES.js 
     500cd lib/jelix-www/jquery/dimensions 
     501c jquery.dimensions.js 
    444502 
    445503cd lib/clearbricks 
  • trunk/build/manifests/jelix-lib.mn

    r768 r769  
    441441  jxbl.xml 
    442442  jxbl.css 
    443  
     443cd lib/jelix-www/wymeditor 
     444c jquery.wymeditor.js 
     445c wym_css_parser.js 
     446c xhtml_parser.js 
     447  GPL-license.txt 
     448  MIT-license.txt 
     449  README 
     450cd lib/jelix-www/wymeditor/lang 
     451c es.js 
     452c fr.js 
     453c de.js 
     454c sv.js 
     455c nl.js 
     456c pl.js 
     457c hu.js 
     458c it.js 
     459c en.js 
     460c ca.js 
     461cd lib/jelix-www/wymeditor/plugins/hovertools 
     462c jquery.wymeditor.hovertools.js 
     463cd lib/jelix-www/wymeditor/plugins/tidy 
     464  tidy.php 
     465c jquery.wymeditor.tidy.js 
     466  wand.png 
     467  README 
     468cd lib/jelix-www/wymeditor/iframe/default 
     469  lbl-pre.png 
     470  lbl-blockquote.png 
     471  lbl-h1.png 
     472  lbl-h2.png 
     473  wymiframe.html 
     474  lbl-h3.png 
     475  lbl-h4.png 
     476  lbl-h5.png 
     477  lbl-h6.png 
     478  wymiframe.css 
     479  lbl-p.png 
     480cd lib/jelix-www/wymeditor/skins 
     481  wymeditor_icon.png 
     482cd lib/jelix-www/wymeditor/skins/default 
     483  screen.css 
     484  icons.png 
     485cd lib/jelix-www/jquery 
     486  GPL-LICENSE.txt 
     487  MIT-LICENSE.txt 
     488  README 
     489! jquery.js 
     490cd lib/jelix-www/jquery/date_input 
     491  README 
     492  date_input.css 
     493c jquery.date_input.js 
     494  LICENCE 
     495! jquery.date_input.nl_NL.js 
     496! jquery.date_input.de_DE.js 
     497! jquery.date_input.pt_PT.js 
     498! jquery.date_input.ru_RU.js 
     499! jquery.date_input.es_ES.js 
     500cd lib/jelix-www/jquery/dimensions 
     501c jquery.dimensions.js 
    444502 
    445503cd lib/clearbricks 
Download in other formats: Unified Diff Zip Archive