internal package Foswiki::Plugins::JQueryPlugin::CombineService
See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

internal package Foswiki::Plugins::JQueryPlugin::CombineService

combines the js and css files of a set of jQuery modules into a single js and css file

ObjectMethod finish()

called when destroying this instance

ObjectMethod run() → ($cssUrl, $jsUrl, $i18nUrl, $ids)

runs the actual file compression of all assets and returns the urls of the results. the compressed files have been added to the head and script zones of the page.

ObjectMethod clearCache()

clears all css, js and gz files from the cache

ObjectMethod handleRestCombine($session, $subject, $verb, $response)

testing handler for the combine service

ObjectMethod getFiles($modules, $seen) → ( $cssFiles, $jsFiles, $i18nFiles, $ids)

gathers all files that can be combined. css, js and i18n files are gathered individually. The $i18nFiles is an array containing entries of the form

{ namespace => "module name", file => $filePath }

So the combined i18n file can properly attribute all translation strings to their namespace.

ObjectMethod combineCssFiles($files) → $urlPath

combines all css files into one and creates a .css and a .css.gz file in the cache.

ObjectMethod readCss($fileName) → $data

reads and parses the css files. all contained url() and import() expressions will be rewritten to fix their baseUrl according to the location of the red file

ObjectMethod combineJsFiles($files) → $urlPath

combines all js files into one and creates a .js and .js.gz file in the cache

ObjectMethod combineI18nFiles($entries) → $url

combines all i18n file entries and creates a combined i18n file

StaticMethod _md5($files) → $m5String

creates am md5 for all filenames in the list

StaticMethod _url2FileName($url) → $fileName

convers an url to a public asset to a fileName as stored on the server

StaticMethod _fileName2Url($fileName) → $url

returns the url to a public asset

StaticMethod _rewriteUrl($url, $baseUrl) → $newUrl

rewrites relative urls using a new base

StaticMethod _writeDebug($msg)

prints a debug message to stderr. use TRACE constant to activate debug output

StaticMethod _expandCommonVariables()

lightweight expansion of some common variables, i.e. not using Foswiki::Func::expandCommonVariables()= for performance reasons

Topic revision: r1 - 21 Nov 2014, ProjectContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback