Sha256: 18bacda49e8bc9fd4d65be4f1aa2703c11365ac8202be4b43235bb8e1dd0dd25
Contents?: true
Size: 832 Bytes
Versions: 14
Compression:
Stored size: 832 Bytes
Contents
$(document).ready(function() { $('.email-events').each(function() { var events_container = this; $(events_container).html('<span class="fa fa-circle-o-notch fa-spin"></span>'); var data_url = $(events_container).data('url'); $.ajax(data_url) .done(function(json) { if (!json.length) { $(events_container).html('<em>No events found.</em>'); return; } var $new_html = $('<ul>'); $(json).each(function(_, event) { $new_html.append('<li><p>' + event.subject + ' : <strong>' + event.type + '</strong><br><em>' + event.timestamp + '</em></p></li>'); }); $(events_container).html($new_html); }) .fail(function() { $(events_container).html('<em>An error ocurred. Please try again later.</em>'); }); }); });
Version data entries
14 entries across 14 versions & 1 rubygems