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