3.0 source code
This commit is contained in:
6
OfficeWeb/vendor/requirejs/tests/mapConfig/a1.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/mapConfig/a1.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
define(['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
6
OfficeWeb/vendor/requirejs/tests/mapConfig/a1/sub/one.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/mapConfig/a1/sub/one.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
define(['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
4
OfficeWeb/vendor/requirejs/tests/mapConfig/adapter/d.js
vendored
Normal file
4
OfficeWeb/vendor/requirejs/tests/mapConfig/adapter/d.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
define(['d'], function(d) {
|
||||
d.adapted = true;
|
||||
return d;
|
||||
});
|
||||
6
OfficeWeb/vendor/requirejs/tests/mapConfig/another/c.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/mapConfig/another/c.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
define(['./minor'], function (minor) {
|
||||
return {
|
||||
name: 'another/c',
|
||||
minorName: minor.name
|
||||
};
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/another/c/dim.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/another/c/dim.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'another/c/dim'
|
||||
});
|
||||
6
OfficeWeb/vendor/requirejs/tests/mapConfig/another/c/sub.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/mapConfig/another/c/sub.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
define(['./dim'], function (dim) {
|
||||
return {
|
||||
name: 'another/c/sub',
|
||||
dimName: dim.name
|
||||
};
|
||||
});
|
||||
4
OfficeWeb/vendor/requirejs/tests/mapConfig/another/minor.js
vendored
Normal file
4
OfficeWeb/vendor/requirejs/tests/mapConfig/another/minor.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
define({
|
||||
name: 'another/minor'
|
||||
});
|
||||
|
||||
6
OfficeWeb/vendor/requirejs/tests/mapConfig/b.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/mapConfig/b.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
define(['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
82
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfig-tests.js
vendored
Normal file
82
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfig-tests.js
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
|
||||
define('c1',{
|
||||
name: 'c1'
|
||||
});
|
||||
|
||||
define('c1/sub',{
|
||||
name: 'c1/sub'
|
||||
});
|
||||
|
||||
define('a',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
define('c',{
|
||||
name: 'c'
|
||||
});
|
||||
|
||||
define('c/sub',{
|
||||
name: 'c/sub'
|
||||
});
|
||||
|
||||
define('b',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
define('c2',{
|
||||
name: 'c2'
|
||||
});
|
||||
|
||||
define('c2/sub',{
|
||||
name: 'c2/sub'
|
||||
});
|
||||
|
||||
define('a/sub/one',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
require({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
a: 'a1'
|
||||
},
|
||||
|
||||
map: {
|
||||
'a': {
|
||||
c: 'c1'
|
||||
},
|
||||
'a/sub/one': {
|
||||
'c': 'c2'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b', 'c', 'a/sub/one'],
|
||||
function(a, b, c, one) {
|
||||
doh.register(
|
||||
'mapConfig',
|
||||
[
|
||||
function mapConfig(t){
|
||||
t.is('c1', a.c.name);
|
||||
t.is('c1/sub', a.csub.name);
|
||||
t.is('c2', one.c.name);
|
||||
t.is('c2/sub', one.csub.name);
|
||||
t.is('c', b.c.name);
|
||||
t.is('c/sub', b.csub.name);
|
||||
t.is('c', c.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
|
||||
define("mapConfig-tests", function(){});
|
||||
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigBuilt.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigBuilt.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Built Test</title>
|
||||
<script type="text/javascript" src="../../../require.js"></script>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfig-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Built Test</h1>
|
||||
<p>Test using the map config after a build.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
91
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigPlugin-tests.js
vendored
Normal file
91
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigPlugin-tests.js
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
|
||||
define('plug',{
|
||||
load: function (name, require, load, config) {
|
||||
if (!name) {
|
||||
name = 'main';
|
||||
} else if (name.charAt(0) === '/') {
|
||||
name = 'main' + name;
|
||||
}
|
||||
|
||||
//Only grab the first segment of the name.
|
||||
//This is just to be different, nothing
|
||||
//that is required behavior.
|
||||
name = name.split('/').shift();
|
||||
|
||||
name = 'plug/' + name;
|
||||
|
||||
require([name], load);
|
||||
}
|
||||
});
|
||||
define('plug/c1',{
|
||||
name: 'plug!c1'
|
||||
});
|
||||
|
||||
define('a',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
define('plug/main',{
|
||||
name: 'plug!main'
|
||||
});
|
||||
|
||||
define('b',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
define('plug/c2',{
|
||||
name: 'plug!c2'
|
||||
});
|
||||
|
||||
define('a/sub/one',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
require({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
a: 'a1'
|
||||
},
|
||||
|
||||
map: {
|
||||
'*': {
|
||||
c: 'plug!'
|
||||
},
|
||||
'a': {
|
||||
c: 'plug!c1'
|
||||
},
|
||||
'a/sub/one': {
|
||||
'c': 'plug!c2'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b', 'c', 'a/sub/one'],
|
||||
function(a, b, c, one) {
|
||||
doh.register(
|
||||
'mapConfigPlugin',
|
||||
[
|
||||
function mapConfigPlugin(t){
|
||||
t.is('plug!c1', a.c.name);
|
||||
t.is('plug!c1', a.csub.name);
|
||||
t.is('plug!c2', one.c.name);
|
||||
t.is('plug!c2', one.csub.name);
|
||||
t.is('plug!main', b.c.name);
|
||||
t.is('plug!main', b.csub.name);
|
||||
t.is('plug!main', c.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
|
||||
define("mapConfigPlugin-tests", function(){});
|
||||
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigPluginBuilt.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigPluginBuilt.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Plugin Built Test</title>
|
||||
<script type="text/javascript" src="../../../require.js"></script>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigPlugin-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Plugin Built Test</h1>
|
||||
<p>Test using the map config with plugin value after a build.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
100
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStar-tests.js
vendored
Normal file
100
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStar-tests.js
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
define('c1',{
|
||||
name: 'c1'
|
||||
});
|
||||
|
||||
define('c1/sub',{
|
||||
name: 'c1/sub'
|
||||
});
|
||||
|
||||
define('a',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
define('another/minor',{
|
||||
name: 'another/minor'
|
||||
});
|
||||
|
||||
|
||||
define('another/c',['./minor'], function (minor) {
|
||||
return {
|
||||
name: 'another/c',
|
||||
minorName: minor.name
|
||||
};
|
||||
});
|
||||
|
||||
define('another/c/dim',{
|
||||
name: 'another/c/dim'
|
||||
});
|
||||
|
||||
define('another/c/sub',['./dim'], function (dim) {
|
||||
return {
|
||||
name: 'another/c/sub',
|
||||
dimName: dim.name
|
||||
};
|
||||
});
|
||||
|
||||
define('b',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
define('c2',{
|
||||
name: 'c2'
|
||||
});
|
||||
|
||||
define('a/sub/one',['c', 'c/sub'], function (c, csub) {
|
||||
return {
|
||||
c: c,
|
||||
csub: csub
|
||||
};
|
||||
});
|
||||
|
||||
require({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
a: 'a1'
|
||||
},
|
||||
|
||||
map: {
|
||||
'*': {
|
||||
'c': 'another/c'
|
||||
},
|
||||
'a': {
|
||||
c: 'c1'
|
||||
},
|
||||
'a/sub/one': {
|
||||
'c': 'c2',
|
||||
'c/sub': 'another/c/sub'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b', 'c', 'a/sub/one'],
|
||||
function(a, b, c, one) {
|
||||
doh.register(
|
||||
'mapConfigStar',
|
||||
[
|
||||
function mapConfigStar(t){
|
||||
t.is('c1', a.c.name);
|
||||
t.is('c1/sub', a.csub.name);
|
||||
t.is('c2', one.c.name);
|
||||
t.is('another/c/sub', one.csub.name);
|
||||
t.is('another/c/dim', one.csub.dimName);
|
||||
t.is('another/c', b.c.name);
|
||||
t.is('another/minor', b.c.minorName);
|
||||
t.is('another/c/sub', b.csub.name);
|
||||
t.is('another/c', c.name);
|
||||
t.is('another/minor', c.minorName);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
|
||||
define("mapConfigStar-tests", function(){});
|
||||
49
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStarAdapter-tests.js
vendored
Normal file
49
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStarAdapter-tests.js
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
|
||||
define('d',{
|
||||
name: 'd'
|
||||
});
|
||||
|
||||
define('adapter/d',['d'], function(d) {
|
||||
d.adapted = true;
|
||||
return d;
|
||||
});
|
||||
|
||||
define('e',['d'], function (d) {
|
||||
return {
|
||||
name: 'e',
|
||||
d: d
|
||||
};
|
||||
});
|
||||
|
||||
/*global doh */
|
||||
require({
|
||||
baseUrl: './',
|
||||
map: {
|
||||
'*': {
|
||||
'd': 'adapter/d'
|
||||
},
|
||||
'adapter/d': {
|
||||
d: 'd'
|
||||
}
|
||||
}
|
||||
},
|
||||
['e', 'adapter/d'],
|
||||
function(e, adapterD) {
|
||||
|
||||
doh.register(
|
||||
'mapConfigStarAdapter',
|
||||
[
|
||||
function mapConfigStarAdapter(t){
|
||||
t.is('e', e.name);
|
||||
t.is('d', e.d.name);
|
||||
t.is(true, e.d.adapted);
|
||||
t.is(true, adapterD.adapted);
|
||||
t.is('d', adapterD.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
|
||||
define("mapConfigStarAdapter-tests", function(){});
|
||||
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStarAdapterBuilt.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStarAdapterBuilt.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Star Adapter Built Test</title>
|
||||
<script type="text/javascript" src="../../../require.js"></script>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigStarAdapter-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Star Adapter Built Test</h1>
|
||||
<p>Test using '*' with an adapter in the built map config.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStarBuilt.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/mapConfig/built/mapConfigStarBuilt.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Star Built Test</title>
|
||||
<script type="text/javascript" src="../../../require.js"></script>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigStar-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Star Built Test</h1>
|
||||
<p>Test using '*' in the built map config.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'c'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c/sub.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c/sub.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'c/sub'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c1.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c1.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'c1'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c1/sub.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c1/sub.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'c1/sub'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c2.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c2.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'c2'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c2/sub.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/c2/sub.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'c2/sub'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/d.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/d.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'd'
|
||||
});
|
||||
6
OfficeWeb/vendor/requirejs/tests/mapConfig/e.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/mapConfig/e.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
define(['d'], function (d) {
|
||||
return {
|
||||
name: 'e',
|
||||
d: d
|
||||
};
|
||||
});
|
||||
34
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfig-tests.js
vendored
Normal file
34
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfig-tests.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
require({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
a: 'a1'
|
||||
},
|
||||
|
||||
map: {
|
||||
'a': {
|
||||
c: 'c1'
|
||||
},
|
||||
'a/sub/one': {
|
||||
'c': 'c2'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b', 'c', 'a/sub/one'],
|
||||
function(a, b, c, one) {
|
||||
doh.register(
|
||||
'mapConfig',
|
||||
[
|
||||
function mapConfig(t){
|
||||
t.is('c1', a.c.name);
|
||||
t.is('c1/sub', a.csub.name);
|
||||
t.is('c2', one.c.name);
|
||||
t.is('c2/sub', one.csub.name);
|
||||
t.is('c', b.c.name);
|
||||
t.is('c/sub', b.csub.name);
|
||||
t.is('c', c.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
15
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfig.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfig.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfig-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Test</h1>
|
||||
<p>Test using the map config.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigDelayed-tests.js
vendored
Normal file
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigDelayed-tests.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
define('one', function () {
|
||||
return { name: 'one' };
|
||||
});
|
||||
|
||||
define('two', function () {
|
||||
return { name: 'two' };
|
||||
});
|
||||
|
||||
define('three', ['one'], function (one) {
|
||||
return { name: 'three',
|
||||
one: one
|
||||
};
|
||||
});
|
||||
|
||||
require([], function() {
|
||||
require({
|
||||
map : {
|
||||
'*': {
|
||||
'one': 'two'
|
||||
}
|
||||
}
|
||||
},
|
||||
['three'],
|
||||
function (three) {
|
||||
doh.register(
|
||||
'mapConfigDelayed',
|
||||
[
|
||||
function mapConfigDelayed(t){
|
||||
t.is('three', three.name);
|
||||
t.is('two', three.one.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
define("app", function(){});
|
||||
17
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigDelayed.html
vendored
Normal file
17
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigDelayed.html
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Multiple Map Delayed Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigDelayed-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Multiple Map Config Delayed Test</h1>
|
||||
<p>Test application of map config after some have already registered
|
||||
modules via define, but have not activated them yet. Related to:
|
||||
<a href="https://github.com/jrburke/requirejs/issues/309">309</a></p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigMulti-tests.js
vendored
Normal file
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigMulti-tests.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
require({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
a: 'a1'
|
||||
},
|
||||
|
||||
map: {
|
||||
'a': {
|
||||
c: 'c1'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
require({
|
||||
map: {
|
||||
'a/sub/one': {
|
||||
'c': 'c2'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b', 'c', 'a/sub/one'],
|
||||
function(a, b, c, one) {
|
||||
doh.register(
|
||||
'mapConfig',
|
||||
[
|
||||
function mapConfig(t){
|
||||
t.is('c1', a.c.name);
|
||||
t.is('c1/sub', a.csub.name);
|
||||
t.is('c2', one.c.name);
|
||||
t.is('c2/sub', one.csub.name);
|
||||
t.is('c', b.c.name);
|
||||
t.is('c/sub', b.csub.name);
|
||||
t.is('c', c.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
15
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigMulti.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigMulti.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Multiple Map Config Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigMulti-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Multiple Map Config Test</h1>
|
||||
<p>Test using the map config.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
37
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigPlugin-tests.js
vendored
Normal file
37
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigPlugin-tests.js
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
require({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
a: 'a1'
|
||||
},
|
||||
|
||||
map: {
|
||||
'*': {
|
||||
c: 'plug!'
|
||||
},
|
||||
'a': {
|
||||
c: 'plug!c1'
|
||||
},
|
||||
'a/sub/one': {
|
||||
'c': 'plug!c2'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b', 'c', 'a/sub/one'],
|
||||
function(a, b, c, one) {
|
||||
doh.register(
|
||||
'mapConfigPlugin',
|
||||
[
|
||||
function mapConfigPlugin(t){
|
||||
t.is('plug!c1', a.c.name);
|
||||
t.is('plug!c1', a.csub.name);
|
||||
t.is('plug!c2', one.c.name);
|
||||
t.is('plug!c2', one.csub.name);
|
||||
t.is('plug!main', b.c.name);
|
||||
t.is('plug!main', b.csub.name);
|
||||
t.is('plug!main', c.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
17
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigPlugin.html
vendored
Normal file
17
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigPlugin.html
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Plugin Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigPlugin-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Plugin Test</h1>
|
||||
<p>Test using the map config that has a plugin
|
||||
for a value.
|
||||
<a href="https://github.com/jrburke/requirejs/issues/466">More info</a>.
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
29
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigRelative-tests.js
vendored
Normal file
29
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigRelative-tests.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
define('lib/b', [], { name: 'b' });
|
||||
|
||||
define('b1', [], { name: 'b1' });
|
||||
|
||||
define('lib/a', ['./b'], function(b) {
|
||||
return {
|
||||
name: 'a',
|
||||
b: b
|
||||
};
|
||||
});
|
||||
|
||||
require({
|
||||
map: {
|
||||
'lib/a': {
|
||||
'lib/b': 'b1'
|
||||
}
|
||||
}
|
||||
},['lib/a'], function(a) {
|
||||
doh.register(
|
||||
'mapConfigRelative',
|
||||
[
|
||||
function mapConfigRelative(t){
|
||||
t.is('a', a.name);
|
||||
t.is('b1', a.b.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
});
|
||||
16
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigRelative.html
vendored
Normal file
16
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigRelative.html
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Relative Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigRelative-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Relative Test</h1>
|
||||
<p>Test using the map config on a relative dependency ID. More info:
|
||||
<a href="https://github.com/jrburke/requirejs/issues/350">350</a></p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigSpecificity-tests.js
vendored
Normal file
39
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigSpecificity-tests.js
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
define('foo-1.0/bar/baz', [], function(){ return '1.0'; });
|
||||
define('foo-1.2/bar/baz', [], function(){ return '1.2'; });
|
||||
|
||||
define('oldmodule', ['foo/bar/baz'], function(baz) {
|
||||
return {
|
||||
name: 'oldmodule',
|
||||
baz: baz
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
require({
|
||||
baseUrl: './',
|
||||
|
||||
map: {
|
||||
'oldmodule': {
|
||||
//This one should be favored over the * value.
|
||||
'foo' : 'foo-1.0'
|
||||
},
|
||||
|
||||
'*': {
|
||||
'foo/bar' : 'foo-1.2/bar'
|
||||
}
|
||||
}
|
||||
},
|
||||
['oldmodule'],
|
||||
function(oldmodule) {
|
||||
doh.register(
|
||||
'mapConfigSpecificity',
|
||||
[
|
||||
function mapConfigSpecificity(t){
|
||||
t.is('oldmodule', oldmodule.name);
|
||||
t.is('1.0', oldmodule.baz);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
16
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigSpecificity.html
vendored
Normal file
16
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigSpecificity.html
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Specificity Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigSpecificity-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Specificity Test</h1>
|
||||
<p>Test specificity of the map config.
|
||||
<a href="https://github.com/jrburke/requirejs/issues/390">More info</a>.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
41
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStar-tests.js
vendored
Normal file
41
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStar-tests.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
require({
|
||||
baseUrl: './',
|
||||
paths: {
|
||||
a: 'a1'
|
||||
},
|
||||
|
||||
map: {
|
||||
'*': {
|
||||
'c': 'another/c'
|
||||
},
|
||||
'a': {
|
||||
c: 'c1'
|
||||
},
|
||||
'a/sub/one': {
|
||||
'c': 'c2',
|
||||
'c/sub': 'another/c/sub'
|
||||
}
|
||||
}
|
||||
},
|
||||
['a', 'b', 'c', 'a/sub/one'],
|
||||
function(a, b, c, one) {
|
||||
doh.register(
|
||||
'mapConfigStar',
|
||||
[
|
||||
function mapConfigStar(t){
|
||||
t.is('c1', a.c.name);
|
||||
t.is('c1/sub', a.csub.name);
|
||||
t.is('c2', one.c.name);
|
||||
t.is('another/c/sub', one.csub.name);
|
||||
t.is('another/c/dim', one.csub.dimName);
|
||||
t.is('another/c', b.c.name);
|
||||
t.is('another/minor', b.c.minorName);
|
||||
t.is('another/c/sub', b.csub.name);
|
||||
t.is('another/c', c.name);
|
||||
t.is('another/minor', c.minorName);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
15
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStar.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStar.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Star Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigStar-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Star Test</h1>
|
||||
<p>Test using '*' in the map config.</p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
30
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStarAdapter-tests.js
vendored
Normal file
30
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStarAdapter-tests.js
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/*global doh */
|
||||
require({
|
||||
baseUrl: './',
|
||||
map: {
|
||||
'*': {
|
||||
'd': 'adapter/d'
|
||||
},
|
||||
'adapter/d': {
|
||||
d: 'd'
|
||||
}
|
||||
}
|
||||
},
|
||||
['e', 'adapter/d'],
|
||||
function(e, adapterD) {
|
||||
'use strict';
|
||||
doh.register(
|
||||
'mapConfigStarAdapter',
|
||||
[
|
||||
function mapConfigStarAdapter(t){
|
||||
t.is('e', e.name);
|
||||
t.is('d', e.d.name);
|
||||
t.is(true, e.d.adapted);
|
||||
t.is(true, adapterD.adapted);
|
||||
t.is('d', adapterD.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
18
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStarAdapter.html
vendored
Normal file
18
OfficeWeb/vendor/requirejs/tests/mapConfig/mapConfigStarAdapter.html
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Map Config Star Swap Test</title>
|
||||
<script type="text/javascript" src="../../require.js"></script>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" src="mapConfigStarAdapter-tests.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Map Config Star Swap Test</h1>
|
||||
<p>Test using '*' in the map config, but with an adapter module
|
||||
that is used to load the non-* version and add to it. More info:
|
||||
<a href="https://github.com/jrburke/requirejs/issues/277">#277</a></p>
|
||||
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
18
OfficeWeb/vendor/requirejs/tests/mapConfig/plug.js
vendored
Normal file
18
OfficeWeb/vendor/requirejs/tests/mapConfig/plug.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
define({
|
||||
load: function (name, require, load, config) {
|
||||
if (!name) {
|
||||
name = 'main';
|
||||
} else if (name.charAt(0) === '/') {
|
||||
name = 'main' + name;
|
||||
}
|
||||
|
||||
//Only grab the first segment of the name.
|
||||
//This is just to be different, nothing
|
||||
//that is required behavior.
|
||||
name = name.split('/').shift();
|
||||
|
||||
name = 'plug/' + name;
|
||||
|
||||
require([name], load);
|
||||
}
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/plug/c1.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/plug/c1.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'plug!c1'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/plug/c2.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/plug/c2.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'plug!c2'
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/mapConfig/plug/main.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/mapConfig/plug/main.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define({
|
||||
name: 'plug!main'
|
||||
});
|
||||
Reference in New Issue
Block a user