3.0 source code
This commit is contained in:
4
OfficeWeb/vendor/requirejs/tests/dataMain/baseUrl/a.js
vendored
Normal file
4
OfficeWeb/vendor/requirejs/tests/dataMain/baseUrl/a.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
define({
|
||||
name: 'a'
|
||||
});
|
||||
|
||||
23
OfficeWeb/vendor/requirejs/tests/dataMain/baseUrl/dataMainBaseUrl.html
vendored
Normal file
23
OfficeWeb/vendor/requirejs/tests/dataMain/baseUrl/dataMainBaseUrl.html
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: data-main baseUrl Test</title>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script>
|
||||
var require = {
|
||||
baseUrl: "./"
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" data-main="src/main" src="../../../require.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: data-main baseUrl Test</h1>
|
||||
|
||||
<p>Confirm that setting a baseUrl does not mess up the data-main module
|
||||
ID. More info:
|
||||
<a href="https://github.com/jrburke/requirejs/issues/325">325</a>.
|
||||
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
11
OfficeWeb/vendor/requirejs/tests/dataMain/baseUrl/src/main.js
vendored
Normal file
11
OfficeWeb/vendor/requirejs/tests/dataMain/baseUrl/src/main.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
define(['a'], function (a) {
|
||||
doh.register(
|
||||
"dataMainBaseUrl",
|
||||
[
|
||||
function dataMainBaseUrl(t){
|
||||
t.is("a", a.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
});
|
||||
13
OfficeWeb/vendor/requirejs/tests/dataMain/dataMain.html
vendored
Normal file
13
OfficeWeb/vendor/requirejs/tests/dataMain/dataMain.html
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: data-main Test</title>
|
||||
<script type="text/javascript" src="../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../doh/_browserRunner.js"></script>
|
||||
<script type="text/javascript" data-main="dataMain.js" src="../../require.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: data-main Test</h1>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
16
OfficeWeb/vendor/requirejs/tests/dataMain/dataMain.js
vendored
Normal file
16
OfficeWeb/vendor/requirejs/tests/dataMain/dataMain.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
require({
|
||||
baseUrl: "../"
|
||||
},
|
||||
["require", "simple"],
|
||||
function(require, simple) {
|
||||
doh.register(
|
||||
"dataMain",
|
||||
[
|
||||
function dataMain(t){
|
||||
t.is("blue", simple.color);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}
|
||||
);
|
||||
23
OfficeWeb/vendor/requirejs/tests/dataMain/dataMainIndex/dataMainIndex.html
vendored
Normal file
23
OfficeWeb/vendor/requirejs/tests/dataMain/dataMainIndex/dataMainIndex.html
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: data-main index Test</title>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script>
|
||||
var require = {
|
||||
baseUrl: "./"
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" data-main="index.js" src="../../../require.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: data-main index Test</h1>
|
||||
|
||||
<p>Confirm that a data-main="index.js" with an inline config with a baseUrl
|
||||
works with a built script that has "index" as the top level define call. More info:
|
||||
<a href="https://github.com/jrburke/requirejs/issues/303">303</a>.
|
||||
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
15
OfficeWeb/vendor/requirejs/tests/dataMain/dataMainIndex/index.js
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/dataMain/dataMainIndex/index.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
define('a', {
|
||||
name: 'a'
|
||||
});
|
||||
|
||||
define('index', ['a'], function (a) {
|
||||
doh.register(
|
||||
"dataMainIndex",
|
||||
[
|
||||
function dataMainIndex(t){
|
||||
t.is("a", a.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
});
|
||||
4
OfficeWeb/vendor/requirejs/tests/dataMain/skipDataMain/a.js
vendored
Normal file
4
OfficeWeb/vendor/requirejs/tests/dataMain/skipDataMain/a.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
define({
|
||||
name: 'a'
|
||||
});
|
||||
|
||||
3
OfficeWeb/vendor/requirejs/tests/dataMain/skipDataMain/index.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/dataMain/skipDataMain/index.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define('index', ['a'], function (a) {
|
||||
a.modified = true;
|
||||
});
|
||||
39
OfficeWeb/vendor/requirejs/tests/dataMain/skipDataMain/skipDataMain.html
vendored
Normal file
39
OfficeWeb/vendor/requirejs/tests/dataMain/skipDataMain/skipDataMain.html
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Skip data-main Test</title>
|
||||
<script type="text/javascript" src="../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../doh/_browserRunner.js"></script>
|
||||
<script>
|
||||
var require = {
|
||||
skipDataMain: true
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" data-main="index" src="../../../require.js"></script>
|
||||
<script>
|
||||
require(['a'], function(a) {
|
||||
//Give a chance for any index.js to get loaded in a failure case
|
||||
setTimeout(function() {
|
||||
doh.register(
|
||||
"skipDataMain",
|
||||
[
|
||||
function skipDataMain(t){
|
||||
t.is("a", a.name);
|
||||
t.is(true, !a.modified);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
}, 300);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Skip data-main Test</h1>
|
||||
|
||||
<p>Skip data-main option test. More info:
|
||||
<a href="https://github.com/jrburke/requirejs/issues/903">903</a>.
|
||||
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user