Sha256: 11b185d75f8ceb80e9697e56d1c93d39e3affb0464ec17326c7d7df0b7a7bb4e

Contents?: true

Size: 1.93 KB

Versions: 125

Compression:

Stored size: 1.93 KB

Contents

$(function() {
  var poll_interval = 2

  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);

  $('.backtrace').click(function() {
    $(this).next().toggle()
    return false
  })

  $('a[rel=poll]').click(function() {
    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)
        $('#main .time').relatizeDate()
      }})
    }, poll_interval * 1000)

    return false
  })

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

  $('ul.failed a[rel=retry]').click(function() {
    var href = $(this).attr('href');
    $(this).text('Retrying...');
    var parent = $(this).parent();
    $.ajax({dataType: 'text', type: 'get', url: href, success: function(data) {
      parent.html('Retried <b><span class="time">' + data + '</span></b>');
      relatizer.apply($('.time', parent));
      $('.date_time', parent).hide();
      $('a.toggle_format span', parent).click(format_toggler);
    }});
    return false;
  })


})

Version data entries

125 entries across 125 versions & 11 rubygems

Version Path
rewritten-0.11.0 lib/rewritten/server/public/ranger.js
classiccms-0.7.2 vendor/bundle/gems/resque-1.20.0/lib/resque/server/public/ranger.js
classiccms-0.7.1 vendor/bundle/gems/resque-1.20.0/lib/resque/server/public/ranger.js
rewritten-0.10.0 lib/rewritten/server/public/ranger.js
rewritten-0.9.1 lib/rewritten/server/public/ranger.js
classiccms-0.7.0 vendor/bundle/gems/resque-1.20.0/lib/resque/server/public/ranger.js
rewritten-0.9.0 lib/rewritten/server/public/ranger.js
rewritten-0.8.2 lib/rewritten/server/public/ranger.js
rewritten-0.8.1 lib/rewritten/server/public/ranger.js
rewritten-0.8.0 lib/rewritten/server/public/ranger.js
rewritten-0.7.0 lib/rewritten/server/public/ranger.js
rewritten-0.6.0 lib/rewritten/server/public/ranger.js
rewritten-0.5.0 lib/rewritten/server/public/ranger.js
rewritten-0.4.0 lib/rewritten/server/public/ranger.js
rewritten-0.3.3 lib/rewritten/server/public/ranger.js
rewritten-0.3.2 lib/rewritten/server/public/ranger.js
classiccms-0.6.9 vendor/bundle/gems/resque-1.20.0/lib/resque/server/public/ranger.js
classiccms-0.6.8 vendor/bundle/gems/resque-1.20.0/lib/resque/server/public/ranger.js
classiccms-0.6.7 vendor/bundle/gems/resque-1.20.0/lib/resque/server/public/ranger.js
classiccms-0.6.6 vendor/bundle/gems/resque-1.20.0/lib/resque/server/public/ranger.js