-
Notifications
You must be signed in to change notification settings - Fork 0
/
mootools.syntax
572 lines (538 loc) · 18.5 KB
/
mootools.syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
---
name: MooTools
scopeName: source.js.mootools
repository:
array-functions:
name: meta.function.array.js.mootools
endCaptures:
"1":
name: support.function.array.js.mootools
begin: (\$(?:each|A)\()
contentName: variable.parameter.function.array.js.mootools
beginCaptures:
"1":
name: support.function.array.js.mootools
end: (\))
patterns:
- include: source.js
element-functions:
name: meta.function.element.js.mootools
endCaptures:
"1":
name: support.function.element.js.mootools
begin: (\$?\$\()
contentName: variable.parameter.function.element.js.mootools
beginCaptures:
"1":
name: support.function.element.js.mootools
end: (\))
patterns:
- include: source.js
hash-functions:
name: meta.function.hash.js.mootools
endCaptures:
"1":
name: support.function.hash.js.mootools
begin: (\$H\()
contentName: variable.parameter.function.hash.js.mootools
beginCaptures:
"1":
name: support.function.hash.js.mootools
end: (\))
patterns:
- include: source.js
fx-options:
patterns:
- name: support.class.keys.fx.options.js.mootools
match: \b(onStart|onComplete|transition|duration|unit|wait|fps)\b
- name: support.class.keys.fx.slide.options.js.mootools
match: \b(mode)\b
leading-space:
patterns:
- name: meta.leading-tabs
begin: ^(?=(\t| ))
end: (?=[^\t\s])
patterns:
- captures:
"6":
name: meta.even-tab.group6.spaces
"11":
name: meta.odd-tab.group11.spaces
"7":
name: meta.odd-tab.group7.spaces
"8":
name: meta.even-tab.group8.spaces
"9":
name: meta.odd-tab.group9.spaces
"1":
name: meta.odd-tab.group1.spaces
"2":
name: meta.even-tab.group2.spaces
"3":
name: meta.odd-tab.group3.spaces
"4":
name: meta.even-tab.group4.spaces
"10":
name: meta.even-tab.group10.spaces
"5":
name: meta.odd-tab.group5.spaces
match: ( )( )?( )?( )?( )?( )?( )?( )?( )?( )?( )?
- captures:
"6":
name: meta.even-tab.group6.tab
"11":
name: meta.odd-tab.group11.tab
"7":
name: meta.odd-tab.group7.tab
"8":
name: meta.even-tab.group8.tab
"9":
name: meta.odd-tab.group9.tab
"1":
name: meta.odd-tab.group1.tab
"2":
name: meta.even-tab.group2.tab
"3":
name: meta.odd-tab.group3.tab
"4":
name: meta.even-tab.group4.tab
"10":
name: meta.even-tab.group10.tab
"5":
name: meta.odd-tab.group5.tab
match: (\t)(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?(\t)?
comment: |
The leading-space code is the ribbon highlighing thomas Aylott contributed to source.js.prototype.
More info in this thread:
http://comox.textdrive.com/pipermail/textmate/2006-August/012373.html
dom-functions:
name: meta.function.dom.js.mootools
endCaptures:
"1":
name: support.function.dom.js.mootools
begin: (\$ES?\()
contentName: variable.parameter.function.dom.js.mootools
beginCaptures:
"1":
name: support.function.dom.js.mootools
end: (\))
patterns:
- include: source.js
uuid: 7E4B5859-2FB4-4D2A-9105-276BDE28B94E
foldingStartMarker: (^.*{[^}]*$|^.*\([^\)]*$|^.*/\*(?!.*\*/).*$)
patterns:
- name: support.class.js.mootools
match: \b(Class|Array|Element|Event|Function|String)\b
comment: |-
Class
The base class object of the http://mootools.net framework.
http://docs.mootools.net/files/Core/Moo-js.html
- name: support.class.class.js.mootools
match: \b(empty|extend|implement)\b
- name: support.function.class.js.mootools
match: \b(extend|Native)\b
- name: support.function.utility.js.mootools
match: \$(type|chk|pick|random|clear)\b
comment: |
Utility
Contains Utility functions
http://docs.mootools.net/files/Core/Utility-js.html
- captures:
"1":
name: support.class.window.browser.js.mootools
match: window\.(ie|ie6|ie7|khtml|gecko)\b
- include: "#array-functions"
comment: |-
Array
A collection of The Array Object prototype methods.
http://docs.mootools.net/files/Native/Array-js.html
- name: support.class.array.js.mootools
match: \b(forEach|filter|map|every|some|indexOf|each|copy|remove|test|extend|associate)\b
- include: "#element-functions"
comment: |-
Element
Custom class to allow all of its methods to be used with any DOM element via the dollar function $.
http://docs.mootools.net/files/Native/Element-js.html
- name: support.class.element.js.mootools
match: \b(injectBefore|injectAfter|injectInside|adopt|remove|clone|replaceWith|appendText|hasClass|addClass|removeClass|toggleClass|setStyle|setStyles|setOpacity|getStyle|addEvent|removeEvent|removeEvents|fireEvent|getPrevious|getNext|getFirst|getLast|getParent|getChildren|setProperty|setProperties|setHTML|getProperty|getTag|scrollTo|getValue|getSize|getPosition|getTop|getLeft|getCoordinates)\b
- name: support.class.event.js.mootools
match: \b(stop|stopPropagation|preventDefault|bindWithEvent)\b
comment: |-
Event
Cross browser methods to manage events.
http://docs.mootools.net/files/Native/Event-js.html
- name: support.class.function.js.mootools
match: \b(create|pass|attempt|bind|bindAsEventListener|delay|periodical)\b
comment: |-
Function
A collection of The Function Object prototype methods.
http://docs.mootools.net/files/Native/Function-js.html
- name: support.class.string.js.mootools
match: \b(test|toInt|camelCase|hyphenate|capitalize|trim|clean|rgbToHex|hexToRgb)\b
comment: |-
String
A collection of The String Object prototype methods.
http://docs.mootools.net/files/Native/String-js.html
- name: support.class.number.js.mootools
match: \btoInt\b
- include: "#dom-functions"
comment: |-
DOM
Css Query related function and Element extensions.
http://docs.mootools.net/files/Addons/Dom-js.html
- name: support.class.dom.js.mootools
match: \b(getElements|getElementById|getElement|getElementsBySelector|getElementsByClassName)\b
comment: document. getElementsByClassName might belong somewhere else
- include: "#hash-functions"
comment: |-
Hash
It wraps an object that it uses internally as a map.
http://docs.mootools.net/files/Addons/Hash-js.html
-- note: several overlaps in here with named properties from array.js.mootools
- name: support.class.hash.js.mootools
match: \b(get|hasKey|set|remove|each|extend|empty|keys|values)\b
- name: support.class.color.js.mootools
match: \b(mix|invert|setHue|setSaturation|setBrightness)\b
comment: |-
Color
Creates a new Color Object, which is an array with some color specific methods.
http://docs.mootools.net/files/Addons/Color-js.html
- name: support.function.color.js.mootools
captures:
"1":
name: variable.parameter.function.js
match: \$(?:RGB|HSB)\(([^)]*)\)\b
- name: support.function.chain.js.mootools
match: \b(chain|(call|clear)Chain)\b
comment: |-
Common
Contains common implementations for custom classes.
http://docs.mootools.net/files/Addons/Common-js.html
- name: support.function.events.js.mootools
match: \b(add|fire|remove)Event\b
- name: support.function.options.js.mootools
match: \bsetOptions\b
- name: support.class.base.window.js.mootools
match: \bonDomReady\b
comment: |-
Window Base
Cross browser methods to get the window size, onDomReady method.
http://docs.mootools.net/files/Window/Window-Base-js.html
-- note: addEvent is already listed under Element
- name: support.class.size.window.js.mootools
match: \b(get(Width|Height|Scroll(Width|Height|Left|Top)))\b
comment: |-
Window Size
Cross browser methods to get various window dimensions.
http://docs.mootools.net/files/Window/Window-Size-js.html
-- note: getSize is already listed under Element
- name: support.class.ajax.js.mootools
match: \b(request|evalScripts)\b
comment: |-
Ajax
An Ajax class, For all your asynchronous needs.
http://docs.mootools.net/files/Remote/Ajax-js.html
- name: support.function.js.mootools
match: \btoQueryString\b
comment: "note: both Object and Element have a toQueryString function/property"
- name: support.class.element.js
match: \bsend\b
- name: support.function.asset.js.mootools
match: \b(javascript|css|images?)\b
comment: |-
Assets
provides dynamic loading for images, css and javascript files.
http://docs.mootools.net/files/Remote/Assets-js.html
- name: support.class.cookie.js.mootools
match: \b(set|get|remove)\b
comment: |-
Cookie
Class for creating, getting, and removing cookies.
http://docs.mootools.net/files/Remote/Assets-js.html
- name: support.class.json.js.mootools
match: \b(toString|evaluate)\b
comment: |-
Json
Simple Json parser and Stringyfier, See: http://www.json.org/
http://docs.mootools.net/files/Remote/Json-js.html
- name: support.class.json.js.mootools
match: \bJson\.Remote\b
comment: |-
Json Remote
Wrapped XHR with automated sending and receiving of Javascript Objects in Json Format.
http://docs.mootools.net/files/Remote/Json-Remote-js.html
- name: support.class.xhr.js.mootools
match: \bXHR\b
comment: |-
XHR
Contains the basic XMLHttpRequest Class Wrapper.
http://docs.mootools.net/files/Remote/XHR-js.html
- name: support.class.base.fx.js.mootools
match: \b(set|start|stop)\b
comment: |-
Fx.Base
Base class for the Mootools Effects (Moo.Fx) library.
http://docs.mootools.net/files/Effects/Fx-Base-js.html
- name: support.class.transitions.fx.js.mootools
match: \b(linear|sineInOut)\b
- name: support.class.keys.options.transitions.fx
match: \b(onStart|onComplete|transition|duration|unit|wait|fps)\b
- name: support.class.elements.fx.js.mootools
match: \b(start)\b
comment: |-
Fx.Elements
Fx.Elements allows you to apply any number of styles transitions to a selection of elements.
http://docs.mootools.net/files/Effects/Fx-Elements-js.html
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (new)\s+(Fx\.Elements)(\()
contentName: variable.parameter.fx.elements.js.mootools
beginCaptures:
"1":
name: keyword.operator.new.js
"2":
name: entity.name.type.instance.js.mootools
"3":
name: punctuation.definition.parameters.begin.js
end: (\)(;|$))
patterns:
- include: "#element-functions"
- include: "#array-functions"
- include: "#dom-functions"
- include: "#hash-functions"
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (\{)
contentName: variable.parameter.fx.elements.options.js.mootools
beginCaptures:
"1":
name: punctuation.definition.parameters.begin.js
end: (\})(?=\))
patterns:
- name: punctuation.separator.key-value.js.mootools
match: (:)
- include: "#fx-options"
- include: source.js
- name: support.class.scroll.fx.js.mootools
match: \b(scrollTo|to(Top|Bottom|Left|Right|Element))
comment: |-
Fx.Scroll
Scroll any element with an overflow, including the window element.
http://docs.mootools.net/files/Effects/Fx-Scroll-js.html
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (new)\s+(Fx\.Scroll)(\()
contentName: variable.parameter.fx.scroll.js.mootools
beginCaptures:
"1":
name: keyword.operator.new.js
"2":
name: entity.name.type.instance.js.mootools
"3":
name: punctuation.definition.parameters.begin.js
end: (\)(;|$))
patterns:
- include: "#element-functions"
- include: "#array-functions"
- include: "#dom-functions"
- include: "#hash-functions"
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (\{)
contentName: variable.parameter.fx.scroll.options.js.mootools
beginCaptures:
"1":
name: punctuation.definition.parameters.begin.js
end: (\})(?=\))
patterns:
- name: punctuation.separator.key-value.js.mootools
match: (:)
- include: "#fx-options"
- include: source.js
- name: support.class.slide.fx.js.mootools
match: \b(slide(In|Out)|hide|show|toggle)\b
comment: |-
Fx.Slide
The slide effect; slides an element in horizontally or vertically, the contents will fold inside.
http://docs.mootools.net/files/Effects/Fx-Slide-js.html
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (new)\s+(Fx\.Slide)(\()
contentName: variable.parameter.fx.slide.js.mootools
beginCaptures:
"1":
name: keyword.operator.new.js
"2":
name: entity.name.type.instance.js.mootools
"3":
name: punctuation.definition.parameters.begin.js
end: (\)(;|$))
patterns:
- include: "#element-functions"
- include: "#array-functions"
- include: "#dom-functions"
- include: "#hash-functions"
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (\{)
contentName: variable.parameter.fx.slide.options.js.mootools
beginCaptures:
"1":
name: punctuation.definition.parameters.begin.js
end: (\})(?=\))
patterns:
- name: punctuation.separator.key-value.js.mootools
match: (:)
- include: "#fx-options"
- include: source.js
- name: support.class.slide.fx.js.mootools
match: \b(hide|start)\b
comment: |-
Fx.Style
The Style effect; Extends Fx.Base, inherits all its properties.
http://docs.mootools.net/files/Effects/Fx-Style-js.html
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (new)\s+(Fx\.Style)(\()
contentName: variable.parameter.fx.style.js.mootools
beginCaptures:
"1":
name: keyword.operator.new.js
"2":
name: entity.name.type.instance.fx.style.js.mootools
"3":
name: punctuation.definition.parameters.begin.js
end: (\)(;|$))
patterns:
- include: "#element-functions"
- include: "#array-functions"
- include: "#dom-functions"
- include: "#hash-functions"
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: ,\s*(\{)
contentName: variable.parameter.fx.style.options.js.mootools
beginCaptures:
"1":
name: punctuation.definition.parameters.begin.js
end: (\})(?=\))
patterns:
- name: punctuation.separator.key-value.js.mootools
match: (:)
- include: "#fx-options"
- include: source.js
- name: support.class.element.js.mootools
match: \b(effect)\b
- name: support.class.styles.fx.js.mootools
match: \b(start)\b
comment: |-
Fx.Styles
Allows you to animate multiple css properties at once; Extends Fx.Base, inherits all its properties.
http://docs.mootools.net/files/Effects/Fx-Styles-js.html
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (new)\s+(Fx\.Styles)(\()
contentName: variable.parameter.fx.styles.js.mootools
beginCaptures:
"1":
name: keyword.operator.new.js
"2":
name: entity.name.type.instance.js.mootools
"3":
name: punctuation.definition.parameters.begin.js
end: (\)(;|$))
patterns:
- include: "#element-functions"
- include: "#array-functions"
- include: "#dom-functions"
- include: "#hash-functions"
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (\{)
contentName: variable.parameter.fx.styles.options.js.mootools
beginCaptures:
"1":
name: punctuation.definition.parameters.begin.js
end: (\})(?=\))
patterns:
- name: punctuation.separator.key-value.js.mootools
match: (:)
- include: "#fx-options"
- include: source.js
- name: support.class.element.js.mootools
match: \b(effects)\b
- name: support.class.transitions.fx.js.mootools
match: \b(linear|quadIn|quadOut|quadInOut|cubicIn|cubicOut|cubicInOut|quartIn|quartOut|quartInOut|quintIn|quintOut|quintInOut|sineIn|sineOut|sineInOut|expoIn|expoOut|expoInOut|circIn|circOut|circInOut|elasticIn|elasticOut|elasticInOut|backIn|backOut|backInOut|bounceIn|bounceOut|bounceInOut)\b
comment: |-
Fx.Transitions
A collection of tweaning transitions for use with the Fx.Base classes.
http://docs.mootools.net/files/Effects/Fx-Transitions-js.html
- name: support.class.fx.utils.js.mootools
match: \b(toggle|show)\b
comment: |-
Fx.Utils
Contains Fx.Height, Fx.Width, Fx.Opacity.
http://docs.mootools.net/files/Effects/Fx-Styles-js.html
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (new)\s+(Fx\.(?:Height|Width|Opacity))(\()
contentName: variable.parameter.fx.utils.js.mootools
beginCaptures:
"1":
name: keyword.operator.new.js
"2":
name: entity.name.type.instance.js.mootools
"3":
name: punctuation.definition.parameters.begin.js
end: (\));?$
patterns:
- include: "#element-functions"
- include: "#array-functions"
- include: "#dom-functions"
- include: "#hash-functions"
- endCaptures:
"1":
name: punctuation.definition.parameters.end.js
begin: (\{)
contentName: variable.parameter.fx.utils.options.js.mootools
beginCaptures:
"1":
name: punctuation.definition.parameters.begin.js
end: (\})\)
patterns:
- name: punctuation.separator.key-value.js.mootools
match: (:)
- include: "#fx-options"
- include: source.js
- name: support.class.element.js.mootools
match: \b(makeResizable)\b
comment: |-
Drag.Base
Modify two css properties of an element based on the position of the mouse.
http://docs.mootools.net/files/Drag/Drag-Base-js.html
- name: support.class.element.js.mootools
match: \b(makeDraggable)\b
comment: |-
Drag.Move
Modify two css properties of an element based on the position of the mouse.
http://docs.mootools.net/files/Drag/Drag-Base-js.html
- include: "#leading-space"
- include: source.js
foldingStopMarker: (^\s*\}|^\s*\)|^(?!.*/\*).*\*/)
keyEquivalent: ^~J
comment: |
MooTools Framework by Valerio Proietti.
http://mootools.net
This syntax document is largely based on the documentation at http://docs.mootools.net
Initial bundle by Joe Maller.