ndt-dev - [ndt-dev] [ndt] r1221 committed - Show warning if chrome/flash or linux/flash detected
Subject: NDT-DEV email list created
List archive
[ndt-dev] [ndt] r1221 committed - Show warning if chrome/flash or linux/flash detected
Chronological Thread
- From:
- To:
- Subject: [ndt-dev] [ndt] r1221 committed - Show warning if chrome/flash or linux/flash detected
- Date: Tue, 31 Mar 2015 13:32:22 +0000
Revision: 1221
Author:
Date: Tue Mar 31 13:32:11 2015 UTC
Log: Show warning if chrome/flash or linux/flash detected
https://code.google.com/p/ndt/source/detail?r=1221
Modified:
/branches/web-client-browser-os-warnings/HTML5-frontend/script.js
/branches/web-client-browser-os-warnings/HTML5-frontend/style.css
/branches/web-client-browser-os-warnings/HTML5-frontend/widget.html
=======================================
--- /branches/web-client-browser-os-warnings/HTML5-frontend/script.js Mon Mar 23 10:05:55 2015 UTC
+++ /branches/web-client-browser-os-warnings/HTML5-frontend/script.js Tue Mar 31 13:32:11 2015 UTC
@@ -57,10 +57,10 @@
evt.stopPropagation();
evt.preventDefault();
if (!isPluginLoaded()) {
- $('#warning').show();
+ $('#warning-plugin').show();
return;
}
- $('#warning').hide();
+ $('#warning-plugin').hide();
document.getElementById('javaButton').disabled = true;
document.getElementById('flashButton').disabled = true;
showPage('test', resetGauges);
@@ -548,6 +548,7 @@
while (backendContainer.firstChild) {
backendContainer.removeChild(backendContainer.firstChild);
}
+ document.getElementById('warning-environment').innerHTML = "";
var app = document.createElement('applet');
app.id = 'NDT';
@@ -563,12 +564,20 @@
function useFlashAsBackend() {
$("#rtt").hide();
- $("#rttValue").hide();
+ $("#rttValue").hide();
var backendContainer = document.getElementById('backendContainer');
while (backendContainer.firstChild) {
backendContainer.removeChild(backendContainer.firstChild);
}
+ if (isLinuxSystem()) {
+ document.getElementById('warning-environment').innerHTML = "Warning: Using flash plugin on Linux system may provide inaccurate results";
+ }
+
+ if (isChromeBrowser()) {
+ document.getElementById('warning-environment').innerHTML = "Warning: Using flash plugin in Chrome browser may provide inaccurate results";
+ }
+
var embed = document.createElement('embed');
embed.id = 'NDT';
embed.name = 'NDT';
@@ -599,7 +608,7 @@
function checkInstalledPlugins() {
var hasFlash = false, hasJava = false;
- $('#warning').hide();
+ $('#warning-plugin').hide();
try {
var activeXObject = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');
if(activeXObject) hasFlash = true;
@@ -624,3 +633,13 @@
}
}
+function isLinuxSystem() {
+ if (navigator.platform.indexOf("Linux") != -1)
+ return true;
+
+ return false;
+}
+
+function isChromeBrowser() {
+ return (/Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor));
+}
=======================================
--- /branches/web-client-browser-os-warnings/HTML5-frontend/style.css Fri Mar 20 12:14:29 2015 UTC
+++ /branches/web-client-browser-os-warnings/HTML5-frontend/style.css Tue Mar 31 13:32:11 2015 UTC
@@ -32,13 +32,17 @@
.header {
margin: 10px;
}
-#warning {
+#warning-environment {
+ color: orange;
+ margin: 5px;
+}
+#warning-plugin {
color: red;
- margin: 10px;
+ margin: 5px;
}
.page {
width: 640px;
- height: 400px;
+ height: 420px;
position: absolute;
left: 0;
top: 0;
=======================================
--- /branches/web-client-browser-os-warnings/HTML5-frontend/widget.html Fri Mar 20 12:14:29 2015 UTC
+++ /branches/web-client-browser-os-warnings/HTML5-frontend/widget.html Tue Mar 31 13:32:11 2015 UTC
@@ -26,8 +26,10 @@
<p>The Network Diagnostic Tool (NDT) provides a sophisticated speed and diagnostic test. An NDT test reports more than just the upload and download speeds — it also attempts to determine what, if any, problems limited these speeds, differentiating between computer configuration and network infrastructure problems. While the diagnostic messages are most useful for expert users, they can also help novice users by allowing them to provide detailed trouble reports to their network administrator.</p>
<p>NDT makes use of either Flash or Java plugins to perform the test. Make sure that the plugin you choose is not blocked by your browser</p>
+ <div id="warning-environment">
+ </div>
- <div id="warning">
+ <div id="warning-plugin">
<p>Selected plugin was not loaded properly. Make sure that you have proper plugin installed, and is not being blocked by your browser.</p>
</div>
- [ndt-dev] [ndt] r1221 committed - Show warning if chrome/flash or linux/flash detected, ndt, 03/31/2015
Archive powered by MHonArc 2.6.16.