~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/static/javascript/changelog.js

  • Committer: Guillermo Gonzalez
  • Date: 2008-09-10 23:12:59 UTC
  • mfrom: (221 trunk)
  • mto: (217.1.9 logging)
  • mto: This revision was merged to the branch mainline in revision 226.
  • Revision ID: guillo.gonzo@gmail.com-20080910231259-4wnfmu30f4n90w6x
 * merge with trunk (resolve conflicts in NEWS and serve-branches)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function toggle_expand_all(action)
2
 
{
3
 
  var revlogs = Y.all('.revision_log');
4
 
  if (revlogs == null) return;
5
 
  revlogs.each(
6
 
    function(item, i)
7
 
    {
8
 
      var collapsable = item.collapsable;
9
 
      if(action == 'close')
10
 
      {
11
 
        Y.get('#expand_all').setStyle('display','block');
12
 
        Y.get('#collapse_all').setStyle('display','none');
13
 
        collapsable.close();
14
 
      }
15
 
      else if(action == 'open')
16
 
      {
17
 
        Y.get('#expand_all').setStyle('display','none');
18
 
        Y.get('#collapse_all').setStyle('display','block');
19
 
        collapsable.open();
20
 
      }
21
 
    });
22
 
}
23
 
 
24
 
Y.on(
25
 
  'click',
26
 
  function (event) {
27
 
    event.preventDefault();
28
 
    toggle_expand_all('open');
29
 
  },
30
 
  '#expand_all a'
31
 
);
32
 
 
33
 
Y.on(
34
 
  'click',
35
 
  function (event) {
36
 
    event.preventDefault();
37
 
    toggle_expand_all('close');
38
 
  },
39
 
  '#collapse_all a'
40
 
);
41
 
 
42
 
Y.on(
43
 
  "domready", function () {
44
 
    Y.all(".show_if_js").removeClass("show_if_js");
45
 
  });
46
 
 
47
 
Y.on(
48
 
  'domready',
49
 
  function()
50
 
  {
51
 
    var revlogs = Y.all('.revision_log');
52
 
    if (revlogs == null) return;
53
 
    revlogs.each(
54
 
      function(item, i)
55
 
      {
56
 
        var revid = revids[item.get('id').replace('log-', '')];
57
 
        var collapsable = new Collapsable(
58
 
          {
59
 
            expand_icon: item.query('.expand_icon'),
60
 
            open_node: item.query('.long_description'),
61
 
            close_node: item.query('.short_description'),
62
 
            source: global_path + '+revlog/' + revid,
63
 
            loading: item.query('.loading'),
64
 
            is_open: false
65
 
          });
66
 
 
67
 
        item.query('.expand_revisioninfo a').on(
68
 
          'click',
69
 
          function(e) {
70
 
            e.preventDefault();
71
 
            collapsable.toggle();
72
 
          });
73
 
        item.collapsable = collapsable;
74
 
      });
75
 
 
76
 
  });