Skip to content
This repository
Browse code

Changed headlines hierarchy (so they match the official MooTools.net …

…docs)
  • Loading branch information...
commit 6b2f7703a32eafe447c665007ef9f8fa45301a07 1 parent 3b33b38
Fabian Beiner authored cpojer committed
56  Docs/Core/Core.md
Source Rendered
... ...
@@ -1,20 +1,20 @@
1  
-## Type: Core {#Core}
  1
+# Type: Core {#Core}
2 2
 
3 3
 Core contains common functions used in [MooTools][].
4 4
 
5  
-### Function: typeOf {#Core:typeOf}
  5
+## Function: typeOf {#Core:typeOf}
6 6
 
7 7
 Returns the type of an object.
8 8
 
9  
-#### Syntax:
  9
+### Syntax:
10 10
 
11 11
 	typeOf(obj);
12 12
 
13  
-#### Arguments:
  13
+### Arguments:
14 14
 
15 15
 1. obj - (*object*) The object to inspect.
16 16
 
17  
-#### Returns:
  17
+### Returns:
18 18
 
19 19
 * 'element'    - (*string*) If object is a DOM element node.
20 20
 * 'elements'   - (*string*) If object is an instance of [Elements][].
@@ -36,33 +36,33 @@ Returns the type of an object.
36 36
 * 'event'      - (*string*) If object is an event.
37 37
 * 'null'       - (*boolean*) If object is undefined, null, NaN or none of the above.
38 38
 
39  
-#### Example:
  39
+### Example:
40 40
 
41 41
 	var myString = 'hello';
42 42
 	typeOf(myString); // returns "string"
43 43
 
44  
-#### Note:
  44
+### Note:
45 45
 
46 46
 This method is equivalent to *$type* from MooTools 1.2, with the exception that undefined and null values now return 'null' as a string, instead of false.
47 47
 
48  
-### Function: instanceOf {#Core:instanceOf}
  48
+## Function: instanceOf {#Core:instanceOf}
49 49
 
50 50
 Checks if an object is an instance of a particular type.
51 51
 
52  
-#### Syntax:
  52
+### Syntax:
53 53
 
54 54
 	instanceOf(item, object)
55 55
 
56  
-#### Arguments:
  56
+### Arguments:
57 57
 
58 58
 1. item - (*mixed*) The item to check.
59 59
 2. object - (*mixed*) The type to compare it with.
60 60
 
61  
-#### Returns:
  61
+### Returns:
62 62
 
63 63
 * (*boolean*) Whether or not the item is an instance of the object.
64 64
 
65  
-#### Examples:
  65
+### Examples:
66 66
 
67 67
 	var foo = [];
68 68
 	instanceOf(foo, Array) // returns true
@@ -72,7 +72,7 @@ Checks if an object is an instance of a particular type.
72 72
 	var bar = new myClass();
73 73
 	instanceOf(bar, myClass) // returns true
74 74
 
75  
-## Type {#Type}
  75
+### Type {#Type}
76 76
 
77 77
 MooTools extends native types, like string, array or number to make them even more useful.
78 78
 
@@ -92,11 +92,11 @@ Custom MooTools types are:
92 92
 - Elements
93 93
 - Event
94 94
 
95  
-### Type method: implement {#Type:implement}
  95
+## Type method: implement {#Type:implement}
96 96
 
97 97
 This method implements a new method to the type's prototype.
98 98
 
99  
-#### Syntax:
  99
+### Syntax:
100 100
 
101 101
 	myType.implement(name, method);
102 102
 
@@ -104,7 +104,7 @@ This method implements a new method to the type's prototype.
104 104
 
105 105
 	myType.implement(methods);
106 106
 
107  
-#### Arguments:
  107
+### Arguments:
108 108
 
109 109
 1. name - (*string*) The method name.
110 110
 2. method - (*function*) The method function.
@@ -113,11 +113,11 @@ This method implements a new method to the type's prototype.
113 113
 
114 114
 1. methods - (*object*) An object with key-value pairs. The key is the method name, the value is the method function.
115 115
 
116  
-#### Returns:
  116
+### Returns:
117 117
 
118 118
 * (*object*) The type.
119 119
 
120  
-#### Examples:
  120
+### Examples:
121 121
 
