3.0 source code
This commit is contained in:
6
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/application.js
vendored
Normal file
6
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/application.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
define('application', ['person'], function(person) {
|
||||
return {
|
||||
name: 'application',
|
||||
person: person
|
||||
};
|
||||
});
|
||||
5
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/employee.js
vendored
Normal file
5
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/employee.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
define('employee', ['plugin!person'], function(person) {
|
||||
return {
|
||||
name: 'employed ' + person.name
|
||||
};
|
||||
});
|
||||
23
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/main.js
vendored
Normal file
23
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/main.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
require({
|
||||
map: {
|
||||
'*': {
|
||||
'person': 'employee'
|
||||
},
|
||||
'employee': {
|
||||
'person': 'person'
|
||||
}
|
||||
}
|
||||
}, ['application'], function (application) {
|
||||
|
||||
doh.register(
|
||||
'pluginMapDynamic',
|
||||
[
|
||||
function pluginMapDynamic(t){
|
||||
t.is('application', application.name);
|
||||
t.is('employed person', application.person.name);
|
||||
}
|
||||
]
|
||||
);
|
||||
doh.run();
|
||||
|
||||
});
|
||||
3
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/person.js
vendored
Normal file
3
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/person.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
define('person', [], {
|
||||
name: 'person'
|
||||
});
|
||||
7
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/plugin.js
vendored
Normal file
7
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/plugin.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
define('plugin', [], {
|
||||
load: function (name, req, load, config) {
|
||||
req([name], function (value) {
|
||||
load(value);
|
||||
});
|
||||
}
|
||||
});
|
||||
15
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/pluginMapDynamic.html
vendored
Normal file
15
OfficeWeb/vendor/requirejs/tests/plugins/pluginMap/dynamic/pluginMapDynamic.html
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>require.js: Plugin Map DynamicTest</title>
|
||||
<script type="text/javascript" src="../../../doh/runner.js"></script>
|
||||
<script type="text/javascript" src="../../../doh/_browserRunner.js"></script>
|
||||
<script data-main="main" src="../../../../require.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>require.js: Plugin Map Test</h1>
|
||||
<p>Test using the map config with plugins and dynamically loaded modules. More info:
|
||||
<a href="https://github.com/jrburke/requirejs/issues/326">326</a></p>
|
||||
<p>Check console for messages</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user