mozilla

Revision 533133 of Template:CompatGeckoDesktop

  • Revision slug: Template:CompatGeckoDesktop
  • Revision title: Template:CompatGeckoDesktop
  • Revision id: 533133
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

<% var fxVer = ''; var geckoVer = $0; var loca = mdn.localString({ 'en-US' : '1.7 or earlier', 'fr' : '1.7 ou moins' }); var date = {}; date["1.0"]="2004-11-11"; date["1.5"]="2005-11-25"; date["2.0"]="2006-10-24"; date["3.0"]="2008-06-17"; date["3.5"]="2009-06-30"; date["3.6"]="2010-01-21"; date["4.0"]="2011-03-22"; date["5.0"]="2011-06-21"; date["6.0"]="2011-08-16"; date["7.0"]="2011-09-26"; date["8.0"]="2011-11-08"; date["9.0"]="2011-12-20"; date["10.0"]="2012-01-31"; date["11.0"]="2012-03-13"; date["12.0"]="2012-04-24"; date["13.0"]="2012-06-05"; date["14.0"]="2012-07-17"; date["15.0"]="2012-08-28"; date["16.0"]="2012-10-09"; date["17.0"]="2012-11-20"; date["18.0"]="2013-01-08"; date["19.0"]="2013-09-02"; date["20.0"]="2013-04-02"; date["21.0"]="2013-05-14"; date["22.0"]="2013-06-25"; date["23.0"]="2013-08-06"; date["24.0"]="2013-09-17"; date["25.0"]="2013-10-29"; date["26.0"]="2013-12-10"; date["27.0"]="2014-02-04"; date["28.0"]="2014-03-18"; date["29.0"]="2014-04-29"; date["30.0"]="2014-06-10"; date["31.0"]="2014-07-22"; date["32.0"]="2014-09-02"; date["33.0"]="2014-10-14"; date["34.0"]="2014-11-25"; if ((geckoVer-0.0) >= 5) { fxVer = geckoVer; } else { switch(geckoVer) { case '1': case '1.0': case '1.7 or earlier': case '1.7': fxVer = '1.0'; geckoVer = loca; break; case '1.8': fxVer = '1.5'; break; case '1.8.1': fxVer = '2.0'; break; case '1.9': fxVer = '3.0'; break; case '1.9.1': fxVer = '3.5'; break; case '1.9.1.4': fxVer = '3.5.4'; break; case '1.9.2': fxVer = '3.6'; break; case '1.9.2.4': fxVer = '3.6.4'; break; case '1.9.2.5': fxVer = '3.6.5'; break; case '1.9.2.9': fxVer = '3.6.9'; break; case '2': case '2.0': fxVer = '4.0'; break; default: fxVer = 'Unknown'; } } release = fxVer - 0.0; // Convert to a number (so that when we convert back, it won't have the trailing '.0' if an integer. releaseDateStr = date[fxVer]; titleStr = ""; // Default value url = fxVer; // Default value if ((fxVer != "1.0") && (fxVer != "Unknown")) { // No release notes for 1.0 titleStr = mdn.localString( {"fr" : "Sorti le " + releaseDateStr + ".", "en-US" : "Released on " + releaseDateStr + "." }); url = ''+ fxVer + ''; } result = url + " (" + geckoVer + ")"; %> <%- result %>

Revision Source

<%

var fxVer = '';
var geckoVer = $0;

var loca = mdn.localString({
    'en-US' : '1.7 or earlier',
    'fr'    : '1.7 ou moins'
});

var date = {};
date["1.0"]="2004-11-11";
date["1.5"]="2005-11-25";
date["2.0"]="2006-10-24";
date["3.0"]="2008-06-17";
date["3.5"]="2009-06-30";
date["3.6"]="2010-01-21";
date["4.0"]="2011-03-22";
date["5.0"]="2011-06-21";
date["6.0"]="2011-08-16";
date["7.0"]="2011-09-26";
date["8.0"]="2011-11-08";
date["9.0"]="2011-12-20";
date["10.0"]="2012-01-31";
date["11.0"]="2012-03-13";
date["12.0"]="2012-04-24";
date["13.0"]="2012-06-05";
date["14.0"]="2012-07-17";
date["15.0"]="2012-08-28";
date["16.0"]="2012-10-09";
date["17.0"]="2012-11-20";
date["18.0"]="2013-01-08";
date["19.0"]="2013-09-02";
date["20.0"]="2013-04-02";
date["21.0"]="2013-05-14";
date["22.0"]="2013-06-25";
date["23.0"]="2013-08-06";
date["24.0"]="2013-09-17";
date["25.0"]="2013-10-29";
date["26.0"]="2013-12-10";
date["27.0"]="2014-02-04";
date["28.0"]="2014-03-18";
date["29.0"]="2014-04-29";
date["30.0"]="2014-06-10";
date["31.0"]="2014-07-22";
date["32.0"]="2014-09-02";
date["33.0"]="2014-10-14";
date["34.0"]="2014-11-25";

if ((geckoVer-0.0) >= 5) {
    fxVer = geckoVer;
}
else {
    switch(geckoVer) {
        case '1':
        case '1.0':
        case '1.7 or earlier':
        case '1.7':
            fxVer = '1.0';
            geckoVer = loca;
            break;
        case '1.8':
            fxVer = '1.5';
            break;
        case '1.8.1':
            fxVer = '2.0';
            break;
        case '1.9':
            fxVer = '3.0';
            break;
        case '1.9.1':
            fxVer = '3.5';
            break;
         case '1.9.1.4':
            fxVer = '3.5.4';
            break;
        case '1.9.2':
            fxVer = '3.6';
            break;
        case '1.9.2.4':
            fxVer = '3.6.4';
            break;
        case '1.9.2.5':
            fxVer = '3.6.5';
            break;
        case '1.9.2.9':
            fxVer = '3.6.9';
            break;
        case '2':
        case '2.0':
            fxVer = '4.0';
            break;
        default:
            fxVer = 'Unknown';
    }
}
release = fxVer - 0.0; // Convert to a number (so that when we convert back, it won't have the trailing '.0' if an integer.
releaseDateStr = date[fxVer];
titleStr = ""; // Default value
url = fxVer; // Default value
if ((fxVer != "1.0") && (fxVer != "Unknown")) { // No release notes for 1.0
    titleStr = mdn.localString(
        {"fr" : "Sorti le " + releaseDateStr + ".",
         "en-US" : "Released on " + releaseDateStr + "."
        });
    url = '<a href="/en-US/Firefox/Releases/' + release + '"'+ (titleStr?' title="'+titleStr+'"':'') + '>'+ fxVer + '</a>';
}
result = url + " (" + geckoVer + ")";
%>
<%- result %>