Author: kschenk
Date: Sun Apr 29 21:38:21 2012
New Revision: 1332003
URL: http://svn.apache.org/viewvc?rev=1332003&view=rev
Log:
kls -- fix up platform identification for current release.
Modified:
incubator/ooo/ooo-site/trunk/content/download/test/download_new_dl.js
Modified: incubator/ooo/ooo-site/trunk/content/download/test/download_new_dl.js
URL:
http://svn.apache.org/viewvc/incubator/ooo/ooo-site/trunk/content/download/test/download_new_dl.js?rev=1332003&r1=1332002&r2=1332003&view=diff
==============================================================================
--- incubator/ooo/ooo-site/trunk/content/download/test/download_new_dl.js
(original)
+++ incubator/ooo/ooo-site/trunk/content/download/test/download_new_dl.js Sun
Apr 29 21:38:21 2012
@@ -376,6 +376,10 @@ function getLanguageISO() {
function hasMirrorLink() {
var a = getArray();
var platform = getPlatform();
+ var schema = SCHEMA;
+ if (schema == "aoo_inclubating") {
+ platform = getPlatform(schema);
+ }
if ( a[4] == 'y' ) {
// special handling for MAC, links in combination with general
flag a[4]
@@ -507,6 +511,70 @@ function getPlatform() {
return "Windows";
}
+/* for customizing platforms for various schemas/release */
+function getPlatform(schema) {
+ if (schema == "aoo_incubating") {
+ if ( navigator.platform != null ) {
+ if ( navigator.platform.indexOf( "Win32" ) != -1 ) {
+ return "Windows";
+ } else if ( navigator.platform.indexOf( "Win64" ) != -1 ) {
+ return "Windows";
+ } else if ( navigator.platform.indexOf( "Win" ) != -1 ) {
+ return "Windows";
+ } else if ( navigator.platform.indexOf( "Linux" ) != -1 ) {
+ if ( navigator.platform.indexOf( "64" ) != -1 ) {
+ if ( navigator.userAgent != null ) {
+ if (
navigator.userAgent.toLowerCase().indexOf( "debian" ) != -1 ||
+
navigator.userAgent.toLowerCase().indexOf( "ubuntu" ) != -1 ) {
+ return "Linux Debian 64-bit";
+ } else {
+ return "Linux 64-bit";
+ }
+ } else {
+ return "Linux 64-bit";
+ }
+ } else {
+ if ( navigator.userAgent != null ) {
+ if (
navigator.userAgent.toLowerCase().indexOf( "debian" ) != -1 ||
+
navigator.userAgent.toLowerCase().indexOf( "ubuntu" ) != -1 ) {
+ return "Linux Debian";
+ } else {
+ return "Linux";
+ }
+ } else {
+ return "Linux";
+ }
+ }
+ } else if ( navigator.platform.indexOf( "SunOS i86pc" ) != -1 )
{
+ return "";
+ } else if ( navigator.platform.indexOf( "SunOS sun4u" ) != -1 )
{
+ return "";
+ } else if ( navigator.platform.indexOf( "SunOS" ) != -1 ) {
+ return "";
+ } else if ( navigator.platform.indexOf( "Mac" ) != -1 &&
navigator.platform.indexOf( "Intel" ) != -1 ) {
+ return "Mac OS Intel";
+ } else if ( navigator.platform.indexOf( "Mac" ) != -1 &&
navigator.platform.indexOf( "PPC" ) != -1 ) {
+ return "";
+ } else if ( navigator.platform.indexOf( "Mac" ) != -1 ) {
+ return "Mac OS Intel" ;
+ } else if ( navigator.platform.indexOf( "iPad" ) != -1 ||
navigator.platform.indexOf( "iPhone" ) != -1 ||
+ navigator.platform.indexOf( "iPod" ) != -1 ) {
+ // this code will redirect the iPad, iPhone and iPod
entries
+ return "Mac OS Intel" ;
+ } else if ( navigator.platform.indexOf( "Series60" ) != -1 ) {
+ // this code will redirect the Series60 entries
+ return "Windows" ;
+ } else if ( navigator.platform.indexOf( "null" ) != -1 ) {
+ return "Windows" ;
+ } else {
+ // return platform name
+ return navigator.platform;
+ }
+ } // null navigator platform
+ return "Windows";
+ }
+}
+
/*
* get platform for bouncer-link
* must be changed