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 2017/11/28 20:58:16 UTC

svn commit: r1816572 - /comdev/projects.apache.org/site/js/projects.js

Author: sebb
Date: Tue Nov 28 20:58:16 2017
New Revision: 1816572

URL: http://svn.apache.org/viewvc?rev=1816572&view=rev
Log:
Fix broken links to podling JSON files

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=1816572&r1=1816571&r2=1816572&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Tue Nov 28 20:58:16 2017
@@ -1576,16 +1576,11 @@ function fixProjectName(project) {
 }
 
 // Add content by id to projects
-function weaveInProjects(json) {
-    var pfx = "incubator-";
+function weaveInProjects(json, pfx) {
+    if (!pfx) { pfx='' }
     for (p in json) {
-        // podlings are stored without the prefix, so we strip it from the podling DOAPs
         // Since podlings are loaded first, DOAPs take precedence
-        if (p.startsWith(pfx)) {
-            projects[p.substring(pfx.length)] = fixProjectName(json[p]);
-        } else {
-            projects[p] = fixProjectName(json[p]);
-        }
+        projects[pfx+p] = fixProjectName(json[p]);
     }
 }
 
@@ -1688,7 +1683,7 @@ function preloadEverything(callback) {
         ["json/foundation/committees.json", "committees", setCommittees],
         ["json/foundation/groups.json", "groups", function(json) { unixgroups = json; }],
         ["json/foundation/people_name.json", "people", function(json) { people = json; }],
-        ["json/foundation/podlings.json", "podlings", function(json) { podlings = json; weaveInProjects(json)}], // do this first
+        ["json/foundation/podlings.json", "podlings", function(json) { podlings = json; weaveInProjects(json,'incubator-')}], // do this first
         ["json/foundation/projects.json", "projects", weaveInProjects], // so can replace with DOAP data where it exists
         ["json/foundation/committees-retired.json", "retired committees", weaveInRetiredCommittees],
         ["json/foundation/podlings-history.json", "podlings history", function(json) { podlingsHistory = json; }],