/loggerhead/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/loggerhead/trunk

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2020-06-04 19:43:36 UTC
  • mto: This revision was merged to the branch mainline in revision 500.
  • Revision ID: jelmer@jelmer.uk-20200604194336-ahskrf4rmy1qaxzs
Port loggerhead from YUI to jQuery.

YUI has been deprecated since 2014 and is due to be removed from Debian.

Show diffs side-by-side

added added

removed removed

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