Sha256: 6111723a92a0459de5dcc70206cf94720fc010346b02fe727e54c8c0659f8c15

Contents?: true

Size: 1.69 KB

Versions: 37

Compression:

Stored size: 1.69 KB

Contents

$(function() {
  var poll_interval = 3;

  var relatizer = function(){
    var dt = $(this).text(), relatized = $.relatizeDate(this)
    if ($(this).parents("a").length > 0 || $(this).is("a")) {
      $(this).relatizeDate()
      if (!$(this).attr('title')) {
        $(this).attr('title', dt)
      }
    } else {
      $(this)
      .text('')
      .append( $('<a href="#" class="toggle_format" title="' + dt + '" />')
              .append('<span class="date_time">' + dt +
                      '</span><span class="relatized_time">' +
                        relatized + '</span>') )
    }
  };

  $('.time').each(relatizer);

  $('.time a.toggle_format .date_time').hide();

  var format_toggler = function(){
    $('.time a.toggle_format span').toggle();
    $(this).attr('title', $('span:hidden',this).text());
    return false;
  };

  $('.time a.toggle_format').click(format_toggler);

  $('ul li.job').hover(function() {
    $(this).addClass('hover');
  }, function() {
    $(this).removeClass('hover');
  })

  $('a.backtrace').click(function (e) {
    e.preventDefault();
    if($(this).prev('div.backtrace:visible').length > 0) {
      $(this).next('div.backtrace').show();
      $(this).prev('div.backtrace').hide();
    } else {
      $(this).next('div.backtrace').hide();
      $(this).prev('div.backtrace').show();
    }
  });

  $('a[rel=poll]').click(function(e) {
    e.preventDefault();
    var href = $(this).attr('href')
    $(this).parent().text('Starting...')
    $("#main").addClass('polling')

    setInterval(function() {
      $.ajax({dataType: 'text', type: 'get', url: href, success: function(data) {
        $('#main').html(data);
      }})
    }, poll_interval * 1000)

    return false
  })
})

Version data entries

37 entries across 37 versions & 6 rubygems

Version Path
delayed_job_web-1.4.4 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.4.3 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.4.2 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.4 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.3 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.10 lib/delayed_job_web/application/public/javascripts/application.js
better_delayed_job_web-1.3.12 lib/better_delayed_job_web/application/public/javascripts/application.js
better_delayed_job_web-1.3.11 lib/better_delayed_job_web/application/public/javascripts/application.js
better_delayed_job_web-1.3.5 lib/better_delayed_job_web/application/public/javascripts/application.js
better_delayed_job_web-1.3.3 lib/delayed_job_web/application/public/javascripts/application.js
better_delayed_job_web-1.3.2 lib/delayed_job_web/application/public/javascripts/application.js
better_delayed_job_web-1.3.1 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.9 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.8 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.7 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.6 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.5 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.4 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.2 lib/delayed_job_web/application/public/javascripts/application.js
delayed_job_web-1.2.1 lib/delayed_job_web/application/public/javascripts/application.js