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