Created
December 6, 2013 11:59
-
-
Save NielsH/7822660 to your computer and use it in GitHub Desktop.
First version that adds realtime filtering of middlecoin addresses.
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
// ==UserScript== | |
// @name Middlecoin utilities | |
// @namespace http://middlecoin.com/ | |
// @version 0.1 | |
// @description Some extras for middlecoin, i.e. table search filter | |
// @match http://middlecoin.com/ | |
// @copyright 2012+, KamiNuvini | |
// @run-at document-end | |
// @require http://code.jquery.com/jquery-2.0.3.min.js | |
// ==/UserScript== | |
// Realtime address search | |
$('table').before('<div id="searchbox"><b>Search address: </b><input id="search" type="search"></div>'); | |
// Search snippet, thanks to dfsq at StackOverflow - http://stackoverflow.com/questions/9127498/how-to-perform-a-real-time-search-and-filter-on-a-html-table | |
var $rows = $('table tbody tr'); | |
$('#search').keyup(function() { | |
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); | |
$rows.show().filter(function() { | |
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); | |
return !~text.indexOf(val); | |
}).hide(); | |
}); | |
// End of realtime address search |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment