I'm building a very simple web-based file browser for my website.
I've styled my links to look like files and I want to be able to single-click to select them so I can do things like rename etc, and I want to be able to double-click to actually activate the link and download the file.
I've come up with the following, but it looks ugly. Does anyone have a more elegant solution?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript">
function nullClick()
{
//do select stuff
return false;
}
function dolink(link)
{
window.location(link.href);
}
</script>
</head>
<body>
<a href="http://pathtofile" onclick="return nullClick();" ondblclick="dolink(this);">Clicky</a>
</body>
</html>