You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hb...@apache.org on 2016/11/06 09:04:39 UTC
svn commit: r1768296 - /comdev/projects.apache.org/site/js/projects.js
Author: hboutemy
Date: Sun Nov 6 09:04:39 2016
New Revision: 1768296
URL: http://svn.apache.org/viewvc?rev=1768296&view=rev
Log:
support multiple bug-tracking values
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=1768296&r1=1768295&r2=1768296&view=diff
==============================================================================
--- comdev/projects.apache.org/site/js/projects.js (original)
+++ comdev/projects.apache.org/site/js/projects.js Sun Nov 6 09:04:39 2016
@@ -190,7 +190,7 @@ function editProject(json, project) {
else {
form.appendChild(addKeyVal(k, input("text", k, json[k] ? json[k] : "")))
}
- }
+ }
var but = input("button", "submit", "Save changes")
but.setAttribute("onclick", "postREST({}, this.form); alert('Changes saved!');")
form.appendChild(but)
@@ -211,13 +211,13 @@ function buildEditor(uid) {
if (unixgroups[p+"-pmc"] && unixgroups[p+"-pmc"].indexOf(uid) >= 0) {
obj.innerHTML += "<a href='javascript:void(0);' onclick='editProjectPreload(\"" + i + "\");'>" + projects[i].name + "</a><br/>"
}
-
+
}
obj.innerHTML += "<hr/><h3>Or create a new project:</h3>"
var form = document.createElement('form')
var groups = []
for (i in unixgroups) {
- for (x in unixgroups[i]) {
+ for (x in unixgroups[i]) {
if (unixgroups[i][x] == uid && i.match(/.+-pmc$/i)) {
groups.push(i.replace("-pmc",""))
break
@@ -420,7 +420,7 @@ function renderProjectPage(project, proj
if (project['programming-language']) {
var pl = project['programming-language'];
var arr = pl.split(/,\s*/);
- pls = "";
+ var pls = "";
for (i in arr) {
pls += "<a href='projects.html?language#" + arr[i] + "'>" + arr[i] + "</a> ";
}
@@ -429,17 +429,22 @@ function renderProjectPage(project, proj
if (project['bug-database']) {
var bd = project['bug-database'];
- appendLiInnerHTML(ul, "<b>Bug-tracking:</b> <a href='" + bd + "'>" + bd + "</a>");
+ var arr = bd.split(/,\s*/);
+ var bds = "";
+ for (i in arr) {
+ bds += "<a href='" + arr[i] + "'>" + arr[i] + "</a> ";
+ }
+ appendLiInnerHTML(ul, "<b>Bug-tracking:</b> " + bds);
}
if (project['mailing-list']) {
- bd = project['mailing-list'];
- var xbd = bd;
+ var ml = project['mailing-list'];
+ var xml = ml;
// email instead of link?
- if (bd.match(/@/)) {
- xbd = "mailto:" + bd;
+ if (ml.match(/@/)) {
+ xml = "mailto:" + ml;
}
- appendLiInnerHTML(ul, "<b>Mailing list(s):</b> <a href='" + xbd + "'>" + bd + "</a>");
+ appendLiInnerHTML(ul, "<b>Mailing list(s):</b> <a href='" + xml + "'>" + ml + "</a>");
}
// repositories
@@ -993,10 +998,10 @@ function buildProjectListAsTable(json) {
var arr = [];
for (p in projects) {
var project = projects[p];
-
+
// Get name of PMC
var pmc = committees[project.pmc] ? committees[project.pmc].name : "Unknown";
-
+
// Get project type
var type = "Sub-Project";
var shortp = p.split("-")[0];
@@ -1008,22 +1013,22 @@ function buildProjectListAsTable(json) {
} else {
type = "Retired";
}
-
+
if (project.podling || project.name.match(/incubating/i)) {
type = "Podling";
pmc = "Apache Incubator";
}
-
+
// Programming language
var pl = project['programming-language'] ? project['programming-language'] : "Unknown";
-
+
// Shove the result into a row
arr.push([ p, project.name, type, pmc, pl, project.category])
}
-
+
// Construct the data table
$('#contents').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="projectlist"></table>' );
-
+
$('#projectlist').dataTable( {
"data": arr,
"columns": [
@@ -1040,7 +1045,7 @@ function buildProjectListAsTable(json) {
return nRow;
}
} );
-
+
$('#projectlist tbody').on('click', 'tr', function () {
var name = $(this).attr('id');
location.href = "project.html?" + name
@@ -1077,7 +1082,7 @@ function renderFrontPage() {
if (urlErrors.length > 0) {
obj.innerHTML += "<p><span style='color: red'><b>Warning: could not load: "+urlErrors.join(', ')+"</b></span></p>"
}
- obj.innerHTML
+ 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>"
@@ -1290,15 +1295,15 @@ function renderLanguageChart() {
}
}
}
-
-
+
+
var narr = [];
for (i in lingos) {
var lang = lingos[i];
narr.push([lang, lcount[lang], 'Click here to view all projects using ' + lang]);
}
narr.sort(function(a,b) { return (b[1] - a[1]) });
-
+
var data = new google.visualization.DataTable();
data.addColumn('string', 'Language');
data.addColumn('number', "Projects using it");
@@ -1314,7 +1319,7 @@ function renderLanguageChart() {
var chartDiv = document.createElement('div');
var chart = new google.visualization.PieChart(chartDiv);
obj.appendChild(chartDiv);
-
+
function selectHandlerLanguage() {
var selectedItem = chart.getSelection()[0];
if (selectedItem) {
@@ -1324,9 +1329,9 @@ function renderLanguageChart() {
}
google.visualization.events.addListener(chart, 'select', selectHandlerLanguage);
chart.draw(data, options);
-
-
- // Categories
+
+
+ // Categories
var cats = [];
var ccount = {};
for (i in projects) {
@@ -1342,16 +1347,16 @@ function renderLanguageChart() {
}
}
}
-
-
+
+
var carr = [];
for (i in cats) {
var cat = cats[i];
carr.push([cat, ccount[cat], 'Click here to view all projects in the ' + cat + ' category'])
}
carr.sort(function(a,b) { return (b[1] - a[1]) });
-
-
+
+
var data2 = new google.visualization.DataTable();
data2.addColumn('string', 'Category');
data2.addColumn('number', "Projects");
@@ -1367,8 +1372,8 @@ function renderLanguageChart() {
var chartDiv2 = document.createElement('div');
var chart2 = new google.visualization.PieChart(chartDiv2);
obj.appendChild(chartDiv2);
-
-
+
+
function selectHandlerCategory() {
var selectedItem = chart2.getSelection()[0];
if (selectedItem) {
@@ -1403,7 +1408,7 @@ function drawAccountCreation(json) {
for (j in json) {
jsort.push(j);
}
-
+
jsort.sort();
var c = 0;
for (i in jsort) {
@@ -1423,10 +1428,10 @@ function drawAccountCreation(json) {
height: 320,
width: 1160,
vAxes:[
-
+
{title: 'New accounts', titleTextStyle: {color: '#0000DD'}},
{title: 'Total number of accounts', titleTextStyle: {color: '#DD0000'}},
-
+
],
series: {
1: {type: "line", pointSize:3, lineWidth: 3, targetAxisIndex: 1},
@@ -1458,11 +1463,11 @@ function buildTimelines() {
function searchProjects(str) {
var obj = document.getElementById('contents');
-
+
str = str.toLowerCase();
var hits = {};
var hitssorted = [];
-
+
// Search committees
for (p in projects) {
var project = projects[p];
@@ -1485,11 +1490,11 @@ function searchProjects(str) {
}
}
}
-
+
obj.innerHTML = "<h2>Search results for '" + str + "' (" + hitssorted.length + "):</h2>";
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];
@@ -1604,10 +1609,10 @@ function renderReleases(releases) {
arr.push([ p, p, date, filename]);
}
}
-
+
// Construct the data table
$('#contents2').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="releases"></table>' );
-
+
$('#releases').dataTable( {
"data": arr,
"columns": [
@@ -1622,7 +1627,7 @@ function renderReleases(releases) {
return nRow;
}
} );
-
+
$('#releases tbody').on('click', 'tr', function () {
var name = $(this).attr('id').replace("incubator-","incubator/");
location.href = "https://www.apache.org/dist/" + name;