Permalink
Browse files

update require-jquery

  • Loading branch information...
1 parent 231ee2d commit 98a3ee2b9756ef9c46173608f41244356956f57b @smith committed Aug 18, 2011
Showing with 35 additions and 21 deletions.
  1. +35 −21 CollegeFootball.wdgt/js/require-jquery.js
@@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4
- * @license RequireJS 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * @license RequireJS 0.26.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
@@ -11,9 +11,9 @@
var requirejs, require, define;
(function () {
//Change this version number for each release.
- var version = "0.25.0",
+ var version = "0.26.0",
commentRegExp = /(\/\*([\s\S]*?)\*\/|\/\/(.*)$)/mg,
- cjsRequireRegExp = /require\(["']([^'"\s]+)["']\)/g,
+ cjsRequireRegExp = /require\(\s*["']([^'"\s]+)["']\s*\)/g,
currDirRegExp = /^\.\//,
jsSuffixRegExp = /\.js$/,
ostring = Object.prototype.toString,
@@ -174,7 +174,8 @@ var requirejs, require, define;
waitSeconds: 7,
baseUrl: s.baseUrl || "./",
paths: {},
- pkgs: {}
+ pkgs: {},
+ catchError: {}
},
defQueue = [],
specified = {
@@ -238,7 +239,7 @@ var requirejs, require, define;
var pkgName, pkgConfig;
//Adjust any relative paths.
- if (name.charAt(0) === ".") {
+ if (name && name.charAt(0) === ".") {
//If have a base name, try to normalize against it,
//otherwise, assume it is a top-level require that will
//be relative to baseUrl in the end.
@@ -319,7 +320,7 @@ var requirejs, require, define;
//it has a normalize method. To avoid possible
//ambiguity with relative names loaded from another
//plugin, use the parent's name as part of this name.
- normalizedName = '__$p' + parentName + '@' + name;
+ normalizedName = '__$p' + parentName + '@' + (name || '');
}
} else {
normalizedName = normalize(name, parentName);
@@ -347,7 +348,7 @@ var requirejs, require, define;
parentMap: parentModuleMap,
url: url,
originalName: originalName,
- fullName: prefix ? prefix + "!" + normalizedName : normalizedName
+ fullName: prefix ? prefix + "!" + (normalizedName || '') : normalizedName
};
}
@@ -526,7 +527,7 @@ var requirejs, require, define;
}
function execManager(manager) {
- var i, ret, waitingCallbacks, err,
+ var i, ret, waitingCallbacks, err, errFile,
cb = manager.callback,
fullName = manager.fullName,
args = [],
@@ -542,10 +543,14 @@ var requirejs, require, define;
}
}
- try {
+ if (config.catchError.define) {
+ try {
+ ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
+ } catch (e) {
+ err = e;
+ }
+ } else {
ret = req.execCb(fullName, manager.callback, args, defined[fullName]);
- } catch (e) {
- err = e;
}
if (fullName) {
@@ -584,10 +589,12 @@ var requirejs, require, define;
}
if (err) {
+ errFile = (fullName ? makeModuleMap(fullName).url : '') ||
+ err.fileName || err.sourceURL;
err = makeError('defineerror', 'Error evaluating ' +
'module "' + fullName + '" at location "' +
- (fullName ? makeModuleMap(fullName).url : '') + '":\n' +
- err + '\nfileName:' + (err.fileName || err.sourceURL) +
+ errFile + '":\n' +
+ err + '\nfileName:' + errFile +
'\nlineNumber: ' + (err.lineNumber || err.line), err);
err.moduleName = fullName;
return req.onError(err);
@@ -984,7 +991,7 @@ var requirejs, require, define;
function loadPaused(dep) {
//Renormalize dependency if its name was waiting on a plugin
//to load, which as since loaded.
- if (dep.prefix && dep.name.indexOf('__$p') === 0 && defined[dep.prefix]) {
+ if (dep.prefix && dep.name && dep.name.indexOf('__$p') === 0 && defined[dep.prefix]) {
dep = makeModuleMap(dep.originalName, dep.parentMap);
}
@@ -1263,7 +1270,7 @@ var requirejs, require, define;
resume();
}
}
- return undefined;
+ return context.require;
},
/**
@@ -1476,6 +1483,14 @@ var requirejs, require, define;
};
/**
+ * Support require.config() to make it easier to cooperate with other
+ * AMD loaders on globally agreed names.
+ */
+ req.config = function (config) {
+ return req(config);
+ };
+
+ /**
* Export require as a global, but only if it does not already exist.
*/
if (typeof require === "undefined") {
@@ -1623,13 +1638,12 @@ var requirejs, require, define;
//work.
if (useInteractive) {
node = currentlyAddingScript || getInteractiveScript();
- if (!node) {
- return req.onError(makeError("interactive", "No matching script interactive for " + callback));
- }
- if (!name) {
- name = node.getAttribute("data-requiremodule");
+ if (node) {
+ if (!name) {
+ name = node.getAttribute("data-requiremodule");
+ }
+ context = contexts[node.getAttribute("data-requirecontext")];
}
- context = contexts[node.getAttribute("data-requirecontext")];
}
//Always save off evaluating the def call until the script onload handler.

0 comments on commit 98a3ee2

Please sign in to comment.