annotate runtime/autoload/javascriptcomplete.vim @ 29161:198a44d40394 v8.2.5100

patch 8.2.5100: memory usage tests are not retried Commit: https://github.com/vim/vim/commit/dad5d2f87b867dab48ac265e3d978d86f0541493 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 15 18:08:42 2022 +0100 patch 8.2.5100: memory usage tests are not retried Problem: Memory usage tests are not retried. Solution: Mark memory usage tests as flaky.
author Bram Moolenaar <Bram@vim.org>
date Wed, 15 Jun 2022 19:15:03 +0200
parents 1b345fb68ae3
children 83cd5e9a5f91
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
1 " Vim completion script
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
2 " Language: Java Script
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
3 " Maintainer: Jay Sitter (jay@jaysitter.com)
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
4 " URL: https://github.com/jsit/javascriptcomplete.vim/
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
5 " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
6 " Last Change: 2020 Jul 30
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
7
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
8 function! javascriptcomplete#CompleteJS(findstart, base)
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
9 if a:findstart
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
10 " locate the start of the word
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
11 let line = getline('.')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
12 let start = col('.') - 1
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
13 let curline = line('.')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
14 let compl_begin = col('.') - 2
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
15 " Bit risky but JS is rather limited language and local chars shouldn't
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
16 " fint way into names
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
17 while start >= 0 && line[start - 1] =~ '\k'
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
18 let start -= 1
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
19 endwhile
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
20 let b:compl_context = getline('.')[0:compl_begin]
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
21 return start
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
22 else
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
23 " Initialize base return lists
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
24 let res = []
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
25 let res2 = []
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
26 " a:base is very short - we need context
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
27 " Shortcontext is context without a:base, useful for checking if we are
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
28 " looking for objects and for what objects we are looking for
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
29 let context = b:compl_context
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
30 let shortcontext = substitute(context, a:base.'$', '', '')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
31 unlet! b:compl_context
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
32
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
33 if exists("b:jsrange")
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
34 let file = getline(b:jsrange[0],b:jsrange[1])
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
35 unlet! b:jsrange
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
36
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
37 if len(b:js_extfiles) > 0
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
38 let file = b:js_extfiles + file
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
39 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
40
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
41 else
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
42 let file = getline(1, '$')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
43 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
44
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
45
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
46 " Completion of properties, methods, etc. {{{
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
47 if shortcontext =~ '\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
48 " Complete methods and properties for objects
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
49 " DOM separate
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
50 let doms = ['style.']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
51 " Arrays
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
52 let arrayprop = ['constructor', 'index', 'input', 'length', 'prototype']
856
8cd729851562 updated for version 7.0g
vimboss
parents: 667
diff changeset
53 let arraymeth = ['concat', 'join', 'pop', 'push', 'reverse', 'shift',
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
54 \ 'splice', 'sort', 'toSource', 'toString', 'unshift', 'valueOf',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
55 \ 'watch', 'unwatch']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
56 call map(arraymeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
57 let arrays = arrayprop + arraymeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
58
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
59 " Boolean - complete subset of array values
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
60 " properties - constructor, prototype
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
61 " methods - toSource, toString, valueOf
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
62
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
63 " Date
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
64 " properties - constructor, prototype
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
65 let datemeth = ['getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
66 \ 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
67 \ 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
68 \ 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
69 \ 'getYear', 'parse', 'parse',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
70 \ 'setDate', 'setDay', 'setFullYear', 'setHours', 'setMilliseconds',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
71 \ 'setMinutes', 'setMonth', 'setSeconds',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
72 \ 'setUTCDate', 'setUTCDay', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
73 \ 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'setTime',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
74 \ 'toGMTString', 'toLocaleString', 'toLocaleDateString', 'toLocaleTimeString',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
75 \ 'toSource', 'toString', 'toUTCString', 'UTC', 'valueOf', 'watch', 'unwatch']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
76 call map(datemeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
77 let dates = datemeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
78
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
79 " Function
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
80 let funcprop = ['arguments', 'arguments.callee', 'arguments.caller', 'arguments.length',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
81 \ 'arity', 'constructor', 'length', 'prototype']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
82 let funcmeth = ['apply', 'call', 'toSource', 'toString', 'valueOf']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
83 call map(funcmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
84 let funcs = funcprop + funcmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
85
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
86 " Math
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
87 let mathprop = ['E', 'LN2', 'LN10', 'LOG2E', 'LOG10E', 'PI', 'SQRT1_2', 'SQRT']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
88 let mathmeth = ['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
89 \ 'log', 'max', 'min', 'pow', 'random', 'round', 'sin', 'sqrt', 'tan',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
90 \ 'watch', 'unwatch']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
91 call map(mathmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
92 let maths = mathprop + mathmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
93
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
94 " Number
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
95 let numbprop = ['MAX_VALUE', 'MIN_VALUE', 'NaN', 'NEGATIVE_INFINITY', 'POSITIVE_INFINITY',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
96 \ 'constructor', 'prototype']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
97 let numbmeth = ['toExponential', 'toFixed', 'toPrecision', 'toSource', 'toString', 'valueOf',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
98 \ 'watch', 'unwatch']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
99 call map(numbmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
100 let numbs = numbprop + numbmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
101
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
102 " Object
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
103 let objeprop = ['constructor', 'prototype']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
104 let objemeth = ['eval', 'toSource', 'toString', 'unwatch', 'watch', 'valueOf']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
105 call map(objemeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
106 let objes = objeprop + objemeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
107
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
108 " RegExp
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
109 let regeprop = ['constructor', 'global', 'ignoreCase', 'lastIndex', 'multiline', 'source', 'prototype']
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
110 let regemeth = ['exec', 'test', 'toSource', 'toString', 'watch', 'unwatch']
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
111 call map(regemeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
112 let reges = regeprop + regemeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
113
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
114 " String
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
115 let striprop = ['constructor', 'length', 'prototype']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
116 let strimeth = ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
117 \ 'fixed', 'fontcolor', 'fontsize', 'fromCharCode', 'indexOf', 'italics',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
118 \ 'lastIndexOf', 'link', 'match', 'replace', 'search', 'slice', 'small',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
119 \ 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLowerCase',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
120 \ 'toSource', 'toString', 'toUpperCase', 'watch', 'unwatch']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
121 call map(strimeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
122 let stris = striprop + strimeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
123
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
124 " User created properties
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
125 let user_props1 = filter(copy(file), 'v:val =~ "this\\.\\k"')
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
126 let juser_props1 = join(user_props1, ' ')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
127 let user_props1 = split(juser_props1, '\zethis\.')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
128 unlet! juser_props1
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
129 call map(user_props1, 'matchstr(v:val, "this\\.\\zs\\k\\+\\ze")')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
130
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
131 let user_props2 = filter(copy(file), 'v:val =~ "\\.prototype\\.\\k"')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
132 let juser_props2 = join(user_props2, ' ')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
133 let user_props2 = split(juser_props2, '\zeprototype\.')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
134 unlet! juser_props2
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
135 call map(user_props2, 'matchstr(v:val, "prototype\\.\\zs\\k\\+\\ze")')
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
136 let user_props = user_props1 + user_props2
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
137
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
138 " HTML DOM properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
139 " Anchors - anchor.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
140 let anchprop = ['accessKey', 'charset', 'coords', 'href', 'hreflang', 'id', 'innerHTML',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
141 \ 'name', 'rel', 'rev', 'shape', 'tabIndex', 'target', 'type', 'onBlur', 'onFocus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
142 let anchmeth = ['blur', 'focus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
143 call map(anchmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
144 let anths = anchprop + anchmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
145 " Area - area.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
146 let areaprop = ['accessKey', 'alt', 'coords', 'hash', 'host', 'hostname', 'href', 'id',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
147 \ 'noHref', 'pathname', 'port', 'protocol', 'search', 'shape', 'tabIndex', 'target']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
148 let areameth = ['onClick', 'onDblClick', 'onMouseOut', 'onMouseOver']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
149 call map(areameth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
150 let areas = areaprop + areameth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
151 " Base - base.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
152 let baseprop = ['href', 'id', 'target']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
153 let bases = baseprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
154 " Body - body.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
155 let bodyprop = ['aLink', 'background', 'gbColor', 'id', 'link', 'scrollLeft', 'scrollTop',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
156 \ 'text', 'vLink']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
157 let bodys = bodyprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
158 " Document - document.
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
159 let docuprop = ['anchors', 'body', 'characterSet', 'doctype',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
160 \ 'documentElement', 'documentURI', 'embeds', 'fonts', 'forms',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
161 \ 'head', 'hidden', 'images', 'implementation', 'lastStyleSheetSet',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
162 \ 'links', 'plugins', 'preferredStyleSheetSet', 'scripts',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
163 \ 'scrollingElement', 'selectedStyleSheetSet', 'styleSheetSets',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
164 \ 'timeline', 'visibilityState', 'cookie', 'defaultView',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
165 \ 'designMode', 'dir', 'domain', 'lastModified', 'location',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
166 \ 'readyState', 'referrer', 'title', 'URL', 'activeElement',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
167 \ 'fullscreenElement', 'styleSheets']
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
168 let documeth = ['adoptNode', 'close', 'createAttribute',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
169 \ 'createAttributeNS', 'createCDATASection', 'createComment',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
170 \ 'createDocumentFragment', 'createElement', 'createElementNS',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
171 \ 'createEvent', 'createExpression', 'createNSResolver',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
172 \ 'createNodeIterator', 'createProcessingInstruction', 'createRange',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
173 \ 'createTextNode', 'createTouchList', 'createTreeWalker',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
174 \ 'enableStyleSheetsForSet', 'evaluate', 'focus', 'getElementById',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
175 \ 'getElementById', 'getElementsByClassName', 'getElementsByName',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
176 \ 'getElementsByTagName', 'getElementsByTagNameNS',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
177 \ 'hasStorageAccess', 'importNode', 'onClick', 'onDblClick',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
178 \ 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp', 'onMouseDown',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
179 \ 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
180 \ 'onResize', 'open', 'querySelector', 'querySelectorAll',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
181 \ 'requestStorageAccess', 'write', 'writeln']
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
182
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
183 call map(documeth, 'v:val."("')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
184 let docuxprop = ['attributes', 'childNodes', 'doctype', 'documentElement', 'firstChild',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
185 \ 'implementation', 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
186 \ 'nodeValue', 'ownerDocument', 'parentNode', 'previousSibling']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
187 let docuxmeth = ['createAttribute', 'createCDATASection',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
188 \ 'createComment', 'createDocument', 'createDocumentFragment',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
189 \ 'createElement', 'createEntityReference', 'createProcessingInstruction',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
190 \ 'createTextNode']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
191 call map(docuxmeth, 'v:val."("')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
192 let docus = docuprop + docuxprop + documeth + docuxmeth
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
193 " Form - form.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
194 let formprop = ['elements', 'acceptCharset', 'action', 'encoding', 'enctype', 'id', 'length',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
195 \ 'method', 'name', 'tabIndex', 'target']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
196 let formmeth = ['reset', 'submit', 'onReset', 'onSubmit']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
197 call map(formmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
198 let forms = formprop + formmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
199 " Frame - frame.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
200 let framprop = ['contentDocument', 'frameBorder', 'id', 'longDesc', 'marginHeight', 'marginWidth',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
201 \ 'name', 'noResize', 'scrolling', 'src']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
202 let frammeth = ['blur', 'focus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
203 call map(frammeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
204 let frams = framprop + frammeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
205 " Frameset - frameset.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
206 let fsetprop = ['cols', 'id', 'rows']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
207 let fsetmeth = ['blur', 'focus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
208 call map(fsetmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
209 let fsets = fsetprop + fsetmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
210 " History - history.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
211 let histprop = ['length']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
212 let histmeth = ['back', 'forward', 'go']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
213 call map(histmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
214 let hists = histprop + histmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
215 " Iframe - iframe.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
216 let ifraprop = ['align', 'frameBorder', 'height', 'id', 'longDesc', 'marginHeight', 'marginWidth',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
217 \ 'name', 'scrolling', 'src', 'width']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
218 let ifras = ifraprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
219 " Image - image.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
220 let imagprop = ['align', 'alt', 'border', 'complete', 'height', 'hspace', 'id', 'isMap', 'longDesc',
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
221 \ 'lowSrc', 'name', 'src', 'useMap', 'vspace', 'width']
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
222 let imagmeth = ['onAbort', 'onError', 'onLoad']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
223 call map(imagmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
224 let imags = histprop + imagmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
225 " Button - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
226 let buttprop = ['accessKey', 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
227 let buttmeth = ['blur', 'click', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
228 call map(buttmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
229 let butts = buttprop + buttmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
230 " Checkbox - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
231 let checprop = ['accept', 'accessKey', 'align', 'alt', 'checked', 'defaultChecked',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
232 \ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
233 let checmeth = ['blur', 'click', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
234 call map(checmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
235 let checs = checprop + checmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
236 " File upload - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
237 let fileprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
238 \ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
239 let filemeth = ['blur', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
240 call map(filemeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
241 let files = fileprop + filemeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
242 " Hidden - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
243 let hiddprop = ['defaultValue', 'form', 'id', 'name', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
244 let hidds = hiddprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
245 " Password - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
246 let passprop = ['accept', 'accessKey', 'defaultValue',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
247 \ 'disabled', 'form', 'id', 'maxLength', 'name', 'readOnly', 'size', 'tabIndex',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
248 \ 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
249 let passmeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus', 'onKeyDown',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
250 \ 'onKeyPress', 'onKeyUp']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
251 call map(passmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
252 let passs = passprop + passmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
253 " Radio - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
254 let radiprop = ['accept', 'accessKey', 'align', 'alt', 'checked', 'defaultChecked',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
255 \ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
256 let radimeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
257 call map(radimeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
258 let radis = radiprop + radimeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
259 " Reset - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
260 let reseprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
261 \ 'disabled', 'form', 'id', 'name', 'size', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
262 let resemeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
263 call map(resemeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
264 let reses = reseprop + resemeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
265 " Submit - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
266 let submprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
267 \ 'disabled', 'form', 'id', 'name', 'size', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
268 let submmeth = ['blur', 'click', 'focus', 'select', 'onClick', 'onSelectStart']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
269 call map(submmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
270 let subms = submprop + submmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
271 " Text - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
272 let textprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
273 \ 'disabled', 'form', 'id', 'maxLength', 'name', 'readOnly',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
274 \ 'size', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
275 let textmeth = ['blur', 'focus', 'select', 'onBlur', 'onChange', 'onFocus', 'onKeyDown',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
276 \ 'onKeyPress', 'onKeyUp', 'onSelect']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
277 call map(textmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
278 let texts = textprop + textmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
279 " Link - link.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
280 let linkprop = ['charset', 'disabled', 'href', 'hreflang', 'id', 'media',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
281 \ 'rel', 'rev', 'target', 'type']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
282 let linkmeth = ['onLoad']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
283 call map(linkmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
284 let links = linkprop + linkmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
285 " Location - location.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
286 let locaprop = ['href', 'hash', 'host', 'hostname', 'pathname', 'port', 'protocol',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
287 \ 'search']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
288 let locameth = ['assign', 'reload', 'replace']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
289 call map(locameth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
290 let locas = locaprop + locameth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
291 " Meta - meta.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
292 let metaprop = ['charset', 'content', 'disabled', 'httpEquiv', 'name', 'scheme']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
293 let metas = metaprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
294 " Navigator - navigator.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
295 let naviprop = ['plugins', 'appCodeName', 'appName', 'appVersion', 'cookieEnabled',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
296 \ 'platform', 'userAgent']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
297 let navimeth = ['javaEnabled', 'taintEnabled']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
298 call map(navimeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
299 let navis = naviprop + navimeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
300 " Object - object.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
301 let objeprop = ['align', 'archive', 'border', 'code', 'codeBase', 'codeType', 'data',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
302 \ 'declare', 'form', 'height', 'hspace', 'id', 'name', 'standby', 'tabIndex',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
303 \ 'type', 'useMap', 'vspace', 'width']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
304 let objes = objeprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
305 " Option - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
306 let optiprop = ['defaultSelected',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
307 \ 'disabled', 'form', 'id', 'index', 'label', 'selected', 'text', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
308 let optis = optiprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
309 " Screen - screen.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
310 let screprop = ['availHeight', 'availWidth', 'colorDepth', 'height', 'width']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
311 let scres = screprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
312 " Select - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
313 let seleprop = ['options', 'disabled', 'form', 'id', 'length', 'multiple', 'name',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
314 \ 'selectedIndex', 'size', 'tabIndex', 'type', 'value']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
315 let selemeth = ['blur', 'focus', 'remove', 'onBlur', 'onChange', 'onFocus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
316 call map(selemeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
317 let seles = seleprop + selemeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
318 " Style - style.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
319 let stylprop = ['background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
320 \ 'backgroundPosition', 'backgroundRepeat',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
321 \ 'border', 'borderBottom', 'borderLeft', 'borderRight', 'borderTop',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
322 \ 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
323 \ 'borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
324 \ 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth',
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
325 \ 'borderColor', 'borderStyle', 'borderWidth', 'margin', 'marginBottom',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
326 \ 'marginLeft', 'marginRight', 'marginTop', 'outline', 'outlineStyle', 'outlineWidth',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
327 \ 'outlineColor', 'outlineStyle', 'outlineWidth', 'padding', 'paddingBottom',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
328 \ 'paddingLeft', 'paddingRight', 'paddingTop',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
329 \ 'clear', 'clip', 'clipBottom', 'clipLeft', 'clipRight', 'clipTop', 'content',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
330 \ 'counterIncrement', 'counterReset', 'cssFloat', 'cursor', 'direction',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
331 \ 'display', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight',
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
332 \ 'minWidth', 'overflow', 'overflowX', 'overflowY', 'verticalAlign', 'visibility',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
333 \ 'width',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
334 \ 'listStyle', 'listStyleImage', 'listStylePosition', 'listStyleType',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
335 \ 'cssText', 'bottom', 'height', 'left', 'position', 'right', 'top', 'width', 'zindex',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
336 \ 'orphans', 'widows', 'page', 'pageBreakAfter', 'pageBreakBefore', 'pageBreakInside',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
337 \ 'borderCollapse', 'borderSpacing', 'captionSide', 'emptyCells', 'tableLayout',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
338 \ 'color', 'font', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
339 \ 'fontStyle', 'fontVariant', 'fontWeight', 'letterSpacing', 'lineHeight', 'quotes',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
340 \ 'textAlign', 'textIndent', 'textShadow', 'textTransform', 'textUnderlinePosition',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
341 \ 'unicodeBidi', 'whiteSpace', 'wordSpacing']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
342 let styls = stylprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
343 " Table - table.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
344 let tablprop = ['rows', 'tBodies', 'align', 'bgColor', 'border', 'caption', 'cellPadding',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
345 \ 'cellSpacing', 'frame', 'height', 'rules', 'summary', 'tFoot', 'tHead', 'width']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
346 let tablmeth = ['createCaption', 'createTFoot', 'createTHead', 'deleteCaption', 'deleteRow',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
347 \ 'deleteTFoot', 'deleteTHead', 'insertRow']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
348 call map(tablmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
349 let tabls = tablprop + tablmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
350 " Table data - TableData.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
351 let tdatprop = ['abbr', 'align', 'axis', 'bgColor', 'cellIndex', 'ch', 'chOff',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
352 \ 'colSpan', 'headers', 'noWrap', 'rowSpan', 'scope', 'vAlign', 'width']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
353 let tdats = tdatprop
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
354 " Table row - TableRow.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
355 let trowprop = ['cells', 'align', 'bgColor', 'ch', 'chOff', 'rowIndex', 'sectionRowIndex',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
356 \ 'vAlign']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
357 let trowmeth = ['deleteCell', 'insertCell']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
358 call map(trowmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
359 let trows = trowprop + trowmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
360 " Textarea - accessible only by other properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
361 let tareprop = ['accessKey', 'cols', 'defaultValue',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
362 \ 'disabled', 'form', 'id', 'name', 'readOnly', 'rows',
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
363 \ 'tabIndex', 'type', 'value', 'selectionStart', 'selectionEnd']
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
364 let taremeth = ['blur', 'focus', 'select', 'onBlur', 'onChange', 'onFocus']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
365 call map(taremeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
366 let tares = tareprop + taremeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
367 " Window - window.
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
368 let windprop = ['frames', 'closed', 'defaultStatus', 'encodeURI', 'event', 'history',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
369 \ 'length', 'location', 'name', 'onload', 'opener', 'parent', 'screen', 'self',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
370 \ 'status', 'top', 'XMLHttpRequest', 'ActiveXObject']
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
371 let windmeth = ['alert', 'blur', 'clearInterval', 'clearTimeout', 'close', 'confirm', 'focus',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
372 \ 'moveBy', 'moveTo', 'open', 'print', 'prompt', 'scrollBy', 'scrollTo', 'setInterval',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
373 \ 'setTimeout']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
374 call map(windmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
375 let winds = windprop + windmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
376 " XMLHttpRequest - access by new xxx()
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
377 let xmlhprop = ['onreadystatechange', 'readyState', 'responseText', 'responseXML',
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
378 \ 'status', 'statusText', 'parseError']
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
379 let xmlhmeth = ['abort', 'getAllResponseHeaders', 'getResponseHeaders', 'open',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
380 \ 'send', 'setRequestHeader']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
381 call map(xmlhmeth, 'v:val."("')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
382 let xmlhs = xmlhprop + xmlhmeth
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
383
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
384 " XML DOM
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
385 " Attributes - element.attributes[x].
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
386 let xdomattrprop = ['name', 'specified', 'value']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
387 " Element - anyelement.
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
388 let xdomelemprop = ['attributes', 'childNodes', 'firstChild', 'lastChild',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
389 \ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
390 \ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling', 'tagName']
21676
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
391 let xdomelemmeth = ['appendChild', 'addEventListener', 'cloneNode',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
392 \ 'dispatchEvent', 'getAttribute', 'getAttributeNode',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
393 \ 'getElementsByTagName', 'hasChildNodes', 'insertBefore',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
394 \ 'normalize', 'removeAttribute', 'removeAttributeNode',
1b345fb68ae3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 11062
diff changeset
395 \ 'removeChild', 'removeEventListener', 'replaceChild',
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
396 \ 'setAttribute', 'setAttributeNode']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
397 call map(xdomelemmeth, 'v:val."("')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
398 let xdomelems = xdomelemprop + xdomelemmeth
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
399 " Node - anynode.
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
400 let xdomnodeprop = ['attributes', 'childNodes', 'firstChild', 'lastChild',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
401 \ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
402 \ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
403 let xdomnodemeth = ['appendChild', 'cloneNode',
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
404 \ 'hasChildNodes', 'insertBefore', 'removeChild', 'replaceChild']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
405 call map(xdomnodemeth, 'v:val."("')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
406 let xdomnodes = xdomnodeprop + xdomnodemeth
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
407 " NodeList
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
408 let xdomnliss = ['length', 'item(']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
409 " Error - parseError.
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
410 let xdomerror = ['errorCode', 'reason', 'line', 'linepos', 'srcText', 'url', 'filepos']
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
411
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
412 " Find object type declaration to reduce number of suggestions. {{{
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
413 " 1. Get object name
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
414 " 2. Find object declaration line
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
415 " 3. General declaration follows "= new Type" syntax, additional else
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
416 " for regexp "= /re/"
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
417 " 4. Make correction for Microsoft.XMLHTTP ActiveXObject
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
418 " 5. Repeat for external files
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
419 let object = matchstr(shortcontext, '\zs\k\+\ze\(\[.\{-}\]\)\?\.$')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
420 if len(object) > 0
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
421 let decl_line = search(object.'.\{-}=\s*new\s*', 'bn')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
422 if decl_line > 0
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
423 let object_type = matchstr(getline(decl_line), object.'.\{-}=\s*new\s*\zs\k\+\ze')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
424 if object_type == 'ActiveXObject' && matchstr(getline(decl_line), object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
425 let object_type = 'XMLHttpRequest'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
426 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
427 else
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
428 let decl_line = search('var\s*'.object.'\s*=\s*\/', 'bn')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
429 if decl_line > 0
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
430 let object_type = 'RegExp'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
431 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
432 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
433 " We didn't find var declaration in current file but we may have
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
434 " something in external files.
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
435 if decl_line == 0 && exists("b:js_extfiles")
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
436 let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "'.object.'.\\{-}=\\s*new\\s*"')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
437 if len(dext_line) > 0
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
438 let object_type = matchstr(dext_line[-1], object.'.\{-}=\s*new\s*\zs\k\+\ze')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
439 if object_type == 'ActiveXObject' && matchstr(dext_line[-1], object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
440 let object_type = 'XMLHttpRequest'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
441 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
442 else
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
443 let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "var\s*'.object.'\\s*=\\s*\\/"')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
444 if len(dext_line) > 0
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
445 let object_type = 'RegExp'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
446 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
447 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
448 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
449 endif
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
450 " }}}
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
451
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
452 if !exists('object_type')
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
453 let object_type = ''
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
454 endif
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
455
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
456 if object_type == 'Date'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
457 let values = dates
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
458 elseif object_type == 'Image'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
459 let values = imags
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
460 elseif object_type == 'Array'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
461 let values = arrays
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
462 elseif object_type == 'Boolean'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
463 " TODO: a bit more than real boolean
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
464 let values = arrays
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
465 elseif object_type == 'XMLHttpRequest'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
466 let values = xmlhs
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
467 elseif object_type == 'String'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
468 let values = stris
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
469 elseif object_type == 'RegExp'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
470 let values = reges
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
471 elseif object_type == 'Math'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
472 let values = maths
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
473 endif
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
474
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
475 if !exists('values')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
476 " List of properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
477 if shortcontext =~ 'Math\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
478 let values = maths
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
479 elseif shortcontext =~ 'anchors\(\[.\{-}\]\)\?\.$'
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
480 let values = anths
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
481 elseif shortcontext =~ 'area\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
482 let values = areas
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
483 elseif shortcontext =~ 'base\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
484 let values = bases
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
485 elseif shortcontext =~ 'body\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
486 let values = bodys
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
487 elseif shortcontext =~ 'document\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
488 let values = docus
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
489 elseif shortcontext =~ 'forms\(\[.\{-}\]\)\?\.$'
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
490 let values = forms
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
491 elseif shortcontext =~ 'frameset\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
492 let values = fsets
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
493 elseif shortcontext =~ 'history\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
494 let values = hists
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
495 elseif shortcontext =~ 'iframe\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
496 let values = ifras
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
497 elseif shortcontext =~ 'images\(\[.\{-}\]\)\?\.$'
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
498 let values = imags
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
499 elseif shortcontext =~ 'links\(\[.\{-}\]\)\?\.$'
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
500 let values = links
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
501 elseif shortcontext =~ 'location\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
502 let values = locas
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
503 elseif shortcontext =~ 'meta\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
504 let values = metas
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
505 elseif shortcontext =~ 'navigator\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
506 let values = navis
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
507 elseif shortcontext =~ 'object\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
508 let values = objes
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
509 elseif shortcontext =~ 'screen\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
510 let values = scres
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
511 elseif shortcontext =~ 'style\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
512 let values = styls
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
513 elseif shortcontext =~ 'table\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
514 let values = tabls
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
515 elseif shortcontext =~ 'TableData\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
516 let values = tdats
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
517 elseif shortcontext =~ 'TableRow\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
518 let values = trows
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
519 elseif shortcontext =~ 'window\.$'
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
520 let values = winds
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
521 elseif shortcontext =~ 'parseError\.$'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
522 let values = xdomerror
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
523 elseif shortcontext =~ 'attributes\[\d\+\]\.$'
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
524 let values = xdomattrprop
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
525 else
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
526 let values = user_props + arrays + dates + funcs + maths + numbs + objes + reges + stris
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
527 let values += doms + anths + areas + bases + bodys + docus + forms + frams + fsets + hists
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
528 let values += ifras + imags + links + locas + metas + navis + objes + scres
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
529 let values += tabls + trows + tares + winds
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
530 let values += xdomnodes + xdomnliss + xdomelems
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
531 endif
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
532 endif
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
533
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
534 for m in values
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
535 if m =~? '^'.a:base
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
536 call add(res, m)
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
537 elseif m =~? a:base
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
538 call add(res2, m)
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
539 endif
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
540 endfor
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
541
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
542 unlet! values
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
543 return res + res2
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
544
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
545 endif
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
546 " }}}
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
547
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
548 " Get variables data.
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
549 let variables = filter(copy(file), 'v:val =~ "var\\s"')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
550 call map(variables, 'matchstr(v:val, ".\\{-}var\\s\\+\\zs.*\\ze")')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
551 call map(variables, 'substitute(v:val, ";\\|$", ",", "g")')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
552 let vars = []
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
553 " This loop (and next one) is necessary to get variable names from
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
554 " constructs like: var var1, var2, var3 = "something";
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
555 for i in range(len(variables))
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
556 let comma_separated = split(variables[i], ',\s*')
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
557 call map(comma_separated, 'matchstr(v:val, "\\k\\+")')
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
558 let vars += comma_separated
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
559 endfor
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
560
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
561 let variables = sort(vars)
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
562 unlet! vars
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
563
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
564 " Add "no var" variables.
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
565 let undeclared_variables = filter(copy(file), 'v:val =~ "^\\s*\\k\\+\\s*="')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
566 let u_vars = []
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
567 for i in range(len(undeclared_variables))
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
568 let split_equal = split(undeclared_variables[i], '\s*=')
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
569 call map(split_equal, 'matchstr(v:val, "\\k\\+$")')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
570 let u_vars += split_equal
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
571 endfor
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
572
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
573 let variables += sort(u_vars)
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
574 unlet! u_vars
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
575
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
576 " Get functions
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
577 let functions = filter(copy(file), 'v:val =~ "^\\s*function\\s"')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
578 let arguments = copy(functions)
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
579 call map(functions, 'matchstr(v:val, "^\\s*function\\s\\+\\zs\\k\\+")')
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
580 call map(functions, 'v:val."("')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
581 let functions = sort(functions)
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
582
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
583 " Create table to keep arguments for additional 'menu' info
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
584 let b:js_menuinfo = {}
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
585 for i in arguments
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
586 let g:ia = i
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
587 let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))')
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 856
diff changeset
588 if len(f_elements) >= 3
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
589 let b:js_menuinfo[f_elements[1].'('] = f_elements[2]
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
590 endif
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
591 endfor
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
592
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
593 " Get functions arguments
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
594 call map(arguments, 'matchstr(v:val, "function.\\{-}(\\zs.\\{-}\\ze)")')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
595 let jargs = join(arguments, ',')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
596 let jargs = substitute(jargs, '\s', '', 'g')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
597 let arguments = split(jargs, ',')
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
598 let arguments = sort(arguments)
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
599
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
600 " Built-in functions
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
601 let builtin = ['alert(', 'confirm(']
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
602
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
603 " Top-level HTML DOM objects
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
604 let htmldom = ['document', 'anchor', 'area', 'base', 'body', 'document', 'event', 'form', 'frame', 'frameset', 'history', 'iframe', 'image', 'input', 'link', 'location', 'meta', 'navigator', 'object', 'option', 'screen', 'select', 'table', 'tableData', 'tableHeader', 'tableRow', 'textarea', 'window']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
605 call map(htmldom, 'v:val."."')
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
606
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
607 " Top-level properties
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
608 let properties = ['decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
609 \ 'eval', 'Infinity', 'isFinite', 'isNaN', 'NaN', 'Number', 'parseFloat',
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
610 \ 'parseInt', 'String', 'undefined', 'escape', 'unescape']
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
611
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
612 " Keywords
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
613 let keywords = ["Array", "Boolean", "Date", "Function", "Math", "Number", "Object", "RegExp", "String", "XMLHttpRequest", "ActiveXObject", "abstract", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double ", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in ", "instanceof", "int", "interface", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super ", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with"]
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
614
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
615 let values = variables + functions + htmldom + arguments + builtin + properties + keywords
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
616
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
617 for m in values
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
618 if m =~? '^'.a:base
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
619 call add(res, m)
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
620 elseif m =~? a:base
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
621 call add(res2, m)
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
622 endif
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
623 endfor
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
624
667
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
625 let menu = res + res2
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
626 let final_menu = []
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
627 for i in range(len(menu))
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
628 let item = menu[i]
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
629 if item =~ '($'
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
630 let kind = 'f'
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
631 if has_key(b:js_menuinfo, item)
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
632 let m_info = b:js_menuinfo[item]
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
633 else
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
634 let m_info = ''
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
635 endif
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
636 else
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
637 let kind = 'v'
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
638 let m_info = ''
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
639 endif
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
640 let final_menu += [{'word':item, 'menu':m_info, 'kind':kind}]
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
641 endfor
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
642 let g:fm = final_menu
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
643 return final_menu
9090f866cd57 updated for version 7.0197
vimboss
parents: 659
diff changeset
644
651
bc95c6c4bac1 updated for version 7.0191
vimboss
parents:
diff changeset
645 endfunction
659
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
646
d6a69271cb9a updated for version 7.0194
vimboss
parents: 651
diff changeset
647 " vim:set foldmethod=marker: