Subversion Repositories wimsdev

Rev

Blame | Last modification | View Log | RSS feed

  1. editAreaLoader.load_syntax["js"] = {
  2.         'COMMENT_SINGLE' : {1 : '//'}
  3.         ,'COMMENT_MULTI' : {'/*' : '*/'}
  4.         ,'QUOTEMARKS' : {1: "'", 2: '"'}
  5.         ,'KEYWORD_CASE_SENSITIVE' : false
  6.         ,'KEYWORDS' : {
  7.                 'statements' : [
  8.                         'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
  9.                         'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
  10.                         'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
  11.                         'while', 'write', 'with'
  12.                 ]
  13.                 ,'keywords' : [
  14.                         'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
  15.                         'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
  16.                         'protected', 'public', 'super', 'true', 'use', 'var', 'window', 'document',            
  17.                         // the list below must be sorted and checked (if it is a keywords or a function and if it is not present twice
  18.                         'Link ', 'outerHeight ', 'Anchor', 'FileUpload',
  19.                         'location', 'outerWidth', 'Select', 'Area', 'find', 'Location', 'Packages', 'self',
  20.                         'arguments', 'locationbar', 'pageXoffset', 'Form',
  21.                         'Math', 'pageYoffset', 'setTimeout', 'assign', 'Frame', 'menubar', 'parent', 'status',
  22.                         'blur', 'frames', 'MimeType', 'parseFloat', 'statusbar', 'Boolean', 'Function', 'moveBy',
  23.                         'parseInt', 'stop', 'Button', 'getClass', 'moveTo', 'Password', 'String', 'callee', 'Hidden',
  24.                         'name', 'personalbar', 'Submit', 'caller', 'history', 'NaN', 'Plugin', 'sun', 'captureEvents',
  25.                         'History', 'navigate', 'print', 'taint', 'Checkbox', 'home', 'navigator', 'prompt', 'Text',
  26.                         'Image', 'Navigator', 'prototype', 'Textarea', 'clearTimeout', 'Infinity',
  27.                         'netscape', 'Radio', 'toolbar', 'close', 'innerHeight', 'Number', 'ref', 'top', 'closed',
  28.                         'innerWidth', 'Object', 'RegExp', 'toString', 'confirm', 'isFinite', 'onBlur', 'releaseEvents',
  29.                         'unescape', 'constructor', 'isNan', 'onError', 'Reset', 'untaint', 'Date', 'java', 'onFocus',
  30.                         'resizeBy', 'unwatch', 'defaultStatus', 'JavaArray', 'onLoad', 'resizeTo', 'valueOf', 'document',
  31.                         'JavaClass', 'onUnload', 'routeEvent', 'watch', 'Document', 'JavaObject', 'open', 'scroll', 'window',
  32.                         'Element', 'JavaPackage', 'opener', 'scrollbars', 'Window', 'escape', 'length', 'Option', 'scrollBy'                   
  33.                 ]
  34.         ,'functions' : [
  35.                         // common functions for Window object
  36.                         'alert', 'Array', 'back', 'blur', 'clearInterval', 'close', 'confirm', 'eval ', 'focus', 'forward', 'home',
  37.                         'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
  38.                         'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'scrollTo', 'setInterval', 'status',
  39.                         'stop'
  40.                 ]
  41.         }
  42.         ,'OPERATORS' :[
  43.                 '+', '-', '/', '*', '=', '<', '>', '%', '!'
  44.         ]
  45.         ,'DELIMITERS' :[
  46.                 '(', ')', '[', ']', '{', '}'
  47.         ]
  48.         ,'STYLES' : {
  49.                 'COMMENTS': 'color: #AAAAAA;'
  50.                 ,'QUOTESMARKS': 'color: #6381F8;'
  51.                 ,'KEYWORDS' : {
  52.                         'statements' : 'color: #60CA00;'
  53.                         ,'keywords' : 'color: #48BDDF;'
  54.                         ,'functions' : 'color: #2B60FF;'
  55.                 }
  56.                 ,'OPERATORS' : 'color: #FF00FF;'
  57.                 ,'DELIMITERS' : 'color: #0038E1;'
  58.                                
  59.         }
  60.         ,'AUTO_COMPLETION' :  {
  61.                 "default": {    // the name of this definition group. It's posisble to have different rules inside the same definition file
  62.                         "REGEXP": { "before_word": "[^a-zA-Z0-9_]|^"    // \\s|\\.|
  63.                                                 ,"possible_words_letters": "[a-zA-Z0-9_]+"
  64.                                                 ,"letter_after_word_must_match": "[^a-zA-Z0-9_]|$"
  65.                                                 ,"prefix_separator": "\\."
  66.                                         }
  67.                         ,"CASE_SENSITIVE": true
  68.                         ,"MAX_TEXT_LENGTH": 100         // the maximum length of the text being analyzed before the cursor position
  69.                         ,"KEYWORDS": {
  70.                                 '': [   // the prefix of thoses items
  71.                                                 /**
  72.                                                  * 0 : the keyword the user is typing
  73.                                                  * 1 : (optionnal) the string inserted in code ("{@}" being the new position of the cursor, "§" beeing the equivalent to the value the typed string indicated if the previous )
  74.                                                  *              If empty the keyword will be displayed
  75.                                                  * 2 : (optionnal) the text that appear in the suggestion box (if empty, the string to insert will be displayed)
  76.                                                  */
  77.                                                  ['Array', '§()', '']
  78.                                         ,['alert', '§({@})', 'alert(String message)']
  79.                                         ,['document']
  80.                                         ,['window']
  81.                                 ]
  82.                         ,'window' : [
  83.                                          ['location']
  84.                                         ,['document']
  85.                                         ,['scrollTo', 'scrollTo({@})', 'scrollTo(Int x,Int y)']
  86.                                         ]
  87.                         ,'location' : [
  88.                                          ['href']
  89.                                         ]
  90.                         }
  91.                 }
  92.         }
  93. };
  94.