diff options
author | Fabian Becker <halfdan@xnorfz.de> | 2013-03-13 23:08:18 +0400 |
---|---|---|
committer | Fabian Becker <halfdan@xnorfz.de> | 2013-03-13 23:13:35 +0400 |
commit | fc2829c301c415c2991a7c591dd3cf9e6052e2a0 (patch) | |
tree | 6e057790000950dbf009a83928a56160d8bdaa87 /js | |
parent | abe2512262ed8ee657e5a5a5e2e2f25c40266632 (diff) |
Markdown beautification :)
Diffstat (limited to 'js')
-rw-r--r-- | js/README.md (renamed from js/README) | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/js/README b/js/README.md index 102a60a5df..478fea68d7 100644 --- a/js/README +++ b/js/README.md @@ -1,20 +1,20 @@ -Introduction +## Introduction -* The js/ folder contains: +The js/ folder contains: - - index.php - a servlet described below - - piwik.js - the uncompressed piwik.js source for you to study or reference - - README - this documentation file +* index.php - a servlet described below +* piwik.js - the uncompressed piwik.js source for you to study or reference +* README.md - this documentation file -Why Use "js/index.php"? +### Why Use "js/index.php"? * js/index.php (or implicitly as "js/") can be used to serve up the minified piwik.js - - it supports conditional-GET and Last-Modified, so piwik.js can be cached - by the browser - - it supports deflate/gzip compression if your web server (e.g., Apache - without mod_deflate or mod_gzip), shrinking the data transfer to 8K + * it supports conditional-GET and Last-Modified, so piwik.js can be cached + by the browser + * it supports deflate/gzip compression if your web server (e.g., Apache + without mod_deflate or mod_gzip), shrinking the data transfer to 8K * js/index.php (or implicitly as "js/") can also act as a proxy to piwik.php @@ -22,19 +22,25 @@ Why Use "js/index.php"? attempt to block tracking, you can change your tracking code to use "js/" instead of "piwik.js" and "piwik.php", respectively. -Deployment +## Deployment * piwik.js is minified using YUICompressor 2.4.2. To install YUICompressor run: - $ cd /path/to/piwik/js/ - $ wget http://www.julienlecomte.net/yuicompressor/yuicompressor-2.4.2.zip - $ unzip yuicompressor-2.4.2.zip + + ``` + $ cd /path/to/piwik/js/ + $ wget http://www.julienlecomte.net/yuicompressor/yuicompressor-2.4.2.zip + $ unzip yuicompressor-2.4.2.zip + ``` To compress the code containing the evil "eval", either apply the patch from http://yuilibrary.com/projects/yuicompressor/ticket/2343811, or run: - $ cd /path/to/piwik/js/ - $ sed '/<DEBUG>/,/<\/DEBUG>/d' < piwik.js | sed 's/eval/replacedEvilString/' | java -jar yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar --type js --line-break 1000 | sed 's/replacedEvilString/eval/' | sed 's/^[/][*]/\/*!/' > piwik-min.js && cp piwik-min.js ../piwik.js + + ``` + $ cd /path/to/piwik/js/ + $ sed '/<DEBUG>/,/<\/DEBUG>/d' < piwik.js | sed 's/eval/replacedEvilString/' | java -jar yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar --type js --line-break 1000 | sed 's/replacedEvilString/eval/' | sed 's/^[/][*]/\/*!/' > piwik-min.js && cp piwik-min.js ../piwik.js + ``` This will generate the minify /path/to/piwik/js/piwik-min.js and copy it to /path/to/piwik/piwik.js @@ -43,7 +49,7 @@ Deployment be removed (if present). Note: if the file "js/tests/enable_sqlite" exists, additional unit tests - (requires the sqlite extension) are enabled. + (requires the sqlite extension) are enabled. * We use /*! to include Piwik's license header in the minified source. Read Stallman's "The JavaScript Trap" for more information. |