upgrade require js and plugins

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1305566 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-03-26 20:46:09 +00:00
parent 9d23364206
commit 21d37b8176
4 changed files with 2092 additions and 9 deletions

View File

@ -10,7 +10,7 @@
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/lab.js"></script>
<script type="text/javascript" src="js/require.1.0.1.js"></script>
<script type="text/javascript" src="js/require.1.0.7.js"></script>
<script type="text/javascript" src="js/jquery.i18n.properties-1.0.9.js"></script>
<script type="text/javascript" src="js/archiva/startup.js"></script>
<title>Apache Archiva</title>
@ -49,6 +49,15 @@
<script type="text/javascript">
$(function() {
require.config({
baseUrl: "js/",
"paths": {
"i18n":"jquery.i18n.properties-1.0.9",
"jquery": "jquery-1.7.2"
}
});
loadJs();
});

View File

@ -1,5 +1,5 @@
/**
* @license RequireJS order 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
* @license RequireJS order 1.0.5 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
*/
@ -120,11 +120,20 @@
}
define({
version: '1.0.0',
version: '1.0.5',
load: function (name, req, onLoad, config) {
var url = req.nameToUrl(name, null),
node, context;
var hasToUrl = !!req.nameToUrl,
url, node, context;
//If no nameToUrl, then probably a build with a loader that
//does not support it, and all modules are inlined.
if (!hasToUrl) {
req([name], onLoad);
return;
}
url = req.nameToUrl(name, null);
//Make sure the async attribute is not set for any pathway involving
//this script.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/**
* @license RequireJS text 1.0.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
* @license RequireJS text 1.0.7 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
*/
@ -41,7 +41,12 @@
fs = require.nodeRequire('fs');
get = function (url, callback) {
callback(fs.readFileSync(url, 'utf8'));
var file = fs.readFileSync(url, 'utf8');
//Remove BOM (Byte Mark Order) from utf8 files if it is there.
if (file.indexOf('\uFEFF') === 0) {
file = file.substring(1);
}
callback(file);
};
} else if (typeof Packages !== 'undefined') {
//Why Java, why is this so awkward?
@ -84,7 +89,7 @@
}
text = {
version: '1.0.0',
version: '1.0.7',
strip: function (content) {
//Strips <?xml ...?> declarations so that external SVG and XML
@ -197,7 +202,7 @@
finishLoad: function (name, strip, content, onLoad, config) {
content = strip ? text.strip(content) : content;
if (config.isBuild && config.inlineText) {
if (config.isBuild) {
buildMap[name] = content;
}
onLoad(content);
@ -211,6 +216,13 @@
//removing the <?xml ...?> declarations so the content can be inserted
//into the current doc without problems.
// Do not bother with the work if a build and text will
// not be inlined.
if (config.isBuild && !config.inlineText) {
onLoad();
return;
}
var parsed = text.parseName(name),
nonStripName = parsed.moduleName + '.' + parsed.ext,
url = req.toUrl(nonStripName),