Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- term:
- <input id='term' />
- <hr />
- files:
- <input multiple type='file' onchange="grepFiles(this.files)" />
- <hr /> <hr />
- results:<br />
- <textarea rows='10' cols='80' id='output'></textarea>
- <script type='text/javascript'>
- function el(tid) {return document.getElementById(tid);}
- function grepFiles(r){
- var term=el("term").value;
- el("output").value=[].slice.call(r).filter(function(a){
- var val=a.getAsBinary()+"";
- return val.indexOf(term) > -1;
- }).map(function(a){
- return a.fileName;
- }).join("\n\n")
- }
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement