Web Site Tweak [Source Included]

Suggestions and discussion of future versions
Post Reply
Ash

Web Site Tweak [Source Included]

Post by Ash »

Hi there. The current download page is a little old-school, having Javascript-only links to the downloads. Having Javascript disabled by default here means it breaks without fail almost every time I visit. It's happened so often, that for my own sanity I thought I'd lend a hand. ;-)

I'm proposing a solution in which very little is required; make the Javascript at least fail gracefully. The main trick here is to:
  • Move the javascript to an onclick attribute.
  • Have a non-Javascript safe link for browsers without it.
For now the attached example should fix it up so that nobody ends up with broken links. To be honest though the download page in its current state is a difficult to work with and really could have been done better, so I encourage you guys to look into unobtrusive javascript and a nicer fallback mechanism next time around.

Note: I'm not 100% certain this works as I haven't tested it, but I can't see a problem with it here. If you want a hand, shoot me a message.

File uploads seem to be disabled, so I've pasted the example in a code block below. Hope this works.
Ash

Re: Web Site Tweak [Source Included]

Post by Ash »

Okay, that was a mess-up. I just re-did the code, most of the last one was messed up by a faulty search and replace. If you've got a spare moment, this should work now. :)

Code: Select all

<tr>
	<td style="width: 17px;">
		<a href="http://download.deluge-torrent.org/source/" onclick="javascript:dpge('source');return false;">
			<img src="/images/source-logo.png" style="border-width: 0px; /* background-color: white; */" />
		</a>
	</td>

	<td style="border-right: 1px solid rgb(72, 93, 115); width: 180px; padding-right: 10px;">
		<a href="http://download.deluge-torrent.org/source/" onclick="javascript:dpge('source');return false;">
Source
		</a>
	</td>
</tr>
<tr>

	<td style="width: 17px;">
			<a href="http://download.deluge-torrent.org/ubuntu/" onclick="javascript:dpge('ubuntu');return false;">
				<img src="/images/ubuntu-logo.png" style="border-width: 0px; /* background-color: white; */" />
		</a>
	</td>
	<td style="border-right: 1px solid rgb(72, 93, 115); width: 180px; padding-right: 10px;">
			<a href="http://download.deluge-torrent.org/ubuntu/" onclick="javascript:dpge('ubuntu');return false;">
	Ubuntu
		</a>
	</td>
</tr>
 
<tr>

	<td style="width: 17px;">
		<a href="http://download.deluge-torrent.org/debian/" onclick="javascript:dpge('debian');return false;">
			<img src="/images/debian-logo.png" style="border-width: 0px; /* background-color: white; */" />
		</a>
	</td>
	<td style="border-right: 1px solid rgb(72, 93, 115); width: 180px; padding-right: 10px;">
		<a href="http://download.deluge-torrent.org/debian/" onclick="javascript:dpge('debian');return false;">
Debian
		</a>
	</td>
</tr>
 
<tr>

	<td style="width: 17px;">
		<a href="http://download.deluge-torrent.org/gentoo/" onclick="javascript:dpge('gentoo');return false;">
			<img src="/images/gentoo-logo.png" style="border-width: 0px; /* background-color: white; */" />
		</a>
	</td>
	<td style="border-right: 1px solid rgb(72, 93, 115); width: 180px; padding-right: 10px;">
		<a href="http://download.deluge-torrent.org/gentoo/" onclick="javascript:dpge('gentoo');return false;">
Gentoo
		</a>
	</td>
</tr>
 
<tr>

	<td style="width: 17px;">
		<a href="http://download.deluge-torrent.org/arch/" onclick="javascript:dpge('arch');return false;">
			<img src="/images/arch-logo.png" style="border-width: 0px; /* background-color: white; */" />
		</a>
	</td>
	<td style="border-right: 1px solid rgb(72, 93, 115); width: 180px; padding-right: 10px;">
		<a href="http://download.deluge-torrent.org/arch/" onclick="javascript:dpge('arch');return false;">
Arch
		</a>
	</td>
</tr>
 
<tr>

	<td style="width: 17px;">
		<a href="http://download.deluge-torrent.org/windows/" onclick="javascript:dpge('windows');return false;">
			<img src="/images/xp-logo.png" style="border-width: 0px; /* background-color: white; */" />
		</a>
	</td>
	<td style="border-right: 1px solid rgb(72, 93, 115); width: 180px; padding-right: 10px;">
		<a href="http://download.deluge-torrent.org/windows/" onclick="javascript:dpge('windows');return false;">
Windows
		</a>
	</td>
</tr>
 
markybob
Compulsive Poster
Compulsive Poster
Posts: 1230
Joined: Thu May 24, 2007 11:27 pm
Location: Chicago, IL, USA
Contact:

Re: Web Site Tweak [Source Included]

Post by markybob »

i dont really understand the why in the javascript debate...but i have no reason to not commit your code, and it does make it easier for that small group, so ok. the download page has been updated. thanks
Post Reply