summaryrefslogtreecommitdiff
path: root/lib/exe
diff options
context:
space:
mode:
Diffstat (limited to 'lib/exe')
-rw-r--r--lib/exe/css.php30
-rw-r--r--lib/exe/js.php16
2 files changed, 43 insertions, 3 deletions
diff --git a/lib/exe/css.php b/lib/exe/css.php
index 6c1d60751..2212656d2 100644
--- a/lib/exe/css.php
+++ b/lib/exe/css.php
@@ -162,7 +162,7 @@ function css_out(){
* most of this function is error handling to show a nice useful error when
* LESS compilation fails
*
- * @param $css
+ * @param string $css
* @return string
*/
function css_parseless($css) {
@@ -222,6 +222,10 @@ function css_parseless($css) {
* (sans the surrounding __ and with a ini_ prefix)
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $css
+ * @param array $replacements array(placeholder => value)
+ * @return string
*/
function css_applystyle($css, $replacements) {
// we convert ini replacements to LESS variable names
@@ -250,6 +254,7 @@ function css_applystyle($css, $replacements) {
* the stylesheet modes
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
* @param string $tpl the used template
* @return array with keys 'stylesheets' and 'replacements'
*/
@@ -320,6 +325,10 @@ function css_styleini($tpl) {
* Amend paths used in replacement relative urls, refer FS#2879
*
* @author Chris Smith <chris@jalakai.co.uk>
+ *
+ * @param array $replacements with key-value pairs
+ * @param string $location
+ * @return array
*/
function css_fixreplacementurls($replacements, $location) {
foreach($replacements as $key => $value) {
@@ -403,6 +412,10 @@ function css_filetypes(){
/**
* Loads a given file and fixes relative URLs with the
* given location prefix
+ *
+ * @param string $file file system path
+ * @param string $location
+ * @return string
*/
function css_loadfile($file,$location=''){
$css_file = new DokuCssFile($file);
@@ -501,6 +514,9 @@ class DokuCssFile {
* Convert local image URLs to data URLs if the filesize is small
*
* Callback for preg_replace_callback
+ *
+ * @param array $match
+ * @return string
*/
function css_datauri($match){
global $conf;
@@ -528,9 +544,11 @@ function css_datauri($match){
* Returns a list of possible Plugin Styles (no existance check here)
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $mediatype
+ * @return array
*/
function css_pluginstyles($mediatype='screen'){
- global $lang;
$list = array();
$plugins = plugin_list();
foreach ($plugins as $p){
@@ -549,6 +567,9 @@ function css_pluginstyles($mediatype='screen'){
* Very simple CSS optimizer
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $css
+ * @return string
*/
function css_compress($css){
//strip comments through a callback
@@ -585,6 +606,9 @@ function css_compress($css){
* Keeps short comments (< 5 chars) to maintain typical browser hacks
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $matches
+ * @return string
*/
function css_comment_cb($matches){
if(strlen($matches[2]) > 4) return '';
@@ -596,7 +620,7 @@ function css_comment_cb($matches){
*
* Strips one line comments but makes sure it will not destroy url() constructs with slashes
*
- * @param $matches
+ * @param array $matches
* @return string
*/
function css_onelinecomment_cb($matches) {
diff --git a/lib/exe/js.php b/lib/exe/js.php
index bec12ef7a..97f2b52c3 100644
--- a/lib/exe/js.php
+++ b/lib/exe/js.php
@@ -154,6 +154,8 @@ function js_out(){
* Load the given file, handle include calls and print it
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $file filename path to file
*/
function js_load($file){
if(!@file_exists($file)) return;
@@ -189,6 +191,8 @@ function js_load($file){
* Returns a list of possible Plugin Scripts (no existance check here)
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @return array
*/
function js_pluginscripts(){
$list = array();
@@ -206,6 +210,8 @@ function js_pluginscripts(){
* - Nothing is returned for plugins without an entry for $lang['js']
*
* @author Gabriel Birke <birke@d-scribe.de>
+ *
+ * @return array
*/
function js_pluginstrings() {
global $conf;
@@ -231,6 +237,8 @@ function js_pluginstrings() {
*
* - $lang['js'] must be an array.
* - Nothing is returned for template without an entry for $lang['js']
+ *
+ * @return array
*/
function js_templatestrings() {
global $conf;
@@ -252,6 +260,9 @@ function js_templatestrings() {
* as newline
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $string
+ * @return string
*/
function js_escape($string){
return str_replace('\\\\n','\\n',addslashes($string));
@@ -261,6 +272,8 @@ function js_escape($string){
* Adds the given JavaScript code to the window.onload() event
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $func
*/
function js_runonstart($func){
echo "jQuery(function(){ $func; });".NL;
@@ -275,6 +288,9 @@ function js_runonstart($func){
* @author Nick Galbreath <nickg@modp.com>
* @author Andreas Gohr <andi@splitbrain.org>
* @link http://code.google.com/p/jsstrip/
+ *
+ * @param string $s
+ * @return string
*/
function js_compress($s){
$s = ltrim($s); // strip all initial whitespace