You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ma...@apache.org on 2013/08/11 18:53:21 UTC
svn commit: r1512968 -
/openoffice/ooo-site/trunk/content/download/test/download.js
Author: marcus
Date: Sun Aug 11 16:53:20 2013
New Revision: 1512968
URL: http://svn.apache.org/r1512968
Log:
Some code and comment updates
Modified:
openoffice/ooo-site/trunk/content/download/test/download.js
Modified: openoffice/ooo-site/trunk/content/download/test/download.js
URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download.js?rev=1512968&r1=1512967&r2=1512968&view=diff
==============================================================================
--- openoffice/ooo-site/trunk/content/download/test/download.js (original)
+++ openoffice/ooo-site/trunk/content/download/test/download.js Sun Aug 11 16:53:20 2013
@@ -21,6 +21,7 @@ var URL_PLATFORM = "";
var FILENAME = "";
var FILESIZE = 0;
var EXTENSION = "";
+var LINK = "";
var CHECKSUM_KEYS = "";
var CHECKSUM_ASC = "";
var CHECKSUM_MD5 = "";
@@ -28,6 +29,16 @@ var CHECKSUM_SHA256 = "";
var ERROR = false;
/*
+ * Initialize the download script and set all global variables with data
+ */
+function initializeDL() {
+ getLanguage();
+ getPlatform();
+ getFilesize();
+ getLink();
+}
+
+/*
* Get array and ISO code for language
* Depends on nl_language
*/
@@ -119,8 +130,7 @@ function hasMirrorLink() {
* Depends on array-list
*/
function getLink() {
- var file_link = "";
- var chk_link = "";
+ var chk_link = "";
getLanguage();
getPlatform();
@@ -137,26 +147,28 @@ function getLink() {
if ( hasMirrorLink() ) {
if ( URL_PLATFORM == "" ) {
+ // If no platform was recognized, set the "other.html" webpage as alternative download URL
if ( UI_PLATFORM == "" ) {
UI_PLATFORM = "an unknown platform/OS";
}
- file_link = "http://www.openoffice.org/download/other.html";
+ LINK = "http://www.openoffice.org/download/other.html";
ERROR = true;
- return file_link;
+ return LINK;
} else {
+ // If platform was recognized, get the download filename and checksum filename
+
// FILENAME = "Apache_OpenOffice_" + VERSION + "_" + URL_PLATFORM + "_" + NL_LANGUAGE;
// FILENAME = FILENAME + EXTENSION;
// Assign the file name (column 3) from the release matrix of language and platform
- FILENAME = release_aoo400_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 3 ]
- // file_link = SOURCEFORGE_BASE_URL + NL_LANGUAGE + "/Apache_OpenOffice_" + VERSION + "_";
- // file_link = file_link + URL_PLATFORM + "_" + NL_LANGUAGE + EXTENSION + "/download";
+ FILENAME = release_aoo400_matrix[ LANG_ISO ][ RELEASE_MATRIX_PLATFORM_POS ][ 3 ];
- file_link = SOURCEFORGE_BASE_URL + NL_LANGUAGE + "/" + FILENAME;
+ // LINK = SOURCEFORGE_BASE_URL + NL_LANGUAGE + "/Apache_OpenOffice_" + VERSION + "_";
+ // LINK = LINK + URL_PLATFORM + "_" + NL_LANGUAGE + EXTENSION + "/download";
+ LINK = SOURCEFORGE_BASE_URL + NL_LANGUAGE + "/" + FILENAME + "/download";
// chk_link = APACHE_DIST_BASE_URL + "/binaries/" + NL_LANGUAGE + "/Apache_OpenOffice_";
// chk_link = chk_link + VERSION + "_" + URL_PLATFORM + "_" + NL_LANGUAGE + EXTENSION;
-
chk_link = APACHE_DIST_BASE_URL + "/binaries/" + NL_LANGUAGE + "/" + FILENAME;
CHECKSUM_KEYS = "http://www.apache.org/dist/openoffice/KEYS";
@@ -164,15 +176,15 @@ function getLink() {
CHECKSUM_MD5 = chk_link + ".md5";
CHECKSUM_SHA256 = chk_link + ".sha256";
}
- return file_link;
+ return LINK;
/*
Used for debugging
- file_link = PEOPLE_BASE_URL + "/binaries/" + NL_LANGUAGE + "/Apache_OpenOffice_";
- file_link = file_link + "/Apache_OpenOffice_" + "_" + NL_LANGUAGE + EXTENSION;
+ LINK = PEOPLE_BASE_URL + "/binaries/" + NL_LANGUAGE + "/Apache_OpenOffice_";
+ LINK = LINK + "/Apache_OpenOffice_" + "_" + NL_LANGUAGE + EXTENSION;
chk_link = PEOPLE_BASE_URL + "/binaries/" + NL_LANGUAGE + "/Apache_OpenOffice_" + VERSION;
chk_link = chk_link + "_" + URL_PLATFORM + "_" + NL_LANGUAGE + EXTENSION;
- return file_link;
+ return LINK;
*/
} else {
ERROR = true;
@@ -246,7 +258,7 @@ function getPlatform() {
return;
}
- // Windows
+ // Windows, x86 or mobile?
if ( os.indexOf( "windows" ) != -1 ||
os.indexOf( "win" ) != -1 ) { UI_PLATFORM = "Windows (EXE)";
URL_PLATFORM = "Win_x86_install";
@@ -255,7 +267,7 @@ function getPlatform() {
ua.indexOf( "mobile" ) != -1 ) UI_PLATFORM = "Windows Mobile device";
}
- // Linux
+ // Linux, x86 or x86_64, DEB or RPM?
if ( os.indexOf( "linux" ) != -1 ) {
if ( os.indexOf( "x86" ) != -1 ||
os.indexOf( "i686" ) != -1 ) { UI_PLATFORM = "Linux 32-bit (RPM)";
@@ -290,7 +302,7 @@ function getPlatform() {
}
}
- // If variable is not filled, then nothing was recognized, set $UI_PLATFORM to show it to the user
+ // If variable is not filled until now, then nothing was recognized, set $UI_PLATFORM to show it to the user
if ( ! UI_PLATFORM ) {
ERROR = true;
UI_PLATFORM = "an unknown platform/OS";
@@ -349,5 +361,5 @@ function openItem( itemid, uri ) {
var thisDocument = document.getElementById( "downloadextendedtext" );
var thisDocument = document.getElementById( itemid );
document.location = uri;
-};
+}