community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1664857 - in /comdev/reporter.apache.org/site: index.html render.js
Date Sat, 07 Mar 2015 14:40:42 GMT
Author: humbedooh
Date: Sat Mar  7 14:40:42 2015
New Revision: 1664857

URL: http://svn.apache.org/r1664857
Log:
fix jquery, redo the 'fetch from jira' dialog.

Modified:
    comdev/reporter.apache.org/site/index.html
    comdev/reporter.apache.org/site/render.js

Modified: comdev/reporter.apache.org/site/index.html
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/index.html?rev=1664857&r1=1664856&r2=1664857&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/index.html (original)
+++ comdev/reporter.apache.org/site/index.html Sat Mar  7 14:40:42 2015
@@ -6,6 +6,8 @@
   <link rel="stylesheet" href="css/foundation.css" />    
     <script src="js/vendor/modernizr.js"></script>
    <script src="https://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
+   <script src="https://code.jquery.com/ui/1.11.3/jquery-ui.js" type="text/javascript"></script>
+   <link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script src="render.js"></script>
    <style type="text/css">
@@ -137,6 +139,5 @@
       GetAsyncJSON("/getjson.py?" + project, project, renderFrontPage)
    });
 </script>
-<script src="js/vendor/jquery.js"></script>
 </body>
 <html>

Modified: comdev/reporter.apache.org/site/render.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/render.js?rev=1664857&r1=1664856&r2=1664857&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/render.js (original)
+++ comdev/reporter.apache.org/site/render.js Sat Mar  7 14:40:42 2015
@@ -21,9 +21,6 @@ function GetAsyncJSON(theUrl, xstate, ca
 	var s = parseInt(xmlHttp.getResponseHeader('Content-Length'))
 	if (document.getElementById('pct')) {
 	    document.getElementById('pct').innerHTML = "<p style='text-align: center;'><b><i>Loading:
" + parseInt((100 * (xmlHttp.responseText.length/s))) + "% done</i></b></p>";
-	    if (parseInt((100 * (xmlHttp.responseText.length/s))) == 100) {
-		document.getElementById('pct').innerHTML = "";
-	    }
 	}
     }
     xmlHttp.onreadystatechange = function(state) {
@@ -33,7 +30,10 @@ function GetAsyncJSON(theUrl, xstate, ca
 		if (xmlHttp.status == 404) {
 		    callback({}, xstate);
 		} else {
-		    callback(JSON.parse(xmlHttp.responseText), xstate);
+			if (document.getElementById('pct')) {
+				document.getElementById('pct').innerHTML = "<p style='text-align: center;'><b><i>Loading:
100% done</i></b></p>";
+			}
+			window.setTimeout(callback, 0.05, JSON.parse(xmlHttp.responseText), xstate);
 		}
 	    }
 	}
@@ -349,7 +349,7 @@ function renderFrontPage(json) {
 	    }
 	}
 	releases.innerHTML += "<i>(A total of " + (tr-nr) + " older release(s) were found
for " + pmc + " in our db)</i><br/>"
-	releases.innerHTML += "<br/><a href='addrelease.html?" + pmc + "'>Add a release</a>
- <a href='javascript:void(0);' onclick=\"fetchJIRA('" + pmc + "');\">Fetch releases
from JIRA</a><br/>"
+	releases.innerHTML += "<br/><a href='addrelease.html?" + pmc + "'>Add a release</a>
- <a href='javascript:void(0);' onclick=\"$('#dialog_" + pmc + "').dialog({minWidth: 450,
minHeight: 240});\">Fetch releases from JIRA</a><br/>"
 	
 	if (tr > 0) {
 		var div = renderReleaseChart(json.releases[pmc], pmc, releases);
@@ -489,6 +489,15 @@ function renderFrontPage(json) {
 	// Reporting example
 	var template = buildPanel(pmc, "Report template");
 	template.innerHTML += "<pre style='border: 2px dotted #444; padding: 10px; background:
#FFD;' contenteditable='true'>" + templates[pmc] + "</pre>"
+	
+	// Fetch from JIRA dialog
+	var dialog = document.createElement('div');
+	dialog.setAttribute("id", "dialog_" + pmc);
+	dialog.setAttribute("title", "Fetch data from JIRA")
+	dialog.setAttribute("style", "display: none;")
+	dialog.innerHTML = "<form><b>JIRA Project:</b><input type='text' name='jira'
placeholder='FOO'><br/><b>Optional prepend:</b> <input name='prepend'
type='text' placeholder='Foo'/><br><input type='button' value='Fetch from JIRA'
onclick='fetchJIRA(\"" + pmc + "\", this.form[\"jira\"].value, this.form[\"prepend\"].value);'></form><p>If
you have multiple JIRA projects and they only have the version number in their release versions,
please enter the component name in the 'prepend' field.</p>"
+	document.getElementById('tab_' + pmc).appendChild(dialog)
+	
     }
     if (json.pmcs.length == 0) {
 	container.innerHTML = "You are not a member of any top level project PMC, sorry!"
@@ -534,6 +543,8 @@ function renderFrontPage(json) {
 		
 	}
 	
+	
+	
 }
 
 
@@ -700,10 +711,9 @@ function renderReleaseChart(releases, na
     return chartDiv
 }
 
-function fetchJIRA(pmc) {
-	var jiraname = window.prompt("Please enter the JIRA project name (e.g. TS): ")
-	if (jiraname) {
-		GetAsyncJSON("/jiraversions.py?project=" + pmc + "&jiraname=" + jiraname, null, function()
{ alert("Information has been fetched, please reload this page!"); })
+function fetchJIRA(pmc, project, prepend ) {
+	if (project && project.length > 1) {
+		GetAsyncJSON("/jiraversions.py?project=" + pmc + "&jiraname=" + project + "&prepend="
+ prepend, null, function() { alert("Information has been fetched, please reload this page!");
})
 	}
 	
 }
\ No newline at end of file



Mime
View raw message