community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1757157 - /comdev/projects.apache.org/site/js/projects.js
Date Mon, 22 Aug 2016 12:44:01 GMT
Author: sebb
Date: Mon Aug 22 12:44:01 2016
New Revision: 1757157

URL: http://svn.apache.org/viewvc?rev=1757157&view=rev
Log:
Localise variables

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=1757157&r1=1757156&r2=1757157&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Mon Aug 22 12:44:01 2016
@@ -418,7 +418,7 @@ function renderProjectPage(project, proj
     ul = document.createElement('ul');
 
     if (project['programming-language']) {
-        pl = project['programming-language'];
+        var pl = project['programming-language'];
         var arr = pl.split(/,\s*/);
         pls = "";
         for (i in arr) {
@@ -468,8 +468,8 @@ function renderProjectPage(project, proj
     }
     if (project.release) {
         project.release.sort(function(a,b){// reverse date order (most recent first)
-            ac = a.created ? a.created : '1970-01-01';
-            bc = b.created ? b.created : '1970-01-01';
+            var ac = a.created ? a.created : '1970-01-01';
+            var bc = b.created ? b.created : '1970-01-01';
             if(ac < bc) return 1;
             if(ac > bc) return -1;
             return 0;});
@@ -503,6 +503,7 @@ function renderCommitteePage(committeeId
 
     obj.innerHTML = "<h1>" + committee.name + " Committee</h1>";
 
+    var description;
     if (!_.isEmpty(committee.shortdesc)) {
         description = committee.shortdesc;
     } else {
@@ -515,6 +516,7 @@ function renderCommitteePage(committeeId
 
     appendElementWithInnerHTML(obj, 'h4', "Charter (from PMC RDF file):");
 
+    var charter;
     if (!_.isEmpty(committee.charter)) {
         charter = committee.charter;
     } else {
@@ -592,7 +594,7 @@ function renderCommitteePage(committeeId
 
         ul = document.createElement('ul');
         var phtml = [];
-        for (p in subprojects.sort()) {
+        for (var p in subprojects.sort()) {
             p = subprojects[p];
             appendLiInnerHTML(ul, projectLink(p));
         }
@@ -659,8 +661,8 @@ function renderProjectsByName() {
 
     // Project list
     var ul = document.createElement('ul');
-    for (i in projectsSorted) {
-        project = projectsSorted[i]
+    for (var i in projectsSorted) {
+        var project = projectsSorted[i];
         appendLiInnerHTML(ul, projectIcon(projects[project].name) + projectLink(project));
     }
     obj.appendChild(ul);
@@ -674,6 +676,8 @@ function renderProjectsByLanguage() {
     // Compile Language array
     var lingos = [];
     var lcount = {};
+    var i;
+    var x;
     for (i in projects) {
         if (projects[i]['programming-language']) {
             var a = projects[i]['programming-language'].split(/,\s*/);
@@ -692,6 +696,7 @@ function renderProjectsByLanguage() {
     lingos.sort();
     var ul = document.createElement('ul');
 
+    var l;
     for (l in lingos) {
         var lang = lingos[l];
         var li = document.createElement('li');
@@ -727,11 +732,13 @@ function renderProjectsByCategory() {
 
     var cats = [];
     var ccount = {};
+    var i;
     for (i in projects) {
         if (projects[i].category) {
             var a = projects[i].category.split(/,\s*/);
+            var x;
             for (x in a) {
-            x = a[x];
+                x = a[x];
                 if (cats.indexOf(x) < 0) {
                             cats.push(x);
                             ccount[x] = 0;
@@ -745,6 +752,7 @@ function renderProjectsByCategory() {
     // Construct category list
     var ul = document.createElement('ul');
 
+    var l;
     for (l in cats) {
         var lang = cats[l];
         var li = document.createElement('li');
@@ -798,6 +806,7 @@ function renderProjectsByNumber() {
 
     for (l in lens) {
         var len = lens[l];
+        var i;
         for (i in projectsSorted) {
             i = projectsSorted[i];
             if (unixgroups[i]) {
@@ -825,7 +834,7 @@ function renderProjectsByPMC() {
     for (var committee in committees) {
         dcount[committee] = 0;
     }
-    for (project in projects) {
+    for (var project in projects) {
         project = projects[project];
         if (committees[project.pmc]) {
             dcount[project.pmc]++;
@@ -835,6 +844,7 @@ function renderProjectsByPMC() {
     // Construct pmc list
     var ul = document.createElement('ul');
 
+    var lpmc;
     for (lpmc in committees) {
         var c = dcount[lpmc];
         var li = document.createElement('li');
@@ -843,11 +853,12 @@ function renderProjectsByPMC() {
             appendLiInnerHTML(cul, projectIcon(committees[lpmc].name) + "<a href='project.html?"
+ lpmc + "'>" + committees[lpmc].name + "</a>");
             c = 1;
         } else {
+            var i;
             for (i in projectsSorted) {
                 i = projectsSorted[i];
                 var project = projects[i];
                 if (committees[project.pmc]) {
-                    xlpmc = project.pmc;
+                    var xlpmc = project.pmc;
                     if (xlpmc == lpmc) {
                         appendLiInnerHTML(cul, projectIcon(project.name) + projectLink(i));
                     }
@@ -907,9 +918,9 @@ function renderCommitteesByName() {
 
     // Committee list
     var ul = document.createElement('ul');
+    var i;
     for (i in committeesSorted) {
-        committee = committeesSorted[i]
-        appendLiInnerHTML(ul, committeeIcon() + committeeLink(committee));
+        appendLiInnerHTML(ul, committeeIcon() + committeeLink(committeesSorted[i]));
     }
     obj.appendChild(ul);
 }
@@ -920,6 +931,7 @@ function renderCommitteesByDate() {
 
     var dates = [];
     var dcount = {};
+    var i;
     for (i in committees) {
         var date = committees[i].established;
         if (dates.indexOf(date) < 0) {
@@ -933,11 +945,13 @@ function renderCommitteesByDate() {
     // Construct date list
     var ul = document.createElement('ul');
 
+    var l;
     for (l in dates) {
         var date = dates[l];
         var li = document.createElement('li');
         li.innerHTML = "<h3><a id='" + date + "'>" + date + " (" + dcount[date]
+ ")</a>:</h3>";
         var cul = document.createElement('ul');
+        var i;
         for (i in committeesByName) {
             i = committeesByName[i];
             if (i.established == date) {
@@ -1234,7 +1248,7 @@ function renderPodlingsEvolution(obj) {
 
     dataTable.addRows(data);
 
-    coptions = {
+    var coptions = {
         title: "Incubating projects evolution",
         isStacked: true,
         height: 320,
@@ -1251,7 +1265,7 @@ function renderPodlingsEvolution(obj) {
     };
     var div = document.createElement('div');
     document.getElementById('details').appendChild(div);
-    chart = new google.visualization.ComboChart(div);
+    var chart = new google.visualization.ComboChart(div);
     chart.draw(dataTable, coptions);
 }
 
@@ -1445,20 +1459,20 @@ function searchProjects(str) {
     var obj = document.getElementById('contents');
     
     str = str.toLowerCase();
-    hits = {};
-    hitssorted = [];
+    var hits = {};
+    var hitssorted = [];
     
     // Search committees
     for (p in projects) {
         var project = projects[p];
         for (key in project) {
             if (typeof project[key] == "string") {
-                val = project[key].toLowerCase();
+                var val = project[key].toLowerCase();
                 if (val.indexOf(str) >= 0 && val.substr(0,1) != "{") {
                     if (!hits[p]) {
                         hits[p] = [];
                     }
-                    estr = new RegExp(str, "i");
+                    var estr = new RegExp(str, "i");
                     hits[p].push({
                     'key': key,
                     'val': project[key].replace(estr, function(a) { return "<u style='color:
#963;'>"+a+"</u>"}, "img")
@@ -1475,6 +1489,7 @@ function searchProjects(str) {
     hitssorted.sort(function(a,b) { return hits[b].length - hits[a].length });
     var ul = document.createElement('ul');
         
+    var h;
     for (h in hitssorted) {
         h = hitssorted[h];
         var project = hits[h];



Mime
View raw message