122 122
 	Array.implement('limitTop', function(top){
123 123
 		for (var i = 0, l = this.length; i < l; i++){
@@ -145,11 +145,11 @@ It is also possible to pass an object of methods:
145 145
 	'MooTools'.ftw(); // returns "MooTools FTW!"
146 146
 	('MooTools'.ftw() + ' ').repeat(2); // returns "MooTools FTW! MooTools FTW! "
147 147
 
148  
-### Type method: extend {#Type:extend}
  148
+## Type method: extend {#Type:extend}
149 149
 
150 150
 Adds one or more functions to the type. These are static functions that accept for example other types to parse them into the type, or other utility functions that belong to the certain type.
151 151
 
152  
-#### Syntax:
  152
+### Syntax:
153 153
 
154 154
 	myType.extend(name, method);
155 155
 
@@ -157,7 +157,7 @@ Adds one or more functions to the type. These are static functions that accept f
157 157
 
158 158
 	myType.extend(methods);
159 159
 
160  
-#### Arguments:
  160
+### Arguments:
161 161
 
162 162
 1. name - (*string*) The method name.
163 163
 2. method - (*function*) The method function.
@@ -166,11 +166,11 @@ Adds one or more functions to the type. These are static functions that accept f
166 166
 
167 167
 1. methods - (*object*) An object with key-value pairs. The key is the method name, the value is the method function.
168 168
 
169  
-#### Returns:
  169
+### Returns:
170 170
 
171 171
 * (*object*) The type.
172 172
 
173  
-#### Examples:
  173
+### Examples:
174 174
 
175 175
 	RegExp.extend('from', function(regexp, flags){
176 176
 		return new RegExp(regexp, flags);
@@ -181,11 +181,11 @@ Adds one or more functions to the type. These are static functions that accept f
181 181
 		// do certain calculations
182 182
 	});
183 183
 
184  
-### Generics {#Type:generics}
  184
+## Generics {#Type:generics}
185 185
 
186 186
 Most methods of types can be used as generic functions. These are the already existing JavaScript methods, methods MooTools adds, or methods you [implemented][implement] yourself.
187 187
 
188  
-#### Example:
  188
+### Example:
189 189
 
190 190
 	var everyArgBiggerThanTwo = function(){
191 191
 		// Instead of this
@@ -197,16 +197,16 @@ Most methods of types can be used as generic functions. These are the already ex
197 197
 This is useful if methods of a certain type should be used as function of another type.
198 198
  As the example above, it is used for the Arguments type, which is not a real array, so `arguments.every(fn)` would not work. However, `Array.every(arguments, fn)` does work in MooTools.
199 199
 
200  
-#### Syntax:
  200
+### Syntax:
201 201
 
202 202
 	Type.methodName(thisArg[, arg1, arg2, ...]);
203 203
 
204  
-#### Arguments:
  204
+### Arguments:
205 205
 
206 206
 1. thisArg - (*mixed*) This is the subject, which is usually `thisArg.method([arg1, arg2, ...]);`.
207 207
 2. arg1, arg2, ... - (*mixed*) Additional arguments which will be passed as method arguments.
208 208
 
209  
-#### Returns:
  209
+### Returns:
210 210
 
211 211
 - (*mixed*) Anything the method usually returns.
212 212
 
34  Docs/Utilities/Cookie.md
Source Rendered
... ...
@@ -1,33 +1,33 @@
@@ -37,44 +37,44 @@ Saves the cookie for a day:
6  Docs/Utilities/DOMReady.md
Source Rendered
... ...
@@ -1,16 +1,16 @@
1  
-## Window Event: domready
  1
+# Window Event: domready
2 2
 
3 3
 Contains the window [Event][] 'domready', which executes when the DOM is loaded.
4 4
 
5 5
 To ensure that DOM elements exist when the code attempts to access them is executed, they need to be placed within the 'domready' event.
6 6
 
7  
-#### Example:
  7
+### Example:
8 8
 
9 9
 	window.addEvent('domready', function() {
10 10
 		alert('The DOM is ready!');
11 11
 	});
12 12
 
13  
-#### Note:
  13
+### Note:
14 14
 
15 15
 This event is only available to the window element.
16 16
 
22  Docs/Utilities/JSON.md
Source Rendered
... ...
@@ -1,45 +1,45 @@
1  
-## Object: JSON {#JSON}
  1
+# Object: JSON {#JSON}
2 2
 
3 3
 JSON decoder and encoder.
4 4
 
5  
-### JSON Method: encode {#JSON:encode}
  5
+## JSON Method: encode {#JSON:encode}
6 6
 
7 7
 Converts an object or array to a JSON string.
8 8
 
9  
-#### Syntax:
  9
+### Syntax:
10 10
 
11 11
 	var myJSON = JSON.encode(obj);
12 12
 
13  
-#### Arguments:
  13
+### Arguments:
14 14
 
15 15
 1. obj - (*object*) The object to convert to string.
16 16
 
17  
-#### Returns:
  17
+### Returns:
18 18
 
19 19
 * (*string*) A JSON string.
20 20
 
21  
-#### Examples:
  21
+### Examples:
22 22
 
23 23
 	var fruitsJSON = JSON.encode({apple: 'red', lemon: 'yellow'}); // returns: '{"apple":"red","lemon":"yellow"}'
24 24
 
25  
-### JSON Method: decode {#JSON:decode}
  25
+## JSON Method: decode {#JSON:decode}
26 26
 
27 27
 Converts a JSON string into a JavaScript object.
28 28
 
29  
-#### Syntax:
  29
+### Syntax:
30 30
 
31 31
 	var object = JSON.decode(string[, secure]);
32 32
 
33  
-#### Arguments:
  33
+### Arguments:
34 34
 
35 35
 1. string - (*string*) The string to evaluate.
36 36
 2. secure - (*boolean*, optional: defaults to false) If set to true, checks for any hazardous syntax and returns null if any found.
37 37
 
38  
-#### Returns:
  38
+### Returns:
39 39
 
40 40
 * (*object*) The object represented by the JSON string.
41 41
 
42  
-#### Examples:
  42
+### Examples:
43 43
 
44 44
 	var myObject = JSON.decode('{"apple":"red","lemon":"yellow"}'); // returns: {apple: 'red', lemon: 'yellow'}
45 45
 
26  Docs/Utilities/Swiff.md
Source Rendered
... ...
@@ -1,17 +1,17 @@
1  
-## Class: Swiff {#Swiff}
  1
+# Class: Swiff {#Swiff}
2 2
 
3 3
 Creates and returns a Flash object using supplied parameters.
4 4
 
5  
-#### Syntax:
  5
+### Syntax:
6 6
 
7 7
 	var mySwiff = new Swiff(path[, options]);
8 8
 
9  
-#### Arguments:
  9
+### Arguments:
10 10
 
11 11
 1. path    - (*string*) The path to the SWF file.
12 12
 2. options - (*object*, optional) See Options below.
13 13
 
14  
-#### Options:
  14
+### Options:
15 15
 
16 16
 * id - (*string*: defaults to 'Swiff\_' + unique id) The id of the SWF object.
17 17
 * width - (*number*: defaults to 1) The width of the SWF object.
@@ -26,11 +26,11 @@ Creates and returns a Flash object using supplied parameters.
26 26
 * vars - (*object*) Vars will be passed to the SWF as query string in flashVars.
27 27
 * callBacks - (*object*) Functions to call from the SWF. These will be available globally in the movie, and bound to the object.
28 28
 
29  
-#### Returns:
  29
+### Returns:
30 30
 
31 31
 * (*element*) A new HTML object element.
32 32
 
33  
-#### Example:
  33
+### Example:
34 34
 
35 35
 	var obj = new Swiff('myMovie.swf', {
36 36
 		id: 'myBeautifulMovie',
@@ -49,35 +49,35 @@ Creates and returns a Flash object using supplied parameters.
49 49
 		}
50 50
 	});
51 51
 
52  
-#### Note:
  52
+### Note:
53 53
 
54 54
 1. Although Swiff returns the object, this element will NOT have any [Element][] methods applied to it.
55 55
 2. The $ function on an object/embed tag will only return its reference without further processing.
56 56
 
57  
-### Swiff Function: remote {#Swiff:remote}
  57
+## Swiff Function: remote {#Swiff:remote}
58 58
 
59 59
 Calls an ActionScript function from JavaScript.
60 60
 
61  
-#### Syntax:
  61
+### Syntax:
62 62
 
63 63
 	var result = Swiff.remote(obj, fn[, arg, arg, arg ...]);
64 64
 
65  
-#### Arguments:
  65
+### Arguments:
66 66
 
67 67
 1. obj - (*element*) A Swiff instance (a HTML object element).
68 68
 2. fn  - (*string*) The function name to execute in the SWF.
69 69
 3. arg - (*mixed*) Any number of arguments to pass to the named function.
70 70
 
71  
-#### Returns:
  71
+### Returns:
72 72
 
73 73
 * (*mixed*) The ActionScript function's result.
74 74
 
75  
-#### Example:
  75
+### Example:
76 76
 
77 77
 	var obj = new Swiff('myMovie.swf');
78 78
 	alert(Swiff.remote(obj, 'myFlashFn')); // alerts "This is from the .swf file!".
79 79
 
80  
-#### Note:
  80
+### Note:
81 81
 
82 82
 The SWF file must be compiled with the ExternalInterface component.  See the Adobe documentation on [External Interface][] for more information.
83 83
 

0 notes on commit 6b2f770

Please sign in to comment.
Something went wrong with that request. Please try again.