[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/lib/exe/ -> js.php (summary)

DokuWiki JavaScript creator

Author: Andreas Gohr
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 490 lines (17 kb)
Included or required: 1 time
Referenced: 1 time
Includes or requires: 1 file
 inc/init.php

Defines 8 functions

  js_out()
  js_load()
  js_pluginscripts()
  js_pluginstrings()
  js_templatestrings()
  js_escape()
  js_runonstart()
  js_compress()

Functions
Functions that are not part of a class:

js_out()   X-Ref
Output all needed JavaScript

author: Andreas Gohr <andi@splitbrain.org>

js_load($file)   X-Ref
Load the given file, handle include calls and print it

param: string $file filename path to file
author: Andreas Gohr <andi@splitbrain.org>

js_pluginscripts()   X-Ref
Returns a list of possible Plugin Scripts (no existance check here)

author: Andreas Gohr <andi@splitbrain.org>
return: array

js_pluginstrings()   X-Ref
Return an two-dimensional array with strings from the language file of each plugin.

- $lang['js'] must be an array.
- Nothing is returned for plugins without an entry for $lang['js']

author: Gabriel Birke <birke@d-scribe.de>
return: array

js_templatestrings($tpl)   X-Ref
Return an two-dimensional array with strings from the language file of current active template.

- $lang['js'] must be an array.
- Nothing is returned for template without an entry for $lang['js']

param: string $tpl
return: array

js_escape($string)   X-Ref
Escapes a String to be embedded in a JavaScript call, keeps \n
as newline

param: string $string
author: Andreas Gohr <andi@splitbrain.org>
return: string

js_runonstart($func)   X-Ref
Adds the given JavaScript code to the window.onload() event

param: string $func
author: Andreas Gohr <andi@splitbrain.org>

js_compress($s)   X-Ref
Strip comments and whitespaces from given JavaScript Code

This is a port of Nick Galbreath's python tool jsstrip.py which is
released under BSD license. See link for original code.

link: http://code.google.com/p/jsstrip/
param: string $s
author: Nick Galbreath <nickg@modp.com>
author: Andreas Gohr <andi@splitbrain.org>
return: string