Ticket #1622: 1622_packager.patch

File 1622_packager.patch, 1.5 KB (added by alfonsoml, 2 years ago)

patch for the packager

  • fckpackager.php

     
    493493                        echo '    Adding ' . basename( $file ) . "\n" ; 
    494494 
    495495                        // Compress (if needed) and process its contents. 
    496                         if ( $this->CompactJavaScript ) 
    497                                 $outputData .= FCKJavaScriptCompressor::Compress( FCKPreProcessor::Process( $data ), $this->ConstantsProcessor ) ; 
     496                        if ( preg_match( '/\.js$/', $file ) ) 
     497                        { 
     498                                if ( $this->CompactJavaScript ) 
     499                                        $outputData .= FCKJavaScriptCompressor::Compress( FCKPreProcessor::Process( $data ), $this->ConstantsProcessor ) ; 
     500                                else 
     501                                        $outputData .= FCKPreProcessor::Process( $data ) ; 
     502                        } 
     503                        else if ( preg_match( '/\.css$/', $file ) ) 
     504                        { 
     505                                $outputData .= FCKCSSProcessor::Process( $data, $file ) ; 
     506                        } 
    498507                        else 
    499                                 $outputData .= FCKPreProcessor::Process( $data ) ; 
     508                        { 
     509                                echo "    Unknown file type, not added!\n"; 
     510                        } 
    500511 
    501512                        // Each file terminates with a CRLF, even if compressed. 
    502513                        $outputData .= "\r\n" ; 
     
    659670?> 
    660671<?php 
    661672 
     673class FCKCSSProcessor 
     674{ 
     675        function FCKCSSProcessor( ) 
     676        { } 
    662677 
     678        // Intended to be static 
     679        function Process( $data, $filename ) 
     680        { 
     681                $def = "FCKCSSManager.AddCachedCSS(" . json_encode( str_replace( 'editor/', '', $filename ) )  . ",". json_encode( $data ) .");" ; 
     682                return $def ; 
     683        } 
     684} 
     685 
    663686class FCKPreProcessor 
    664687{ 
    665688        function FCKPreProcessor()