# Source for file javascript.php

Documentation is available at javascript.php

    1     <?php
    2     /***********************************************************************************
    3      * javascript.php
    4      * --------------
    5      * Author: Ben Keen (ben.keen@gmail.com)
    6      * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
    7      * Release Version: 1.0.7.3
    8      * CVS Revision Version: $Revision: 1.1 $
    9      * Date Started: 2004/06/20
    10     * Last Modified: $Date: 2006/01/23 09:27:29 $
    11     *
    12     * JavaScript language file for GeSHi.
    13     *
    14     * CHANGES
    15     * -------
    16     * 2004/11/27 (1.0.1)
    17     *  -  Added support for multiple object splitters
    18     * 2004/10/27 (1.0.0)
    19     *  -  First Release
    20     *
    21     * TODO (updated 2004/11/27)
    22     * -------------------------
    23     *
    24     ************************************************************************************
    25     *
    26     *     This file is part of GeSHi.
    27     *
    28     *   GeSHi is free software; you can redistribute it and/or modify
    29     *   it under the terms of the GNU General Public License as published by
    30     *   the Free Software Foundation; either version 2 of the License, or
    31     *   (at your option) any later version.
    32     *
    33     *   GeSHi is distributed in the hope that it will be useful,
    34     *   but WITHOUT ANY WARRANTY; without even the implied warranty of
    35     *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    36     *   GNU General Public License for more details.
    37     *
    38     *   You should have received a copy of the GNU General Public License
    39     *   along with GeSHi; if not, write to the Free Software
    40     *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    41     *
    42     ************************************************************************************/
    42
    43
    44    $language_data = array (
    45      'LANG_NAME' => 'JAVASCRIPT',
    46      'COMMENT_SINGLE' => array(1 => '//'),
    47      'COMMENT_MULTI' => array('/*' => '*/'),
    48      'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
    49      'QUOTEMARKS' => array("'", '"'),
    50      'ESCAPE_CHAR' => '\\',
    51      'KEYWORDS' => array(
    52        1 => array(
    53          'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
    54          'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
    55          'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
    56          'while', 'write', 'with'
    57          ),
    58        2 => array(
    59          'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
    60          'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
    61          'protected', 'public', 'super', 'true', 'use', 'var'
    62          ),
    63        3 => array(
    64
    65          // common functions for Window object
    66          'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
    67          'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
    68          'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
    69          'stop',
    70          )
    71        ),
    72      'SYMBOLS' => array(
    73        '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
    74        ),
    75      'CASE_SENSITIVE' => array(
    76        GESHI_COMMENTS => false,
    77        1 => false,
    78        2 => false,
    79        3 => false
    80        ),
    81      'STYLES' => array(
    82        'KEYWORDS' => array(
    83          1 => 'color: #000066; font-weight: bold;',
    84          2 => 'color: #003366; font-weight: bold;',
    85          3 => 'color: #000066;'
    86          ),
    87        'COMMENTS' => array(
    88          1 => 'color: #009900; font-style: italic;',
    89          'MULTI' => 'color: #009900; font-style: italic;'
    90          ),
    91        'ESCAPE_CHAR' => array(
    92          0 => 'color: #000099; font-weight: bold;'
    93          ),
    94        'BRACKETS' => array(
    95          0 => 'color: #66cc66;'
    96          ),
    97        'STRINGS' => array(
    98          0 => 'color: #3366CC;'
    99          ),
    100       'NUMBERS' => array(
    101         0 => 'color: #CC0000;'
    102         ),
    103       'METHODS' => array(
    104         1 => 'color: #006600;'
    105         ),
    106       'SYMBOLS' => array(
    107         0 => 'color: #66cc66;'
    108         ),
    109       'REGEXPS' => array(
    110         0 => 'color: #0066FF;'
    111         ),
    112       'SCRIPT' => array(
    113         0 => '',
    114         1 => '',
    115         2 => '',
    116         3 => ''
    117         )
    118       ),
    119     'URLS' => array(
    120           1 => '',
    121           2 => '',
    122           3 => ''
    123         ),
    124     'OOLANG' => true,
    125     'OBJECT_SPLITTERS' => array(
    126         1 => '.'
    127       ),
    128     'REGEXPS' => array(
    129       0 => "/.*/([igm]*)?"         // matches js reg exps
    130       ),
    131     'STRICT_MODE_APPLIES' => GESHI_MAYBE,
    132     'SCRIPT_DELIMITERS' => array(
    133       0 => array(
    134         '<script type="text/javascript">' => '</script>'
    135         ),
    136       1 => array(
    137         '<script language="javascript">' => '</script>'
    138         )
    139       ),
    140     'HIGHLIGHT_STRICT_BLOCK' => array(
    141       0 => true,
    142       1 => true
    143     )
    144   );
    145
    146   ?>

Documentation generated on Thu, 22 Sep 2005 13:48:02 +1200 by phpDocumentor 1.2.3