Skip to content

Instantly share code, notes, and snippets.

@NemoAlex
Created March 13, 2012 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NemoAlex/2027594 to your computer and use it in GitHub Desktop.
Save NemoAlex/2027594 to your computer and use it in GitHub Desktop.
File Detective
<!DOCTYPE html>
<html>
<header>
<title>File Detective</title>
</header>
<body>
<h1>File Detective</h1>
<p>
<a href="javascript:(function(){function getFileType(a) { a = a.split('.'); if (a.length == 1) return false; if (~a[a.length - 1].indexOf('/')) return false; return a[a.length - 1] } for (var fileList = [], els = document.getElementsByTagName('a'), i = 0; els[i]; i++) getFileType(els[i].href) && fileList.push('\'' + els[i].href + '\''); var ta = document.createElement('textarea'); ta.setAttribute('onclick', 'this.select()'); ta.setAttribute('style', 'width:100%'); ta.setAttribute('rows', fileList.length); ta.innerHTML = fileList.join(' '); document.body.appendChild(ta);})()">Detective</a>
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment