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 @@
.hidden

View File

@@ -0,0 +1 @@
aux

View File

@@ -0,0 +1 @@
main.html

View File

@@ -0,0 +1,8 @@
define(function (require) {
return {
html: require('text!./main.html'),
noext: require('text!sub/noext'),
hidden: require('text!.hidden.html'),
util: require('sub/util')
};
});

View File

@@ -0,0 +1,7 @@
define(function (require) {
return {
noext: require('text!../noext'),
dirPath: require.toUrl('.'),
parentPath: require.toUrl('..')
};
});

View File

@@ -0,0 +1 @@
noext

View File

@@ -0,0 +1 @@
util

View File

@@ -0,0 +1,8 @@
define(function (require) {
return {
dotPath: require.toUrl('.'),
html: require('text!./util.html'),
auxHtml: require('text!../auxil.html'),
thing: require('./nested/thing')
};
});

View File

@@ -0,0 +1,30 @@
require.config({
paths: {
text: '../../../text/text'
}
});
require(['main'], function(main) {
var subRegExp = /\/sub$/,
nestedRegExp = /\/sub\/nested$/;
doh.register(
"toUrl",
[
function toUrl(t){
t.is(".hidden", main.hidden);
t.is("main.html", main.html);
t.is("noext", main.noext);
t.is("aux", main.util.auxHtml);
t.is(true, subRegExp.test(main.util.dotPath));
t.is("util", main.util.html);
t.is(true, nestedRegExp.test(main.util.thing.dirPath));
t.is(true, subRegExp.test(main.util.thing.parentPath));
t.is("noext", main.util.thing.noext);
}
]
);
doh.run();
});

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<title>require.js: toUrl Test</title>
<script src="../doh/runner.js"></script>
<script src="../doh/_browserRunner.js"></script>
<script src="../../require.js"></script>
<script src="toUrl-tests.js"></script>
</head>
<body>
<h1>require.js: toUrl Test</h1>
<p>Check console for messages</p>
</body>
</html>