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