Return-Path: X-Original-To: apmail-openoffice-commits-archive@www.apache.org Delivered-To: apmail-openoffice-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDBA01151C for ; Sat, 31 May 2014 19:09:44 +0000 (UTC) Received: (qmail 58407 invoked by uid 500); 31 May 2014 19:09:44 -0000 Delivered-To: apmail-openoffice-commits-archive@openoffice.apache.org Received: (qmail 58363 invoked by uid 500); 31 May 2014 19:09:44 -0000 Mailing-List: contact commits-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list commits@openoffice.apache.org Received: (qmail 58356 invoked by uid 99); 31 May 2014 19:09:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 May 2014 19:09:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 May 2014 19:09:44 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 924A52388994; Sat, 31 May 2014 19:09:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1598902 - /openoffice/ooo-site/trunk/content/download/test/download_droplist.js Date: Sat, 31 May 2014 19:09:20 -0000 To: commits@openoffice.apache.org From: marcus@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140531190920.924A52388994@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: marcus Date: Sat May 31 19:09:19 2014 New Revision: 1598902 URL: http://svn.apache.org/r1598902 Log: Implemented an analyze mode to support the 'analyze.html' Modified: openoffice/ooo-site/trunk/content/download/test/download_droplist.js Modified: openoffice/ooo-site/trunk/content/download/test/download_droplist.js URL: http://svn.apache.org/viewvc/openoffice/ooo-site/trunk/content/download/test/download_droplist.js?rev=1598902&r1=1598901&r2=1598902&view=diff ============================================================================== --- openoffice/ooo-site/trunk/content/download/test/download_droplist.js (original) +++ openoffice/ooo-site/trunk/content/download/test/download_droplist.js Sat May 31 19:09:19 2014 @@ -19,7 +19,7 @@ * function showErrorMessage ( error_text ) * function isLangSupported () * function getLink ( rel_mode ) - * function getLinkSel ( rel_mode ) + * function getLinkSel () * function getPlatform () * function getReleaseMatrixPos () * function getFilename ( ver ) @@ -32,7 +32,7 @@ /* * Init function */ -function init() { +function init( a, b ) { // Set global variables. initVars(); @@ -50,8 +50,11 @@ function init() { setLangSel(); setVerSel(); - // Get the download link from the selected elements. - getLinkSel( 1 ); + + // Get release mode and analyze mode from "index.html" respective "analyze.html". + R_MODE = a; + A_MODE = b; + getLinkSel(); } /* @@ -76,6 +79,8 @@ function initVars() { "dl_lp_chk_keys", "dl_lp_chk_asc", "dl_lp_chk_md5", "dl_lp_chk_sha256", "dl_hlp", "dl_chk", "dl_rpt" ]; // The following are used in "download.js". and "index.html". + R_MODE = ""; // The release mode (1 = stable release (default), 2 = beta release, etc.). + A_MODE = ""; // The analyze mode (0 = no debug (default), 1 = debug mode). LANG_ISO = ""; // The language as ISO code. LANG_ARRAY = ""; // This array contains all language specific data. UI_PLATFORM = ""; // The platform as readable string. @@ -1163,16 +1168,19 @@ function getLink( rel_mode ) { * Get link to mirror system for download file and checksum file * Depends on chosen OS, language and type */ -function getLinkSel( rel_mode ) { +function getLinkSel() { // Reset all error flags. SF = false; OTHER = false; ARCHIVE = false; ERROR = false; - // If no release mode was given, assume it is about the stable release. - if( rel_mode === undefined ) - rel_mode = 1; + // If no mode was given, assume it is the release mode (stable release). + if( R_MODE === undefined ) + R_MODE = 1; + // If no mode was given, assume it is not the analyze mode (used for "analyze.html"). + if( A_MODE === undefined ) + A_MODE = false; // Get the selected data from the select boxes. getOSSel(); @@ -1235,7 +1243,7 @@ function getLinkSel( rel_mode ) { // If language is not supported, show the none-availability to the user. if( ! isLangSupported() ) { - if( rel_mode === 1 ) { + if( R_MODE === 1 ) { // Release mode. // Provide the link from the Native Language (NL) group. // LINK_FULL = LANG_ARRAY[ 4 ]; @@ -1355,9 +1363,6 @@ function getLinkSel( rel_mode ) { document.getElementById( "dl_rpt_img" ).src = "../cachedimages/help-report-broken-link-icon.png"; document.getElementById( "dl_rpt_img" ).title = "Broken download link? Click here to report."; document.getElementById( "dl_rpt_img" ).alt = "Broken link"; - document.getElementById( "dl_rpt" ).href = "analyze_droplist.html"; - document.getElementById( "dl_rpt" ).innerHTML = "Report broken link"; - document.getElementById( "dl_rpt" ).title = "Broken download link? Click here to report."; // Reset the CSS styles for the elements in the sub-green colored boxes. document.getElementById( "sub_green_box" ).style.background = "#E9FEBE"; // LightGreen @@ -1387,6 +1392,25 @@ function getLinkSel( rel_mode ) { document.getElementById( "dl_chk" ).style.cursor = "help"; document.getElementById( "dl_rpt_img" ).style.cursor = "help"; document.getElementById( "dl_rpt" ).style.cursor = "help"; + + // Set different values depending if in analyze mode or not + if( A_MODE === false ) { + document.getElementById( "dl_rpt" ).href = "analyze_droplist.html"; + document.getElementById( "dl_rpt" ).innerHTML = "Report broken link"; + document.getElementById( "dl_rpt" ).title = "Broken download link? Click here to report."; + } else { + + for( var i = 0, j = element_ids_sub_green.length; i < j; i++ ) { + document.getElementById( element_ids_sub_green[ i ] ).style.display = "none"; + } + + document.getElementById( "dl_rpt" ).style.fontSize = "1.6em"; + document.getElementById( "dl_rpt" ).href = "javascript:void( 0 )"; + document.getElementById( "dl_rpt" ).innerHTML = "Select your favorite options and click to update the table below"; + document.getElementById( "dl_rpt" ).title = "Update the values in the table below."; + document.getElementById( "dl_rpt_img" ).style.display = "none"; + document.getElementById( "dl_rpt" ).style.display = "inline-block"; + } } // alertDbg( "getLinkSel(): End" );