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

JS and CSS minifier. More...

Namespaces

 Lwt_Documentation
 

Functions

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

Variables

const LWT_JS_FILES array( 'src/js/audio_controller.js', 'src/js/third_party/countuptimer.js', 'src/js/jq_feedwizard.js', 'src/js/text_events.js', 'src/js/jq_pgm.js', 'src/js/overlib_interface.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', )
 
const LWT_CSS_FILES 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', )
 

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/.

PHP version 8.1

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 (CSS) files

Returns
void
Since
2.0.3-fork

◆ minifyAllJS()

minifyAllJS ( )

Minify all JavaScript files

Returns
string Minified code
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