|
From: Lasse Kärkkäi. <tr...@us...> - 2011-01-10 23:16:29
|
Module: web
Branch: master
Commit: 0d1f0316e8cec272082e5563fa5571f42d963f58
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Dec 7 01:28:31 2010 +0100
Download button platform detection (b0rked)
---
htdocs-binary/download.js | 17 +++++++++++++++++
htdocs-source/index.txt | 3 +--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/htdocs-binary/download.js b/htdocs-binary/download.js
new file mode 100644
index 0000000..aa30eb2
--- /dev/null
+++ b/htdocs-binary/download.js
@@ -0,0 +1,17 @@
+function smartDownload() {
+ var e = document.getElementById('download');
+ var agent = navigator.appVersion;
+ if (agent.indexOf('Linux') != -1) return;
+ if (agent.indexOf('Macintosh') != -1) {
+ e.href = 'http://sourceforge.net/projects/performous/files/performous/0.5.0/Performous-0.5.0.dmg/download';
+ e.title = 'Performous 0.5.0 (OS X 10.5)';
+ return;
+ }
+ if (agent.indexOf('Windows') != -1) {
+ e.href = 'http://sourceforge.net/projects/performous/files/performous/0.6.1/Performous-0.6.1.exe/download';
+ e.title = 'Performous 0.6.1 (Windows)';
+ return;
+ }
+}
+smartDownload();
+
diff --git a/htdocs-source/index.txt b/htdocs-source/index.txt
index 63a4b48..3c072f5 100644
--- a/htdocs-source/index.txt
+++ b/htdocs-source/index.txt
@@ -8,5 +8,4 @@ While Performous is still in development and you will find some crappy graphics
We constantly strive to improve the gameplay and the algorithms the game is built on. Performous does not attempt to clone and catch other games but instead we listen to user feedback and try to find the best solutions. The game is developed by a relatively large team of skilled people but we are always looking for new recruits. If you think you can improve something or if you just wish to build from source, click the C++ button.
-<div style="width: 128px; margin-left: auto" id="download"><a href="https://sourceforge.net/projects/performous/files/performous/0.6.1/Performous-0.6.1.exe/download" title="Performous 0.6.1 (Windows, 22 MB)" target="_new"><img style="width: 64px; height: 64px;" src="imgs/icon_down.png" style="display: inline" alt="Download"></a><a href="http://wiki.performous.org/index.php/Building_and_installing_from_source" title="Build from source" target="_new"><img style="width: 64px; height: 64px;" src="imgs/icon_cpp.png" style="display: inline" alt="Source code"></a></div>
-
+<div style="width: 128px; margin-left: auto"><a id="download" href="download.html" title="Downloads"><img style="width: 64px; height: 64px;" src="imgs/icon_down.png" style="display: inline" alt="Download"></a><a href="http://wiki.performous.org/index.php/Building_and_installing_from_source" title="Build from source" target="_new"><img style="width: 64px; height: 64px;" src="imgs/icon_cpp.png" style="display: inline" alt="Source code"></a></div><script type="text/javascript" src="download.js"></script>
|