~caneypuggies/reformedchurcheslocator/couchapp-backbone

« back to all changes in this revision

Viewing changes to _attachments/js/vendor/requirejs/tests/paths/paths.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
<!DOCTYPE html>
 
2
<html>
 
3
<head>
 
4
    <title>require.js: paths Test</title>
 
5
    <script type="text/javascript" src="../../require.js"></script>
 
6
    <script type="text/javascript" src="../doh/runner.js"></script>
 
7
    <script type="text/javascript" src="../doh/_browserRunner.js"></script>
 
8
    <script type="text/javascript">
 
9
    var globalCounter = 0,
 
10
        scriptCounter = 0;
 
11
    require({
 
12
            baseUrl: "./",
 
13
            packages: [
 
14
                {
 
15
                    name:"first",
 
16
                    location:"first.js",
 
17
                    main:"./first"
 
18
                }
 
19
            ]
 
20
        },
 
21
        ["require", "first!whatever"],
 
22
        function(require, first) {
 
23
            doh.register(
 
24
                "paths",
 
25
                [
 
26
                    function paths(t){
 
27
                        //First confirm there is only one script tag for each
 
28
                        //module:
 
29
                        var scripts = document.getElementsByTagName("script"),
 
30
                            i, counts = {}, modName, props, something;
 
31
                        for (var i = scripts.length - 1; i > -1; i--) {
 
32
                            modName = scripts[i].getAttribute("data-requiremodule");
 
33
                            if (modName && modName === "first" || modName === "first/first") {
 
34
                                scriptCounter += 1;
 
35
                            }
 
36
                        }
 
37
 
 
38
                        t.is(1, scriptCounter);
 
39
                        t.is(2, globalCounter);
 
40
                        t.is("first", first.name);
 
41
                        t.is("second", first.secondName);
 
42
                    }
 
43
                ]
 
44
            );
 
45
            doh.run();
 
46
        }
 
47
    );
 
48
    </script>
 
49
</head>
 
50
<body>
 
51
    <h1>require.js: paths Test</h1>
 
52
    <p>Check console for messages</p>
 
53
</body>
 
54
</html>