cornerstone-source 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +20 -0
- data/Rakefile +8 -0
- data/config.rb +79 -0
- data/config.ru +4 -0
- data/cornerstone.gemspec +22 -0
- data/doc_scraper.rb +51 -0
- data/game.js +4293 -0
- data/lib/assets/javascripts/cornerstone.js +4719 -0
- data/lib/cornerstone.rb +11 -0
- data/lib/cornerstone/rails.rb +5 -0
- data/lib/cornerstone/sprockets.rb +2 -0
- data/lib/cornerstone/version.rb +3 -0
- data/manifest.json +15 -0
- data/pixie.json +12 -0
- data/source/javascripts/_cornerstone/_object_extensions.js.coffee +108 -0
- data/source/javascripts/_cornerstone/array_extensions.js.coffee +570 -0
- data/source/javascripts/_cornerstone/bindable.js.coffee +125 -0
- data/source/javascripts/_cornerstone/command_stack.js.coffee +36 -0
- data/source/javascripts/_cornerstone/core_object.js.coffee +183 -0
- data/source/javascripts/_cornerstone/function_extensions.js.coffee +60 -0
- data/source/javascripts/_cornerstone/logging.js.coffee +19 -0
- data/source/javascripts/_cornerstone/matrix.js.coffee +337 -0
- data/source/javascripts/_cornerstone/number_extensions.js.coffee +491 -0
- data/source/javascripts/_cornerstone/point.js.coffee +641 -0
- data/source/javascripts/_cornerstone/random.js.coffee +86 -0
- data/source/javascripts/_cornerstone/rectangle.js.coffee +35 -0
- data/source/javascripts/_cornerstone/string_extensions.js.coffee +232 -0
- data/source/javascripts/_cornerstone/stubs.js.coffee +1042 -0
- data/source/javascripts/_cornerstone/uuid.js +96 -0
- data/source/javascripts/_test/array_extensions.coffee +173 -0
- data/source/javascripts/_test/bindable.coffee +68 -0
- data/source/javascripts/_test/command_stack.coffee +99 -0
- data/source/javascripts/_test/core_object.coffee +95 -0
- data/source/javascripts/_test/function_extensions.coffee +50 -0
- data/source/javascripts/_test/logging.coffee +7 -0
- data/source/javascripts/_test/matrix.coffee +174 -0
- data/source/javascripts/_test/number_extensions.coffee +138 -0
- data/source/javascripts/_test/object_extensions.coffee +53 -0
- data/source/javascripts/_test/point.coffee +196 -0
- data/source/javascripts/_test/random.coffee +22 -0
- data/source/javascripts/_test/rectangle.coffee +70 -0
- data/source/javascripts/_test/string_extensions.coffee +59 -0
- data/source/javascripts/cornerstone.js.coffee +1 -0
- data/source/javascripts/cornerstone_tests.js.coffee +2 -0
- data/source/test.html.haml +13 -0
- data/vendor/javascripts/qunit.js +1275 -0
- data/vendor/stylesheets/qunit.css.sass +115 -0
- metadata +141 -0
@@ -0,0 +1,86 @@
|
|
1
|
+
( ->
|
2
|
+
###*
|
3
|
+
@name Random
|
4
|
+
@namespace Some useful methods for generating random things.
|
5
|
+
###
|
6
|
+
(exports ? this)["Random"] =
|
7
|
+
###*
|
8
|
+
Returns a random angle, uniformly distributed, between 0 and 2pi.
|
9
|
+
|
10
|
+
@name angle
|
11
|
+
@methodOf Random
|
12
|
+
@returns {Number} A random angle between 0 and 2pi
|
13
|
+
###
|
14
|
+
angle: ->
|
15
|
+
rand() * Math.TAU
|
16
|
+
|
17
|
+
###*
|
18
|
+
Returns a random angle between the given angles.
|
19
|
+
|
20
|
+
@name angleBetween
|
21
|
+
@methodOf Random
|
22
|
+
@returns {Number} A random angle between the angles given.
|
23
|
+
###
|
24
|
+
angleBetween: (min, max) ->
|
25
|
+
rand() * (max - min) + min
|
26
|
+
|
27
|
+
###*
|
28
|
+
Returns a random color.
|
29
|
+
|
30
|
+
@name color
|
31
|
+
@methodOf Random
|
32
|
+
@returns {Color} A random color
|
33
|
+
###
|
34
|
+
color: ->
|
35
|
+
Color.random()
|
36
|
+
|
37
|
+
###*
|
38
|
+
Happens often.
|
39
|
+
|
40
|
+
@name often
|
41
|
+
@methodOf Random
|
42
|
+
###
|
43
|
+
often: ->
|
44
|
+
return rand(3)
|
45
|
+
|
46
|
+
###*
|
47
|
+
Happens sometimes.
|
48
|
+
|
49
|
+
@name sometimes
|
50
|
+
@methodOf Random
|
51
|
+
###
|
52
|
+
sometimes: ->
|
53
|
+
!rand(3)
|
54
|
+
|
55
|
+
###*
|
56
|
+
Returns random integers from [0, n) if n is given.
|
57
|
+
Otherwise returns random float between 0 and 1.
|
58
|
+
|
59
|
+
@name rand
|
60
|
+
@methodOf window
|
61
|
+
@param {Number} n
|
62
|
+
@returns {Number} A random integer from 0 to n - 1 if n is given. If n is not given, a random float between 0 and 1.
|
63
|
+
###
|
64
|
+
(exports ? this)["rand"] = (n) ->
|
65
|
+
if n
|
66
|
+
Math.floor(n * Math.random())
|
67
|
+
else
|
68
|
+
Math.random()
|
69
|
+
|
70
|
+
###*
|
71
|
+
Returns random float from [-n / 2, n / 2] if n is given.
|
72
|
+
Otherwise returns random float between -0.5 and 0.5.
|
73
|
+
|
74
|
+
@name signedRand
|
75
|
+
@methodOf window
|
76
|
+
@param {Number} n
|
77
|
+
@returns {Number} A random float from -n / 2 to n / 2 if n is given. If n is not given, a random float between -0.5 and 0.5.
|
78
|
+
###
|
79
|
+
(exports ? this)["signedRand"] = (n) ->
|
80
|
+
if n
|
81
|
+
(n * Math.random()) - (n / 2)
|
82
|
+
else
|
83
|
+
Math.random() - 0.5
|
84
|
+
|
85
|
+
)()
|
86
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
(->
|
2
|
+
Rectangle = ({x, y, width, height}) ->
|
3
|
+
|
4
|
+
return {
|
5
|
+
__proto__: Rectangle::
|
6
|
+
|
7
|
+
x: x || 0
|
8
|
+
y: y || 0
|
9
|
+
|
10
|
+
width: width || 0
|
11
|
+
height: height || 0
|
12
|
+
}
|
13
|
+
|
14
|
+
Rectangle:: =
|
15
|
+
center: ->
|
16
|
+
Point(@x + @width / 2, @y + @height / 2)
|
17
|
+
|
18
|
+
equal: (other) ->
|
19
|
+
@x == other.x && @y == other.y &&
|
20
|
+
@width == other.width && @height == other.height
|
21
|
+
|
22
|
+
Rectangle::__defineGetter__ 'left', ->
|
23
|
+
@x
|
24
|
+
|
25
|
+
Rectangle::__defineGetter__ 'right', ->
|
26
|
+
@x + @width
|
27
|
+
|
28
|
+
Rectangle::__defineGetter__ 'top', ->
|
29
|
+
@y
|
30
|
+
|
31
|
+
Rectangle::__defineGetter__ 'bottom', ->
|
32
|
+
@y + @height
|
33
|
+
|
34
|
+
(exports ? this)["Rectangle"] = Rectangle
|
35
|
+
)()
|
@@ -0,0 +1,232 @@
|
|
1
|
+
###*
|
2
|
+
Returns true if this string only contains whitespace characters.
|
3
|
+
|
4
|
+
"".blank()
|
5
|
+
# => true
|
6
|
+
|
7
|
+
"hello".blank()
|
8
|
+
# => false
|
9
|
+
|
10
|
+
" ".blank()
|
11
|
+
# => true
|
12
|
+
|
13
|
+
@name blank
|
14
|
+
@methodOf String#
|
15
|
+
@returns {Boolean} Whether or not this string is blank.
|
16
|
+
###
|
17
|
+
String::blank = ->
|
18
|
+
/^\s*$/.test(this)
|
19
|
+
|
20
|
+
###*
|
21
|
+
Returns a new string that is a camelCase version.
|
22
|
+
|
23
|
+
"camel_case".camelize()
|
24
|
+
"camel-case".camelize()
|
25
|
+
"camel case".camelize()
|
26
|
+
|
27
|
+
# => "camelCase"
|
28
|
+
|
29
|
+
@name camelize
|
30
|
+
@methodOf String#
|
31
|
+
@returns {String} A new string. camelCase version of `this`.
|
32
|
+
###
|
33
|
+
String::camelize = ->
|
34
|
+
this.trim().replace /(\-|_|\s)+(.)?/g, (match, separator, chr) ->
|
35
|
+
if chr then chr.toUpperCase() else ''
|
36
|
+
|
37
|
+
###*
|
38
|
+
Returns a new string with the first letter capitalized and the rest lower cased.
|
39
|
+
|
40
|
+
"capital".capitalize()
|
41
|
+
"cAPITAL".capitalize()
|
42
|
+
"cApItAl".capitalize()
|
43
|
+
"CAPITAL".capitalize()
|
44
|
+
|
45
|
+
# => "Capital"
|
46
|
+
|
47
|
+
@name capitalize
|
48
|
+
@methodOf String#
|
49
|
+
@returns {String} A new string. Capitalized version of `this`
|
50
|
+
###
|
51
|
+
String::capitalize = ->
|
52
|
+
this.charAt(0).toUpperCase() + this.substring(1).toLowerCase()
|
53
|
+
|
54
|
+
###*
|
55
|
+
Return the class or constant named in this string.
|
56
|
+
|
57
|
+
|
58
|
+
"Constant".constantize()
|
59
|
+
# => Constant
|
60
|
+
# notice this isn't a string. Useful for calling methods on class with the same name as `this`.
|
61
|
+
|
62
|
+
@name constantize
|
63
|
+
@methodOf String#
|
64
|
+
@returns {Object} The class or constant named in this string.
|
65
|
+
###
|
66
|
+
String::constantize = ->
|
67
|
+
target = exports ? window
|
68
|
+
|
69
|
+
target = target[item] for item in this.split '.'
|
70
|
+
|
71
|
+
return target
|
72
|
+
|
73
|
+
###*
|
74
|
+
Get the file extension of a string.
|
75
|
+
|
76
|
+
"README.md".extension() # => "md"
|
77
|
+
"README".extension() # => ""
|
78
|
+
|
79
|
+
@name extension
|
80
|
+
@methodOf String#
|
81
|
+
@returns {String} File extension
|
82
|
+
###
|
83
|
+
String::extension = ->
|
84
|
+
if extension = this.match(/\.([^\.]*)$/, '')?.last()
|
85
|
+
extension
|
86
|
+
else
|
87
|
+
''
|
88
|
+
|
89
|
+
###*
|
90
|
+
Returns a new string that is a more human readable version.
|
91
|
+
|
92
|
+
"player_id".humanize()
|
93
|
+
# => "Player"
|
94
|
+
|
95
|
+
"player_ammo".humanize()
|
96
|
+
# => "Player ammo"
|
97
|
+
|
98
|
+
@name humanize
|
99
|
+
@methodOf String#
|
100
|
+
@returns {String} A new string. Replaces _id and _ with "" and capitalizes the word.
|
101
|
+
###
|
102
|
+
String::humanize = ->
|
103
|
+
this.replace(/_id$/, "").replace(/_/g, " ").capitalize()
|
104
|
+
|
105
|
+
###*
|
106
|
+
Returns true.
|
107
|
+
|
108
|
+
@name isString
|
109
|
+
@methodOf String#
|
110
|
+
@returns {Boolean} true
|
111
|
+
###
|
112
|
+
String::isString = ->
|
113
|
+
true
|
114
|
+
|
115
|
+
###*
|
116
|
+
Parse this string as though it is JSON and return the object it represents. If it
|
117
|
+
is not valid JSON returns the string itself.
|
118
|
+
|
119
|
+
# this is valid json, so an object is returned
|
120
|
+
'{"a": 3}'.parse()
|
121
|
+
# => {a: 3}
|
122
|
+
|
123
|
+
# double quoting instead isn't valid JSON so a string is returned
|
124
|
+
"{'a': 3}".parse()
|
125
|
+
# => "{'a': 3}"
|
126
|
+
|
127
|
+
|
128
|
+
@name parse
|
129
|
+
@methodOf String#
|
130
|
+
@returns {Object} Returns an object from the JSON this string contains. If it is not valid JSON returns the string itself.
|
131
|
+
###
|
132
|
+
String::parse = () ->
|
133
|
+
try
|
134
|
+
JSON.parse(this.toString())
|
135
|
+
catch e
|
136
|
+
this.toString()
|
137
|
+
|
138
|
+
###*
|
139
|
+
Returns true if this string starts with the given string.
|
140
|
+
|
141
|
+
@name startsWith
|
142
|
+
@methodOf String#
|
143
|
+
@param {String} str The string to check.
|
144
|
+
|
145
|
+
@returns {Boolean} True if this string starts with the given string, false otherwise.
|
146
|
+
###
|
147
|
+
String::startsWith = (str) ->
|
148
|
+
@lastIndexOf(str, 0) is 0
|
149
|
+
|
150
|
+
###*
|
151
|
+
Returns a new string in Title Case.
|
152
|
+
|
153
|
+
"title-case".titleize()
|
154
|
+
# => "Title Case"
|
155
|
+
|
156
|
+
"title case".titleize()
|
157
|
+
# => "Title Case"
|
158
|
+
|
159
|
+
@name titleize
|
160
|
+
@methodOf String#
|
161
|
+
@returns {String} A new string. Title Cased.
|
162
|
+
###
|
163
|
+
String::titleize = ->
|
164
|
+
this.split(/[- ]/).map (word) ->
|
165
|
+
word.capitalize()
|
166
|
+
.join(' ')
|
167
|
+
|
168
|
+
###*
|
169
|
+
Underscore a word, changing camelCased with under_scored.
|
170
|
+
|
171
|
+
"UNDERScore".underscore()
|
172
|
+
# => "under_score"
|
173
|
+
|
174
|
+
"UNDER-SCORE".underscore()
|
175
|
+
# => "under_score"
|
176
|
+
|
177
|
+
"UnDEr-SCorE".underscore()
|
178
|
+
# => "un_d_er_s_cor_e"
|
179
|
+
|
180
|
+
@name underscore
|
181
|
+
@methodOf String#
|
182
|
+
@returns {String} A new string. Separated by _.
|
183
|
+
###
|
184
|
+
String::underscore = ->
|
185
|
+
this.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
|
186
|
+
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
|
187
|
+
.replace(/-/g, '_')
|
188
|
+
.toLowerCase()
|
189
|
+
|
190
|
+
###*
|
191
|
+
Assumes the string is something like a file name and returns the
|
192
|
+
contents of the string without the extension.
|
193
|
+
|
194
|
+
"neat.png".witouthExtension()
|
195
|
+
# => "neat"
|
196
|
+
|
197
|
+
@name withoutExtension
|
198
|
+
@methodOf String#
|
199
|
+
@returns {String} A new string without the extension name.
|
200
|
+
###
|
201
|
+
String::withoutExtension = ->
|
202
|
+
this.replace(/\.[^\.]*$/, '')
|
203
|
+
|
204
|
+
String::parseHex = ->
|
205
|
+
hexString = @replace(/#/, '')
|
206
|
+
|
207
|
+
switch hexString.length
|
208
|
+
when 3, 4
|
209
|
+
if hexString.length == 4
|
210
|
+
alpha = ((parseInt(hexString.substr(3, 1), 16) * 0x11) / 255)
|
211
|
+
else
|
212
|
+
alpha = 1
|
213
|
+
|
214
|
+
rgb = (parseInt(hexString.substr(i, 1), 16) * 0x11 for i in [0..2])
|
215
|
+
rgb.push(alpha)
|
216
|
+
|
217
|
+
return rgb
|
218
|
+
|
219
|
+
when 6, 8
|
220
|
+
if hexString.length == 8
|
221
|
+
alpha = (parseInt(hexString.substr(6, 2), 16) / 255)
|
222
|
+
else
|
223
|
+
alpha = 1
|
224
|
+
|
225
|
+
rgb = (parseInt(hexString.substr(2 * i, 2), 16) for i in [0..2])
|
226
|
+
rgb.push(alpha)
|
227
|
+
|
228
|
+
return rgb
|
229
|
+
|
230
|
+
else
|
231
|
+
return undefined
|
232
|
+
|
@@ -0,0 +1,1042 @@
|
|
1
|
+
###*
|
2
|
+
Returns a string representing the specified Boolean object.
|
3
|
+
|
4
|
+
<code><em>bool</em>.toString()</code>
|
5
|
+
|
6
|
+
@name toString
|
7
|
+
@methodOf Boolean#
|
8
|
+
###
|
9
|
+
###*
|
10
|
+
Returns the primitive value of a Boolean object.
|
11
|
+
|
12
|
+
<code><em>bool</em>.valueOf()</code>
|
13
|
+
|
14
|
+
@name valueOf
|
15
|
+
@methodOf Boolean#
|
16
|
+
###
|
17
|
+
###*
|
18
|
+
Returns a string representing the Number object in exponential notation
|
19
|
+
|
20
|
+
<code><i>number</i>.toExponential( [<em>fractionDigits</em>] )</code>
|
21
|
+
@param fractionDigits
|
22
|
+
An integer specifying the number of digits after the decimal point. Defaults
|
23
|
+
to as many digits as necessary to specify the number.
|
24
|
+
@name toExponential
|
25
|
+
@methodOf Number#
|
26
|
+
###
|
27
|
+
###*
|
28
|
+
Formats a number using fixed-point notation
|
29
|
+
|
30
|
+
<code><i>number</i>.toFixed( [<em>digits</em>] )</code>
|
31
|
+
@param digits The number of digits to appear after the decimal point; this
|
32
|
+
may be a value between 0 and 20, inclusive, and implementations may optionally
|
33
|
+
support a larger range of values. If this argument is omitted, it is treated as
|
34
|
+
0.
|
35
|
+
@name toFixed
|
36
|
+
@methodOf Number#
|
37
|
+
###
|
38
|
+
###*
|
39
|
+
number.toLocaleString();
|
40
|
+
|
41
|
+
@name toLocaleString
|
42
|
+
@methodOf Number#
|
43
|
+
###
|
44
|
+
###*
|
45
|
+
Returns a string representing the Number object to the specified precision.
|
46
|
+
|
47
|
+
<code><em>number</em>.toPrecision( [ <em>precision</em> ] )</code>
|
48
|
+
@param precision An integer specifying the number of significant digits.
|
49
|
+
@name toPrecision
|
50
|
+
@methodOf Number#
|
51
|
+
###
|
52
|
+
|
53
|
+
###*
|
54
|
+
Returns a string representing the specified Number object
|
55
|
+
|
56
|
+
<code><i>number</i>.toString( [<em>radix</em>] )</code>
|
57
|
+
@param radix
|
58
|
+
An integer between 2 and 36 specifying the base to use for representing
|
59
|
+
numeric values.
|
60
|
+
@name toString
|
61
|
+
@methodOf Number#
|
62
|
+
###
|
63
|
+
###*
|
64
|
+
Returns the primitive value of a Number object.
|
65
|
+
|
66
|
+
@name valueOf
|
67
|
+
@methodOf Number#
|
68
|
+
###
|
69
|
+
###*
|
70
|
+
Returns the specified character from a string.
|
71
|
+
|
72
|
+
<code><em>string</em>.charAt(<em>index</em>)</code>
|
73
|
+
@param index An integer between 0 and 1 less than the length of the string.
|
74
|
+
@name charAt
|
75
|
+
@methodOf String#
|
76
|
+
###
|
77
|
+
###*
|
78
|
+
Returns the numeric Unicode value of the character at the given index (except
|
79
|
+
for unicode codepoints > 0x10000).
|
80
|
+
|
81
|
+
|
82
|
+
@param index An integer greater than 0 and less than the length of the string;
|
83
|
+
if it is not a number, it defaults to 0.
|
84
|
+
@name charCodeAt
|
85
|
+
@methodOf String#
|
86
|
+
###
|
87
|
+
###*
|
88
|
+
Combines the text of two or more strings and returns a new string.
|
89
|
+
|
90
|
+
<code><em>string</em>.concat(<em>string2</em>, <em>string3</em>[, ..., <em>stringN</em>])</code>
|
91
|
+
@param string2...stringN Strings to concatenate to this string.
|
92
|
+
@name concat
|
93
|
+
@methodOf String#
|
94
|
+
###
|
95
|
+
###*
|
96
|
+
Returns the index within the calling String object of the first occurrence of
|
97
|
+
the specified value, starting the search at fromIndex,
|
98
|
+
returns -1 if the value is not found.
|
99
|
+
|
100
|
+
<code><em>string</em>.indexOf(<em>searchValue</em>[, <em>fromIndex</em>]</code>
|
101
|
+
@param searchValue A string representing the value to search for.
|
102
|
+
@param fromIndex The location within the calling string to start the search
|
103
|
+
from. It can be any integer between 0 and the length of the string. The default
|
104
|
+
value is 0.
|
105
|
+
@name indexOf
|
106
|
+
@methodOf String#
|
107
|
+
###
|
108
|
+
###*
|
109
|
+
Returns the index within the calling String object of the last occurrence of the
|
110
|
+
specified value, or -1 if not found. The calling string is searched backward,
|
111
|
+
starting at fromIndex.
|
112
|
+
|
113
|
+
<code><em>string</em>.lastIndexOf(<em>searchValue</em>[, <em>fromIndex</em>])</code>
|
114
|
+
@param searchValue A string representing the value to search for.
|
115
|
+
@param fromIndex The location within the calling string to start the search
|
116
|
+
from, indexed from left to right. It can be any integer between 0 and the length
|
117
|
+
of the string. The default value is the length of the string.
|
118
|
+
@name lastIndexOf
|
119
|
+
@methodOf String#
|
120
|
+
###
|
121
|
+
###*
|
122
|
+
Returns a number indicating whether a reference string comes before or after or
|
123
|
+
is the same as the given string in sort order.
|
124
|
+
|
125
|
+
<code> localeCompare(compareString) </code>
|
126
|
+
|
127
|
+
@name localeCompare
|
128
|
+
@methodOf String#
|
129
|
+
###
|
130
|
+
###*
|
131
|
+
Used to retrieve the matches when matching a string against a regular
|
132
|
+
expression.
|
133
|
+
|
134
|
+
<code><em>string</em>.match(<em>regexp</em>)</code>
|
135
|
+
@param regexp A regular expression object. If a non-RegExp object obj is passed,
|
136
|
+
it is implicitly converted to a RegExp by using new RegExp(obj).
|
137
|
+
@name match
|
138
|
+
@methodOf String#
|
139
|
+
###
|
140
|
+
|
141
|
+
###*
|
142
|
+
Returns a new string with some or all matches of a pattern replaced by a
|
143
|
+
replacement. The pattern can be a string or a RegExp, and the replacement can
|
144
|
+
be a string or a function to be called for each match.
|
145
|
+
|
146
|
+
<code><em>str</em>.replace(<em>regexp|substr</em>, <em>newSubStr|function[</em>, </code><code><em>flags]</em>);</code>
|
147
|
+
@param regexp A RegExp object. The match is replaced by the return value of
|
148
|
+
parameter #2.
|
149
|
+
@param substr A String that is to be replaced by newSubStr.
|
150
|
+
@param newSubStr The String that replaces the substring received from parameter
|
151
|
+
#1. A number of special replacement patterns are supported; see the "Specifying
|
152
|
+
a string as a parameter" section below.
|
153
|
+
@param function A function to be invoked to create the new substring (to put in
|
154
|
+
place of the substring received from parameter #1). The arguments supplied to
|
155
|
+
this function are described in the "Specifying a function as a parameter"
|
156
|
+
section below.
|
157
|
+
@param flags gimy
|
158
|
+
|
159
|
+
Non-standardThe use of the flags parameter in the String.replace method is
|
160
|
+
non-standard. For cross-browser compatibility, use a RegExp object with
|
161
|
+
corresponding flags.A string containing any combination of the RegExp flags: g
|
162
|
+
global match i ignore case m match over multiple lines y Non-standard
|
163
|
+
sticky global matchignore casematch over multiple linesNon-standard sticky
|
164
|
+
@name replace
|
165
|
+
@methodOf String#
|
166
|
+
###
|
167
|
+
###*
|
168
|
+
Executes the search for a match between a regular expression and this String
|
169
|
+
object.
|
170
|
+
|
171
|
+
<code><em>string</em>.search(<em>regexp</em>)</code>
|
172
|
+
@param regexp A regular expression object. If a non-RegExp object obj is
|
173
|
+
passed, it is implicitly converted to a RegExp by using new RegExp(obj).
|
174
|
+
@name search
|
175
|
+
@methodOf String#
|
176
|
+
###
|
177
|
+
###*
|
178
|
+
Extracts a section of a string and returns a new string.
|
179
|
+
|
180
|
+
<code><em>string</em>.slice(<em>beginslice</em>[, <em>endSlice</em>])</code>
|
181
|
+
@param beginSlice The zero-based index at which to begin extraction.
|
182
|
+
@param endSlice The zero-based index at which to end extraction. If omitted,
|
183
|
+
slice extracts to the end of the string.
|
184
|
+
@name slice
|
185
|
+
@methodOf String#
|
186
|
+
###
|
187
|
+
###*
|
188
|
+
Splits a String object into an array of strings by separating the string into
|
189
|
+
substrings.
|
190
|
+
|
191
|
+
<code><em>string</em>.split([<em>separator</em>][, <em>limit</em>])</code>
|
192
|
+
@param separator Specifies the character to use for separating the string. The
|
193
|
+
separator is treated as a string or a regular expression. If separator is
|
194
|
+
omitted, the array returned contains one element consisting of the entire
|
195
|
+
string.
|
196
|
+
@param limit Integer specifying a limit on the number of splits to be found.
|
197
|
+
@name split
|
198
|
+
@methodOf String#
|
199
|
+
###
|
200
|
+
###*
|
201
|
+
Returns the characters in a string beginning at the specified location through
|
202
|
+
the specified number of characters.
|
203
|
+
|
204
|
+
<code><em>string</em>.substr(<em>start</em>[, <em>length</em>])</code>
|
205
|
+
@param start Location at which to begin extracting characters.
|
206
|
+
@param length The number of characters to extract.
|
207
|
+
@name substr
|
208
|
+
@methodOf String#
|
209
|
+
###
|
210
|
+
###*
|
211
|
+
Returns a subset of a string between one index and another, or through the end
|
212
|
+
of the string.
|
213
|
+
|
214
|
+
<code><em>string</em>.substring(<em>indexA</em>[, <em>indexB</em>])</code>
|
215
|
+
@param indexA An integer between 0 and one less than the length of the string.
|
216
|
+
@param indexB (optional) An integer between 0 and the length of the string.
|
217
|
+
@name substring
|
218
|
+
@methodOf String#
|
219
|
+
###
|
220
|
+
###*
|
221
|
+
Returns the calling string value converted to lower case, according to any
|
222
|
+
locale-specific case mappings.
|
223
|
+
|
224
|
+
<code> toLocaleLowerCase() </code>
|
225
|
+
|
226
|
+
@name toLocaleLowerCase
|
227
|
+
@methodOf String#
|
228
|
+
###
|
229
|
+
###*
|
230
|
+
Returns the calling string value converted to upper case, according to any
|
231
|
+
locale-specific case mappings.
|
232
|
+
|
233
|
+
<code> toLocaleUpperCase() </code>
|
234
|
+
|
235
|
+
@name toLocaleUpperCase
|
236
|
+
@methodOf String#
|
237
|
+
###
|
238
|
+
###*
|
239
|
+
Returns the calling string value converted to lowercase.
|
240
|
+
|
241
|
+
<code><em>string</em>.toLowerCase()</code>
|
242
|
+
|
243
|
+
@name toLowerCase
|
244
|
+
@methodOf String#
|
245
|
+
###
|
246
|
+
|
247
|
+
###*
|
248
|
+
Returns a string representing the specified object.
|
249
|
+
|
250
|
+
<code><em>string</em>.toString()</code>
|
251
|
+
|
252
|
+
@name toString
|
253
|
+
@methodOf String#
|
254
|
+
###
|
255
|
+
###*
|
256
|
+
Returns the calling string value converted to uppercase.
|
257
|
+
|
258
|
+
<code><em>string</em>.toUpperCase()</code>
|
259
|
+
|
260
|
+
@name toUpperCase
|
261
|
+
@methodOf String#
|
262
|
+
###
|
263
|
+
###*
|
264
|
+
Removes whitespace from both ends of the string.
|
265
|
+
|
266
|
+
<code><em>string</em>.trim()</code>
|
267
|
+
|
268
|
+
@name trim
|
269
|
+
@methodOf String#
|
270
|
+
###
|
271
|
+
|
272
|
+
###*
|
273
|
+
Returns the primitive value of a String object.
|
274
|
+
|
275
|
+
<code><em>string</em>.valueOf()</code>
|
276
|
+
|
277
|
+
@name valueOf
|
278
|
+
@methodOf String#
|
279
|
+
###
|
280
|
+
###*
|
281
|
+
Removes the last element from an array and returns that element.
|
282
|
+
|
283
|
+
<code>
|
284
|
+
<i>array</i>.pop()
|
285
|
+
</code>
|
286
|
+
|
287
|
+
@name pop
|
288
|
+
@methodOf Array#
|
289
|
+
###
|
290
|
+
###*
|
291
|
+
Mutates an array by appending the given elements and returning the new length of
|
292
|
+
the array.
|
293
|
+
|
294
|
+
<code><em>array</em>.push(<em>element1</em>, ..., <em>elementN</em>)</code>
|
295
|
+
@param element1, ..., elementN The elements to add to the end of the array.
|
296
|
+
@name push
|
297
|
+
@methodOf Array#
|
298
|
+
###
|
299
|
+
###*
|
300
|
+
Reverses an array in place. The first array element becomes the last and the
|
301
|
+
last becomes the first.
|
302
|
+
|
303
|
+
<code><em>array</em>.reverse()</code>
|
304
|
+
|
305
|
+
@name reverse
|
306
|
+
@methodOf Array#
|
307
|
+
###
|
308
|
+
###*
|
309
|
+
Removes the first element from an array and returns that element. This method
|
310
|
+
changes the length of the array.
|
311
|
+
|
312
|
+
<code><em>array</em>.shift()</code>
|
313
|
+
|
314
|
+
@name shift
|
315
|
+
@methodOf Array#
|
316
|
+
###
|
317
|
+
###*
|
318
|
+
Sorts the elements of an array in place.
|
319
|
+
|
320
|
+
<code><em>array</em>.sort([<em>compareFunction</em>])</code>
|
321
|
+
@param compareFunction Specifies a function that defines the sort order. If
|
322
|
+
omitted, the array is sorted lexicographically (in dictionary order) according
|
323
|
+
to the string conversion of each element.
|
324
|
+
@name sort
|
325
|
+
@methodOf Array#
|
326
|
+
###
|
327
|
+
###*
|
328
|
+
Changes the content of an array, adding new elements while removing old
|
329
|
+
elements.
|
330
|
+
|
331
|
+
<code><em>array</em>.splice(<em>index</em>, <em>howMany</em>[, <em>element1</em>[, ...[, <em>elementN</em>]]])</code>
|
332
|
+
@param index Index at which to start changing the array. If negative, will
|
333
|
+
begin that many elements from the end.
|
334
|
+
@param howMany An integer indicating the number of old array elements to
|
335
|
+
remove. If howMany is 0, no elements are removed. In this case, you should
|
336
|
+
specify at least one new element. If no howMany parameter is specified (second
|
337
|
+
syntax above, which is a SpiderMonkey extension), all elements after index are
|
338
|
+
removed.
|
339
|
+
@param element1, ..., elementN The elements to add to the array. If you don't
|
340
|
+
specify any elements, splice simply removes elements from the array.
|
341
|
+
@name splice
|
342
|
+
@methodOf Array#
|
343
|
+
###
|
344
|
+
###*
|
345
|
+
Adds one or more elements to the beginning of an array and returns the new
|
346
|
+
length of the array.
|
347
|
+
|
348
|
+
<code><em>arrayName</em>.unshift(<em>element1</em>, ..., <em>elementN</em>) </code>
|
349
|
+
@param element1, ..., elementN The elements to add to the front of the array.
|
350
|
+
@name unshift
|
351
|
+
@methodOf Array#
|
352
|
+
###
|
353
|
+
###*
|
354
|
+
Returns a new array comprised of this array joined with other array(s) and/or
|
355
|
+
value(s).
|
356
|
+
|
357
|
+
<code><em>array</em>.concat(<em>value1</em>, <em>value2</em>, ..., <em>valueN</em>)</code>
|
358
|
+
@param valueN Arrays and/or values to concatenate to the resulting array.
|
359
|
+
@name concat
|
360
|
+
@methodOf Array#
|
361
|
+
###
|
362
|
+
###*
|
363
|
+
Joins all elements of an array into a string.
|
364
|
+
|
365
|
+
<code><em>array</em>.join(<em>separator</em>)</code>
|
366
|
+
@param separator Specifies a string to separate each element of the array. The
|
367
|
+
separator is converted to a string if necessary. If omitted, the array elements
|
368
|
+
are separated with a comma.
|
369
|
+
@name join
|
370
|
+
@methodOf Array#
|
371
|
+
###
|
372
|
+
###*
|
373
|
+
Returns a one-level deep copy of a portion of an array.
|
374
|
+
|
375
|
+
<code><em>array</em>.slice(<em>begin</em>[, <em>end</em>])</code>
|
376
|
+
@param begin Zero-based index at which to begin extraction.As a negative index,
|
377
|
+
start indicates an offset from the end of the sequence. slice(-2) extracts the
|
378
|
+
second-to-last element and the last element in the sequence.
|
379
|
+
@param end Zero-based index at which to end extraction. slice extracts up to
|
380
|
+
but not including end.slice(1,4) extracts the second element through the fourth
|
381
|
+
element (elements indexed 1, 2, and 3).As a negative index, end indicates an
|
382
|
+
offset from the end of the sequence. slice(2,-1) extracts the third element
|
383
|
+
through the second-to-last element in the sequence.If end is omitted, slice
|
384
|
+
extracts to the end of the sequence.
|
385
|
+
@name slice
|
386
|
+
@methodOf Array#
|
387
|
+
###
|
388
|
+
|
389
|
+
###*
|
390
|
+
Returns a string representing the specified array and its elements.
|
391
|
+
|
392
|
+
<code><em>array</em>.toString()</code>
|
393
|
+
|
394
|
+
@name toString
|
395
|
+
@methodOf Array#
|
396
|
+
###
|
397
|
+
###*
|
398
|
+
Returns the first index at which a given element can be found in the array, or
|
399
|
+
-1 if it is not present.
|
400
|
+
|
401
|
+
<code><em>array</em>.indexOf(<em>searchElement</em>[, <em>fromIndex</em>])</code>
|
402
|
+
@param searchElement fromIndex Element to locate in the array.The index at
|
403
|
+
which to begin the search. Defaults to 0, i.e. the whole array will be searched.
|
404
|
+
If the index is greater than or equal to the length of the array, -1 is
|
405
|
+
returned, i.e. the array will not be searched. If negative, it is taken as the
|
406
|
+
offset from the end of the array. Note that even when the index is negative, the
|
407
|
+
array is still searched from front to back. If the calculated index is less than
|
408
|
+
0, the whole array will be searched.
|
409
|
+
@name indexOf
|
410
|
+
@methodOf Array#
|
411
|
+
###
|
412
|
+
###*
|
413
|
+
Returns the last index at which a given element can be found in the array, or -1
|
414
|
+
if it is not present. The array is searched backwards, starting at fromIndex.
|
415
|
+
|
416
|
+
<code><em>array</em>.lastIndexOf(<em>searchElement</em>[, <em>fromIndex</em>])</code>
|
417
|
+
@param searchElement fromIndex Element to locate in the array.The index at
|
418
|
+
which to start searching backwards. Defaults to the array's length, i.e. the
|
419
|
+
whole array will be searched. If the index is greater than or equal to the
|
420
|
+
length of the array, the whole array will be searched. If negative, it is taken
|
421
|
+
as the offset from the end of the array. Note that even when the index is
|
422
|
+
negative, the array is still searched from back to front. If the calculated
|
423
|
+
index is less than 0, -1 is returned, i.e. the array will not be searched.
|
424
|
+
@name lastIndexOf
|
425
|
+
@methodOf Array#
|
426
|
+
###
|
427
|
+
###*
|
428
|
+
Creates a new array with all elements that pass the test implemented by the
|
429
|
+
provided function.
|
430
|
+
|
431
|
+
<code><em>array</em>.filter(<em>callback</em>[, <em>thisObject</em>])</code>
|
432
|
+
@param callback thisObject Function to test each element of the array.Object to
|
433
|
+
use as this when executing callback.
|
434
|
+
@name filter
|
435
|
+
@methodOf Array#
|
436
|
+
###
|
437
|
+
###*
|
438
|
+
Executes a provided function once per array element.
|
439
|
+
|
440
|
+
<code><em>array</em>.forEach(<em>callback</em>[, <em>thisObject</em>])</code>
|
441
|
+
@param callback thisObject Function to execute for each element.Object to use
|
442
|
+
as this when executing callback.
|
443
|
+
@name forEach
|
444
|
+
@methodOf Array#
|
445
|
+
###
|
446
|
+
###*
|
447
|
+
Tests whether all elements in the array pass the test implemented by the
|
448
|
+
provided function.
|
449
|
+
|
450
|
+
<code><em>array</em>.every(<em>callback</em>[, <em>thisObject</em>])</code>
|
451
|
+
@param callbackthisObject Function to test for each element.Object to use as
|
452
|
+
this when executing callback.
|
453
|
+
@name every
|
454
|
+
@methodOf Array#
|
455
|
+
###
|
456
|
+
###*
|
457
|
+
Creates a new array with the results of calling a provided function on every
|
458
|
+
element in this array.
|
459
|
+
|
460
|
+
<code><em>array</em>.map(<em>callback</em>[, <em>thisObject</em>])</code>
|
461
|
+
@param callbackthisObject Function that produces an element of the new Array
|
462
|
+
from an element of the current one.Object to use as this when executing
|
463
|
+
callback.
|
464
|
+
@name map
|
465
|
+
@methodOf Array#
|
466
|
+
###
|
467
|
+
###*
|
468
|
+
Tests whether some element in the array passes the test implemented by the
|
469
|
+
provided function.
|
470
|
+
|
471
|
+
<code><em>array</em>.some(<em>callback</em>[, <em>thisObject</em>])</code>
|
472
|
+
@param callback thisObject Function to test for each element.Object to use as
|
473
|
+
this when executing callback.
|
474
|
+
@name some
|
475
|
+
@methodOf Array#
|
476
|
+
###
|
477
|
+
###*
|
478
|
+
Apply a function against an accumulator and each value of the array (from
|
479
|
+
left-to-right) as to reduce it to a single value.
|
480
|
+
|
481
|
+
<code><em>array</em>.reduce(<em>callback</em>[, <em>initialValue</em>])</code>
|
482
|
+
@param callbackinitialValue Function to execute on each value in the
|
483
|
+
array.Object to use as the first argument to the first call of the callback.
|
484
|
+
@name reduce
|
485
|
+
@methodOf Array#
|
486
|
+
###
|
487
|
+
###*
|
488
|
+
Apply a function simultaneously against two values of the array (from
|
489
|
+
right-to-left) as to reduce it to a single value.
|
490
|
+
|
491
|
+
<code><em>array</em>.reduceRight(<em>callback</em>[, <em>initialValue</em>])</code>
|
492
|
+
@param callback initialValue Function to execute on each value in the
|
493
|
+
array.Object to use as the first argument to the first call of the callback.
|
494
|
+
@name reduceRight
|
495
|
+
@methodOf Array#
|
496
|
+
###
|
497
|
+
###*
|
498
|
+
Returns a boolean indicating whether the object has the specified property.
|
499
|
+
|
500
|
+
<code><em>obj</em>.hasOwnProperty(<em>prop</em>)</code>
|
501
|
+
@param prop The name of the property to test.
|
502
|
+
@name hasOwnProperty
|
503
|
+
@methodOf Object#
|
504
|
+
###
|
505
|
+
###*
|
506
|
+
Calls a function with a given this value and arguments provided as an array.
|
507
|
+
|
508
|
+
<code><em>fun</em>.apply(<em>thisArg</em>[, <em>argsArray</em>])</code>
|
509
|
+
@param thisArg Determines the value of this inside fun. If thisArg is null or
|
510
|
+
undefined, this will be the global object. Otherwise, this will be equal to
|
511
|
+
Object(thisArg) (which is thisArg if thisArg is already an object, or a String,
|
512
|
+
Boolean, or Number if thisArg is a primitive value of the corresponding type).
|
513
|
+
Therefore, it is always true that typeof this == "object" when the function
|
514
|
+
executes.
|
515
|
+
@param argsArray An argument array for the object, specifying the arguments
|
516
|
+
with which fun should be called, or null or undefined if no arguments should be
|
517
|
+
provided to the function.
|
518
|
+
@name apply
|
519
|
+
@methodOf Function#
|
520
|
+
###
|
521
|
+
###*
|
522
|
+
Creates a new function that, when called, itself calls this function in the
|
523
|
+
context of the provided this value, with a given sequence of arguments preceding
|
524
|
+
any provided when the new function was called.
|
525
|
+
|
526
|
+
<code><em>fun</em>.bind(<em>thisArg</em>[, <em>arg1</em>[, <em>arg2</em>[, ...]]])</code>
|
527
|
+
@param thisValuearg1, arg2, ... The value to be passed as the this parameter to
|
528
|
+
the target function when the bound function is called. The value is ignored if
|
529
|
+
the bound function is constructed using the new operator.Arguments to prepend to
|
530
|
+
arguments provided to the bound function when invoking the target function.
|
531
|
+
@name bind
|
532
|
+
@methodOf Function#
|
533
|
+
###
|
534
|
+
###*
|
535
|
+
Calls a function with a given this value and arguments provided individually.
|
536
|
+
|
537
|
+
<code><em>fun</em>.call(<em>thisArg</em>[, <em>arg1</em>[, <em>arg2</em>[, ...]]])</code>
|
538
|
+
@param thisArg Determines the value of this inside fun. If thisArg is null or
|
539
|
+
undefined, this will be the global object. Otherwise, this will be equal to
|
540
|
+
Object(thisArg) (which is thisArg if thisArg is already an object, or a String,
|
541
|
+
Boolean, or Number if thisArg is a primitive value of the corresponding type).
|
542
|
+
Therefore, it is always true that typeof this == "object" when the function
|
543
|
+
executes.
|
544
|
+
@param arg1, arg2, ... Arguments for the object.
|
545
|
+
@name call
|
546
|
+
@methodOf Function#
|
547
|
+
###
|
548
|
+
|
549
|
+
###*
|
550
|
+
Returns a string representing the source code of the function.
|
551
|
+
|
552
|
+
<code><em>function</em>.toString(<em>indentation</em>)</code>
|
553
|
+
@param indentation Non-standard The amount of spaces to indent the string
|
554
|
+
representation of the source code. If indentation is less than or equal to -1,
|
555
|
+
most unnecessary spaces are removed.
|
556
|
+
@name toString
|
557
|
+
@methodOf Function#
|
558
|
+
###
|
559
|
+
###*
|
560
|
+
Executes a search for a match in a specified string. Returns a result array, or
|
561
|
+
null.
|
562
|
+
|
563
|
+
|
564
|
+
@param regexp The name of the regular expression. It can be a variable name or
|
565
|
+
a literal.
|
566
|
+
@param str The string against which to match the regular expression.
|
567
|
+
@name exec
|
568
|
+
@methodOf RegExp#
|
569
|
+
###
|
570
|
+
###*
|
571
|
+
Executes the search for a match between a regular expression and a specified
|
572
|
+
string. Returns true or false.
|
573
|
+
|
574
|
+
<code> <em>regexp</em>.test([<em>str</em>]) </code>
|
575
|
+
@param regexp The name of the regular expression. It can be a variable name or
|
576
|
+
a literal.
|
577
|
+
@param str The string against which to match the regular expression.
|
578
|
+
@name test
|
579
|
+
@methodOf RegExp#
|
580
|
+
###
|
581
|
+
|
582
|
+
###*
|
583
|
+
Returns a string representing the specified object.
|
584
|
+
|
585
|
+
<code><i>regexp</i>.toString()</code>
|
586
|
+
|
587
|
+
@name toString
|
588
|
+
@methodOf RegExp#
|
589
|
+
###
|
590
|
+
###*
|
591
|
+
Returns a reference to the Date function that created the instance's prototype.
|
592
|
+
Note that the value of this property is a reference to the function itself, not
|
593
|
+
a string containing the function's name.
|
594
|
+
|
595
|
+
|
596
|
+
|
597
|
+
@name constructor
|
598
|
+
@methodOf Date#
|
599
|
+
###
|
600
|
+
###*
|
601
|
+
Returns the day of the month for the specified date according to local time.
|
602
|
+
|
603
|
+
<code>
|
604
|
+
getDate()
|
605
|
+
</code>
|
606
|
+
|
607
|
+
@name getDate
|
608
|
+
@methodOf Date#
|
609
|
+
###
|
610
|
+
###*
|
611
|
+
Returns the day of the week for the specified date according to local time.
|
612
|
+
|
613
|
+
<code>
|
614
|
+
getDay()
|
615
|
+
</code>
|
616
|
+
|
617
|
+
@name getDay
|
618
|
+
@methodOf Date#
|
619
|
+
###
|
620
|
+
###*
|
621
|
+
Returns the year of the specified date according to local time.
|
622
|
+
|
623
|
+
<code>
|
624
|
+
getFullYear()
|
625
|
+
</code>
|
626
|
+
|
627
|
+
@name getFullYear
|
628
|
+
@methodOf Date#
|
629
|
+
###
|
630
|
+
###*
|
631
|
+
Returns the hour for the specified date according to local time.
|
632
|
+
|
633
|
+
<code>
|
634
|
+
getHours()
|
635
|
+
</code>
|
636
|
+
|
637
|
+
@name getHours
|
638
|
+
@methodOf Date#
|
639
|
+
###
|
640
|
+
###*
|
641
|
+
Returns the milliseconds in the specified date according to local time.
|
642
|
+
|
643
|
+
<code>
|
644
|
+
getMilliseconds()
|
645
|
+
</code>
|
646
|
+
|
647
|
+
@name getMilliseconds
|
648
|
+
@methodOf Date#
|
649
|
+
###
|
650
|
+
###*
|
651
|
+
Returns the minutes in the specified date according to local time.
|
652
|
+
|
653
|
+
<code>
|
654
|
+
getMinutes()
|
655
|
+
</code>
|
656
|
+
|
657
|
+
@name getMinutes
|
658
|
+
@methodOf Date#
|
659
|
+
###
|
660
|
+
###*
|
661
|
+
Returns the month in the specified date according to local time.
|
662
|
+
|
663
|
+
<code>
|
664
|
+
getMonth()
|
665
|
+
</code>
|
666
|
+
|
667
|
+
@name getMonth
|
668
|
+
@methodOf Date#
|
669
|
+
###
|
670
|
+
###*
|
671
|
+
Returns the seconds in the specified date according to local time.
|
672
|
+
|
673
|
+
<code>
|
674
|
+
getSeconds()
|
675
|
+
</code>
|
676
|
+
|
677
|
+
@name getSeconds
|
678
|
+
@methodOf Date#
|
679
|
+
###
|
680
|
+
###*
|
681
|
+
Returns the numeric value corresponding to the time for the specified date
|
682
|
+
according to universal time.
|
683
|
+
|
684
|
+
<code> getTime() </code>
|
685
|
+
|
686
|
+
@name getTime
|
687
|
+
@methodOf Date#
|
688
|
+
###
|
689
|
+
###*
|
690
|
+
Returns the time-zone offset from UTC, in minutes, for the current locale.
|
691
|
+
|
692
|
+
<code> getTimezoneOffset() </code>
|
693
|
+
|
694
|
+
@name getTimezoneOffset
|
695
|
+
@methodOf Date#
|
696
|
+
###
|
697
|
+
###*
|
698
|
+
Returns the day (date) of the month in the specified date according to universal
|
699
|
+
time.
|
700
|
+
|
701
|
+
<code>
|
702
|
+
getUTCDate()
|
703
|
+
</code>
|
704
|
+
|
705
|
+
@name getUTCDate
|
706
|
+
@methodOf Date#
|
707
|
+
###
|
708
|
+
###*
|
709
|
+
Returns the day of the week in the specified date according to universal time.
|
710
|
+
|
711
|
+
<code>
|
712
|
+
getUTCDay()
|
713
|
+
</code>
|
714
|
+
|
715
|
+
@name getUTCDay
|
716
|
+
@methodOf Date#
|
717
|
+
###
|
718
|
+
###*
|
719
|
+
Returns the year in the specified date according to universal time.
|
720
|
+
|
721
|
+
<code>
|
722
|
+
getUTCFullYear()
|
723
|
+
</code>
|
724
|
+
|
725
|
+
@name getUTCFullYear
|
726
|
+
@methodOf Date#
|
727
|
+
###
|
728
|
+
###*
|
729
|
+
Returns the hours in the specified date according to universal time.
|
730
|
+
|
731
|
+
<code>
|
732
|
+
getUTCHours
|
733
|
+
</code>
|
734
|
+
|
735
|
+
@name getUTCHours
|
736
|
+
@methodOf Date#
|
737
|
+
###
|
738
|
+
###*
|
739
|
+
Returns the milliseconds in the specified date according to universal time.
|
740
|
+
|
741
|
+
<code>
|
742
|
+
getUTCMilliseconds()
|
743
|
+
</code>
|
744
|
+
|
745
|
+
@name getUTCMilliseconds
|
746
|
+
@methodOf Date#
|
747
|
+
###
|
748
|
+
###*
|
749
|
+
Returns the minutes in the specified date according to universal time.
|
750
|
+
|
751
|
+
<code>
|
752
|
+
getUTCMinutes()
|
753
|
+
</code>
|
754
|
+
|
755
|
+
@name getUTCMinutes
|
756
|
+
@methodOf Date#
|
757
|
+
###
|
758
|
+
###*
|
759
|
+
Returns the month of the specified date according to universal time.
|
760
|
+
|
761
|
+
<code>
|
762
|
+
getUTCMonth()
|
763
|
+
</code>
|
764
|
+
|
765
|
+
@name getUTCMonth
|
766
|
+
@methodOf Date#
|
767
|
+
###
|
768
|
+
###*
|
769
|
+
Returns the seconds in the specified date according to universal time.
|
770
|
+
|
771
|
+
<code>
|
772
|
+
getUTCSeconds()
|
773
|
+
</code>
|
774
|
+
|
775
|
+
@name getUTCSeconds
|
776
|
+
@methodOf Date#
|
777
|
+
###
|
778
|
+
|
779
|
+
###*
|
780
|
+
Sets the day of the month for a specified date according to local time.
|
781
|
+
|
782
|
+
<code> setDate(<em>dayValue</em>) </code>
|
783
|
+
@param dayValue An integer from 1 to 31, representing the day of the month.
|
784
|
+
@name setDate
|
785
|
+
@methodOf Date#
|
786
|
+
###
|
787
|
+
###*
|
788
|
+
Sets the full year for a specified date according to local time.
|
789
|
+
|
790
|
+
<code>
|
791
|
+
setFullYear(<i>yearValue</i>[, <i>monthValue</i>[, <em>dayValue</em>]])
|
792
|
+
</code>
|
793
|
+
@param yearValue An integer specifying the numeric value of the year, for
|
794
|
+
example, 1995.
|
795
|
+
@param monthValue An integer between 0 and 11 representing the months January
|
796
|
+
through December.
|
797
|
+
@param dayValue An integer between 1 and 31 representing the day of the
|
798
|
+
month. If you specify the dayValue parameter, you must also specify the
|
799
|
+
monthValue.
|
800
|
+
@name setFullYear
|
801
|
+
@methodOf Date#
|
802
|
+
###
|
803
|
+
###*
|
804
|
+
Sets the hours for a specified date according to local time.
|
805
|
+
|
806
|
+
<code>
|
807
|
+
setHours(<i>hoursValue</i>[, <i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]]])
|
808
|
+
</code>
|
809
|
+
@param hoursValue An integer between 0 and 23, representing the hour.
|
810
|
+
@param minutesValue An integer between 0 and 59, representing the minutes.
|
811
|
+
@param secondsValue An integer between 0 and 59, representing the seconds. If
|
812
|
+
you specify the secondsValue parameter, you must also specify the minutesValue.
|
813
|
+
@param msValue A number between 0 and 999, representing the milliseconds. If
|
814
|
+
you specify the msValue parameter, you must also specify the minutesValue and
|
815
|
+
secondsValue.
|
816
|
+
@name setHours
|
817
|
+
@methodOf Date#
|
818
|
+
###
|
819
|
+
###*
|
820
|
+
Sets the milliseconds for a specified date according to local time.
|
821
|
+
|
822
|
+
<code>
|
823
|
+
setMilliseconds(<i>millisecondsValue</i>)
|
824
|
+
</code>
|
825
|
+
@param millisecondsValue A number between 0 and 999, representing the
|
826
|
+
milliseconds.
|
827
|
+
@name setMilliseconds
|
828
|
+
@methodOf Date#
|
829
|
+
###
|
830
|
+
###*
|
831
|
+
Sets the minutes for a specified date according to local time.
|
832
|
+
|
833
|
+
<code>
|
834
|
+
setMinutes(<i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]])
|
835
|
+
</code>
|
836
|
+
@param minutesValue An integer between 0 and 59, representing the minutes.
|
837
|
+
@param secondsValue An integer between 0 and 59, representing the seconds. If
|
838
|
+
you specify the secondsValue parameter, you must also specify the minutesValue.
|
839
|
+
@param msValue A number between 0 and 999, representing the milliseconds. If
|
840
|
+
you specify the msValue parameter, you must also specify the minutesValue and
|
841
|
+
secondsValue.
|
842
|
+
@name setMinutes
|
843
|
+
@methodOf Date#
|
844
|
+
###
|
845
|
+
###*
|
846
|
+
Set the month for a specified date according to local time.
|
847
|
+
|
848
|
+
<code>
|
849
|
+
setMonth(<i>monthValue</i>[, <em>dayValue</em>])
|
850
|
+
</code>
|
851
|
+
@param monthValue An integer between 0 and 11 (representing the months
|
852
|
+
January through December).
|
853
|
+
@param dayValue An integer from 1 to 31, representing the day of the month.
|
854
|
+
@name setMonth
|
855
|
+
@methodOf Date#
|
856
|
+
###
|
857
|
+
###*
|
858
|
+
Sets the seconds for a specified date according to local time.
|
859
|
+
|
860
|
+
<code>
|
861
|
+
setSeconds(<i>secondsValue</i>[, <em>msValue</em>])
|
862
|
+
</code>
|
863
|
+
@param secondsValue An integer between 0 and 59.
|
864
|
+
@param msValue A number between 0 and 999, representing the milliseconds.
|
865
|
+
@name setSeconds
|
866
|
+
@methodOf Date#
|
867
|
+
###
|
868
|
+
###*
|
869
|
+
Sets the Date object to the time represented by a number of milliseconds since
|
870
|
+
January 1, 1970, 00:00:00 UTC.
|
871
|
+
|
872
|
+
<code>
|
873
|
+
setTime(<i>timeValue</i>)
|
874
|
+
</code>
|
875
|
+
@param timeValue An integer representing the number of milliseconds since 1
|
876
|
+
January 1970, 00:00:00 UTC.
|
877
|
+
@name setTime
|
878
|
+
@methodOf Date#
|
879
|
+
###
|
880
|
+
###*
|
881
|
+
Sets the day of the month for a specified date according to universal time.
|
882
|
+
|
883
|
+
<code>
|
884
|
+
setUTCDate(<i>dayValue</i>)
|
885
|
+
</code>
|
886
|
+
@param dayValue An integer from 1 to 31, representing the day of the month.
|
887
|
+
@name setUTCDate
|
888
|
+
@methodOf Date#
|
889
|
+
###
|
890
|
+
###*
|
891
|
+
Sets the full year for a specified date according to universal time.
|
892
|
+
|
893
|
+
<code>
|
894
|
+
setUTCFullYear(<i>yearValue</i>[, <i>monthValue</i>[, <em>dayValue</em>]])
|
895
|
+
</code>
|
896
|
+
@param yearValue An integer specifying the numeric value of the year, for
|
897
|
+
example, 1995.
|
898
|
+
@param monthValue An integer between 0 and 11 representing the months January
|
899
|
+
through December.
|
900
|
+
@param dayValue An integer between 1 and 31 representing the day of the
|
901
|
+
month. If you specify the dayValue parameter, you must also specify the
|
902
|
+
monthValue.
|
903
|
+
@name setUTCFullYear
|
904
|
+
@methodOf Date#
|
905
|
+
###
|
906
|
+
###*
|
907
|
+
Sets the hour for a specified date according to universal time.
|
908
|
+
|
909
|
+
<code>
|
910
|
+
setUTCHours(<i>hoursValue</i>[, <i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]]])
|
911
|
+
</code>
|
912
|
+
@param hoursValue An integer between 0 and 23, representing the hour.
|
913
|
+
@param minutesValue An integer between 0 and 59, representing the minutes.
|
914
|
+
@param secondsValue An integer between 0 and 59, representing the seconds. If
|
915
|
+
you specify the secondsValue parameter, you must also specify the minutesValue.
|
916
|
+
@param msValue A number between 0 and 999, representing the milliseconds. If
|
917
|
+
you specify the msValue parameter, you must also specify the minutesValue and
|
918
|
+
secondsValue.
|
919
|
+
@name setUTCHours
|
920
|
+
@methodOf Date#
|
921
|
+
###
|
922
|
+
###*
|
923
|
+
Sets the milliseconds for a specified date according to universal time.
|
924
|
+
|
925
|
+
<code>
|
926
|
+
setUTCMilliseconds(<i>millisecondsValue</i>)
|
927
|
+
</code>
|
928
|
+
@param millisecondsValue A number between 0 and 999, representing the
|
929
|
+
milliseconds.
|
930
|
+
@name setUTCMilliseconds
|
931
|
+
@methodOf Date#
|
932
|
+
###
|
933
|
+
###*
|
934
|
+
Sets the minutes for a specified date according to universal time.
|
935
|
+
|
936
|
+
<code>
|
937
|
+
setUTCMinutes(<i>minutesValue</i>[, <i>secondsValue</i>[, <em>msValue</em>]])
|
938
|
+
</code>
|
939
|
+
@param minutesValue An integer between 0 and 59, representing the minutes.
|
940
|
+
@param secondsValue An integer between 0 and 59, representing the seconds. If
|
941
|
+
you specify the secondsValue parameter, you must also specify the minutesValue.
|
942
|
+
@param msValue A number between 0 and 999, representing the milliseconds. If
|
943
|
+
you specify the msValue parameter, you must also specify the minutesValue and
|
944
|
+
secondsValue.
|
945
|
+
@name setUTCMinutes
|
946
|
+
@methodOf Date#
|
947
|
+
###
|
948
|
+
###*
|
949
|
+
Sets the month for a specified date according to universal time.
|
950
|
+
|
951
|
+
<code>
|
952
|
+
setUTCMonth(<i>monthValue</i>[, <em>dayValue</em>])
|
953
|
+
</code>
|
954
|
+
@param monthValue An integer between 0 and 11, representing the months
|
955
|
+
January through December.
|
956
|
+
@param dayValue An integer from 1 to 31, representing the day of the month.
|
957
|
+
@name setUTCMonth
|
958
|
+
@methodOf Date#
|
959
|
+
###
|
960
|
+
###*
|
961
|
+
Sets the seconds for a specified date according to universal time.
|
962
|
+
|
963
|
+
<code>
|
964
|
+
setUTCSeconds(<i>secondsValue</i>[, <em>msValue</em>])
|
965
|
+
</code>
|
966
|
+
@param secondsValue An integer between 0 and 59.
|
967
|
+
@param msValue A number between 0 and 999, representing the milliseconds.
|
968
|
+
@name setUTCSeconds
|
969
|
+
@methodOf Date#
|
970
|
+
###
|
971
|
+
###*
|
972
|
+
Returns the date portion of a Date object in human readable form in American
|
973
|
+
English.
|
974
|
+
|
975
|
+
<code><em>date</em>.toDateString()</code>
|
976
|
+
|
977
|
+
@name toDateString
|
978
|
+
@methodOf Date#
|
979
|
+
###
|
980
|
+
###*
|
981
|
+
Returns a JSON representation of the Date object.
|
982
|
+
|
983
|
+
<code><em>date</em>.prototype.toJSON()</code>
|
984
|
+
|
985
|
+
@name toJSON
|
986
|
+
@methodOf Date#
|
987
|
+
###
|
988
|
+
###*
|
989
|
+
Converts a date to a string, returning the "date" portion using the operating
|
990
|
+
system's locale's conventions.
|
991
|
+
|
992
|
+
<code>
|
993
|
+
toLocaleDateString()
|
994
|
+
</code>
|
995
|
+
|
996
|
+
@name toLocaleDateString
|
997
|
+
@methodOf Date#
|
998
|
+
###
|
999
|
+
###*
|
1000
|
+
Converts a date to a string, using the operating system's locale's conventions.
|
1001
|
+
|
1002
|
+
<code>
|
1003
|
+
toLocaleString()
|
1004
|
+
</code>
|
1005
|
+
|
1006
|
+
@name toLocaleString
|
1007
|
+
@methodOf Date#
|
1008
|
+
###
|
1009
|
+
###*
|
1010
|
+
Converts a date to a string, returning the "time" portion using the current
|
1011
|
+
locale's conventions.
|
1012
|
+
|
1013
|
+
<code> toLocaleTimeString() </code>
|
1014
|
+
|
1015
|
+
@name toLocaleTimeString
|
1016
|
+
@methodOf Date#
|
1017
|
+
###
|
1018
|
+
###*
|
1019
|
+
Returns a string representing the specified Date object.
|
1020
|
+
|
1021
|
+
<code> toString() </code>
|
1022
|
+
|
1023
|
+
@name toString
|
1024
|
+
@methodOf Date#
|
1025
|
+
###
|
1026
|
+
###*
|
1027
|
+
Returns the time portion of a Date object in human readable form in American
|
1028
|
+
English.
|
1029
|
+
|
1030
|
+
<code><em>date</em>.toTimeString()</code>
|
1031
|
+
|
1032
|
+
@name toTimeString
|
1033
|
+
@methodOf Date#
|
1034
|
+
###
|
1035
|
+
###*
|
1036
|
+
Converts a date to a string, using the universal time convention.
|
1037
|
+
|
1038
|
+
<code> toUTCString() </code>
|
1039
|
+
|
1040
|
+
@name toUTCString
|
1041
|
+
@methodOf Date#
|
1042
|
+
###
|