Reviewers: Kasper Lund,

Description:
Added a warning shown if the viewed version is not the current version
of
V8 benchmark suite. This change list is only for v1/run.html. I will add
changes for v2, v3 and v4 plus the current one in trunk once this CL
has been accepted.

Please review this at http://codereview.chromium.org/149530

SVN Base: http://v8.googlecode.com/svn/data/

Affected files:
   M     benchmarks/v1/run.html


Index: benchmarks/v1/run.html
===================================================================
--- benchmarks/v1/run.html      (revision 2426)
+++ benchmarks/v1/run.html      (working copy)
@@ -62,6 +62,16 @@
    background-repeat: no-repeat;
    border: 1px solid rgb(51, 102, 204);
  }
+
+div.warning {
+  background:#ffffd9;
+  border:1px solid #d2d26a;
+  display:none;
+  margin:1em 0 2em;
+  padding:8px;
+  text-align:center;
+}
+
  </style>

  <script type="text/javascript">
@@ -93,9 +103,33 @@
                               NotifyScore: AddScore });
  }

+function showWarning() {
+  var xmlhttp = null;
+  var latesturl = "../v" + (parseInt(BenchmarkSuite.version)+1)  
+ "/run.html";
+  if (window.XMLHttpRequest) {
+    xmlhttp = new window.XMLHttpRequest();
+  } else {
+    if (window.ActiveXObject) {
+      xmlhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
+    }
+  }
+  try {
+    xmlhttp.open('GET', latesturl, true);
+    xmlhttp.onreadystatechange = function() {
+      if (xmlhttp.readyState==4 && xmlhttp.status==200) {
+        document.getElementById('obsolete').style.display="block";
+      }
+    }
+    xmlhttp.send(null);
+  } catch(e) {
+    // Ignore exception if check for newer version fails
+  }
+}
+
  function Load() {
    var version = BenchmarkSuite.version;
    document.getElementById("version").innerHTML = version;
+  showWarning();
    window.setTimeout(Run, 200);
  }
  </script>
@@ -103,6 +137,10 @@
  <body onLoad="Load()">
  <div>
    <div class="title"><h1>V8 Benchmark Suite - version <span  
id="version">?</span></h1></div>
+  <div class="warning" id="obsolete">
+    Warning! This is not the latest version of V8 Benchmark Suite. For the  
latest version please visit <a  
href="http://v8.googlecode.com/svn/data/benchmarks/current/run.html";>this  
page</a>.
+  </div>
+
    <table>
      <tr>
        <td class="contents">



--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to