community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1658050 - /comdev/projects.apache.org/site/js/projects.js
Date Sat, 07 Feb 2015 11:12:07 GMT
Author: humbedooh
Date: Sat Feb  7 11:12:07 2015
New Revision: 1658050

URL: http://svn.apache.org/r1658050
Log:
camelCase

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=1658050&r1=1658049&r2=1658050&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Sat Feb  7 11:12:07 2015
@@ -471,6 +471,10 @@ function setCycles(json, state) {
 
 // ------------ Projects listing ------------\\
 
+function camelCase(str) {
+    return str.replace(/^([a-zA-Z])(.+)/, function(a,b) { return a.toUpperCase() + b.toLowerCase()
} );
+}
+
 function renderProjectsList(cat) {
 
     var obj = document.getElementById('contents');
@@ -521,6 +525,7 @@ function renderProjectsList(cat) {
 	    if (projects[i]['programming-language']) {
 		var a = projects[i]['programming-language'].split(/,\s*/)
 		for (x in a) {
+		    a[x] = camelCase(a[x])
 		    if (lingos.indexOf(a[x]) < 0) {
 			lingos.push(a[x])
 			lcount[a[x]] = 0;
@@ -544,7 +549,7 @@ function renderProjectsList(cat) {
 		if (projects[i]['programming-language']) {
 		    var a = projects[i]['programming-language'].split(/,\s*/)
 		    for (x in a) {
-			if (a[x] == lang) {
+			if (a[x].toLowerCase() == lang.toLowerCase()) {
 			    var cli = document.createElement('li');
 			    cli.innerHTML = "<a href='/project.html?" + i + "'>" + projects[i].name + "</a>";
 			    if (isTLP(projects[i].name)) {



Mime
View raw message