Sha256: fcbfda39715d5a5e99f8b49a2b94a694864df0bb3b8eed957cbb4b3bc2011fac

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

$(function() {
  $('[data-toggle="tooltip"]').tooltip();

  $('.js-lazy').lazyload({
    effect: 'fadeIn',
    threshold: 200
  });

  $('#js-toggle-file-listing').click(function() {
    var text = $(this).text();
    $(this).text(text == 'Show file listing' ? 'Hide file listing': 'Show file listing');
    $('#js-file-listing').toggle();
  });

  function selectText() {
    var range;

    if (document.selection) {
      range = document.body.createTextRange();
      range.moveToElementText(this);
      range.select();
    } else if (window.getSelection) {
      range = document.createRange();
      range.selectNode(this);
      window.getSelection().addRange(range);
    }
  }

  $('#js-clone-url').click(selectText);

  $('.js-nav').click(function() {
    location.href = $(this).data('href');
  });

  $('#pjax-container').pjax('#js-tree a, #js-tree-nav a').on('pjax:send', function() {
    $('#loader').show();
  }).on('pjax:end', function() {
    $('#js-clone-url').click(selectText);
  });

  // filter repositories
  $('.js-filter-query').on('keyup', function() {
    var regexp = new RegExp($(this).val(), 'i'),
        $repolist = $('.js-repolist a');

    $repolist.hide();
    $repolist.filter(function() {
      return regexp.test($(this).text());
    }).show();
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ginatra-4.1.0 public/js/custom.js