~ubuntu-branches/ubuntu/raring/maas/raring-updates

« back to all changes in this revision

Viewing changes to src/maasserver/static/jslibs/yui/3.4.1/tests/history/tests/manual/history-hash.html

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-03 17:42:37 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20120703174237-p8l0keuuznfg721k
Tags: 0.1+bzr709+dfsg-0ubuntu1
* New Upstream release
* debian/control:
  - Depends on python-celery, python-tempita, libjs-yui3-{full,min},
    libjs-raphael
* debian/maas.install:
  - Install apiclient, celeryconfig.py, maas-import-pxe-files, preseeds_v2.
  - Update to install various files from chroot, rather tha manually copy
    them from the source.
* debian/maas.links: symlink celeryconfig.py
* debian/maas.maas-celery.upstart: Add job.
* debian/rules:
  - Install celery upstart job.
  - Do not install jslibs as packages are now used.
  - Drop copying of maas_local_settings_sample.py as source now ships
    a maas_local_settings.py
* debian/patches:
  - 04-maas-http-fix.patch: Drop. Merged upstream.
  - 01-fix-database-settings.patch: Refreshed.
  - 99_enums_js.patch: Added until creation of enum.js / build process
    is fixed.
* debian/maas.postinst: Update bzr version to correctly handle upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html>
2
 
<html>
3
 
<head>
4
 
    <title>history-hash test</title>
5
 
    <style>
6
 
        #menu {
7
 
            list-style: none;
8
 
            margin: 0;
9
 
            padding: 0;
10
 
        }
11
 
 
12
 
        #log { margin-top: 1em; }
13
 
 
14
 
        #photos {
15
 
            height: 200px;
16
 
            margin-top: 1em;
17
 
        }
18
 
 
19
 
        #photos img {
20
 
            margin-right: 10px;
21
 
            max-height: 200px;
22
 
        }
23
 
    </style>
24
 
</head>
25
 
<body class="yui3-skin-sam">
26
 
 
27
 
<h1>history-hash test</h1>
28
 
 
29
 
<form>
30
 
    <ul id="menu">
31
 
        <li><label><input type="checkbox" id="asparagus">Asparagus</label></li>
32
 
        <li><label><input type="checkbox" id="bluebird">Bluebird</label></li>
33
 
        <li><label><input type="checkbox" id="coffee">Coffee</label></li>
34
 
    </ul>
35
 
 
36
 
    <p>
37
 
        <label><input type="radio" name="mode" id="add" checked>addValue</label>
38
 
        <label><input type="radio" name="mode" id="replace">replaceValue</label>
39
 
    </p>
40
 
</form>
41
 
 
42
 
<ul>
43
 
    <li><a href="http://www.yahoo.com">Yahoo!</a></li>
44
 
    <li><a href="#foo=bar/baz">#foo=bar/baz</a></li>
45
 
</ul>
46
 
 
47
 
<div id="photos"></div>
48
 
<div id="log"></div>
49
 
 
50
 
<script src="../../../../build/yui/yui.js"></script>
51
 
<script>
52
 
var Y = YUI({
53
 
    filter: 'raw',
54
 
    filters: {
55
 
        history: 'debug',
56
 
        'history-hash': 'debug',
57
 
        'history-hash-ie': 'debug'
58
 
    },
59
 
    useBrowserConsole: false
60
 
}).use('console', 'event-delegate', 'history-hash', 'json-stringify', function (Y) {
61
 
    new Y.Console().render('#log');
62
 
 
63
 
    var history    = new Y.History(),
64
 
        bookmarked = history.get(),
65
 
        images  = {
66
 
            asparagus: 'http://farm5.static.flickr.com/4005/4686935131_253e921bf7_m.jpg', // http://www.flickr.com/photos/allenr/4686935131/
67
 
            bluebird : 'http://farm1.static.flickr.com/26/66307916_811efccdfc_m.jpg',     // http://www.flickr.com/photos/allenr/66307916/
68
 
            coffee   : 'http://farm4.static.flickr.com/3336/4638474362_093edb7565_m.jpg'  // http://www.flickr.com/photos/allenr/4638474362/
69
 
        },
70
 
 
71
 
        menuNode   = Y.one('#menu'),
72
 
        photosNode = Y.one('#photos');
73
 
 
74
 
    function refresh(state) {
75
 
        menuNode.all('input[type="checkbox"]').set('checked', false);
76
 
        photosNode.setContent('');
77
 
 
78
 
        Y.Object.each(state, function (value, key) {
79
 
            if (Y.Object.owns(images, key)) {
80
 
                var img = new Image();
81
 
 
82
 
                img.src = images[key];
83
 
                img.alt = key;
84
 
 
85
 
                menuNode.one('#' + key).set('checked', true);
86
 
                photosNode.append(img);
87
 
            }
88
 
        });
89
 
    }
90
 
 
91
 
    Y.on('history:change', function (e) {
92
 
        refresh(e.newVal);
93
 
    });
94
 
 
95
 
    menuNode.delegate('click', function (e) {
96
 
        var node = e.currentTarget,
97
 
            add  = Y.one('#add');
98
 
 
99
 
        history[add.get('checked') ? 'addValue' : 'replaceValue'](
100
 
                node.get('id'), node.get('checked') ? '1' : null);
101
 
    }, 'input');
102
 
 
103
 
    // Refresh with the bookmarked state, if any.
104
 
    Y.log('Bookmarked state: ' + Y.JSON.stringify(bookmarked));
105
 
    refresh(bookmarked);
106
 
});
107
 
</script>
108
 
 
109
 
</body>
110
 
</html>