lsd_rails 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Packages/art/Source/ART.Path.js +1 -1
- data/Packages/art/Source/ART.SVG.js +4 -3
- data/Packages/art/Source/ART.VML.js +8 -2
- data/Packages/mootools-core/Docs/Browser/Browser.md +1 -1
- data/Packages/mootools-core/Docs/Core/Core.md +1 -1
- data/Packages/{mootools-more → mootools-core}/Docs/Element/Element.Delegation.md +58 -38
- data/Packages/mootools-core/Docs/Element/Element.md +5 -5
- data/Packages/mootools-core/Docs/Fx/Fx.Morph.md +5 -1
- data/Packages/mootools-core/Docs/Intro.md +3 -1
- data/Packages/mootools-core/Docs/Request/Request.HTML.md +3 -3
- data/Packages/mootools-core/Docs/Request/Request.JSON.md +1 -1
- data/Packages/mootools-core/Docs/Request/Request.md +12 -12
- data/Packages/mootools-core/Docs/Slick/Slick.md +318 -0
- data/Packages/mootools-core/Docs/Types/{Event.md → DOMEvent.md} +37 -27
- data/Packages/mootools-core/Docs/Types/Function.md +2 -2
- data/Packages/mootools-core/Docs/Types/String.md +4 -4
- data/Packages/mootools-core/Source/Class/Class.Extras.js +1 -1
- data/Packages/mootools-core/Source/Core/Core.js +3 -3
- data/Packages/mootools-core/Source/Element/Element.Delegation.js +198 -0
- data/Packages/mootools-core/Source/Element/Element.Dimensions.js +1 -2
- data/Packages/mootools-core/Source/Element/Element.Event.js +22 -7
- data/Packages/mootools-core/Source/Element/Element.Style.js +65 -50
- data/Packages/mootools-core/Source/Element/Element.js +289 -200
- data/Packages/mootools-core/Source/Fx/Fx.Tween.js +16 -10
- data/Packages/mootools-core/Source/Fx/Fx.js +6 -6
- data/Packages/mootools-core/Source/Request/Request.js +7 -7
- data/Packages/mootools-core/Source/Slick/Slick.Finder.js +23 -10
- data/Packages/mootools-core/Source/Types/Array.js +7 -7
- data/Packages/mootools-core/Source/Types/DOMEvent.js +125 -0
- data/Packages/mootools-core/Source/Types/Function.js +20 -10
- data/Packages/mootools-core/Source/Types/String.js +10 -10
- data/Packages/mootools-core/Source/Utilities/DOMReady.js +2 -2
- data/Packages/mootools-core/build +0 -2
- data/Packages/mootools-core/package.yml +2 -1
- data/Packages/mootools-more/Docs/Element/Element.Event.Pseudos.md +9 -9
- data/Packages/mootools-more/Docs/Forms/Form.Validator.md +20 -4
- data/Packages/mootools-more/Docs/Interface/HtmlTable.md +19 -0
- data/Packages/mootools-more/Docs/Interface/Tips.md +2 -2
- data/Packages/mootools-more/Docs/Types/Number.Format.md +10 -2
- data/Packages/mootools-more/Source/Class/Events.Pseudos.js +39 -62
- data/Packages/mootools-more/Source/Element/Element.Event.Pseudos.Keys.js +24 -25
- data/Packages/mootools-more/Source/Element/Element.Event.Pseudos.js +5 -5
- data/Packages/mootools-more/Source/Forms/Form.Validator.js +14 -2
- data/Packages/mootools-more/Source/Forms/OverText.js +0 -1
- data/Packages/mootools-more/Source/Interface/HtmlTable.js +21 -14
- data/Packages/mootools-more/Source/Locale/Locale.en-US.Form.Validator.js +1 -0
- data/Packages/mootools-more/Source/Locale/Locale.fr-FR.Form.Validator.js +1 -0
- data/Packages/mootools-more/Source/Locale/Locale.nl-NL.Form.Validator.js +1 -0
- data/Packages/mootools-more/Source/More/More.js +2 -2
- data/Packages/mootools-more/Source/Types/Date.js +2 -1
- data/Packages/mootools-more/Source/Types/Number.Format.js +6 -4
- data/Packages/mootools-more/Source/Utilities/Group.js +17 -23
- data/Packages/mootools-more/Tests/Interactive/Drag/Drag.Move_(container).html +2 -2
- data/Packages/mootools-more/Tests/Interactive/Element/Element.Event.Pseudos.html +10 -10
- data/Packages/mootools-more/Tests/Interactive/Interface/HtmlTable_(id).html +15 -4
- data/Packages/mootools-more/Tests/Interactive/Interface/HtmlTable_(zebra).html +4 -1
- data/Packages/mootools-more/Tests/Interactive/Interface/Keyboard_(nested).html +19 -26
- data/Packages/mootools-more/Tests/Interactive/Interface/Keyboard_(single).html +21 -24
- data/Packages/mootools-more/Tests/Specs/1.3/Class/Events.Pseudos.js +7 -154
- data/Packages/mootools-more/Tests/Specs/1.3/Element/Element.Delegation.js +2 -4
- data/Packages/mootools-more/Tests/Specs/1.3/Element/Element.Event.Pseudos.js +13 -21
- data/Packages/mootools-more/Tests/Specs/1.3/Forms/Form.Validator.js +14 -0
- data/Packages/mootools-more/Tests/Specs/1.3/Interface/HtmlTable.js +29 -14
- data/Packages/mootools-more/Tests/Specs/1.3/Types/Date.js +1 -0
- data/Packages/mootools-more/Tests/Specs/1.3/Types/Number.Format.js +4 -1
- data/Packages/mootools-more/Tests/Specs/Configuration.js +136 -4
- data/Packages/mootools-more/package.yml +0 -1
- data/lib/lsd/railtie.rb +2 -2
- data/lib/lsd/widget_generator.rb +1 -1
- metadata +32 -39
- data/Packages/mootools-core/Source/Types/Event.js +0 -135
- data/Packages/mootools-more/Source/Element/Element.Delegation.js +0 -140
@@ -0,0 +1,318 @@
|
|
1
|
+
Slick {#Slick}
|
2
|
+
==========================
|
3
|
+
|
4
|
+
Slick is the selector engine used by MooTools. It supports many CSS3 selectors and more!
|
5
|
+
|
6
|
+
### See Also:
|
7
|
+
|
8
|
+
- [W3C Pseudo Classes](http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#pseudo-classes)
|
9
|
+
|
10
|
+
|
11
|
+
Reverse Combinators
|
12
|
+
-------------------
|
13
|
+
|
14
|
+
Reverse Combinators redirect the flow of selectors and combinators. Slick implements these by prepending `!` to a selector or combinator.
|
15
|
+
|
16
|
+
### Examples:
|
17
|
+
|
18
|
+
document.getElement('p ! div') // A <div> that is an ancestor of a <p>
|
19
|
+
document.getElement('p !> div') // A <div> that is a direct parent of a <p>
|
20
|
+
document.getElement('.foo !+ p') // Gets the previous adjacent <p> sibling
|
21
|
+
|
22
|
+
### Notes:
|
23
|
+
|
24
|
+
Reverse Combinators are used internally by MooTools for many of our traversal methods. They offer an extremely concise and powerful alternative to traversal methods like `getParent()`.
|
25
|
+
|
26
|
+
|
27
|
+
Function: Slick.definePseudo {#Slick:Slick-definePseudo}
|
28
|
+
---------------------------------------------------------
|
29
|
+
|
30
|
+
definePseudo allows you to create your own custom pseudo selectors.
|
31
|
+
|
32
|
+
### Examples:
|
33
|
+
|
34
|
+
Slick.definePseudo('display', function(value){
|
35
|
+
return Element.getStyle(this, 'display') == value;
|
36
|
+
});
|
37
|
+
|
38
|
+
<div style="display: none">foo</div>
|
39
|
+
<div style="display: block">bar</div>
|
40
|
+
|
41
|
+
$$(':display(block)'); // Will return the block element
|
42
|
+
|
43
|
+
Slick.definePseudo('my-custom-pseudo', function(){
|
44
|
+
// 'this' is the node to check
|
45
|
+
return Element.retrieve(this, 'something-custom').isAwesome;
|
46
|
+
});
|
47
|
+
|
48
|
+
$$(':my-custom-pseudo') // Will return the first <p> tag that is awesome
|
49
|
+
|
50
|
+
|
51
|
+
Selector: Next Siblings ('~') {#Slick:nextSiblings}
|
52
|
+
---------------------------------------------------
|
53
|
+
|
54
|
+
Gets the next siblings.
|
55
|
+
|
56
|
+
### Example:
|
57
|
+
|
58
|
+
$$('p.foo ~') // Gets all next siblings of <p class="foo">
|
59
|
+
$$('p.foo ~ blockquote') // Gets every <blockquote> with a <p class="foo"> sibling somewhere *before* it
|
60
|
+
|
61
|
+
|
62
|
+
Selector: Previous Siblings ('!~') {#Slick:previouSiblings}
|
63
|
+
------------------------------------------------------------
|
64
|
+
|
65
|
+
Gets the previous siblings.
|
66
|
+
|
67
|
+
### Example:
|
68
|
+
|
69
|
+
$$('p.foo !~') // Gets all previous siblings of <p class="foo">
|
70
|
+
$$('p.foo !~ blockquote') // Gets every <blockquote> with a <p class="foo"> sibling somewhere *after* it
|
71
|
+
|
72
|
+
|
73
|
+
Selector: All Siblings ('~~') {#Slick:allSiblings}
|
74
|
+
--------------------------------------------------
|
75
|
+
|
76
|
+
Gets all siblings.
|
77
|
+
|
78
|
+
### Example:
|
79
|
+
|
80
|
+
$$('p.foo ~~') // Gets all previous and next siblings of <p class="foo">
|
81
|
+
$$('p.foo ~~ blockquote') // Gets every <blockquote> with a <p class="foo"> sibling before OR after it
|
82
|
+
|
83
|
+
Selector: First Child ('^') {#Slick:firstChild}
|
84
|
+
-----------------------------------------------
|
85
|
+
|
86
|
+
Gets the first child of an element.
|
87
|
+
|
88
|
+
### Example:
|
89
|
+
|
90
|
+
$$('p.foo ^') // Gets the first child of <p class="foo">
|
91
|
+
$$('p.foo ^ strong') // Gets every <strong> that is the first element child of a <p class="foo">
|
92
|
+
|
93
|
+
|
94
|
+
Selector: Last Child ('!^') {#Slick:lastChild}
|
95
|
+
----------------------------------------------
|
96
|
+
|
97
|
+
Gets the last child of an element.
|
98
|
+
|
99
|
+
### Example:
|
100
|
+
|
101
|
+
$$('p.foo !^') // Gets the last child of <p class="foo">
|
102
|
+
$$('p.foo !^ strong') // Gets every <strong> that is the last element child of a <p class="foo">
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
Selector: checked {#Slick:checked}
|
107
|
+
----------------------------------
|
108
|
+
|
109
|
+
Matches all Elements that are checked.
|
110
|
+
|
111
|
+
### Examples:
|
112
|
+
|
113
|
+
$$(':checked')
|
114
|
+
|
115
|
+
$('myForm').getElements('input:checked');
|
116
|
+
|
117
|
+
|
118
|
+
Selector: enabled {#Slick:enabled}
|
119
|
+
----------------------------------
|
120
|
+
|
121
|
+
Matches all Elements that are enabled.
|
122
|
+
|
123
|
+
### Examples:
|
124
|
+
|
125
|
+
$$(':enabled')
|
126
|
+
|
127
|
+
$('myElement').getElements(':enabled');
|
128
|
+
|
129
|
+
|
130
|
+
Selector: empty {#Slick:empty}
|
131
|
+
------------------------------
|
132
|
+
|
133
|
+
Matches all elements which are empty.
|
134
|
+
|
135
|
+
### Example:
|
136
|
+
|
137
|
+
$$(':empty');
|
138
|
+
|
139
|
+
|
140
|
+
Selector: contains {#Slick:contains}
|
141
|
+
------------------------------------
|
142
|
+
|
143
|
+
Matches all the Elements which contains the text.
|
144
|
+
|
145
|
+
### Variables:
|
146
|
+
|
147
|
+
* text - (string) The text that the Element should contain.
|
148
|
+
|
149
|
+
### Example:
|
150
|
+
|
151
|
+
$$('p:contains("find me")');
|
152
|
+
|
153
|
+
|
154
|
+
Selector: focus {#Slick:focus}
|
155
|
+
------------------------------
|
156
|
+
|
157
|
+
Gets the element in focus.
|
158
|
+
|
159
|
+
### Example:
|
160
|
+
|
161
|
+
$$(':focus'); // Gets the element in focus
|
162
|
+
|
163
|
+
|
164
|
+
Selector: not {#Slick:not}
|
165
|
+
--------------------------
|
166
|
+
|
167
|
+
Matches all elements that do not match the selector.
|
168
|
+
|
169
|
+
<small>Note: The Slick implementation of the `:not` pseudoClass is a superset of the standard. i.e. it is more advanced than the specification.</small>
|
170
|
+
|
171
|
+
### Examples:
|
172
|
+
|
173
|
+
$$(':not(div.foo)'); // all elements except divs with class 'foo'
|
174
|
+
|
175
|
+
$$('input:not([type="submit"])'); // all inputs except submit buttons
|
176
|
+
|
177
|
+
myElement.getElements(':not(a)');
|
178
|
+
|
179
|
+
$$(':not(ul li)');
|
180
|
+
|
181
|
+
|
182
|
+
Selector: nth-child {#Slick:nth-child}
|
183
|
+
--------------------------------------
|
184
|
+
|
185
|
+
Matches every nth child.
|
186
|
+
|
187
|
+
### Usage:
|
188
|
+
|
189
|
+
Nth Expression:
|
190
|
+
|
191
|
+
':nth-child(nExpression)'
|
192
|
+
|
193
|
+
### Variables:
|
194
|
+
|
195
|
+
* nExpression - (string) A nth expression for the "every" nth-child.
|
196
|
+
|
197
|
+
### Examples:
|
198
|
+
|
199
|
+
$$('#myDiv:nth-child(2n)'); //Returns every even child.
|
200
|
+
|
201
|
+
$$('#myDiv:nth-child(n)'); //Returns all children.
|
202
|
+
|
203
|
+
$$('#myDiv:nth-child(2n+1)') //Returns every odd child.
|
204
|
+
|
205
|
+
$$('#myDiv:nth-child(4n+3)') //Returns Elements 3, 7, 11, 15, etc.
|
206
|
+
|
207
|
+
|
208
|
+
Every Odd Child:
|
209
|
+
|
210
|
+
':nth-child(odd)'
|
211
|
+
|
212
|
+
Every Even Child:
|
213
|
+
|
214
|
+
':nth-child(even)'
|
215
|
+
|
216
|
+
Only Child:
|
217
|
+
|
218
|
+
':nth-child(only)'
|
219
|
+
|
220
|
+
First Child:
|
221
|
+
|
222
|
+
'nth-child(first)'
|
223
|
+
|
224
|
+
Last Child:
|
225
|
+
|
226
|
+
'nth-child(last)'
|
227
|
+
|
228
|
+
### Note:
|
229
|
+
|
230
|
+
This selector respects the w3c specifications, so it has 1 as its first child, not 0. Therefore nth-child(odd) will actually select the even children, if you think in zero-based indexes.
|
231
|
+
|
232
|
+
|
233
|
+
Selector: even {#Slick:even}
|
234
|
+
----------------------------
|
235
|
+
|
236
|
+
Matches every even child.
|
237
|
+
|
238
|
+
### Example:
|
239
|
+
|
240
|
+
$$('td:even');
|
241
|
+
|
242
|
+
### Note:
|
243
|
+
|
244
|
+
This selector is not part of the w3c specification, therefore its index starts at 0. This selector is highly recommended over nth-child(even), as this will return the real even children.
|
245
|
+
|
246
|
+
|
247
|
+
Selector: odd {#Slick:odd}
|
248
|
+
--------------------------
|
249
|
+
|
250
|
+
Matches every odd child.
|
251
|
+
|
252
|
+
### Example:
|
253
|
+
|
254
|
+
$$('td:odd');
|
255
|
+
|
256
|
+
### Note:
|
257
|
+
|
258
|
+
This selector is not part of the w3c specification, therefore its index starts at 0. This selector is highly recommended over nth-child(odd), as this will return the real odd children.
|
259
|
+
|
260
|
+
|
261
|
+
Selector: index {#Slick:index}
|
262
|
+
------------------------------
|
263
|
+
|
264
|
+
Matches the node at the specified index
|
265
|
+
|
266
|
+
### Example:
|
267
|
+
|
268
|
+
$$('p:index(2)'); // Gets the third <p> tag.
|
269
|
+
|
270
|
+
### Note:
|
271
|
+
|
272
|
+
This is zero-indexed.
|
273
|
+
|
274
|
+
|
275
|
+
Selector: first-child {#Slick:first-child}
|
276
|
+
------------------------------------------
|
277
|
+
|
278
|
+
Matches the first child.
|
279
|
+
|
280
|
+
### Usage:
|
281
|
+
|
282
|
+
':first-child'
|
283
|
+
|
284
|
+
### Example:
|
285
|
+
|
286
|
+
$$('td:first-child');
|
287
|
+
|
288
|
+
|
289
|
+
Selector: last-child {#Slick:last-child}
|
290
|
+
----------------------------------------
|
291
|
+
|
292
|
+
Matches the last child.
|
293
|
+
|
294
|
+
### Usage:
|
295
|
+
|
296
|
+
':last-child'
|
297
|
+
|
298
|
+
### Example:
|
299
|
+
|
300
|
+
$$('td:last-child');
|
301
|
+
|
302
|
+
|
303
|
+
Selector: only-child {#Slick:only-child}
|
304
|
+
----------------------------------------
|
305
|
+
|
306
|
+
Matches an only child of its parent Element.
|
307
|
+
|
308
|
+
### Usage:
|
309
|
+
|
310
|
+
':only-child'
|
311
|
+
|
312
|
+
### Example:
|
313
|
+
|
314
|
+
$$('td:only-child');
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
[Slick]: /core/Slick/Slick
|
@@ -1,14 +1,14 @@
|
|
1
|
-
Type:
|
1
|
+
Type: DOMEvent {#Event}
|
2
2
|
====================
|
3
3
|
|
4
|
-
MooTools
|
4
|
+
MooTools DOMEvent Methods.
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
DOMEvent Method: constructor {#DOMEvent:constructor}
|
7
|
+
----------------------------------------------------
|
8
8
|
|
9
9
|
### Syntax:
|
10
10
|
|
11
|
-
new
|
11
|
+
new DOMEvent([event[, win]]);
|
12
12
|
|
13
13
|
### Arguments:
|
14
14
|
|
@@ -35,7 +35,7 @@ Event Method: constructor {#Event:constructor}
|
|
35
35
|
### Examples:
|
36
36
|
|
37
37
|
$('myLink').addEvent('keydown', function(event){
|
38
|
-
// the passed event parameter is already an instance of the Event
|
38
|
+
// the passed event parameter is already an instance of the Event type.
|
39
39
|
alert(event.key); // returns the lowercase letter pressed.
|
40
40
|
alert(event.shift); // returns true if the key pressed is shift.
|
41
41
|
if (event.key == 's' && event.control) alert('Document saved.'); //executes if the user presses Ctr+S.
|
@@ -47,10 +47,10 @@ Event Method: constructor {#Event:constructor}
|
|
47
47
|
- Every event added with addEvent gets the MooTools method automatically, without the need to manually instance it.
|
48
48
|
|
49
49
|
|
50
|
-
|
51
|
-
|
50
|
+
DOMEvent Method: stop {#DOMEvent:stop}
|
51
|
+
--------------------------------------
|
52
52
|
|
53
|
-
Stop an
|
53
|
+
Stop an event from propagating and also executes preventDefault.
|
54
54
|
|
55
55
|
### Syntax:
|
56
56
|
|
@@ -58,7 +58,7 @@ Stop an Event from propagating and also executes preventDefault.
|
|
58
58
|
|
59
59
|
### Returns:
|
60
60
|
|
61
|
-
* (*object*) This
|
61
|
+
* (*object*) This DOMEvent instance.
|
62
62
|
|
63
63
|
### Examples:
|
64
64
|
|
@@ -72,7 +72,7 @@ Stop an Event from propagating and also executes preventDefault.
|
|
72
72
|
event.stop(); //Prevents the browser from following the link.
|
73
73
|
this.set('text', 'Where do you think you\'re going?'); //'this' is Element that fires the Event.
|
74
74
|
(function(){
|
75
|
-
this.set('text','Instead visit the Blog.').set('href', 'http://blog.mootools.net');
|
75
|
+
this.set('text', 'Instead visit the Blog.').set('href', 'http://blog.mootools.net');
|
76
76
|
}).delay(500, this);
|
77
77
|
});
|
78
78
|
|
@@ -82,12 +82,11 @@ Stop an Event from propagating and also executes preventDefault.
|
|
82
82
|
|
83
83
|
### See Also:
|
84
84
|
|
85
|
-
- [Element.addEvent](#Element:addEvent), [
|
86
|
-
|
85
|
+
- [Element.addEvent](#Element:addEvent), [DOMEvent.stopPropagation](#DOMEvent:stopPropagation), [DOMEvent.preventDefault](#DOMEvent:preventDefault), [Function:delay][]
|
87
86
|
|
88
87
|
|
89
|
-
|
90
|
-
|
88
|
+
DOMEvent Method: stopPropagation {#DOMEvent:stopPropagation}
|
89
|
+
------------------------------------------------------------
|
91
90
|
|
92
91
|
Cross browser method to stop the propagation of an event (this stops the event from bubbling up through the DOM).
|
93
92
|
|
@@ -97,7 +96,7 @@ Cross browser method to stop the propagation of an event (this stops the event f
|
|
97
96
|
|
98
97
|
### Returns:
|
99
98
|
|
100
|
-
* (*object*) This
|
99
|
+
* (*object*) This DOMEvent object.
|
101
100
|
|
102
101
|
### Examples:
|
103
102
|
|
@@ -125,9 +124,8 @@ Cross browser method to stop the propagation of an event (this stops the event f
|
|
125
124
|
- [MDC event.stopPropagation][]
|
126
125
|
|
127
126
|
|
128
|
-
|
129
|
-
|
130
|
-
----------------------------------------------------
|
127
|
+
DOMEvent Method: preventDefault {#DOMEvent:preventDefault}
|
128
|
+
--------------------------------------------
|
131
129
|
|
132
130
|
Cross browser method to prevent the default action of the event.
|
133
131
|
|
@@ -137,7 +135,7 @@ Cross browser method to prevent the default action of the event.
|
|
137
135
|
|
138
136
|
### Returns:
|
139
137
|
|
140
|
-
* (*object*) This
|
138
|
+
* (*object*) This DOMEvent object.
|
141
139
|
|
142
140
|
### Examples:
|
143
141
|
|
@@ -159,19 +157,19 @@ Cross browser method to prevent the default action of the event.
|
|
159
157
|
- [MDC event.preventDefault][]
|
160
158
|
|
161
159
|
|
162
|
-
|
163
|
-
|
160
|
+
Function: DOMEvent.defineKey {#DOMEvent:DOMEvent-defineKey}
|
161
|
+
-----------------------------------------------------------
|
164
162
|
|
165
|
-
|
163
|
+
This function allows to add an additional event key code.
|
166
164
|
|
167
165
|
#### Example:
|
168
166
|
|
169
|
-
|
167
|
+
DOMEvent.defineKey(16, 'shift');
|
170
168
|
$('myInput').addEvent('keydown', function(event){
|
171
169
|
if (event.key == 'shift') alert('You pressed shift.');
|
172
170
|
});
|
173
171
|
|
174
|
-
####
|
172
|
+
#### Predefined keys:
|
175
173
|
|
176
174
|
- enter
|
177
175
|
- up
|
@@ -188,9 +186,21 @@ Additional Event key codes can be added by adding properties to the Event.Keys O
|
|
188
186
|
|
189
187
|
- [MooTools More Keyboard][]
|
190
188
|
|
191
|
-
### Note:
|
192
189
|
|
193
|
-
|
190
|
+
Function: DOMEvent.defineKeys {#DOMEvent:DOMEvent-defineKey}
|
191
|
+
-----------------------------------------------------------
|
192
|
+
|
193
|
+
This function allows to add additional event key codes.
|
194
|
+
|
195
|
+
#### Example:
|
196
|
+
|
197
|
+
DOMEvent.defineKeys({
|
198
|
+
'16': 'shift',
|
199
|
+
'17': 'control'
|
200
|
+
});
|
201
|
+
$('myInput').addEvent('keydown', function(event){
|
202
|
+
if (event.key == 'control') alert('You pressed control.');
|
203
|
+
});
|
194
204
|
|
195
205
|
|
196
206
|
[Element:addEvent]: /core/Element/Element.Event#Element:addEvent
|
@@ -38,8 +38,8 @@ If the passed argument is a function, it will return itself. Otherwise, it will
|
|
38
38
|
|
39
39
|
This function is equivalent to the following deprecated MooTools 1.2 methods:
|
40
40
|
|
41
|
-
var fn1 = Function.from(); // equivalent to var fn1 =
|
42
|
-
var fn2 = Function.from(foo); // equivalent to var fn2 =
|
41
|
+
var fn1 = Function.from(); // equivalent to var fn1 = function(){};
|
42
|
+
var fn2 = Function.from(foo); // equivalent to var fn2 = function(){ return foo; };
|
43
43
|
|
44
44
|
|
45
45
|
Function: Function.attempt {#Function:Function-attempt}
|
@@ -74,7 +74,7 @@ For more information see [MDC Regexp:test][].
|
|
74
74
|
### Examples:
|
75
75
|
|
76
76
|
'I like cookies'.test('cookie'); // returns true
|
77
|
-
'I like cookies'.test('COOKIE',
|
77
|
+
'I like cookies'.test('COOKIE', 'i'); // returns true (ignore case)
|
78
78
|
'I like cookies'.test('cake'); // returns false
|
79
79
|
|
80
80
|
### See Also:
|
@@ -291,7 +291,7 @@ Converts a hexadecimal color value to RGB. Input string must be in one of the fo
|
|
291
291
|
|
292
292
|
### Arguments:
|
293
293
|
|
294
|
-
1. array - (*boolean*, optional) If true is passed, will output an array (e.g. \[255, 51, 0\]) instead of a string (e.g.
|
294
|
+
1. array - (*boolean*, optional) If true is passed, will output an array (e.g. \[255, 51, 0\]) instead of a string (e.g. 'rgb(255, 51, 0)').
|
295
295
|
|
296
296
|
### Returns:
|
297
297
|
|
@@ -310,7 +310,7 @@ String method: rgbToHex {#String:rgbToHex}
|
|
310
310
|
-----------------------------------
|
311
311
|
|
312
312
|
Converts an RGB color value to hexadecimal. Input string must be in one of the following RGB color formats.
|
313
|
-
|
313
|
+
'rgb(255, 255, 255)', or 'rgba(255, 255, 255, 1)'
|
314
314
|
|
315
315
|
### Syntax:
|
316
316
|
|
@@ -318,7 +318,7 @@ Converts an RGB color value to hexadecimal. Input string must be in one of the f
|
|
318
318
|
|
319
319
|
### Arguments:
|
320
320
|
|
321
|
-
1. array - (*boolean*, optional) If true is passed, will output an array (e.g. \['ff', '33', '00'\]) instead of a string (e.g.
|
321
|
+
1. array - (*boolean*, optional) If true is passed, will output an array (e.g. \['ff', '33', '00'\]) instead of a string (e.g. '#ff3300').
|
322
322
|
|
323
323
|
### Returns:
|
324
324
|
|
@@ -23,7 +23,7 @@ provides: [Core, MooTools, Type, typeOf, instanceOf, Native]
|
|
23
23
|
(function(){
|
24
24
|
|
25
25
|
this.MooTools = {
|
26
|
-
version: '1.
|
26
|
+
version: '1.4.1dev',
|
27
27
|
build: '%build%'
|
28
28
|
};
|
29
29
|
|
@@ -195,7 +195,7 @@ var implement = function(name, method){
|
|
195
195
|
if (typeOf(hook) == 'type') implement.call(hook, name, method);
|
196
196
|
else hook.call(this, name, method);
|
197
197
|
}
|
198
|
-
|
198
|
+
|
199
199
|
var previous = this.prototype[name];
|
200
200
|
if (previous == null || !previous.$protected) this.prototype[name] = method;
|
201
201
|
|
@@ -257,7 +257,7 @@ var force = function(name, object, methods){
|
|
257
257
|
|
258
258
|
force('String', String, [
|
259
259
|
'charAt', 'charCodeAt', 'concat', 'indexOf', 'lastIndexOf', 'match', 'quote', 'replace', 'search',
|
260
|
-
'slice', 'split', 'substr', 'substring', 'toLowerCase', 'toUpperCase'
|
260
|
+
'slice', 'split', 'substr', 'substring', 'trim', 'toLowerCase', 'toUpperCase'
|
261
261
|
])('Array', Array, [
|
262
262
|
'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift', 'concat', 'join', 'slice',
|
263
263
|
'indexOf', 'lastIndexOf', 'filter', 'forEach', 'every', 'map', 'some', 'reduce', 'reduceRight'
|