-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,52 @@ | ||
$(function() { | ||
function mapDataAttributes(element) { | ||
html = ""; | ||
var html = ""; | ||
$.each(element.data(), function( key, value ) { | ||
html += "<tr><th>Argument #" + key + "</th><td>" + value + "</td></tr>"; | ||
}); | ||
return html; | ||
} | ||
|
||
$('#expected tbody td:last-child > a').live('click', function(e){ | ||
window.addEventListener("keydown", function (event) { | ||
if (event.keyCode === 114 || ((event.ctrlKey || event.metaKey) && event.keyCode === 70)) { | ||
$('#search').toggleClass('hidden').focus(); | ||
event.preventDefault(); | ||
} | ||
}); | ||
|
||
$('#search').live('keyup', function(event) { | ||
var query = $(this).val().toLowerCase(); | ||
if (query.length) { | ||
$('.search-warning').remove(); | ||
$('#expected tbody tr').each(function(index) { | ||
if ($(this).find('[data-search*="' + query + '"]').length) { | ||
$(this).show(); | ||
} else { | ||
$(this).hide(); | ||
} | ||
}); | ||
|
||
if (!($('#expected tbody tr:visible').length)) { | ||
$('#expected tbody').append('<tr class="search-warning"><td colspan="5">Nothing found!</td></tr>'); | ||
} | ||
} else { | ||
$('#expected tbody tr').show(); | ||
} | ||
}); | ||
|
||
$('#expected tbody td:last-child > a').live('click', function(event){ | ||
$('#job-details .modal-body table tbody').html(mapDataAttributes($(this))); | ||
$('#job-details .modal-title').text($(this).attr('title')); | ||
$('#job-details').modal('show'); | ||
|
||
e.preventDefault(); | ||
event.preventDefault(); | ||
}); | ||
|
||
$('#clear-jobs select').live('change', function(e){ | ||
$('#clear-jobs select').live('change', function(event) { | ||
$(this).parent('form').submit(); | ||
}); | ||
|
||
$('#filter-jobs select').live('change', function(e){ | ||
$('#filter-jobs select').live('change', function(event) { | ||
location.href = $(this).val(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters