Skip to content

Commit

Permalink
Remove remaining timeago uses, replaced by moment.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fzaninotto committed Jul 4, 2012
1 parent fdd6bd6 commit 90df2ca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
10 changes: 0 additions & 10 deletions app/dashboard/public/javascripts/jquery.timeago.js

This file was deleted.

8 changes: 3 additions & 5 deletions app/dashboard/views/_checks.ejs
Expand Up @@ -11,7 +11,6 @@
</thead>
<tbody></tbody>
</table>
<script src="<%= route %>/javascripts/jquery.timeago.js"></script>
<script src="<%= route %>/javascripts/jquery.tablesorter.min.js"></script>
<script src="<%= route %>/javascripts/ejs.min.js"></script>
<script id="check_template" type="text/template">
Expand All @@ -22,11 +21,11 @@
</td>
{{ if (check.lastTested) { }}
{{ if (check.isPaused) { }}
<td data-sort="{{= check.isUp ? check.uptime : -check.downtime }}"><span class="label label-info">paused</span> <span class="blue"> for <span class="timeago" title="{{= new Date(check.lastTested) }}"></span></span></td>
<td data-sort="{{= check.isUp ? check.uptime : -check.downtime }}"><span class="label label-info">paused</span> <span class="blue"> for <span title="{{= new Date(check.lastTested) }}">{{= moment(check.lastChanged).fromNow(true) }}</span></span></td>
{{ } else if (check.isUp) { }}
<td data-sort="{{= check.uptime }}"><span class="label label-success">Up</span> <span class="green"> for <span class="timeago" title="{{= new Date(check.lastChanged) }}"></span></span></td>
<td data-sort="{{= check.uptime }}"><span class="label label-success">Up</span> <span class="green"> for <span title="{{= new Date(check.lastChanged) }}">{{= moment(check.lastChanged).fromNow(true) }}</span></span></td>
{{ } else { }}
<td data-sort="{{= -check.downtime }}"><span class="label label-important">Down</span> <span class="red"> for <span class="timeago" title="{{= new Date(check.lastChanged) }}"></span></span></td>
<td data-sort="{{= -check.downtime }}"><span class="label label-important">Down</span> <span class="red"> for <span title="{{= new Date(check.lastChanged) }}">{{= moment(check.lastChanged).fromNow(true) }}</span></span></td>
{{ } }}
{{ } else { }}
<td data-sort="0"><span class="label label-important">down</span> <span class="label label-warning">new</span></td>
Expand Down Expand Up @@ -69,7 +68,6 @@ jQuery(document).ready(function($) {
});
$('#checks tbody').html(lines.join(''));
$('#checks').trigger('update');
$('#checks .timeago').timeago();
if (lastTest) {
$('#last_update').text('Last updated on ' + moment(lastTest).format('LLLL'));
}
Expand Down
4 changes: 1 addition & 3 deletions app/dashboard/views/check.ejs
Expand Up @@ -3,7 +3,6 @@
<script src="<%= route %>/javascripts/ejs.min.js"></script>
<script src="<%= route %>/javascripts/highcharts.js"></script>
<script src="<%= route %>/javascripts/pagination.js"></script>
<script src="<%= route %>/javascripts/jquery.timeago.js"></script>
<script>
var ejs = require('ejs');
ejs.open = '{{';
Expand Down Expand Up @@ -68,12 +67,11 @@ $(document).ready(function() {
status.date = check.lastChanged;
}
html += '<span class="label label-' + status.label + '">' + status.text +'</span>'
html += '<span class="' + status.color + '"> for <span class="timeago" title="' + new Date(status.date) + '"></span></span>';
html += '<span class="' + status.color + '"> for <span title="' + new Date(status.date) + '">' + moment(status.date).fromNow(true) + '</span></span>';
} else {
html += '<span class="label label-important">down</span> <span class="label label-warning">new</span>';
}
$('#check_24h').html(html);
$('#check_24h .timeago').timeago();
});
};
socket.on('CheckEvent', updateLast24h);
Expand Down

0 comments on commit 90df2ca

Please sign in to comment.