Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8708)

Unified Diff: chrome_release_test_status/war/changelist.jsp

Issue 2831022: The following java and jsp files will collect the Chrome release testing stat... Base URL: svn://svn.chromium.org/chrome/trunk/tools/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_release_test_status/war/calendar.jsp ('k') | chrome_release_test_status/war/cl_notes.jsp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_release_test_status/war/changelist.jsp
===================================================================
--- chrome_release_test_status/war/changelist.jsp (revision 0)
+++ chrome_release_test_status/war/changelist.jsp (revision 0)
@@ -0,0 +1,120 @@
+<%@ page import="java.util.*" %>
+<%@ page import="java.net.*" %>
+<%@ page import="java.io.*" %>
+
+<HTML>
+<HEAD>
+<TITLE>
+ AJAX DEMO : Getting JavaReference Author Profile using Ajax interaction
+</TITLE>
+</HEAD>
+
+
+<script type="text/javascript">
+ var httpRequest;
+
+ /**
+ * This method is called when the author is selected
+ * It creates XMLHttpRequest object to communicate with the
+ * servlet
+ */
+ function getProfile()
+ {
+ var url = 'http://build.chromium.org/buildbot/perf/dashboard/ui/changelog.html?url=/branches/249/src&range=42898:44010&mode=html';
+
+ if (window.ActiveXObject)
+ {
+ httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ else if (window.XMLHttpRequest)
+ {
+ httpRequest = new XMLHttpRequest();
+ }
+
+ httpRequest.open("GET", url, true);
+ httpRequest.onreadystatechange = function() {processRequest(); } ;
+ httpRequest.send(null);
+ }
+
+ /**
+ * This is the call back method
+ * If the call is completed when the readyState is 4
+ * and if the HTTP is successfull when the status is 200
+ * update the profileSection DIV
+ */
+ function processRequest()
+ {
+ if (httpRequest.readyState == 4)
+ {
+ if(httpRequest.status == 200)
+ {
+ //get the XML send by the servlet
+ var profileXML = httpRequest.responseXML.getElementsByTagName("pre")[0];
+
+ //Update the HTML
+ updateHTML(profileXML);
+ }
+ else
+ {
+ alert("Error loading page\n"+ httpRequest.status +":"+ httpRequest.statusText);
+ }
+ }
+ }
+
+ /**
+ * This function parses the XML and updates the
+ * HTML DOM by creating a new text node is not present
+ * or replacing the existing text node.
+ */
+ function updateHTML(profileXML)
+ {
+ //The node valuse will give actual data
+ var profileText = profileXML.childNodes[0].nodeValue;
+
+ //Create the Text Node with the data received
+ var profileBody = document.createTextNode(profileText);
+
+ //Get the reference of the DIV in the HTML DOM by passing the ID
+ var profileSection = document.getElementById("profileSection");
+
+ //Check if the TextNode already exist
+ if(profileSection.childNodes[0])
+ {
+ //If yes then replace the existing node with the new one
+ profileSection.replaceChild(profileBody, profileSection.childNodes[0]);
+ }
+ else
+ {
+ //If not then append the new Text node
+ profileSection.appendChild(profileBody);
+ }
+ }
+
+</script>
+
+<BODY>
+
+<TABLE align=left border=0 cellPadding=3 cellSpacing=1 width="100%" >
+ <TR>
+ <TD align="center">
+ <STRONG>Getting JavaReference Author Profile using Ajax interaction.</STRONG>
+ <br>
+ </TD>
+ </TR>
+
+ <TR bgColor="#FFD0B1">
+ <TD>
+ <div id="profileSection">
+ <br><br>
+ <div>
+
+ <script type="text/javascript">
+ getProfile();
+ </script>
+
+ </TD>
+ </TR>
+</TABLE>
+
+</BODY>
+</HTML>
« no previous file with comments | « chrome_release_test_status/war/calendar.jsp ('k') | chrome_release_test_status/war/cl_notes.jsp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698