293:085ce95c6d95
Anton Shestakov <av6@dwimlabs.net>, Mon, 18 Sep 2017 16:54:55 +0800
tests: shortcut for attrib check (it works quite well with pytest)

next change 299:18a3583a520a
previous change 277:6777a5c2acad

static/candolint.js

Permissions: -rw-r--r--

Other formats: Feeds:
(function($) {
var humanizeTimestamps = function() {
$('time[datetime]').each(function() {
var $this = $(this);
$this.text(moment($this.attr('datetime')).fromNow());
});
};
humanizeTimestamps();
window.setInterval(humanizeTimestamps, 15 * 1000);
})(jQuery);
(function($) {
$('.check-log div.task').each(function() {
var $line = $(this);
var task = $line.attr('data-task');
var $lines = $line.nextAll('[data-task="' + task + '"]');
if ($lines.length === 0) { return; }
var $collapser = $('<a>').addClass('collapser');
$line.append($collapser);
var toggle = function() {
var collapsed = $collapser.hasClass('collapsed');
$lines.toggleClass('uk-hidden', collapsed);
};
$collapser.on('click', function() {
$collapser.toggleClass('collapsed');
toggle();
});
var important = '.error, .warning, .failure, :target';
if (task !== 'checks' && $lines.filter(important).length === 0) {
$collapser.addClass('collapsed');
toggle();
}
});
})(jQuery);