~ubuntu-branches/ubuntu/karmic/firebug/karmic

« back to all changes in this revision

Viewing changes to content/firebug/tests/domplateLoop.html

  • Committer: Bazaar Package Importer
  • Author(s): Jared Greenwald
  • Date: 2008-02-21 17:34:24 UTC
  • Revision ID: james.westby@ubuntu.com-20080221173424-illircvfpyvnp4uo
Tags: upstream-1.1.0~b11+svn317
ImportĀ upstreamĀ versionĀ 1.1.0~b11+svn317

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
2
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
 
 
4
<html xmlns="http://www.w3.org/1999/xhtml">
 
5
 
 
6
<head>
 
7
<script src="debug.js"></script>
 
8
<script src="../domplate.js"></script>
 
9
<script>
 
10
 
 
11
function runTest()
 
12
{
 
13
        var people = [
 
14
        {firstName: 'Bob', lastName: 'Jones', buds: ['A', 'B', 'C']},
 
15
        {firstName: 'Fred', lastName: 'Smith', buds: ['A', 'B', 'C']},
 
16
        {firstName: 'Hugo', lastName: 'Britos', buds: ['A', 'B', 'C']}
 
17
        ];
 
18
 
 
19
        var args = {
 
20
                peeps: people,
 
21
                sections: [1,2],
 
22
                blah: "yay!"
 
23
        };
 
24
                
 
25
        PEOPLE.insertAfter(args, $("first"));
 
26
}
 
27
 
 
28
var DUDE =
 
29
    DIV(
 
30
                DIV({_firstName: '$who.firstName'}, 'I am $who.firstName $who.lastName'),
 
31
                FOR('bud', '$who.buds',
 
32
                    SPAN("($bud) ")
 
33
                )
 
34
    );
 
35
 
 
36
var PEOPLE =
 
37
        DIV(
 
38
                FOR('peep', '$peeps',
 
39
                    TAG(DUDE, {who: "$peep"})
 
40
                ),
 
41
                "---",
 
42
                FOR('section', '$sections',
 
43
            H1("DUDE"),
 
44
                FOR('peep', '$peeps',
 
45
                TAG(DUDE, {who: "$peep"})
 
46
                )
 
47
                ),
 
48
                P({id: "dude", _blah: "$blah"}, "Got object?")
 
49
        );
 
50
 
 
51
window.addEventListener("load", runTest, false);
 
52
 
 
53
function formatCaption(text)
 
54
{
 
55
        return "(" + text + ")"
 
56
}
 
57
 
 
58
</script>
 
59
 
 
60
</head>
 
61
 
 
62
<body>
 
63
        <div id="first">===</div>
 
64
        <div id="last">---</div>
 
65
</body>
 
66
</html>