3.0 source code

This commit is contained in:
agolybev
2015-04-28 17:59:00 +03:00
parent c69fd34bdd
commit 7b3b2248e5
16311 changed files with 1445974 additions and 3108429 deletions

View File

@@ -0,0 +1,6 @@
define('application', ['person'], function(person) {
return {
name: 'application',
person: person
};
});

View File

@@ -0,0 +1,5 @@
define('employee', ['plugin!person'], function(person) {
return {
name: 'employed ' + person.name
};
});

View 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();
});

View File

@@ -0,0 +1,3 @@
define('person', [], {
name: 'person'
});

View File

@@ -0,0 +1,7 @@
define('plugin', [], {
load: function (name, req, load, config) {
req([name], function (value) {
load(value);
});
}
});

View 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>

View File

@@ -0,0 +1,48 @@
define('plugin', [], {
load: function (name, req, load, config) {
req([name], function (value) {
load(value);
});
}
});
define('person', [], {
name: 'person'
});
define('employee', ['plugin!person'], function(person) {
return {
name: 'employed ' + person.name
};
});
define('application', ['person'], function(person) {
return {
name: 'application',
person: person
};
});
require({
map: {
'*': {
'person': 'employee'
},
'employee': {
'person': 'person'
}
}
}, ['application'], function (application) {
doh.register(
'pluginMap',
[
function pluginMap(t){
t.is('application', application.name);
t.is('employed person', application.person.name);
}
]
);
doh.run();
});

View File

@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<title>require.js: Plugin Map 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="pluginMap-tests.js"></script>
</head>
<body>
<h1>require.js: Plugin Map Test</h1>
<p>Test using the map config with plugins. More info:
<a href="https://github.com/jrburke/requirejs/issues/320">320</a></p>
<p>Check console for messages</p>
</body>
</html>