~caneypuggies/reformedchurcheslocator/couchapp-backbone

« back to all changes in this revision

Viewing changes to _attachments/js/vendor/requirejs/tests/simple-badbase.html

  • Committer: Tim Black
  • Date: 2013-09-16 22:50:16 UTC
  • Revision ID: tim@alwaysreformed.com-20130916225016-zk8jiba25z33ew7h
Versioned Bower vendor directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<head>
 
3
    <title>require.js: Simple Bad Base Test</title>
 
4
    <base href="http://some.example.com/path/" />
 
5
    <script type="text/javascript" src="http://127.0.0.1/requirejs/requirejs/require.js"></script>
 
6
    <script type="text/javascript" src="http://127.0.0.1/requirejs/requirejs/tests/doh/runner.js"></script>
 
7
    <script type="text/javascript" src="http://127.0.0.1/requirejs/requirejs/tests/doh/_browserRunner.js"></script>
 
8
    <script type="text/javascript">
 
9
        require({
 
10
                baseUrl: "http://127.0.0.1/requirejs/requirejs/tests/"
 
11
            },
 
12
            ["require", "simple", "dimple", "func"],
 
13
            function(require, simple, dimple, func) {
 
14
                doh.register(
 
15
                    "simple",
 
16
                    [
 
17
                        function colors(t){
 
18
                            t.is("blue", simple.color);
 
19
                            t.is("dimple-blue", dimple.color);
 
20
                            t.is("You called a function", func());
 
21
                        }
 
22
                    ]
 
23
                );
 
24
                doh.run();
 
25
            }
 
26
        );
 
27
    </script>
 
28
    <script type="text/javascript">
 
29
        //This test is only in the HTML since it uses an URL for a require
 
30
        //argument. It will not work well in say, the Rhino tests.
 
31
        var path = location.href.replace(/simple-badbase\.html$/, "foo"),
 
32
            index = path.indexOf(":"),
 
33
            noProtocolPath = path.substring(index + 1, path.length).replace(/foo/, "bar");
 
34
 
 
35
        require([path, noProtocolPath], function() {
 
36
            doh.register(
 
37
                        "fooBar",
 
38
                        [
 
39
                            function fooBar(t){
 
40
                                t.is("foo", foo.name);
 
41
                                t.is("bar", bar.name);
 
42
                            }
 
43
                        ]
 
44
                    );
 
45
            doh.run();
 
46
 
 
47
        });
 
48
    </script>
 
49
</head>
 
50
<body>
 
51
    <h1>require.js: Simple Test</h1>
 
52
    <p>You may need to change the IP address used for this test for it to work correctly.</p>
 
53
    <p>Check console for messages</p>
 
54
</body>
 
55
</html>