requirejs-rails 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/bin/r.js +2815 -80
- data/lib/requirejs/rails/version.rb +1 -1
- data/vendor/assets/javascripts/require.js +19 -9
- metadata +9 -9
@@ -1,5 +1,5 @@
|
|
1
1
|
/** vim: et:ts=4:sw=4:sts=4
|
2
|
-
* @license RequireJS 1.0.
|
2
|
+
* @license RequireJS 1.0.8 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
3
3
|
* Available via the MIT or new BSD license.
|
4
4
|
* see: http://github.com/jrburke/requirejs for details
|
5
5
|
*/
|
@@ -7,9 +7,9 @@
|
|
7
7
|
/*global window, navigator, document, importScripts, jQuery, setTimeout, opera */
|
8
8
|
|
9
9
|
var requirejs, require, define;
|
10
|
-
(function () {
|
10
|
+
(function (undefined) {
|
11
11
|
//Change this version number for each release.
|
12
|
-
var version = "1.0.
|
12
|
+
var version = "1.0.8",
|
13
13
|
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
|
14
14
|
cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
|
15
15
|
currDirRegExp = /^\.\//,
|
@@ -423,18 +423,19 @@ var requirejs, require, define;
|
|
423
423
|
fullName = map.fullName,
|
424
424
|
args = manager.deps,
|
425
425
|
listeners = manager.listeners,
|
426
|
+
execCb = config.requireExecCb || req.execCb,
|
426
427
|
cjsModule;
|
427
428
|
|
428
429
|
//Call the callback to define the module, if necessary.
|
429
430
|
if (cb && isFunction(cb)) {
|
430
431
|
if (config.catchError.define) {
|
431
432
|
try {
|
432
|
-
ret =
|
433
|
+
ret = execCb(fullName, manager.callback, args, defined[fullName]);
|
433
434
|
} catch (e) {
|
434
435
|
err = e;
|
435
436
|
}
|
436
437
|
} else {
|
437
|
-
ret =
|
438
|
+
ret = execCb(fullName, manager.callback, args, defined[fullName]);
|
438
439
|
}
|
439
440
|
|
440
441
|
if (fullName) {
|
@@ -1174,7 +1175,7 @@ var requirejs, require, define;
|
|
1174
1175
|
} else {
|
1175
1176
|
//Regular dependency.
|
1176
1177
|
if (!urlFetched[url] && !loaded[fullName]) {
|
1177
|
-
req.load(context, fullName, url);
|
1178
|
+
(config.requireLoad || req.load)(context, fullName, url);
|
1178
1179
|
|
1179
1180
|
//Mark the URL as fetched, but only if it is
|
1180
1181
|
//not an empty: URL, used by the optimizer.
|
@@ -1478,7 +1479,8 @@ var requirejs, require, define;
|
|
1478
1479
|
moduleName = normalize(moduleName, relModuleMap && relModuleMap.fullName);
|
1479
1480
|
|
1480
1481
|
//If a colon is in the URL, it indicates a protocol is used and it is just
|
1481
|
-
//an URL to a file, or if it starts with a slash
|
1482
|
+
//an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
|
1483
|
+
//or ends with .js, then assume the user meant to use an url and not a module id.
|
1482
1484
|
//The slash is important for protocol-less URLs as well as full paths.
|
1483
1485
|
if (req.jsExtRegExp.test(moduleName)) {
|
1484
1486
|
//Just a plain path, not module name lookup, so just return it.
|
@@ -1514,7 +1516,7 @@ var requirejs, require, define;
|
|
1514
1516
|
|
1515
1517
|
//Join the path parts together, then figure out if baseUrl is needed.
|
1516
1518
|
url = syms.join("/") + (ext || ".js");
|
1517
|
-
url = (url.charAt(0) === '/' || url.match(
|
1519
|
+
url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? "" : config.baseUrl) + url;
|
1518
1520
|
}
|
1519
1521
|
|
1520
1522
|
return config.urlArgs ? url +
|
@@ -1878,7 +1880,15 @@ var requirejs, require, define;
|
|
1878
1880
|
//https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
|
1879
1881
|
//UNFORTUNATELY Opera implements attachEvent but does not follow the script
|
1880
1882
|
//script execution mode.
|
1881
|
-
if (node.attachEvent &&
|
1883
|
+
if (node.attachEvent &&
|
1884
|
+
// check if node.attachEvent is artificially added by custom script or
|
1885
|
+
// natively supported by browser
|
1886
|
+
// read https://github.com/jrburke/requirejs/issues/187
|
1887
|
+
// if we can NOT find [native code] then it must NOT natively supported.
|
1888
|
+
// in IE8, node.attachEvent does not have toString()
|
1889
|
+
// TODO: a better way to check interactive mode
|
1890
|
+
!(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code]') < 0) &&
|
1891
|
+
!isOpera) {
|
1882
1892
|
//Probably IE. IE (at least 6-8) do not fire
|
1883
1893
|
//script onload right after executing the script, so
|
1884
1894
|
//we cannot tie the anonymous define call to a name.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: requirejs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-04-20 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
16
|
-
requirement: &
|
16
|
+
requirement: &70218915266960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: '3.3'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *70218915266960
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rails
|
30
|
-
requirement: &
|
30
|
+
requirement: &70218915433300 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -38,10 +38,10 @@ dependencies:
|
|
38
38
|
version: '3.3'
|
39
39
|
type: :development
|
40
40
|
prerelease: false
|
41
|
-
version_requirements: *
|
41
|
+
version_requirements: *70218915433300
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: sqlite3
|
44
|
-
requirement: &
|
44
|
+
requirement: &70218915431540 !ruby/object:Gem::Requirement
|
45
45
|
none: false
|
46
46
|
requirements:
|
47
47
|
- - ! '>='
|
@@ -49,7 +49,7 @@ dependencies:
|
|
49
49
|
version: '0'
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
|
-
version_requirements: *
|
52
|
+
version_requirements: *70218915431540
|
53
53
|
description: This gem provides RequireJS support for your Rails 3 application.
|
54
54
|
email:
|
55
55
|
- whitley@bangpath.org
|
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
segments:
|
131
131
|
- 0
|
132
|
-
hash:
|
132
|
+
hash: 2649433147791205198
|
133
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
134
|
none: false
|
135
135
|
requirements:
|
@@ -138,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
138
|
version: '0'
|
139
139
|
segments:
|
140
140
|
- 0
|
141
|
-
hash:
|
141
|
+
hash: 2649433147791205198
|
142
142
|
requirements:
|
143
143
|
- node.js is required for 'rake assets:precompile', used to run the r.js build
|
144
144
|
- If needed, jQuery should be v1.7 or greater (jquery-rails >= 1.0.17).
|