From: <ahe...@us...> - 2011-01-30 12:03:52
|
Revision: 15073 http://jmol.svn.sourceforge.net/jmol/?rev=15073&view=rev Author: aherraez Date: 2011-01-30 12:03:45 +0000 (Sun, 30 Jan 2011) Log Message: ----------- revised browser detection (after Jmol.js revision for Mac/Chrome change) Modified Paths: -------------- trunk/Jmol-web/source/doc/browsercheck/index.en.html trunk/Jmol-web/source/doc/browsercheck/index.es.html trunk/Jmol-web/source/doc/browsercheck/index.fr.html trunk/Jmol-web/source/doc/browsercheck/index.nl.html trunk/Jmol-web/source/doc/browsercheck/outdated.xml Added Paths: ----------- trunk/Jmol-web/source/doc/browsercheck/browsercheck.js Added: trunk/Jmol-web/source/doc/browsercheck/browsercheck.js =================================================================== --- trunk/Jmol-web/source/doc/browsercheck/browsercheck.js (rev 0) +++ trunk/Jmol-web/source/doc/browsercheck/browsercheck.js 2011-01-30 12:03:45 UTC (rev 15073) @@ -0,0 +1,100 @@ +/* Copyright (C) 2004-2011 The Jmol Development Team + * + * Contact: jmo...@li... + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307 USA. + */ +function firstUpperCase(x) { + return x.charAt(0).toUpperCase() + x.substring(1); +} +function testBrowser(candidate) { // similar to _jmolTestUA() in Jmol.js + var ua = _jmol.ua; + var index = ua.indexOf(candidate); + if (index < 0) { return false; } + browserName = candidate; + var t = ua.substring(index+candidate.length+1); + browserNameVersion = t.substring(0,t.indexOf(" ")); //this is a string, not a number; no comparisons with it! + return true; +} + +var msg = msgAcceptable; +var mozillaVersion = ""; +var javaVersion = 0; +var state = "yellow"; + +with (_jmol) { + if (browser == "mozilla" && browserVersion >= 5) { + var indexRV = ua.indexOf("rv:"); + if (indexRV > 0) { + var rv = ua.substring(indexRV + 3); + var indexEnd = rv.indexOf(")"); + var indexSemi = rv.indexOf(";"); + if (indexEnd < 0 || (indexSemi > 0 && indexSemi < indexEnd)) + indexEnd = indexSemi; + if (indexEnd > 0) + mozillaVersion = " " + rv.substring(0, indexEnd); + } + } + do { + // Non-compatible or troublesome browsers: + if (os == "mac" && browser == "mozilla" && browserVersion >= 5) { + eval("try{javaVersion=" + + "java.lang.System.getProperty('java.version');" + + "} catch (e) { }"); + if (javaVersion < 1.4) { + msg = msgMacMozillaOldJava + msgNoLiveConnectMac + + msgMacMozillaAlternative; + break; + } + } + if (! isJavaEnabled) { msg = msgGenericNoJava; state = "red"; break; } + if (! hasGetElementById) { msg = msgNoGetElementById; state = "red"; break; } + if (os == "mac" && browser == "msie") { msg = msgMacIE + msgNoLiveConnectMac; break; } + if (browser == "webkit" && browserVersion < 125.1) { msg = msgMacOldSafari + msgNoLiveConnectMac; break; } + if (os == "mac" && browser == "opera" && browserVersion <= 7.54) { msg = msgMacOpera754OrLess; state = "red"; break; } + if ((os == "linux" || os == "unix") && + browser == "konqueror" && browserVersion <= 3.3) { + msg = msgLinuxKonqueror331OrLess; state = "red"; break; + } + // Fully compliant browsers: + if ( (os == "win" && browser == "msie") || + (browser == "webkit" && browserVersion >= 412.2) || + (browser == "mozilla" && browserVersion >= 5) || + (browser == "opera" && browserVersion >= 7.54) ) { + msg = msgOK; state = "green"; break; + } + // Other cases default to acceptable, yellow + } while (false); // this 'loop' is here only to allow use of 'break' + + var osString = os; /* for a more meaningful display */ + if (osString=="win") { osString = "Windows"; } + else if (osString=="linux") { osString = "Linux"; } + else if (osString=="unix") { osString = "Unix"; } + else if (osString=="mac") { osString = "MacOS"; } + else { osString = firstUpperCase(osString); } + + var browserName = browser, browserNameVersion = browserVersion; /* for a more meaningful display */ + if ( browserName=="mozilla" && browserVersion >= 5 ) { + /* Mozillas are always Mozilla/5; the browserVersion=5 is hence irrelevant as version nr. + All details are shown in UA anyway, so I'll put here the most user-friendly string */ + testBrowser("firefox") || testBrowser("seamonkey"); //instead of Mozilla data + if (browserName=="mozilla") { browserNameVersion = mozillaVersion; } + } + else if ( browserName=="webkit" ) { testBrowser("chrome") || testBrowser("epiphany") || testBrowser("safari"); } + else if ( browserName=="msie") { testBrowser("msie"); browserName = "Internet Explorer"; } + if ( browserName=="safari" && testBrowser("version") ) { browserName="safari"; } //display Safari version instead of WebKit version + var browserString = firstUpperCase(browserName) + " " + browserNameVersion; + } Modified: trunk/Jmol-web/source/doc/browsercheck/index.en.html =================================================================== --- trunk/Jmol-web/source/doc/browsercheck/index.en.html 2011-01-30 12:02:14 UTC (rev 15072) +++ trunk/Jmol-web/source/doc/browsercheck/index.en.html 2011-01-30 12:03:45 UTC (rev 15073) @@ -1,3 +1,4 @@ +<html> <!-- /* $RCSfile$ * $Author$ @@ -3,9 +4,13 @@ * $Date$ * $Revision$ + * Revised aHerraez, 29 Jan. 2011: + * - better browser name detection and display (accompanying a revision in Jmol.js) + * - added output source code from Jmol.js + * - code extracted to JS file (common for all languages) * A few changes by aHerraez 1-4 oct. 2008: * - fix: no message was being shown for compatible browsers * - more user-friendly browser name and OS name displayed * - * Copyright (C) 2004-2008 The Jmol Development Team + * Copyright (C) 2004-2011 The Jmol Development Team * * Contact: jmo...@li... @@ -27,44 +32,10 @@ * 02111-1307 USA. */ --> -<html> <head> <title>Jmol Browser Check</title> - <script type="text/javascript" src="../jmol/Jmol.js"></script> - </head> - <body> - <img src="../images/Jmol_smallLogo.jpg" /> - <hr /> - <h1>Jmol Browser Check</h1> - <h2>Background information:</h2> - <blockquote> - <p> - The Jmol applet requires a web browser that supports Java applets. - </p> - <p> - In addition, most web pages using the Jmol applet - include HTML controls (buttons, - checkboxes, etc.) that send scripts to control the Jmol applet. - In order for these controls to function properly the web browser - must also support JavaScript and LiveConnect communications - between JavaScript and Java applets. - </p> - </blockquote> - - <h2> - Results of testing your browser: - </h2> - <script type="text/javascript"> - var msgNetscape47Win = - "<p>While Jmol generally supports Netscape 4.7 on Windows, there are <b>some " + - "small problem</b> areas related to mouse events and occasional " + - "JavaScript/LiveConnect issues. </p>" + - "<p>In addition, the state of the applet does not get reset when " + - "a web page gets reloaded, sometimes causing html checkboxes " + - "and radio buttons to be out of synch with the applet appearance. </p>" + - "<p>We <b>recommend</b> that you consider upgrading " + - "to a newer web browser. </p>"; - + <script src="../jmol/Jmol.js" type="text/javascript"></script> + <script type="text/javascript"> var msgNoGetElementById = "<p>This seems to be an older web browser that does not support " + "current browser standards. Jmol and/or the buttons to control Jmol " + @@ -79,11 +50,6 @@ "<img border='0' src='get_java_red_button.gif' /></a>." + "</p>"; - var msgGenericOK = - "<p>Your web browser seems to <b>properly support</b> Jmol. </p>" + - "<p>If you do encounter problems please report them to " + - "<code>jmo...@li...</code></p>"; - var msgNoLiveConnectMac = "<p>The Jmol applet itself <b>will function properly</b>. " + "However, web pages constructed with HTML controls such as " + @@ -129,107 +95,57 @@ "you can use a Mozilla family browser.</p>"; var msgOK = - "<p>Your browser seems <b>compliant</b> with Jmol.</p>" + + "<p>Your browser seems to <b>properly support</b> Jmol.</p>" + "<p>If you do experience problems with Jmol running in your browser " + " please report them to " + - "<code>jmo...@li...</code></p>"; + "<code>jmo...@li...</code> with a copy of this page.</p>"; - var msg = ""; - var mozillaVersion = ""; - var javaVersion = 0; - var state = "yellow"; + var msgAcceptable = + "<p>Your browser <b>probably supports</b> Jmol.</p>" + + "<p>If you do experience problems with Jmol running in your browser " + + " please report them to " + + "<code>jmo...@li...</code> with a copy of this page</p>"; + </script> + <script src="browsercheck.js" type="text/javascript"></script> + </head> + <body> + <img src="../images/Jmol_smallLogo.jpg" /> + <hr /> + <h1>Jmol Browser Check</h1> + <h2>Background information:</h2> + <blockquote> + <p> + The Jmol applet requires a web browser that supports Java applets. + </p> + <p> + In addition, most web pages using the Jmol applet + include HTML controls (buttons, + checkboxes, etc.) that send scripts to control the Jmol applet. + In order for these controls to function properly the web browser + must also support JavaScript and LiveConnect communications + between JavaScript and Java applets. + </p> + </blockquote> - with (_jmol) { - if (browser == "mozilla" && browserVersion >= 5) { - var indexRV = ua.indexOf("rv:"); - if (indexRV > 0) { - var rv = ua.substring(indexRV + 3); - var indexEnd = rv.indexOf(")"); - var indexSemi = rv.indexOf(";"); - if (indexEnd < 0 || (indexSemi > 0 && indexSemi < indexEnd)) - indexEnd = indexSemi; - if (indexEnd > 0) - mozillaVersion = " " + rv.substring(0, indexEnd); - } - } - do { - if (isNetscape47Win) - { msg = msgNetscape47Win; break; } - if (os == "mac" && browser == "mozilla" && browserVersion >= 5) { - eval("try{javaVersion=" + - "java.lang.System.getProperty('java.version');" + - "} catch (e) { }"); - if (javaVersion < 1.4) { - msg = msgMacMozillaOldJava + msgNoLiveConnectMac + - msgMacMozillaAlternative; - break; - } - } - if (! isJavaEnabled) - { msg = msgGenericNoJava; state = "red"; break; } - if (! hasGetElementById) - { msg = msgNoGetElementById; state = "red"; break; } - if (os == "mac" && browser == "msie") - { msg = msgMacIE + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "safari" && browserVersion < 125.1) - { msg = msgMacOldSafari + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "opera" && browserVersion <= 7.54) - { msg = msgMacOpera754OrLess; state = "red"; break; } - if ((os == "win" && browser == "msie") || - (os == "win" && browser == "mozilla" && browserVersion >= 5) || - (os == "win" && browser == "opera" && browserVersion >= 7.54) || - ((os == "linux" || os == "unix") && - browser == "mozilla" && browserVersion >= 5)) - { state = "green"; break; } - if ((os == "linux" || os == "unix") && - browser == "konqueror" && browserVersion <= 3.3) - { msg = msgLinuxKonqueror331OrLess; state = "red"; break; } - } while (false); // this 'loop' is here only to allow use of 'break' - - var osString = os; /* for a more meaningful display */ - if (osString=="win") { osString = "Windows" } - else if (osString=="linux") { osString = "Linux" } - else if (osString=="unix") { osString = "Unix" } - else if (osString=="mac") { osString = "MacOS" } - - var browserString; - var Ffox = navigator.userAgent.indexOf("Firefox"); - if ( browser=="mozilla") - { /* Mozillas are always Mozilla/5; the browserVersion=5 is hence irrelevant as version nr. - All details are shown in UA anyway, so I'll put here the most user-friendly string */ - if (Ffox!=-1) - { browser = "Firefox"; - browserVersion = navigator.userAgent.substring(Ffox + "Firefox/".length); - browserString = browser + " " + browserVersion; - } - else - { browserVersion = mozillaVersion; - browserString = browser + " " + browserVersion; - } - } - else if ( browser=="msie") - { browser = "Internet Explorer"; - browserString = browser + " " + browserVersion; - } - else - { browserString = browser + " " + browserVersion + mozillaVersion; /* default */ - } - - document.writeln("<p><big>Your web browser seems to be " + - "<i>" + browserString + "</i>" + - " running on <i>" + osString + "</i></big></p>"); - document.writeln("<table border='0'>" + - "<tr><td bgcolor='" + state + "'> " + - "</td><td>"); - if (msg == "") msg = msgOK; - document.writeln(msg); - document.writeln("</td></tr></table>"); - } + <h2> + Results of testing your browser: + </h2> + <noscript> + Either the browser does not support Javascript, or its use has been disabled.<br> + Javascript must be enabled in your browser for the Jmol applets to work. + </noscript> + <script type="text/javascript"> + var tx = "<p><big>Your web browser seems to be " + + "<i>" + browserString + "</i>" + + " running on <i>" + osString + "</i></big></p>" + + "<table border='0'><tr>" + + "<td bgcolor='" + state + "' width='40'> </td>" + + "<td>" + msg + "</td>"+ + "</tr></table>" + document.writeln(tx); </script> - <p> - <b>Details:</b> - </p> + <h3>Browser details:</h3> <table border="1" cellpadding="5" cellspacing="0"> <tr> <td>Operating System</td> @@ -241,7 +157,7 @@ </tr> <tr> <td> - Web browser + Web browser family </td> <td> <script type="text/javascript"> @@ -251,7 +167,7 @@ </tr> <tr> <td> - Browser version + Browser family version </td> <td> <script type="text/javascript"> @@ -261,7 +177,8 @@ </tr> <tr> <td> - navigator.userAgent + Specific browser<br /> + [ navigator.userAgent ] </td> <td> <script type="text/javascript"> @@ -271,7 +188,8 @@ </tr> <tr> <td> - has getElementById() + Uses the DOM<br /> + [ has getElementById() ] </td> <td> <script type="text/javascript"> @@ -280,8 +198,9 @@ </td> </tr> <tr> - <td> - navigator.javaEnabled() + <td nowrap> + Can use Java<br /> + [ navigator.javaEnabled() ] </td> <td> <script type="text/javascript"> @@ -290,6 +209,13 @@ </td> </tr> </table> - <br /> + + <h3>Code produced by Jmol.js:</h3> + <script type="text/javascript"> + jmolInitialize("."); + jmolSetDocument(false); + document.write( "<textarea cols='100' rows='15' style='width:95%; height:15em;'>"+ jmolApplet(200) +"</textarea>" ); + </script> + </body> </html> Modified: trunk/Jmol-web/source/doc/browsercheck/index.es.html =================================================================== --- trunk/Jmol-web/source/doc/browsercheck/index.es.html 2011-01-30 12:02:14 UTC (rev 15072) +++ trunk/Jmol-web/source/doc/browsercheck/index.es.html 2011-01-30 12:03:45 UTC (rev 15073) @@ -1,3 +1,4 @@ +<html lang="es"> <!-- /* $RCSfile$ * $Author$ @@ -3,9 +4,13 @@ * $Date$ * $Revision$ + * Revised aHerraez, 29 Jan. 2011: + * - better browser name detection and display (accompanying a revision in Jmol.js) + * - added output source code from Jmol.js + * - code extracted to JS file (common for all languages) * A few changes by aHerraez 1-4 oct. 2008: * - fix: no message was being shown for compatible browsers * - more user-friendly browser name and OS name displayed * - * Copyright (C) 2004-2008 The Jmol Development Team + * Copyright (C) 2004-2011 The Jmol Development Team * * Contact: jmo...@li... @@ -31,210 +36,120 @@ Spanish translation Translated from default version : index.en.html (v 1.1 --> -<html> <head> - <title>Verificaci\xF3n del navegador para Jmol</title> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Verificación del navegador para Jmol</title> <script src="../jmol/Jmol.js"></script> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> - </head> - <body> - <img src="../images/Jmol_smallLogo.jpg" /> - <hr /> - <h1>Verificaci\xF3n del navegador para Jmol</h1> - <h2>Informaci\xF3n de base:</h2> - <blockquote> - <p> - La miniaplicaci\xF3n Jmol requiere un navegador web compatible con miniaplicaciones Java (<i>applets</i>). - </p> - <p> - Adem\xE1s, la mayor\xEDa de p\xE1ginas web que usan la miniaplicaci\xF3n Jmol - incluyen controles HTML (botones, casillas de selecci\xF3n, etc.) - que env\xEDan instrucciones de control a Jmol. - Para que estos controles funcionen, el navegador web - debe tambi\xE9n reconocer JavaScript y la comunicaci\xF3n LiveConnect - entre JavaScript y Java. - </p> - </blockquote> - - <h2> - Resultados obtenidos con tu navegador: - </h2> - <script type="text/javascript"> - var msgNetscape47Win = - "<p>Aunque en general Jmol es compatible con Netscape 4.7 en Windows, hay <b>algunos " + - "peque\xF1os problemas</b> relativos a eventos del rat\xF3n y ocasionalmente " + - "a JavaScript/LiveConnect. </p>" + - "<p>Adem\xE1s, el estado de la miniaplicaci\xF3n no se reinicia cuando " + - "se recarga la p\xE1gina web, lo cual en ocasiones hace que las casillas de selecci\xF3n " + - "y botones de opci\xF3n queden desincronizados con el aspecto de la miniaplicaci\xF3n. </p>" + - "<p><b>Recomendamos</b> que consideres la posibilidad de actualizar " + - "a un navegador m\xE1s moderno. </p>"; - + <script type="text/javascript"> var msgNoGetElementById = "<p>Aparentemente, este navegador no es compatible " + - "con los est\xE1ndares de los navegadores modernos. Probablemente, Jmol o los botones que lo controlan " + + "con los estándares de los navegadores modernos. Probablemente, Jmol o los botones que lo controlan " + "<b>no funcionen</b> adecuadamente en este navegador. Se <b>recomienda</b> " + "que actualices el navegador. </p>"; var msgGenericNoJava = - "<p>El naveagdor web informa de que Java no est\xE1 activado. " + - "La miniaplicaci\xF3n Jmol <b>requiere</b> apoyo de Java desde el navegador.<br />" + + "<p>El naveagdor web informa de que Java no está activado. " + + "La miniaplicación Jmol <b>requiere</b> apoyo de Java desde el navegador.<br />" + "Por favor, <b>configura</b> el navegador para que active Java o <b>descarga</b> Java desde " + "<a href='http://www.java.com' target='_blank'>www.java.com " + "<img border='0' src='get_java_red_button.gif' /></a>." + "</p>"; - var msgGenericOK = - "<p>El navegador parece <b>compatible</b> con Jmol. </p>" + - "<p>Si encuentras problemas, por favor informa de ellos a " + - "<code>jmo...@li...</code></p>"; - var msgNoLiveConnectMac = - "<p>La miniaplicaci\xF3n Jmol <b>funcionar\xE1</b> adecuadamente. " + - "Sin embargo, las p\xE1ginas web que contengan controls HTML tales como " + - "botones, casillas de selecci\xF3n y enlaces <b>no funcionar\xE1n</b> adecuadamente porque " + + "<p>La miniaplicación Jmol <b>funcionará</b> adecuadamente. " + + "Sin embargo, las páginas web que contengan controls HTML tales como " + + "botones, casillas de selección y enlaces <b>no funcionarán</b> adecuadamente porque " + "los controles no pueden enviar las instrucciones a Jmol.</p>" + "<p><b>Se recomienda</b> que consideres la posibilidadv de utilizar Safari u otro " + - "navegador Macintosh que admita la comunicaci\xF3n LiveConnect entre " + + "navegador Macintosh que admita la comunicación LiveConnect entre " + "JavaScript y Java.</p>"; var msgMacIE = "<p>Microsoft Internet Explorer en Macintosh <b>no admite</b> " + - "la comunicaci\xF3n LiveConnect entre JavaScript y Java. </p>"; + "la comunicación LiveConnect entre JavaScript y Java. </p>"; var msgMacOldSafari = "<p>Las versiones antiguas de Safari <b>no admiten</b> " + - "la comunicaci\xF3n LiveConnect entre JavaScript y Java. </p>"; + "la comunicación LiveConnect entre JavaScript y Java. </p>"; var msgMacMozillaOldJava = "<p>Netscape/Mozilla/FireFox en Macintosh no tiene acceso a " + - "la \xFAltima versi\xF3n de Java y por ello <b>no es compatible</b> con " + - "la comunicaci\xF3n LiveConnect entre JavaScript y Java. </p>"; + "la última versión de Java y por ello <b>no es compatible</b> con " + + "la comunicación LiveConnect entre JavaScript y Java. </p>"; var msgMacMozillaAlternative = - "<p>Puedes tambi\xE9n <b>intentar</b> instalar el conector Java "+ + "<p>Puedes también <b>intentar</b> instalar el conector Java "+ "Plug-in para Macintosh OS X desde" + "<a href='http://javaplugin.sourceforge.net' target='_blank'>" + "javaplugin.sourceforge.net</a>"; var msgMacOpera754OrLess = - "<p>Esta versi\xF3n de Opera en Macintosh aparentemente tiene <b>problemas</b> " + + "<p>Esta versión de Opera en Macintosh aparentemente tiene <b>problemas</b> " + "para ejecutar miniaplicaciones. </p>" + "<b>Se recomienda</b> que cosideres la posibilidad de emplear Safari u otro " + - "navegador Macintosh que ejecute con garant\xEDas las miniaplicaciones Java y admita " + - "la comunicaci\xF3n LiveConnect entre JavaScript y Java. </p>"; + "navegador Macintosh que ejecute con garantías las miniaplicaciones Java y admita " + + "la comunicación LiveConnect entre JavaScript y Java. </p>"; var msgLinuxKonqueror331OrLess = "<p>Todas las versiones de Konqueror bajo Linux/Unix hasta la 3.3.1 tienen " + - "<b>anomal\xEDas</b> en la compatibilidad con Java. " + + "<b>anomalías</b> en la compatibilidad con Java. " + "El equipo de Jmol ha enviado informes de fallo al equipo Konqueror y " + - "\xE9ste los est\xE1 considerando.</p>" + - "<p>Es posible que en una versi\xF3n de Konqueror posterior a la 3.3.1 " + + "éste los está considerando.</p>" + + "<p>Es posible que en una versión de Konqueror posterior a la 3.3.1 " + "se haya solucionado el problema. Alternativamente, " + "puedes utilizar un navegador de la familia Mozilla.</p>"; var msgOK = - "<p>El navegador parece ser <b>compatible</b> con Jmol.</p>" + + "<p>El navegador parece <b>compatible</b> con Jmol.</p>" + "<p>Si encuentras problemas con Jmol en este navegador, " + "por favor informa de ellos a " + - "<code>jmo...@li...</code></p>"; + "<code>jmo...@li...</code> con una copia de esta página.</p>"; - var msg = ""; - var mozillaVersion = ""; - var javaVersion = 0; - var state = "yellow"; + var msgAcceptable = + "<p>El navegador es <b>probablemente compatible</b> con Jmol. </p>" + + "<p>Si encuentras problemas con Jmol en este navegador, por favor informa de ellos a " + + "<code>jmo...@li...</code> con una copia de esta página.</p>"; + </script> + <script src="browsercheck.js" type="text/javascript"></script> + </head> + <body> + <img src="../images/Jmol_smallLogo.jpg" /> + <hr /> + <h1>Verificación del navegador para Jmol</h1> + <h2>Información de base:</h2> + <blockquote> + <p> + La miniaplicación Jmol requiere un navegador web compatible con miniaplicaciones Java (<i>applets</i>). + </p> + <p> + Además, la mayoría de páginas web que usan la miniaplicación Jmol + incluyen controles HTML (botones, casillas de selección, etc.) + que envían instrucciones de control a Jmol. + Para que estos controles funcionen, el navegador web + debe también reconocer JavaScript y la comunicación LiveConnect + entre JavaScript y Java. + </p> + </blockquote> - with (_jmol) { - if (browser == "mozilla" && browserVersion >= 5) { - var indexRV = ua.indexOf("rv:"); - if (indexRV > 0) { - var rv = ua.substring(indexRV + 3); - var indexEnd = rv.indexOf(")"); - var indexSemi = rv.indexOf(";"); - if (indexEnd < 0 || (indexSemi > 0 && indexSemi < indexEnd)) - indexEnd = indexSemi; - if (indexEnd > 0) - mozillaVersion = " " + rv.substring(0, indexEnd); - } - } - do { - if (isNetscape47Win) - { msg = msgNetscape47Win; break; } - if (os == "mac" && browser == "mozilla" && browserVersion >= 5) { - eval("try{javaVersion=" + - "java.lang.System.getProperty('java.version');" + - "} catch (e) { }"); - if (javaVersion < 1.4) { - msg = msgMacMozillaOldJava + msgNoLiveConnectMac + - msgMacMozillaAlternative; - break; - } - } - if (! isJavaEnabled) - { msg = msgGenericNoJava; state = "red"; break; } - if (! hasGetElementById) - { msg = msgNoGetElementById; state = "red"; break; } - if (os == "mac" && browser == "msie") - { msg = msgMacIE + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "safari" && browserVersion < 125.1) - { msg = msgMacOldSafari + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "opera" && browserVersion <= 7.54) - { msg = msgMacOpera754OrLess; state = "red"; break; } - if ((os == "win" && browser == "msie") || - (os == "win" && browser == "mozilla" && browserVersion >= 5) || - (os == "win" && browser == "opera" && browserVersion >= 7.54) || - ((os == "linux" || os == "unix") && - browser == "mozilla" && browserVersion >= 5)) - { state = "green"; break; } - if ((os == "linux" || os == "unix") && - browser == "konqueror" && browserVersion <= 3.3) - { msg = msgLinuxKonqueror331OrLess; state = "red"; break; } - } while (false); // this 'loop' is here only to allow use of 'break' - - var osString = os; /* for a more meaningful display */ - if (osString=="win") { osString = "Windows" } - else if (osString=="linux") { osString = "Linux" } - else if (osString=="unix") { osString = "Unix" } - else if (osString=="mac") { osString = "MacOS" } - - var browserString; - var Ffox = navigator.userAgent.indexOf("Firefox"); - if ( browser=="mozilla") - { /* Mozillas are always Mozilla/5; the browserVersion=5 is hence irrelevant as version nr. - All details are shown in UA anyway, so I'll put here the most user-friendly string */ - if (Ffox!=-1) - { browser = "Firefox"; - browserVersion = navigator.userAgent.substring(Ffox + "Firefox/".length); - browserString = browser + " " + browserVersion; - } - else - { browserVersion = mozillaVersion; - browserString = browser + " " + browserVersion; - } - } - else if ( browser=="msie") - { browser = "Internet Explorer"; - browserString = browser + " " + browserVersion; - } - else - { browserString = browser + " " + browserVersion + mozillaVersion; /* default */ - } - - document.writeln("<p><big>Tu navegador web es, aparentemente, " + - "<i>" + browserString + "</i>" + - " sobre <i>" + osString + "</i></big></p>"); - document.writeln("<table border='0'>" + - "<tr><td bgcolor='" + state + "'> " + - "</td><td>"); - if (msg == "") msg = msgOK; - document.writeln(msg); - document.writeln("</td></tr></table>"); - } + <h2> + Resultados obtenidos con tu navegador: + </h2> + <noscript> + El navegador no es compatible con Javascript, o bien se ha desactivado su uso.<br> + Javascript debe estar activado en el navegador para que funcionen las miniaplicacines Jmol. + </noscript> + <script type="text/javascript"> + var tx = "<p><big>Tu navegador web es, aparentemente, " + + "<i>" + browserString + "</i>" + + " sobre <i>" + osString + "</i></big></p>" + + "<table border='0'><tr>" + + "<td bgcolor='" + state + "' width='40'> </td>" + + "<td>" + msg + "</td>"+ + "</tr></table>" + document.writeln(tx); </script> - <p> - <b>Detalles:</b> - </p> + <h3>Detalles del navegador:</h3> <table border="1" cellpadding="5" cellspacing="0"> <tr> <td>Sistema operativo</td> @@ -246,7 +161,7 @@ </tr> <tr> <td> - Navegador web + Familia de navegador web </td> <td> <script type="text/javascript"> @@ -256,7 +171,7 @@ </tr> <tr> <td> - Versi\xF3n del navegador + Versión de la familia del navegador </td> <td> <script type="text/javascript"> @@ -266,7 +181,8 @@ </tr> <tr> <td> - navigator.userAgent + Navegador concreto<br /> + [ navigator.userAgent ] </td> <td> <script type="text/javascript"> @@ -276,7 +192,8 @@ </tr> <tr> <td> - tiene getElementById() + Utiliza el DOM<br /> + [ tiene getElementById() ] </td> <td> <script type="text/javascript"> @@ -285,8 +202,9 @@ </td> </tr> <tr> - <td> - navigator.javaEnabled() + <td nowrap> + Puede usar Java<br /> + [ navigator.javaEnabled() ] </td> <td> <script type="text/javascript"> @@ -295,6 +213,13 @@ </td> </tr> </table> - <br /> + + <h3>Código producido por Jmol.js:</h3> + <script type="text/javascript"> + jmolInitialize("."); + jmolSetDocument(false); + document.write( "<textarea cols='100' rows='15' style='width:95%; height:15em;'>"+ jmolApplet(200) +"</textarea>" ); + </script> + </body> </html> Modified: trunk/Jmol-web/source/doc/browsercheck/index.fr.html =================================================================== --- trunk/Jmol-web/source/doc/browsercheck/index.fr.html 2011-01-30 12:02:14 UTC (rev 15072) +++ trunk/Jmol-web/source/doc/browsercheck/index.fr.html 2011-01-30 12:03:45 UTC (rev 15073) @@ -1,3 +1,4 @@ +<html lang="fr"> <!-- /* $RCSfile$ * $Author$ @@ -3,9 +4,13 @@ * $Date$ * $Revision$ + * Revised aHerraez, 29 Jan. 2011: + * - better browser name detection and display (accompanying a revision in Jmol.js) + * - added output source code from Jmol.js + * - code extracted to JS file (common for all languages) * A few changes by aHerraez 1-4 oct. 2008: * - fix: no message was being shown for compatible browsers * - more user-friendly browser name and OS name displayed * - * Copyright (C) 2004-2008 The Jmol Development Team + * Copyright (C) 2004-2011 The Jmol Development Team * * Contact: jmo...@li... @@ -31,44 +36,10 @@ French translation Translated from default version : index.en.html (v 1.1) --> -<html lang="fr"> <head> <title>Jmol - Vérification du Navigateur</title> <script src="../jmol/Jmol.js"></script> - </head> - <body> - <img src="../images/Jmol_smallLogo.jpg" /> - <hr /> - <h1>Jmol - Vérification du Navigateur</h1> - <h2>Informations de contexte:</h2> - <blockquote> - <p> - L'applet Jmol a besoin d'un navigateur web qui supporte les applets Java. - </p> - <p> - De plus, la plupart des pages web qui utilisent l'applet Jmol incluent des - contrôles HTML (boutons, cases à cocher, ...) qui envoient des - scripts pour contrôler l'applet Jmol. Pour que ces contrôles - fonctionnent normalement le navigateur doit aussi supporter JavaScript et les - communications LiveConnect entre JavaScript et les applets Java. - </p> - </blockquote> - - <h2> - Résultats d'examiner votre navigateur web: - </h2> - <script type="text/javascript"> - var msgNetscape47Win = - "<p>Bien que Jmol supporte normalement Netscape 4.7 sous Windows, il semble y avoir " + - "de <b>petits problémes</b> liès aux èvènements souris " + - "et des problèmes occasionnels JavaScript/LiveConnect. </p>" + - "<p>De plus, l'ètat de l'applet n'est pas rèinitialisè " + - "quand une page web est rechargèe, ce qui entraîne parfois que " + - "les cases à cocher et les boutons radio ne correspondent plus à " + - "l'apparaence de l'applet. </p>" + - "<p>Nous <b>vous recommandons</b> de penser à passer à un navigateur " + - "plus récent. </p>"; - + <script type="text/javascript"> var msgNoGetElementById = "<p>Il semble que ce soit un ancien navigateur web qui ne supporte pas les " + "standards actuels des navigateurs. Jmol et/ou les boutons qui " + @@ -84,11 +55,6 @@ "<img border='0' src='get_java_red_button.gif' /></a>. " + "</p>"; - var msgGenericOK = - "<p>Votre navigateur web semble <b>supporter correctement</b> Jmol. </p>" - "<p>Si vous rencontrez des problèmes, veuillez les indiquer à " - "<code>jmo...@li...</code></p>"; - var msgNoLiveConnectMac = "<p>L'applet Jmol elle-m&x00EA;me <b>fonctionnera correctement</b>. " + "Néanmoins, les pages web construites avec des contrôles " + @@ -135,109 +101,57 @@ "navigateur de la famille Mozilla.</p>"; var msgOK = - "<p>Votre navigateur semble être <b>compatible</b> avec Jmol.</p>" + + "<p>Votre navigateur semble <b>supporter correctement</b> Jmol.</p>" + "<p>Si vous rencontrez des problèmes avec Jmol " + "s'exécutant dans votre navigateur, veuillez nous avertir " + "à " + "<code>jmo...@li...</code></p>"; - var msg = ""; - var mozillaVersion = ""; - var javaVersion = 0; - var state = "yellow"; - - with (_jmol) { - if (browser == "mozilla" && browserVersion >= 5) { - var indexRV = ua.indexOf("rv:"); - if (indexRV > 0) { - var rv = ua.substring(indexRV + 3); - var indexEnd = rv.indexOf(")"); - var indexSemi = rv.indexOf(";"); - if (indexEnd < 0 || (indexSemi > 0 && indexSemi < indexEnd)) - indexEnd = indexSemi; - if (indexEnd > 0) - mozillaVersion = " " + rv.substring(0, indexEnd); - } - } - do { - if (isNetscape47Win) - { msg = msgNetscape47Win; break; } - if (os == "mac" && browser == "mozilla" && browserVersion >= 5) { - eval("try{javaVersion=" + - "java.lang.System.getProperty('java.version');" + - "} catch (e) { }"); - if (javaVersion < 1.4) { - msg = msgMacMozillaOldJava + msgNoLiveConnectMac + - msgMacMozillaAlternative; - break; - } - } - if (! isJavaEnabled) - { msg = msgGenericNoJava; state = "red"; break; } - if (! hasGetElementById) - { msg = msgNoGetElementById; state = "red"; break; } - if (os == "mac" && browser == "msie") - { msg = msgMacIE + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "safari" && browserVersion < 125.1) - { msg = msgMacOldSafari + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "opera" && browserVersion <= 7.54) - { msg = msgMacOpera754OrLess; state = "red"; break; } - if ((os == "win" && browser == "msie") || - (os == "win" && browser == "mozilla" && browserVersion >= 5) || - (os == "win" && browser == "opera" && browserVersion >= 7.54) || - ((os == "linux" || os == "unix") && - browser == "mozilla" && browserVersion >= 5)) - { state = "green"; break; } - if ((os == "linux" || os == "unix") && - browser == "konqueror" && browserVersion <= 3.3) - { msg = msgLinuxKonqueror331OrLess; state = "red"; break; } - } while (false); // this 'loop' is here only to allow use of 'break' - - var osString = os; /* for a more meaningful display */ - if (osString=="win") { osString = "Windows" } - else if (osString=="linux") { osString = "Linux" } - else if (osString=="unix") { osString = "Unix" } - else if (osString=="mac") { osString = "MacOS" } - - var browserString; - var Ffox = navigator.userAgent.indexOf("Firefox"); - if ( browser=="mozilla") - { /* Mozillas are always Mozilla/5; the browserVersion=5 is hence irrelevant as version nr. - All details are shown in UA anyway, so I'll put here the most user-friendly string */ - if (Ffox!=-1) - { browser = "Firefox"; - browserVersion = navigator.userAgent.substring(Ffox + "Firefox/".length); - browserString = browser + " " + browserVersion; - } - else - { browserVersion = mozillaVersion; - browserString = browser + " " + browserVersion; - } - } - else if ( browser=="msie") - { browser = "Internet Explorer"; - browserString = browser + " " + browserVersion; - } - else - { browserString = browser + " " + browserVersion + mozillaVersion; /* default */ - } - - - document.writeln("<p><big>Votre navigateur web semble être " + - "<i>" + browserString + "</i>" + - " tournant sur <i>" + osString + "</i></big></p>"); - document.writeln("<table border='0'>" + - "<tr><td bgcolor='" + state + "'> " + - "</td><td>"); - if (msg == "") msg = msgOK; - document.writeln(msg); - document.writeln("</td></tr></table>"); - } + var msgAcceptable = + "<p>Your browser <b>probably supports</b> Jmol.</p>" + + "<p>If you do experience problems with Jmol running in your browser " + + " please report them to " + + "<code>jmo...@li...</code> with a copy of this page</p>"; + </script> + <script src="browsercheck.js" type="text/javascript"></script> + </head> + <body> + <img src="../images/Jmol_smallLogo.jpg" /> + <hr /> + <h1>Jmol - Vérification du Navigateur</h1> + <h2>Informations de contexte:</h2> + <blockquote> + <p> + L'applet Jmol a besoin d'un navigateur web qui supporte les applets Java. + </p> + <p> + De plus, la plupart des pages web qui utilisent l'applet Jmol incluent des + contrôles HTML (boutons, cases à cocher, ...) qui envoient des + scripts pour contrôler l'applet Jmol. Pour que ces contrôles + fonctionnent normalement le navigateur doit aussi supporter JavaScript et les + communications LiveConnect entre JavaScript et les applets Java. + </p> + </blockquote> + + <h2> + Résultats d'examiner votre navigateur web: + </h2> + <noscript> + Either the browser does not support Javascript, or its use has been disabled.<br> + Javascript must be enabled in your browser for the Jmol applets to work. + </noscript> + <script type="text/javascript"> + var tx = "<p><big>Votre navigateur web semble être " + + "<i>" + browserString + "</i>" + + " tournant sur <i>" + osString + "</i></big></p>" + + "<table border='0'><tr>" + + "<td bgcolor='" + state + "' width='40'> </td>" + + "<td>" + msg + "</td>"+ + "</tr></table>" + document.writeln(tx); </script> - <p> - <b>Détails:</b> - </p> + <h3>Détails du Navigateur:</h3> <table border="1" cellpadding="5" cellspacing="0"> <tr> <td>Système d'exploitation</td> @@ -298,6 +212,13 @@ </td> </tr> </table> - <br /> + + <h3>Code produced by Jmol.js:</h3> + <script type="text/javascript"> + jmolInitialize("."); + jmolSetDocument(false); + document.write( "<textarea cols='100' rows='15' style='width:95%; height:15em;'>"+ jmolApplet(200) +"</textarea>" ); + </script> + </body> </html> Modified: trunk/Jmol-web/source/doc/browsercheck/index.nl.html =================================================================== --- trunk/Jmol-web/source/doc/browsercheck/index.nl.html 2011-01-30 12:02:14 UTC (rev 15072) +++ trunk/Jmol-web/source/doc/browsercheck/index.nl.html 2011-01-30 12:03:45 UTC (rev 15073) @@ -1,3 +1,4 @@ +<html> <!-- /* $RCSfile$ * $Author$ @@ -31,42 +32,10 @@ Dutch translation Translated from default version : index.en.html (v 1.1) --> -<html> <head> <title>Jmol Browser Controle</title> <script src="../jmol/Jmol.js"></script> - </head> - <body> - <img src="../images/Jmol_smallLogo.jpg" /> - <hr /> - <h1>Jmol Browser Controle</h1> - <h2>Informatie van context:</h2> - <blockquote> - <p> - De Jmol applet vereist een browser die Java applets ondersteunt. - </p> - <p> - De meeste websites die de Jmol applet gebruiken voegen HTML controlemiddelen toe - (knoppen, aanvinkvakjes, enz.) die scripts versturen om de Jmol applet te besturen. - Om deze besturing goed te laten werken moet de browser eveneens JavaScript en LiveConnect - communicatie tussen JavaScript en Java applets ondersteunen. - </p> - </blockquote> - - <h2> - Resultaten van het testen van uw browser: - </h2> - <script type="text/javascript"> - var msgNetscape47Win = - "<p>While Jmol generally supports Netscape 4.7 on Windows, there are <b>some " + - "small problem</b> areas related to mouse events and occasional " + - "JavaScript/LiveConnect issues. </p>" + - "<p>In addition, the state of the applet does not get reset when " + - "a web page gets reloaded, sometimes causing html checkboxes " + - "and radio buttons to be out of synch with the applet appearance. </p>" + - "<p>We <b>recommend</b> that you consider upgrading " + - "to a newer web browser. </p>"; - + <script type="text/javascript"> var msgNoGetElementById = "<p>This seems to be an older web browser that does not support " + "current browser standards. Jmol and/or the buttons to control Jmol " + @@ -81,11 +50,6 @@ "<img border='0' src='get_java_red_button.gif' /></a>." + "</p>"; - var msgGenericOK = - "<p>Your web browser seems to <b>properly support</b> Jmol. </p>" + - "<p>If you do encounter problems please report them to " + - "<code>jmo...@li...</code></p>"; - var msgNoLiveConnectMac = "<p>The Jmol applet itself <b>will function properly</b>. " + "However, web pages constructed with HTML controls such as " + @@ -131,107 +95,55 @@ "you can use a Mozilla family browser.</p>"; var msgOK = - "<p>Your browser seems <b>compliant</b> with Jmol.</p>" + + "<p>Your browser seems to <b>properly support</b> Jmol.</p>" + "<p>If you do experience problems with Jmol running in your browser " + " please report them to " + - "<code>jmo...@li...</code></p>"; + "<code>jmo...@li...</code> with a copy of this page.</p>"; - var msg = ""; - var mozillaVersion = ""; - var javaVersion = 0; - var state = "yellow"; - - with (_jmol) { - if (browser == "mozilla" && browserVersion >= 5) { - var indexRV = ua.indexOf("rv:"); - if (indexRV > 0) { - var rv = ua.substring(indexRV + 3); - var indexEnd = rv.indexOf(")"); - var indexSemi = rv.indexOf(";"); - if (indexEnd < 0 || (indexSemi > 0 && indexSemi < indexEnd)) - indexEnd = indexSemi; - if (indexEnd > 0) - mozillaVersion = " " + rv.substring(0, indexEnd); - } - } - do { - if (isNetscape47Win) - { msg = msgNetscape47Win; break; } - if (os == "mac" && browser == "mozilla" && browserVersion >= 5) { - eval("try{javaVersion=" + - "java.lang.System.getProperty('java.version');" + - "} catch (e) { }"); - if (javaVersion < 1.4) { - msg = msgMacMozillaOldJava + msgNoLiveConnectMac + - msgMacMozillaAlternative; - break; - } - } - if (! isJavaEnabled) - { msg = msgGenericNoJava; state = "red"; break; } - if (! hasGetElementById) - { msg = msgNoGetElementById; state = "red"; break; } - if (os == "mac" && browser == "msie") - { msg = msgMacIE + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "safari" && browserVersion < 125.1) - { msg = msgMacOldSafari + msgNoLiveConnectMac; break; } - if (os == "mac" && browser == "opera" && browserVersion <= 7.54) - { msg = msgMacOpera754OrLess; state = "red"; break; } - if ((os == "win" && browser == "msie") || - (os == "win" && browser == "mozilla" && browserVersion >= 5) || - (os == "win" && browser == "opera" && browserVersion >= 7.54) || - ((os == "linux" || os == "unix") && - browser == "mozilla" && browserVersion >= 5)) - { state = "green"; break; } - if ((os == "linux" || os == "unix") && - browser == "konqueror" && browserVersion <= 3.3) - { msg = msgLinuxKonqueror331OrLess; state = "red"; break; } - } while (false); // this 'loop' is here only to allow use of 'break' - - var osString = os; /* for a more meaningful display */ - if (osString=="win") { osString = "Windows" } - else if (osString=="linux") { osString = "Linux" } - else if (osString=="unix") { osString = "Unix" } - else if (osString=="mac") { osString = "MacOS" } - - var browserString; - var Ffox = navigator.userAgent.indexOf("Firefox"); - if ( browser=="mozilla") - { /* Mozillas are always Mozilla/5; the browserVersion=5 is hence irrelevant as version nr. - All details are shown in UA anyway, so I'll put here the most user-friendly string */ - if (Ffox!=-1) - { browser = "Firefox"; - browserVersion = navigator.userAgent.substring(Ffox + "Firefox/".length); - browserString = browser + " " + browserVersion; - } - else - { browserVersion = mozillaVersion; - browserString = browser + " " + browserVersion; - } - } - else if ( browser=="msie") - { browser = "Internet Explorer"; - browserString = browser + " " + browserVersion; - } - else - { browserString = browser + " " + browserVersion + mozillaVersion; /* default */ - } - - document.writeln("<p><big>Your web browser seems to be " + - "<i>" + browserString + "</i>" + - " running on <i>" + osString + "</i></big></p>"); - document.writeln("<table border='0'>" + - "<tr><td bgcolor='" + state + "'> " + - "</td><td>"); - if (msg == "") msg = msgOK; - document.writeln(msg); - document.writeln("</td></tr></table>"); - } + var msgAcceptable = + "<p>Your browser <b>probably supports</b> Jmol.</p>" + + "<p>If you do experience problems with Jmol running in your browser " + + " please report them to " + + "<code>jmo...@li...</code> with a copy of this page</p>"; + </script> + <script src="browsercheck.js" type="text/javascript"></script> + </head> + <body> + <img src="../images/Jmol_smallLogo.jpg" /> + <hr /> + <h1>Jmol Browser Controle</h1> + <h2>Informatie van context:</h2> + <blockquote> + <p> + De Jmol applet vereist een browser die Java applets ondersteunt. + </p> + <p> + De meeste websites die de Jmol applet gebruiken voegen HTML controlemiddelen toe + (knoppen, aanvinkvakjes, enz.) die scripts versturen om de Jmol applet te besturen. + Om deze besturing goed te laten werken moet de browser eveneens JavaScript en LiveConnect + communicatie tussen JavaScript en Java applets ondersteunen. + </p> + </blockquote> + + <h2> + Resultaten van het testen van uw browser: + </h2> + <noscript> + Either the browser does not support Javascript, or its use has been disabled.<br> + Javascript must be enabled in your browser for the Jmol applets to work. + </noscript> + <script type="text/javascript"> + var tx = "<p><big>Your web browser seems to be " + + "<i>" + browserString + "</i>" + + " running on <i>" + osString + "</i></big></p>" + + "<table border='0'><tr>" + + "<td bgcolor='" + state + "' width='40'> </td>" + + "<td>" + msg + "</td>"+ + "</tr></table>" + document.writeln(tx); </script> - <p> - <b>Details:</b> - </p> + <h3>Browser details:</h3> <table border="1" cellpadding="5" cellspacing="0"> <tr> <td>Besturingssysteem</td> @@ -292,6 +204,12 @@ </td> </tr> </table> - <br /> + + <h3>Code produced by Jmol.js:</h3> + <script type="text/javascript"> + jmolInitialize("."); + jmolSetDocument(false); + document.write( "<textarea cols='100' rows='15' style='width:95%; height:15em;'>"+ jmolApplet(200) +"</textarea>" ); + </script> </body> </html> Modified: trunk/Jmol-web/source/doc/browsercheck/outdated.xml =================================================================== --- trunk/Jmol-web/source/doc/browsercheck/outdated.xml 2011-01-30 12:02:14 UTC (rev 15072) +++ trunk/Jmol-web/source/doc/browsercheck/outdated.xml 2011-01-30 12:03:45 UTC (rev 15073) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <outdated> <es>no</es> - <fr>no</fr> - <nl>no</nl> + <fr>minor</fr> + <nl>minor</nl> </outdated> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |