├── tests
├── anon
│ ├── message.txt
│ ├── green.js
│ ├── yellow.js
│ ├── blue.js
│ ├── red.js
│ ├── sub
│ │ └── b.js
│ ├── c.js
│ ├── a.js
│ ├── magenta.js
│ ├── anonSimple.html
│ └── anon-tests.js
├── layers
│ ├── helloWorld.txt
│ ├── epsilon.js
│ ├── layer1.js
│ ├── allplugins-text.html
│ └── layers.html
├── relative
│ ├── foo
│ │ ├── bar
│ │ │ ├── message.txt
│ │ │ ├── two.js
│ │ │ └── one.js
│ │ └── three.js
│ ├── relative.html
│ └── relative-tests.js
├── text
│ ├── resources
│ │ ├── local.html
│ │ └── sample.html
│ ├── subwidget2.html
│ ├── widget.html
│ ├── local.js
│ ├── subwidget.js
│ ├── subwidget.html
│ ├── widget.js
│ ├── textOnly.html
│ └── text.html
├── browsertests
│ ├── onerror
│ │ ├── ok.js
│ │ ├── parseError.js
│ │ ├── scriptError.js
│ │ └── index.html
│ ├── scriptload
│ │ ├── one.js
│ │ ├── six.js
│ │ ├── eight.js
│ │ ├── five.js
│ │ ├── nine.js
│ │ ├── seven.js
│ │ ├── three.js
│ │ ├── two.js
│ │ └── index.html
│ ├── appendbeforeload
│ │ ├── two.js
│ │ ├── one.dphpd
│ │ └── test.html
│ ├── async
│ │ ├── two.js
│ │ ├── one.php
│ │ └── async.php
│ ├── docwritenested
│ │ ├── two.js
│ │ ├── one.js
│ │ └── index.html
│ ├── scriptloadinteractive
│ │ ├── eight.js
│ │ ├── five.js
│ │ ├── nine.js
│ │ ├── one.js
│ │ ├── seven.js
│ │ ├── six.js
│ │ ├── three.js
│ │ └── two.js
│ ├── common.js
│ └── functionToString.html
├── plugins
│ ├── a.js
│ ├── c.js
│ ├── prime
│ │ ├── a.js
│ │ ├── c.js
│ │ ├── b.js
│ │ └── earth.js
│ ├── b.js
│ ├── earth.js
│ ├── sync.html
│ ├── sync-tests.js
│ ├── index.js
│ └── indexBuilder.js
├── order
│ ├── one.js
│ ├── three.js
│ ├── bar.js
│ ├── foo.js
│ └── order.html
├── urlfetch
│ ├── one.js
│ ├── two.js
│ ├── three.js
│ └── urlfetch.html
├── version1
│ ├── gamma.js
│ ├── beta.js
│ ├── omega.js
│ └── alpha.js
├── version2
│ ├── epsilon.js
│ ├── alpha.js
│ ├── beta.js
│ └── omega.js
├── jsonp
│ ├── lamp.js
│ ├── twitter.html
│ └── jsonp.html
├── packages
│ ├── funky
│ │ ├── lib
│ │ │ └── monkey.js
│ │ └── index.js
│ ├── dojox
│ │ ├── door.js
│ │ └── window
│ │ │ ├── pane.js
│ │ │ └── window.js
│ ├── foo
│ │ └── lib
│ │ │ ├── second.js
│ │ │ └── main.js
│ ├── pkgs
│ │ ├── alpha
│ │ │ └── lib
│ │ │ │ ├── main.js
│ │ │ │ └── replace.js
│ │ ├── beta
│ │ │ └── 0.2
│ │ │ │ └── scripts
│ │ │ │ ├── util.js
│ │ │ │ └── beta.js
│ │ └── dojox
│ │ │ ├── table
│ │ │ ├── legs.js
│ │ │ └── table.js
│ │ │ └── chair
│ │ │ └── lib
│ │ │ ├── legs.js
│ │ │ └── main.js
│ ├── baz
│ │ └── lib
│ │ │ ├── helper.js
│ │ │ └── index.js
│ ├── bar
│ │ └── 0.4
│ │ │ └── scripts
│ │ │ └── main.js
│ ├── replace.js
│ ├── packages.html
│ └── packages-tests.js
├── i18n
│ ├── nls
│ │ ├── en-us-surfer
│ │ │ └── colors.js
│ │ ├── fr
│ │ │ └── colors.js
│ │ └── colors.js
│ ├── commonA.js
│ ├── commonB.js
│ ├── testModule.js
│ ├── common.html
│ └── i18n.html
├── uniques
│ ├── three.js
│ ├── one.js
│ ├── two.js
│ └── uniques.html
├── jquery
│ ├── scripts
│ │ ├── app.js
│ │ ├── jquery.alpha.js
│ │ ├── jquery.beta.js
│ │ ├── dynamicApp.js
│ │ ├── jquery.gamma.js
│ │ ├── jquery.epsilon.js
│ │ └── jquery-MIT-LICENSE.txt
│ ├── jquery.html
│ ├── jqueryDynamic.html
│ └── jqueryDynamic2.html
├── afterloadreadystate.js
├── dimple.js
├── doh
│ ├── runner.sh
│ ├── small_logo.png
│ ├── _sounds
│ │ ├── doh.wav
│ │ ├── dohaaa.wav
│ │ ├── woohoo.wav
│ │ └── LICENSE
│ ├── _rhinoRunner.js
│ ├── README
│ └── _nodeRunner.js
├── priority
│ ├── epsilon.js
│ ├── flower.js
│ ├── leaf.js
│ ├── priorityWithDeps
│ │ ├── script
│ │ │ └── req
│ │ │ │ ├── begin.js
│ │ │ │ ├── config.js
│ │ │ │ ├── utils
│ │ │ │ └── utils.js
│ │ │ │ ├── app.js
│ │ │ │ └── bootstrap.js
│ │ └── priorityWithDeps.html
│ ├── tree.js
│ ├── two.js
│ ├── one.js
│ ├── priority.html
│ ├── three.js
│ ├── priority.js
│ ├── priorityOrder.html
│ └── prioritySingleCall.html
├── foo
├── bar
├── map.js
├── tres.js
├── simple.js
├── commonjs
│ └── tests
│ │ └── modules
│ │ └── 1.0
│ │ ├── hasOwnProperty
│ │ ├── determinism
│ │ ├── submodule
│ │ │ ├── b.js
│ │ │ └── a.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── absolute
│ │ ├── b.js
│ │ ├── submodule
│ │ │ └── a.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── monkeys
│ │ ├── a.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── transitive
│ │ ├── a.js
│ │ ├── b.js
│ │ ├── c.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── relative
│ │ ├── submodule
│ │ │ ├── b.js
│ │ │ └── a.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── nested
│ │ ├── a
│ │ │ └── b
│ │ │ │ └── c
│ │ │ │ └── d.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── cyclic
│ │ ├── a.js
│ │ ├── b.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── system.js
│ │ ├── exactExports
│ │ ├── a.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── method
│ │ ├── a.js
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── missing
│ │ ├── program.js
│ │ ├── program.html
│ │ └── test.js
│ │ ├── test.js
│ │ └── all.html
├── exports
│ ├── assign2.js
│ ├── assign.js
│ ├── vanilla.js
│ ├── funcSet.js
│ ├── exports.html
│ └── exports-tests.js
├── func.js
├── paths
│ ├── first.js
│ │ ├── first.js
│ │ └── second.js
│ └── paths.html
├── dos.js
├── one.js
├── two.js
├── index.html
├── uno.js
├── funcFour.js
├── funcThree.js
├── workers.js
├── dataMain.js
├── funcTwo.js
├── funcOne.js
├── dataMain.html
├── baseUrl.html
├── circular.html
├── depoverlap.html
├── simple-tests.js
├── circular-tests.js
├── simple-nohead.html
├── depoverlap.js
├── simple.html
├── config.html
├── README.md
├── workers.html
├── all-server.js
├── simple-badbase.html
├── multiversion.html
└── all.js
├── bin
├── x.bat
├── xdebug.bat
├── x
├── xj.bat
├── xjdebug.bat
├── xdebug
├── xjdebug
└── xj
├── adapt
├── tests
│ ├── node
│ │ ├── tests
│ │ │ ├── foo.js
│ │ │ ├── alpha
│ │ │ │ ├── foo.js
│ │ │ │ └── hello.html
│ │ │ └── server.js
│ │ ├── index.js
│ │ └── canvasTest.js
│ ├── sub
│ │ └── betaSub.js
│ ├── alpha.js
│ ├── beta.js
│ └── all.js
├── dist.js
├── rhino.js
└── node.js
├── dist
├── fonts
│ ├── Inconsolata.ttf
│ └── PT-Sans
│ │ ├── PT_Sans.ttf
│ │ ├── PT_Sans_Bold.ttf
│ │ ├── PT_Sans_Caption.ttf
│ │ ├── PT_Sans_Italic.ttf
│ │ ├── PT_Sans_Narrow.ttf
│ │ ├── PT_Sans_Bold_Italic.ttf
│ │ ├── PT_Sans_Caption_Bold.ttf
│ │ ├── PT_Sans_Narrow_Bold.ttf
│ │ └── Paratype PT Sans Free Font License.txt
├── ie.css
├── post.html
├── init.js
├── README.md
├── Markdown-License.text
└── dist-build.sh
├── docs
├── design
│ └── packages.md
├── jquery-require-sample
│ ├── webapp
│ │ ├── scripts
│ │ │ ├── jquery.alpha.js
│ │ │ ├── jquery.beta.js
│ │ │ ├── main.js
│ │ │ ├── app.build.js
│ │ │ └── jquery-MIT-LICENSE.txt
│ │ └── app.html
│ └── dist.sh
├── faq.html
├── dojo.html
├── history.html
├── contributing.html
└── node.html
├── package.json
├── testBaseUrl.js
├── .gitignore
├── index.html
├── README.md
└── LICENSE
/tests/anon/message.txt:
--------------------------------------------------------------------------------
1 | hello world
--------------------------------------------------------------------------------
/tests/layers/helloWorld.txt:
--------------------------------------------------------------------------------
1 | hello world
--------------------------------------------------------------------------------
/tests/relative/foo/bar/message.txt:
--------------------------------------------------------------------------------
1 | hello world
--------------------------------------------------------------------------------
/tests/text/resources/local.html:
--------------------------------------------------------------------------------
1 |
Local
--------------------------------------------------------------------------------
/tests/browsertests/onerror/ok.js:
--------------------------------------------------------------------------------
1 | log("ok has executed");
--------------------------------------------------------------------------------
/tests/plugins/a.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'a'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/plugins/c.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: "c"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/text/subwidget2.html:
--------------------------------------------------------------------------------
1 | This! is template2
--------------------------------------------------------------------------------
/bin/x.bat:
--------------------------------------------------------------------------------
1 | set MYDIR=%~dp0
2 | node %MYDIR%x.js %MYDIR% %*
3 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/one.js:
--------------------------------------------------------------------------------
1 | log("one.js script");
2 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/six.js:
--------------------------------------------------------------------------------
1 | log("six.js script");
2 |
--------------------------------------------------------------------------------
/tests/order/one.js:
--------------------------------------------------------------------------------
1 | var one = {
2 | name: "one"
3 | };
4 |
--------------------------------------------------------------------------------
/tests/anon/green.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | name: "green"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/browsertests/appendbeforeload/two.js:
--------------------------------------------------------------------------------
1 | console.log("TWO");
2 |
--------------------------------------------------------------------------------
/tests/browsertests/async/two.js:
--------------------------------------------------------------------------------
1 | window.log("two.js script");
2 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/eight.js:
--------------------------------------------------------------------------------
1 | log("eight.js script");
2 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/five.js:
--------------------------------------------------------------------------------
1 | log("five.js script");
2 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/nine.js:
--------------------------------------------------------------------------------
1 | log("nine.js script");
2 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/seven.js:
--------------------------------------------------------------------------------
1 | log("seven.js script");
2 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/three.js:
--------------------------------------------------------------------------------
1 | log("three.js script");
2 |
--------------------------------------------------------------------------------
/tests/plugins/prime/a.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'aPrime'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/plugins/prime/c.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: "cPrime"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/urlfetch/one.js:
--------------------------------------------------------------------------------
1 | var one = {
2 | name: "one"
3 | };
4 |
--------------------------------------------------------------------------------
/tests/version1/gamma.js:
--------------------------------------------------------------------------------
1 | gamma = {
2 | color: "green"
3 | }
4 |
--------------------------------------------------------------------------------
/tests/version2/epsilon.js:
--------------------------------------------------------------------------------
1 | epsilon = {
2 | color: "red"
3 | }
4 |
--------------------------------------------------------------------------------
/adapt/tests/node/tests/foo.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'foo'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/jsonp/lamp.js:
--------------------------------------------------------------------------------
1 | define("lamp", {
2 | color: "blue"
3 | });
4 |
--------------------------------------------------------------------------------
/adapt/tests/sub/betaSub.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'betaSubName'
3 | });
4 |
--------------------------------------------------------------------------------
/bin/xdebug.bat:
--------------------------------------------------------------------------------
1 | set MYDIR=%~dp0
2 | node --debug-brk %MYDIR%x.js %MYDIR% %*
3 |
--------------------------------------------------------------------------------
/tests/packages/funky/lib/monkey.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'monkey'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/anon/yellow.js:
--------------------------------------------------------------------------------
1 | require.def("yellow", {
2 | name: "yellow"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/browsertests/docwritenested/two.js:
--------------------------------------------------------------------------------
1 | two = {
2 | name: "two"
3 | };
4 |
--------------------------------------------------------------------------------
/tests/i18n/nls/en-us-surfer/colors.js:
--------------------------------------------------------------------------------
1 | define({
2 | red: "red, dude"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/packages/dojox/door.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | name: 'dojox/door'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/packages/foo/lib/second.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'foo/second'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/packages/pkgs/alpha/lib/main.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | name: 'alpha'
3 | });
--------------------------------------------------------------------------------
/tests/uniques/three.js:
--------------------------------------------------------------------------------
1 | require.def("three", {
2 | name: "three"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/jquery/scripts/app.js:
--------------------------------------------------------------------------------
1 | define(["jquery.alpha", "jquery.beta"], function() {});
2 |
--------------------------------------------------------------------------------
/tests/packages/baz/lib/helper.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | name: "baz/helper"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/relative/foo/three.js:
--------------------------------------------------------------------------------
1 | require.def("foo/three", {
2 | name: "three"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/jquery/scripts/jquery.alpha.js:
--------------------------------------------------------------------------------
1 | $.fn.alpha = function() {
2 | return "alpha";
3 | };
--------------------------------------------------------------------------------
/tests/packages/pkgs/alpha/lib/replace.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'alpha/replace'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/packages/pkgs/beta/0.2/scripts/util.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'beta/util'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/packages/pkgs/dojox/table/legs.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'dojox/table/legs'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/relative/foo/bar/two.js:
--------------------------------------------------------------------------------
1 | require.def("foo/bar/two", {
2 | name: "two"
3 | });
4 |
--------------------------------------------------------------------------------
/tests/afterloadreadystate.js:
--------------------------------------------------------------------------------
1 | doh.is("complete", document.readyState);
2 | d.callback(true);
3 |
--------------------------------------------------------------------------------
/tests/browsertests/onerror/parseError.js:
--------------------------------------------------------------------------------
1 |
2 | funktion = foo() {
3 | return 'funky';
4 | }
5 |
--------------------------------------------------------------------------------
/tests/dimple.js:
--------------------------------------------------------------------------------
1 | define("dimple",
2 | {
3 | color: "dimple-blue"
4 | }
5 | );
6 |
--------------------------------------------------------------------------------
/tests/doh/runner.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | java -jar ../../build/lib/rhino/js.jar runner.js "$@"
4 |
--------------------------------------------------------------------------------
/tests/i18n/nls/fr/colors.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | red: "rouge",
3 | blue: "bleu"
4 | });
5 |
--------------------------------------------------------------------------------
/tests/jquery/scripts/jquery.beta.js:
--------------------------------------------------------------------------------
1 | $.fn.beta = function() {
2 | return "beta";
3 | };
4 |
--------------------------------------------------------------------------------
/tests/packages/dojox/window/pane.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | name: 'dojox/window/pane'
3 | });
4 |
--------------------------------------------------------------------------------
/adapt/tests/alpha.js:
--------------------------------------------------------------------------------
1 | define(function(require, exports) {
2 | exports.name = 'alpha';
3 | });
4 |
--------------------------------------------------------------------------------
/tests/anon/blue.js:
--------------------------------------------------------------------------------
1 | define(function () {
2 | return {
3 | name: "blue"
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/appendbeforeload/one.dphpd:
--------------------------------------------------------------------------------
1 |
4 |
5 | console.log("ONE");
--------------------------------------------------------------------------------
/tests/browsertests/async/one.php:
--------------------------------------------------------------------------------
1 |
4 |
5 | window.log("one.php script");
6 |
--------------------------------------------------------------------------------
/tests/doh/small_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/tests/doh/small_logo.png
--------------------------------------------------------------------------------
/tests/packages/bar/0.4/scripts/main.js:
--------------------------------------------------------------------------------
1 | define({
2 | name: 'bar',
3 | version: '0.4'
4 | });
5 |
--------------------------------------------------------------------------------
/tests/packages/pkgs/dojox/chair/lib/legs.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | name: 'dojox/chair/legs'
3 | });
4 |
--------------------------------------------------------------------------------
/tests/plugins/b.js:
--------------------------------------------------------------------------------
1 | define(function () {
2 | return {
3 | name: "b"
4 | };
5 | });
6 |
--------------------------------------------------------------------------------
/tests/priority/epsilon.js:
--------------------------------------------------------------------------------
1 | define("epsilon",
2 | {
3 | name: "epsilon"
4 | }
5 | );
6 |
--------------------------------------------------------------------------------
/tests/text/widget.html:
--------------------------------------------------------------------------------
1 | This is a widget!
I am in a widget
--------------------------------------------------------------------------------
/dist/fonts/Inconsolata.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/Inconsolata.ttf
--------------------------------------------------------------------------------
/tests/browsertests/onerror/scriptError.js:
--------------------------------------------------------------------------------
1 |
2 | if (true) {
3 | throw "scriptError throwing";
4 | }
5 |
--------------------------------------------------------------------------------
/tests/doh/_sounds/doh.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/tests/doh/_sounds/doh.wav
--------------------------------------------------------------------------------
/tests/i18n/commonA.js:
--------------------------------------------------------------------------------
1 | define(['i18n!nls/colors'], function (colors) {
2 | return colors.red;
3 | });
4 |
--------------------------------------------------------------------------------
/tests/i18n/commonB.js:
--------------------------------------------------------------------------------
1 | define(['i18n!nls/colors'], function (colors) {
2 | return colors.blue;
3 | });
4 |
--------------------------------------------------------------------------------
/tests/layers/epsilon.js:
--------------------------------------------------------------------------------
1 | require.def("epsilon",
2 | {
3 | name: "epsilon"
4 | }
5 | );
6 |
--------------------------------------------------------------------------------
/tests/packages/pkgs/beta/0.2/scripts/beta.js:
--------------------------------------------------------------------------------
1 | require.def(function () {
2 | return 'beta';
3 | });
4 |
--------------------------------------------------------------------------------
/tests/anon/red.js:
--------------------------------------------------------------------------------
1 | require.def("red", function () {
2 | return {
3 | name: "red"
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/doh/_sounds/dohaaa.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/tests/doh/_sounds/dohaaa.wav
--------------------------------------------------------------------------------
/tests/doh/_sounds/woohoo.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/tests/doh/_sounds/woohoo.wav
--------------------------------------------------------------------------------
/tests/plugins/prime/b.js:
--------------------------------------------------------------------------------
1 | define(function () {
2 | return {
3 | name: "bPrime"
4 | };
5 | });
6 |
--------------------------------------------------------------------------------
/tests/priority/flower.js:
--------------------------------------------------------------------------------
1 | define(function () {
2 | return {
3 | name: "flower"
4 | };
5 | });
6 |
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans.ttf
--------------------------------------------------------------------------------
/tests/foo:
--------------------------------------------------------------------------------
1 | //A test for loading a file with a protocol URL via require()
2 |
3 | var foo = {
4 | name: "foo"
5 | };
--------------------------------------------------------------------------------
/tests/bar:
--------------------------------------------------------------------------------
1 | //A test for loading a file with a protocol-less URL via require()
2 |
3 | var bar = {
4 | name: "bar"
5 | };
--------------------------------------------------------------------------------
/tests/map.js:
--------------------------------------------------------------------------------
1 | require.def("map",
2 | function() {
3 | return {
4 | name: "map"
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/tests/priority/leaf.js:
--------------------------------------------------------------------------------
1 | var globalLeafName = "leaf";
2 |
3 | require.def("leaf", {
4 | name: globalLeafName
5 | });
6 |
--------------------------------------------------------------------------------
/tests/tres.js:
--------------------------------------------------------------------------------
1 | require.def("tres",
2 | function() {
3 | return {
4 | name: "tres"
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans_Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans_Bold.ttf
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/eight.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'eight'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/five.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'five'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/nine.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'nine'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/one.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'one'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/seven.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'seven'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/six.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'six'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/three.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'three'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/browsertests/scriptloadinteractive/two.js:
--------------------------------------------------------------------------------
1 | def(function () {
2 | return {
3 | name: 'two'
4 | };
5 | });
--------------------------------------------------------------------------------
/tests/simple.js:
--------------------------------------------------------------------------------
1 | require.def("simple",
2 | function() {
3 | return {
4 | color: "blue"
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/tests/version1/beta.js:
--------------------------------------------------------------------------------
1 | define("beta",
2 | function() {
3 | return {
4 | version: 1
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/tests/version1/omega.js:
--------------------------------------------------------------------------------
1 | define("omega",
2 | function() {
3 | return {
4 | version: 1
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/tests/version2/alpha.js:
--------------------------------------------------------------------------------
1 | define("alpha",
2 | function() {
3 | return {
4 | version: 2
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/tests/version2/beta.js:
--------------------------------------------------------------------------------
1 | define("beta",
2 | function() {
3 | return {
4 | version: 2
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans_Caption.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans_Caption.ttf
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans_Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans_Italic.ttf
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans_Narrow.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans_Narrow.ttf
--------------------------------------------------------------------------------
/tests/anon/sub/b.js:
--------------------------------------------------------------------------------
1 | define(function(require, exports, module) {
2 | exports.f = function () { return "sub/b" };
3 | });
4 |
--------------------------------------------------------------------------------
/tests/version1/alpha.js:
--------------------------------------------------------------------------------
1 | require.def("alpha",
2 | function() {
3 | return {
4 | version: 1
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/tests/version2/omega.js:
--------------------------------------------------------------------------------
1 | require.def("omega",
2 | function() {
3 | return {
4 | version: 2
5 | };
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/dist/ie.css:
--------------------------------------------------------------------------------
1 |
2 | body .sect {
3 | display: none;
4 | }
5 |
6 |
7 | #content ul.index {
8 | list-style: none;
9 | }
10 |
--------------------------------------------------------------------------------
/docs/design/packages.md:
--------------------------------------------------------------------------------
1 | # Packages
2 |
3 | Moved to [pkg project](http://github.com/jrburke/pkg/blob/master/docs/design/packages.md)
4 |
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans_Bold_Italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans_Bold_Italic.ttf
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans_Caption_Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans_Caption_Bold.ttf
--------------------------------------------------------------------------------
/dist/fonts/PT-Sans/PT_Sans_Narrow_Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kriszyp/requirejs/master/dist/fonts/PT-Sans/PT_Sans_Narrow_Bold.ttf
--------------------------------------------------------------------------------
/docs/jquery-require-sample/webapp/scripts/jquery.alpha.js:
--------------------------------------------------------------------------------
1 | $.fn.alpha = function() {
2 | return this.append("Alpha is Go!
");
3 | };
--------------------------------------------------------------------------------
/docs/jquery-require-sample/webapp/scripts/jquery.beta.js:
--------------------------------------------------------------------------------
1 | $.fn.beta = function() {
2 | return this.append("Beta is Go!
");
3 | };
4 |
--------------------------------------------------------------------------------
/tests/order/three.js:
--------------------------------------------------------------------------------
1 | //three assumes two has already been loaded
2 | var three = {
3 | name: "three",
4 | twoName: two.name
5 | };
6 |
--------------------------------------------------------------------------------
/tests/order/bar.js:
--------------------------------------------------------------------------------
1 | var bar = 0;
2 | define(function () {
3 | bar += 1;
4 | return function () {
5 | bar += 2;
6 | }
7 | });
8 |
--------------------------------------------------------------------------------
/tests/order/foo.js:
--------------------------------------------------------------------------------
1 | //Just a test file to to use in order build process.
2 | define(["require", "order!one.js", "order!two", "order!three.js"]);
3 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/hasOwnProperty/toString.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 |
3 | });
4 |
--------------------------------------------------------------------------------
/tests/packages/replace.js:
--------------------------------------------------------------------------------
1 | //Tests overriding a package path with a more specific mapping.
2 | require.def({
3 | name: 'fake/alpha/replace'
4 | });
5 |
--------------------------------------------------------------------------------
/tests/text/local.js:
--------------------------------------------------------------------------------
1 | define(['text!./resources/local.html'], function (localHtml) {
2 | return {
3 | localHtml: localHtml
4 | }
5 | });
6 |
--------------------------------------------------------------------------------
/tests/browsertests/docwritenested/one.js:
--------------------------------------------------------------------------------
1 | loadScript("two.js");
2 |
3 | one = {
4 | name: "one"
5 | };
6 |
7 | console.log("Two's name is: " + two.name);
8 |
--------------------------------------------------------------------------------
/tests/browsertests/scriptload/two.js:
--------------------------------------------------------------------------------
1 | log("two.js script");
2 | setTimeout(function () {
3 | log("two.js timeout -- should occur after two.js load");
4 | }, 13);
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/hasOwnProperty/hasOwnProperty.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 |
3 | });
4 |
--------------------------------------------------------------------------------
/adapt/tests/beta.js:
--------------------------------------------------------------------------------
1 | define(['./sub/betaSub'], function (betaSub) {
2 | return {
3 | name: 'beta',
4 | subName: betaSub.name
5 | };
6 | });
7 |
--------------------------------------------------------------------------------
/bin/x:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # A command line tool to run some RequireJS scripts via Node
4 |
5 | MYDIR=`cd \`dirname "$0"\`; pwd`
6 | node $MYDIR/x.js $MYDIR "$@"
7 |
--------------------------------------------------------------------------------
/tests/anon/c.js:
--------------------------------------------------------------------------------
1 | require.def(function (require) {
2 | var a = require('a');
3 | return {
4 | name: 'c',
5 | aName: a.name
6 | };
7 | });
8 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/determinism/submodule/b.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 |
3 |
4 |
5 | });
6 |
--------------------------------------------------------------------------------
/tests/i18n/testModule.js:
--------------------------------------------------------------------------------
1 | //A sample module to use in the i18n build test.
2 | require.def(["i18n!nls/colors"], function (colors) {
3 | var red = colors.red;
4 | });
--------------------------------------------------------------------------------
/tests/packages/foo/lib/main.js:
--------------------------------------------------------------------------------
1 | define(function (require, exports) {
2 | exports.name = 'foo';
3 | exports.alphaName = require('alpha').name;
4 | });
5 |
--------------------------------------------------------------------------------
/tests/exports/assign2.js:
--------------------------------------------------------------------------------
1 | require.def(["module", "exports", "require"],
2 | function (module, exports, require) {
3 | module.exports = "assign2";
4 | });
5 |
--------------------------------------------------------------------------------
/tests/func.js:
--------------------------------------------------------------------------------
1 | require.def("func",
2 | function () {
3 | return function () {
4 | return "You called a function";
5 | }
6 | }
7 | );
8 |
--------------------------------------------------------------------------------
/adapt/tests/node/tests/alpha/foo.js:
--------------------------------------------------------------------------------
1 | define(function (require) {
2 | var foo = require('../foo');
3 | return {
4 | name: 'ALPHA' + foo.name
5 | };
6 | });
7 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/absolute/b.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 | exports.foo = function() {};
3 |
4 | });
5 |
--------------------------------------------------------------------------------
/tests/packages/funky/index.js:
--------------------------------------------------------------------------------
1 | define(['./lib/monkey'], function (monkey) {
2 | return {
3 | name: 'funky',
4 | monkeyName: monkey.name
5 | };
6 | });
7 |
--------------------------------------------------------------------------------
/tests/anon/a.js:
--------------------------------------------------------------------------------
1 | define(function (require, module, exports) {
2 | var b = require("sub/b");
3 | return {
4 | name: "a",
5 | bName: b.f()
6 | };
7 | });
8 |
--------------------------------------------------------------------------------
/bin/xj.bat:
--------------------------------------------------------------------------------
1 | set MYDIR=%~dp0
2 | java -classpath %MYDIR%..\build\lib\rhino\js.jar;%MYDIR%..\build\lib\closure\compiler.jar org.mozilla.javascript.tools.shell.Main %MYDIR%x.js %MYDIR% %*
3 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/monkeys/a.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "program"], function(require, exports, module) {
2 | require('program').monkey = 10;
3 |
4 | });
5 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/transitive/a.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "b"], function(require, exports, module) {
2 | exports.foo = require('b').foo;
3 |
4 | });
5 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/transitive/b.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "c"], function(require, exports, module) {
2 | exports.foo = require('c').foo;
3 |
4 | });
5 |
--------------------------------------------------------------------------------
/tests/packages/dojox/window/window.js:
--------------------------------------------------------------------------------
1 | require.def(['./pane'], function (pane) {
2 | return {
3 | name: 'dojox/window',
4 | paneName: pane.name
5 | };
6 | });
7 |
--------------------------------------------------------------------------------
/tests/packages/pkgs/dojox/chair/lib/main.js:
--------------------------------------------------------------------------------
1 | define(['./legs'], function (legs) {
2 | return {
3 | name: 'dojox/chair',
4 | legsName: legs.name
5 | }
6 | });
7 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/relative/submodule/b.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 | exports.foo = function () {
3 | };
4 |
5 | });
6 |
--------------------------------------------------------------------------------
/tests/paths/first.js/first.js:
--------------------------------------------------------------------------------
1 | globalCounter += 1;
2 |
3 | define(['./second'], function (second) {
4 | globalCounter += 1;
5 | return {
6 | load: second
7 | };
8 | });
9 |
--------------------------------------------------------------------------------
/bin/xjdebug.bat:
--------------------------------------------------------------------------------
1 | set MYDIR=%~dp0
2 | java -classpath %MYDIR%..\build\lib\rhino\js.jar;%MYDIR%..\build\lib\closure\compiler.jar org.mozilla.javascript.tools.debugger.Main %MYDIR%x.js %MYDIR% %*
3 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/relative/submodule/a.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "./b"], function(require, exports, module) {
2 | exports.foo = require('./b').foo;
3 |
4 | });
5 |
--------------------------------------------------------------------------------
/tests/exports/assign.js:
--------------------------------------------------------------------------------
1 | require.def("assign",
2 | ["require", "exports", "module"],
3 | function (require, exports, module) {
4 | module.exports = "assign";
5 | });
6 |
--------------------------------------------------------------------------------
/tests/exports/vanilla.js:
--------------------------------------------------------------------------------
1 | require.def("vanilla",
2 | ["require", "exports", "module"],
3 | function (require, exports, module) {
4 | exports.name = "vanilla";
5 | });
6 |
--------------------------------------------------------------------------------
/tests/packages/pkgs/dojox/table/table.js:
--------------------------------------------------------------------------------
1 | require.def(['dojox/chair'], function (chair) {
2 | return {
3 | name: 'dojox/table',
4 | chairName: chair.name
5 | };
6 | });
7 |
--------------------------------------------------------------------------------
/adapt/tests/node/tests/alpha/hello.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Hello World
5 |
6 |
7 | Hello World
8 |
9 |
10 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/nested/a/b/c/d.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 | exports.foo = function () {
3 | return 1;
4 | };
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/transitive/c.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 | exports.foo = function () {
3 | return 1;
4 | };
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/tests/exports/funcSet.js:
--------------------------------------------------------------------------------
1 | require.def("funcSet",
2 | ["require", "exports", "module"],
3 | function (require, exports, module) {
4 | module.setExports("funcSet");
5 | });
6 |
--------------------------------------------------------------------------------
/tests/uniques/one.js:
--------------------------------------------------------------------------------
1 | define(function (require) {
2 | return {
3 | name: "one",
4 | threeName: require("three").name,
5 | threeName2: require("three").name
6 | };
7 | });
8 |
9 |
--------------------------------------------------------------------------------
/bin/xdebug:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # A command line tool to run some scripts used in the RequireJS project, in
4 | # debug mode.
5 |
6 | MYDIR=`cd \`dirname "$0"\`; pwd`
7 | node --debug-brk $MYDIR/x.js $MYDIR "$@"
8 |
--------------------------------------------------------------------------------
/tests/i18n/nls/colors.js:
--------------------------------------------------------------------------------
1 | require.def({
2 | "root": {
3 | red: "red",
4 | blue: "blue",
5 | green: "green"
6 | },
7 | "en-us-surfer": true,
8 | "fr": true
9 | });
10 |
--------------------------------------------------------------------------------
/bin/xjdebug:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | MYDIR=`cd \`dirname "$0"\`; pwd`
4 | java -classpath $MYDIR/../build/lib/rhino/js.jar:$MYDIR/../build/lib/closure/compiler.jar org.mozilla.javascript.tools.debugger.Main $MYDIR/x.js $MYDIR "$@"
5 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "require",
3 | "version": "0.15.0",
4 | "author": {
5 | "name":"James Burke"
6 | },
7 | "directories": {
8 | "lib": "require"
9 | },
10 | "main": "./require.js"
11 | }
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/absolute/submodule/a.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "b"], function(require, exports, module) {
2 | exports.foo = function () {
3 | return require('b');
4 | };
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/cyclic/a.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "b"], function(require, exports, module) {
2 | exports.a = function () {
3 | return b;
4 | };
5 | var b = require('b');
6 |
7 | });
8 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/cyclic/b.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "a"], function(require, exports, module) {
2 | var a = require('a');
3 | exports.b = function () {
4 | return a;
5 | };
6 |
7 | });
8 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/system.js:
--------------------------------------------------------------------------------
1 | define({
2 | stdio: {
3 | //Funky list args to appease Safari
4 | print: function (a, b) {
5 | console.log(a, b);
6 | }
7 | }
8 | });
9 |
--------------------------------------------------------------------------------
/tests/urlfetch/two.js:
--------------------------------------------------------------------------------
1 | require.def("one", {
2 | name: "one"
3 | });
4 |
5 | require.def("two", ["one"], function (one) {
6 | return {
7 | name: "two",
8 | oneName: "one"
9 | };
10 | });
11 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/exactExports/a.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "program"], function(require, exports, module) {
2 | exports.program = function () {
3 | return require('program');
4 | };
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/tests/urlfetch/three.js:
--------------------------------------------------------------------------------
1 | require.def("three", {
2 | name: "three"
3 | });
4 |
5 | define("four", ["three"], function (three) {
6 | return {
7 | name: "four",
8 | threeName: "three"
9 | };
10 | });
11 |
--------------------------------------------------------------------------------
/tests/paths/first.js/second.js:
--------------------------------------------------------------------------------
1 | define(['./first'], function () {
2 | return function (id, parentRequire, loaded) {
3 | loaded({
4 | name: 'first',
5 | secondName: 'second'
6 | });
7 | };
8 | });
9 |
--------------------------------------------------------------------------------
/tests/priority/priorityWithDeps/script/req/begin.js:
--------------------------------------------------------------------------------
1 | require.def('req/begin', function() {
2 | window.ip = {
3 | begin: 'begin',
4 | controllers: {},
5 | models: {},
6 | views: {},
7 | utils: {},
8 | config: {}
9 | };
10 | });
11 |
--------------------------------------------------------------------------------
/tests/priority/priorityWithDeps/script/req/config.js:
--------------------------------------------------------------------------------
1 | require.def('req/config', [
2 | 'req/begin'
3 | ], function() {
4 | var config = {
5 | test: 'Hello require',
6 | state: 'alpha'
7 | };
8 | return ip.config = config;
9 | });
10 |
--------------------------------------------------------------------------------
/tests/uniques/two.js:
--------------------------------------------------------------------------------
1 | require.def("two", ["one", "three", "one"], function (one, three, one2) {
2 | return {
3 | name: "two",
4 | oneName: one.name,
5 | oneName2: one2.name,
6 | threeName: three.name
7 | };
8 | });
9 |
--------------------------------------------------------------------------------
/testBaseUrl.js:
--------------------------------------------------------------------------------
1 | define([], function() {
2 | doh.register(
3 | "testBaseUrl",
4 | [
5 | function testBaseUrl(t){
6 | t.is(true, true);
7 | }
8 | ]
9 | );
10 | doh.run();
11 | });
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/determinism/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "test","submodule/a"], function(require, exports, module) {
2 | var test = require('test');
3 | require('submodule/a');
4 | test.print('DONE', 'info');
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/tests/dos.js:
--------------------------------------------------------------------------------
1 | define("dos",
2 | ["tres"],
3 | function(tres) {
4 | return {
5 | name: "dos",
6 | doSomething: function() {
7 | return {
8 | tresName: tres.name
9 | };
10 | }
11 | };
12 | }
13 | );
14 |
--------------------------------------------------------------------------------
/tests/packages/baz/lib/index.js:
--------------------------------------------------------------------------------
1 | define(['bar', 'foo', './helper'], function (bar, foo, helper) {
2 | return {
3 | name: 'baz',
4 | barDepVersion: bar.version,
5 | fooName: foo.name,
6 | helperName: helper.name
7 | };
8 | });
9 |
--------------------------------------------------------------------------------
/docs/jquery-require-sample/webapp/scripts/main.js:
--------------------------------------------------------------------------------
1 | require(["jquery", "jquery.alpha", "jquery.beta"], function($) {
2 | //the jquery.alpha.js and jquery.beta.js plugins have been loaded.
3 | $(function() {
4 | $('body').alpha().beta();
5 | });
6 | });
7 |
--------------------------------------------------------------------------------
/tests/one.js:
--------------------------------------------------------------------------------
1 | define("one",
2 | ["require", "two"],
3 | function(require) {
4 | var one = {
5 | size: "large",
6 | doSomething: function() {
7 | return require("two");
8 | }
9 | };
10 |
11 | return one;
12 | }
13 | );
14 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/transitive/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "test","a"], function(require, exports, module) {
2 | var test = require('test');
3 | test.assert(require('a').foo() == 1, 'transitive');
4 | test.print('DONE', 'info');
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/tests/text/resources/sample.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | sample.html
5 |
6 |
7 | Hello World!
8 |
9 |
--------------------------------------------------------------------------------
/tests/two.js:
--------------------------------------------------------------------------------
1 | define("two",
2 | ["require", "one"],
3 | function(require, one) {
4 | return {
5 | size: "small",
6 | color: "redtwo",
7 | doSomething: function() {
8 | return require("one").doSomething();
9 | }
10 | };
11 | }
12 | );
13 |
--------------------------------------------------------------------------------
/bin/xj:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # A command line tool to run some RequireJS scripts via Java/Rhino
4 |
5 | MYDIR=`cd \`dirname "$0"\`; pwd`
6 | java -classpath $MYDIR/../build/lib/rhino/js.jar:$MYDIR/../build/lib/closure/compiler.jar org.mozilla.javascript.tools.shell.Main $MYDIR/x.js $MYDIR "$@"
7 |
--------------------------------------------------------------------------------
/tests/text/subwidget.js:
--------------------------------------------------------------------------------
1 | require.def("subwidget",
2 | ["text!subwidget.html!strip", "text!subwidget2.html"],
3 | function(template, template2) {
4 | return {
5 | name: "subwidget",
6 | template: template,
7 | template2: template2
8 | };
9 | }
10 | );
11 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/nested/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "test","a/b/c/d"], function(require, exports, module) {
2 | var test = require('test');
3 | test.assert(require('a/b/c/d').foo() == 1, 'nested module identifier');
4 | test.print('DONE', 'info');
5 |
6 | });
7 |
--------------------------------------------------------------------------------
/tests/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | require.js: Tests
5 |
6 |
7 | require.js: Tests
8 |
9 | - All Automated Tests
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/monkeys/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "a","test"], function(require, exports, module) {
2 | var a = require('a');
3 | var test = require('test');
4 | test.assert(exports.monkey == 10, 'monkeys permitted');
5 | test.print('DONE', 'info');
6 |
7 | });
8 |
--------------------------------------------------------------------------------
/tests/priority/priorityWithDeps/script/req/utils/utils.js:
--------------------------------------------------------------------------------
1 | require.def('req/utils/utils', [
2 | 'req/begin',
3 | 'req/config'
4 | ], function() {
5 | var utils = {
6 | test: function() {
7 | return ('utils ' + ip.config.test);
8 | }
9 | };
10 | return ip.utils = utils;
11 | });
12 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/exactExports/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "test","a"], function(require, exports, module) {
2 | var test = require('test');
3 | var a = require('a');
4 | test.assert(a.program() === exports, 'exact exports');
5 | test.print('DONE', 'info');
6 |
7 | });
8 |
--------------------------------------------------------------------------------
/tests/text/subwidget.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | sample.html
5 |
6 |
7 | This is a subwidget
8 |
9 |
--------------------------------------------------------------------------------
/tests/priority/priorityWithDeps/script/req/app.js:
--------------------------------------------------------------------------------
1 | require.def('Carousel', function () {
2 | return function Carousel(service) {
3 | this.service = service;
4 | this.someType = 'Carousel';
5 | };
6 | });
7 |
8 | require.def('app', ['Carousel'], function () {
9 |
10 | });
11 |
--------------------------------------------------------------------------------
/tests/uno.js:
--------------------------------------------------------------------------------
1 | require.def("uno",
2 | ["dos", "tres"],
3 | function(dos, tres) {
4 | return {
5 | name: "uno",
6 | doSomething: function() {
7 | return {
8 | dosName: dos.name,
9 | tresName: tres.name
10 | };
11 | }
12 | };
13 | }
14 | );
15 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/hasOwnProperty/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "hasOwnProperty","toString","test"], function(require, exports, module) {
2 | var hasOwnProperty = require('hasOwnProperty');
3 | var toString = require('toString');
4 | var test = require('test');
5 | test.print('DONE', 'info');
6 |
7 | });
8 |
--------------------------------------------------------------------------------
/tests/text/widget.js:
--------------------------------------------------------------------------------
1 | define("widget",
2 | ["subwidget", "text!widget.html"],
3 | function(subwidget, template) {
4 | return {
5 | subWidgetName: subwidget.name,
6 | subWidgetTemplate: subwidget.template,
7 | subWidgetTemplate2: subwidget.template2,
8 | template: template
9 | };
10 | }
11 | );
12 |
--------------------------------------------------------------------------------
/tests/relative/foo/bar/one.js:
--------------------------------------------------------------------------------
1 | define("foo/bar/one",
2 | ["require", "./two", "../three", "text!./message.txt"],
3 | function (require, two, three, message) {
4 | return {
5 | name: "one",
6 | twoName: two.name,
7 | threeName: three.name,
8 | message: message
9 | };
10 | });
11 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/absolute/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "test","submodule/a","b"], function(require, exports, module) {
2 | var test = require('test');
3 | var a = require('submodule/a');
4 | var b = require('b');
5 | test.assert(a.foo().foo === b.foo, 'require works with absolute identifiers');
6 | test.print('DONE', 'info');
7 |
8 | });
9 |
--------------------------------------------------------------------------------
/tests/priority/tree.js:
--------------------------------------------------------------------------------
1 | require.def("bark", function () {
2 | return {
3 | name: "bark"
4 | };
5 | });
6 |
7 | var globalLeafNameForTree = globalLeafName;
8 |
9 | define("tree", ["leaf", "bark"], function () {
10 | return {
11 | name: "tree",
12 | leafName: globalLeafNameForTree,
13 | barkName: bark.name
14 | };
15 | });
16 |
--------------------------------------------------------------------------------
/tests/funcFour.js:
--------------------------------------------------------------------------------
1 | define("funcFour",
2 | ["require", "funcThree"],
3 | function (require) {
4 | var four = function (arg) {
5 | return "FOUR called with " + arg;
6 | };
7 |
8 | four.suffix = function () {
9 | return require("funcThree").suffix();
10 | };
11 |
12 | return four;
13 | }
14 | );
15 |
--------------------------------------------------------------------------------
/tests/funcThree.js:
--------------------------------------------------------------------------------
1 | require.def("funcThree",
2 | ["funcFour"],
3 | function (four) {
4 | var three = function (arg) {
5 | return arg + "-" + require("funcFour").suffix();
6 | };
7 |
8 | three.suffix = function () {
9 | return "THREE_SUFFIX";
10 | };
11 |
12 | return three;
13 | }
14 | );
15 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/relative/program.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module", "test","submodule/a","submodule/b"], function(require, exports, module) {
2 | var test = require('test');
3 | var a = require('submodule/a');
4 | var b = require('submodule/b');
5 | test.assert(a.foo == b.foo, 'a and b share foo through a relative require');
6 | test.print('DONE', 'info');
7 |
8 | });
9 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | adapt/r.js
3 | build/convert/build/
4 | build/convert/node/r.js
5 | build/convert/dojorequire/
6 | build/convert/dojo-build/
7 | build/tests/builds/
8 | build/tests/priority/webapp-build
9 | build/jquery/dist/
10 | build/require/build/
11 | docs/jquery-require-sample/webapp-build/
12 | docs/jquery-require-sample/dist
13 | dist/dist-site/
14 | dist/dist-build/
15 |
16 |
--------------------------------------------------------------------------------
/tests/commonjs/tests/modules/1.0/method/a.js:
--------------------------------------------------------------------------------
1 | define(["require", "exports", "module"], function(require, exports, module) {
2 | exports.foo = function () {
3 | return this;
4 | };
5 | exports.set = function (x) {
6 | this.x = x;
7 | };
8 | exports.get = function () {
9 | return this.x;
10 | };
11 | exports.getClosed = function () {
12 | return exports.x;
13 | };
14 |
15 | });
16 |
--------------------------------------------------------------------------------
/tests/workers.js:
--------------------------------------------------------------------------------
1 | importScripts('../require.js');
2 |
3 | require({
4 | baseUrl: "./"
5 | },
6 | ["require", "simple", "anon/blue", "func", "anon/green"],
7 | function(require, simple, blue, func, green) {
8 | postMessage(simple.color);
9 | postMessage(green.name);
10 | postMessage(func());
11 | postMessage(blue.name);
12 | }
13 | );
14 |
--------------------------------------------------------------------------------
/tests/plugins/earth.js:
--------------------------------------------------------------------------------
1 | define(function (require) {
2 | return {
3 | getA: function () {
4 | return require("./index!0?./a:./b:./c");
5 | },
6 | getC: function () {
7 | return require("./index!2?./a:./b:./c");
8 | },
9 | getB: function () {
10 | return require("./index!1?./a:./b:./c");
11 | }
12 | };
13 | });
14 |
--------------------------------------------------------------------------------
/tests/dataMain.js:
--------------------------------------------------------------------------------
1 | require({
2 | baseUrl: "./"
3 | },
4 | ["require", "simple"],
5 | function(require, simple) {
6 | doh.register(
7 | "dataMain",
8 | [
9 | function dataMain(t){
10 | t.is("blue", simple.color);
11 | }
12 | ]
13 | );
14 | doh.run();
15 | }
16 | );
17 |
--------------------------------------------------------------------------------
/tests/doh/_sounds/LICENSE:
--------------------------------------------------------------------------------
1 | License Disclaimer:
2 |
3 | All contents of this directory are Copyright (c) the Dojo Foundation, with the
4 | following exceptions:
5 | -------------------------------------------------------------------------------
6 |
7 | woohoo.wav, doh.wav, dohaaa.wav:
8 | * Copyright original authors.
9 | Copied from:
10 | http://simpson-homer.com/homer-simpson-soundboard.html
11 |
--------------------------------------------------------------------------------
/tests/plugins/prime/earth.js:
--------------------------------------------------------------------------------
1 | define(function (require) {
2 | return {
3 | getA: function () {
4 | return require("../index!0?./a:./b:./c");
5 | },
6 | getC: function () {
7 | return require("../index!2?./a:./b:./c");
8 | },
9 | getB: function () {
10 | return require("../index!1?./a:./b:./c");
11 | }
12 | };
13 | });
14 |
--------------------------------------------------------------------------------
/tests/funcTwo.js:
--------------------------------------------------------------------------------
1 | define("funcTwo",
2 | ["require", "funcOne"],
3 | function (require) {
4 | var two = function (name) {
5 | this.name = name;
6 | this.one = new (require("funcOne"))("ONE");
7 | };
8 |
9 | two.prototype.oneName = function () {
10 | return this.one.getName();
11 | };
12 |
13 | return two;
14 | }
15 | );
16 |
--------------------------------------------------------------------------------
/dist/post.html:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |