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