Learning with Texts - Fork 2.4.0-fork
Learn foreign languages with texts
Namespaces | Functions | Variables
minifier.php File Reference

JS and CSS minifier. More...

Namespaces

namespace  Lwt
 

Functions

 minifyJS ($path, $outputPath)
 
 minifyCSS ($path, $outputPath)
 
 minifyAllJS ()
 
 minifyAllCSS ()
 
 regenerateSingleTheme ($parent_folder, $theme_folder)
 
 regenerateThemes ()
 
 minify_everything ()
 

Variables

 $jsFiles
 
 $cssFiles
 

Detailed Description

JS and CSS minifier.

Use this script to minify JS and CSS files from src/js and src/css to js/ and css/.

Function Documentation

◆ minify_everything()

minify_everything ( )

One-do-all command to minify all your JS, CSS, and regenerate themes.

Returns
void

◆ minifyAllCSS()

minifyAllCSS ( )

Minify all Cascading-Style Sheet files

@global array<string> $cssFiles All the file to be minified

Returns
void
Since
2.0.3-fork

◆ minifyAllJS()

minifyAllJS ( )

Minify all JavaScript files

@global array<string> $jsFiles All the file to be minified

Returns
void
Since
2.0.3-fork
2.3.0-fork JS code is "combined" above being minified: only one file is outputted.

◆ minifyCSS()

minifyCSS (   $path,
  $outputPath 
)

Minify a JavaScript file and outputs the result to css/

Parameters
string$pathInput file path with extension.
string$outputPathOutput file path with extension
Returns
string Minified content
Since
2.2.2-fork Relative paths in the returned content is the same as the saved content.

◆ minifyJS()

minifyJS (   $path,
  $outputPath 
)

Minify a JavaScript file and outputs the result to js/

Parameters
string$pathInput file path with extension.
string$outputPathOutput file path with extension
Returns
string Minified content
Since
2.2.2-fork Relative paths in the returned content is the same as the saved content.

◆ regenerateSingleTheme()

regenerateSingleTheme (   $parent_folder,
  $theme_folder 
)

Regenerate a single theme.

Parameters
string$parent_folderPath to the parent folder (I. E. src/themes/)
string$theme_folderName of the theme folder
Returns
void

◆ regenerateThemes()

regenerateThemes ( )

Find and regenerate all themes. CSS is minified while other files are copied.

Nested folders are ignored.

Returns
void

Variable Documentation

◆ $cssFiles

$cssFiles
Initial value:
= array(
'src/css/css_charts.css', 'src/css/feed_wizard.css', 'src/css/gallery.css',
'src/css/jplayer.css', 'src/css/jquery-ui.css', 'src/css/jquery.tagit.css',
'src/css/styles.css',
)

◆ $jsFiles

$jsFiles
Initial value:
= array(
'src/js/audio_controller.js', 'src/js/third_party/countuptimer.js',
'src/js/jq_feedwizard.js',
'src/js/jq_pgm.js', 'src/js/pgm.js',
'src/js/translation_api.js', 'src/js/unloadformcheck.js',
'src/js/third_party/sorttable.js', 'src/js/user_interactions.js',
)