You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2016/02/10 00:52:24 UTC
svn commit: r1729510 - /comdev/projects.apache.org/site/js/projects.js
Author: sebb
Date: Tue Feb 9 23:52:24 2016
New Revision: 1729510
URL: http://svn.apache.org/viewvc?rev=1729510&view=rev
Log:
Basic error reporting for URLs
Modified:
comdev/projects.apache.org/site/js/projects.js
Modified: comdev/projects.apache.org/site/js/projects.js
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/site/js/projects.js?rev=1729510&r1=1729509&r2=1729510&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Tue Feb 9 23:52:24 2016
@@ -64,6 +64,7 @@ function GetAsyncJSON(theUrl, xstate, ca
}
}
+var urlErrors = []
var fetchCount = 0;
// Fetch an array of URLs, each with their description and own callback plus a final callback
// Used to fetch everything before rendering a page that relies on multiple JSON sources.
@@ -94,7 +95,7 @@ function GetAsyncJSONArray(urls, finalCa
if (xmlHttp.status == 200) {
cb(JSON.parse(xmlHttp.responseText));
} else {
- // TODO report error(s) back to user somehow
+ urlErrors.push(URL)
cb({});
}
}
@@ -1053,7 +1054,12 @@ function renderFrontPage() {
var initiatives = curPodlings + numcommittees + nsubs; // podlings + committees + sub-projects
initiatives -= initiatives % 100; // round down
var obj = document.getElementById('details');
- obj.innerHTML = "<h3 style='text-align: center;'>There are currently <span style='color: #269;'>" + initiatives + "+</span> open source initatives at the ASF:</h3>"
+ obj.innerHTML = ""
+ if (urlErrors.length > 0) {
+ obj.innerHTML += "<p><span style='color: red'><b>Warning: could not load: "+urlErrors.join(', ')+"</b></span></p>"
+ }
+ obj.innerHTML
+ += "<h3 style='text-align: center;'>There are currently <span style='color: #269;'>" + initiatives + "+</span> open source initatives at the ASF:</h3>"
+ "<ul style='width: 400px; margin: 0 auto; font-size: 18px; color: #269; font-weight: bold;'>"
+ "<li>" + numcommittees + " committees managing " + (numcommittees + nsubs) + " projects</li>"
+ "<li>5 special committees*</li>"