community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1799048 - in /comdev/reporter.apache.org/trunk/site/js: coffee/main.coffee tabs.js
Date Sun, 18 Jun 2017 07:29:41 GMT
Author: humbedooh
Date: Sun Jun 18 07:29:41 2017
New Revision: 1799048

URL: http://svn.apache.org/viewvc?rev=1799048&view=rev
Log:
- untabify
- save rendered HTML, recall it instead of re-rendering the project page

Modified:
    comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee
    comdev/reporter.apache.org/trunk/site/js/tabs.js

Modified: comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee?rev=1799048&r1=1799047&r2=1799048&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee (original)
+++ comdev/reporter.apache.org/trunk/site/js/coffee/main.coffee Sun Jun 18 07:29:41 2017
@@ -1,4 +1,5 @@
 jsdata = {}
+rendered = {}
 
 templates = {}
 nproject = null;
@@ -235,238 +236,287 @@ renderFrontPage = (tpmc) ->
     hvalues = ["Super Healthy", "Healthy", "Mostly Okay", "Unhealthy", "Action required!",
"URGENT ACTION REQUIRED!"]
     for pmc, i in json.pmcs
         if pmc == tpmc or not tpmc
-                # Stuff has broken, check that we have dates!
-                if (not pmc in json.pmcdates)
-                    continue
-                
-                templates[pmc] = ""
-        
-                addLine(pmc, "## Description:")
-                if ('shortdesc' in jsdata.pdata[pmc])
-                    addLine(pmc, "   " + json.pdata[pmc].shortdesc)
+            # If we already rendered this, just re-add it
+            if rendered[pmc]
+                container.innerHTML = ""
+                container.appendChild(rendered[pmc])
+            # Stuff has broken, check that we have dates!
+            if (not pmc in json.pmcdates)
+                continue
+            
+            templates[pmc] = ""
+    
+            addLine(pmc, "## Description:")
+            if ('shortdesc' in jsdata.pdata[pmc])
+                addLine(pmc, "   " + json.pdata[pmc].shortdesc)
+            else
+                addLine(pmc, " - <font color='red'>Description goes here</font>")
+            
+            addLine(pmc)
+    
+            a = animals[Math.floor(Math.random()*animals.length*0.999)]
+            addLine(pmc, "## Issues:")
+            addLine(pmc, " - <font color='red'>TODO - list any issues that require
board attention, \n  or say \"there are no issues requiring board attention at this time\"
- if not, the " + a + " will get you.</font>")
+            addLine(pmc)
+    
+            addLine(pmc, "## Activity:")
+            addLine(pmc, " - <font color='red'>TODO - the PMC <b><u>MUST</u></b>
provide this information</font>")
+            addLine(pmc)
+    
+            
+            a = animals[Math.floor(Math.random()*animals.length*0.999)]
+            addLine(pmc, "## Health report:")
+            addLine(pmc, " - <font color='red'>TODO - Please use this paragraph to
elaborate on why the current project activity (mails, commits, bugs etc) is at its current
level - Maybe " + a + " took over and are now controlling the project?</font>")
+            addLine(pmc)
+    
+            obj = document.createElement('div');
+            rendered[pmc] = obj
+            obj.setAttribute("id", "tab_" + pmc)
+            obj.style = "padding: 10px; text-align: left !important;"
+            obj.setAttribute("aria-hidden", "true")
+            title = document.createElement('h2')
+            title.innerHTML = json.pdata[pmc].name or pmc
+            obj.appendChild(title)
+            health = document.createElement('p');
+            if (json.health[pmc] && !isNaN(json.health[pmc]['cscore']))
+                health.style.marginTop = "10px"
+                health.innerHTML = "<b>Committee Health score:</b> <a href='chi.py#"
+ pmc + "'><u><font color='" + hcolors[json.health[pmc]['cscore']] + "'>" +
(6.33 + (json.health[pmc]['score'] * -1.00 * (20 / 12.25))).toFixed(2) + " (" + hvalues[json.health[pmc]['cscore']]
+ ")</u></font></a> <i>(This is an automatically generated score,
it is NOT authoritative in any way!)</i>"
+                obj.appendChild(health)
+            
+            container.appendChild(obj)
+    
+    
+    
+            # Report date
+    
+            reportdate = buildPanel(pmc, "Report date")
+            if (json.pdata[pmc].chair)
+                reportdate.innerHTML += "<b>Committee Chair: </b>" + json.pdata[pmc].chair
+ "<br>"
+            
+    
+            fetch("reportingcycles.json?" + thisHour, [pmc, reportdate, json.pdata[pmc].name],
setReportDate)
+    
+    
+            # LDAP committee + Committer changes
+    
+            mo = new Date().getMonth() - 3;
+            after = new Date();
+            after.setMonth(mo); # This also works if mo is negative
+            PMCchanges(json, pmc, after);
+    
+            changes = buildPanel(pmc, "PMC changes (From LDAP)");
+    
+            c = 0; # total number of committer + pmc changes since establishment
+            cu = 0; # total number of committer (user) changes
+            for x,y of json.changes[pmc].committer
+                cu++;
+                c++;
+            for x,y of json.changes[pmc].pmc
+                c++;
+            nc = 0; # newest committer date
+            np = 0; # newest pmc date
+            ncn = null; # newest committer name
+            npn = null; # newest pmc name
+    
+            addLine(pmc, "## Committer base changes:")
+            addLine(pmc)
+            addLine(pmc, " - Currently " + json.count[pmc][1] + " committers.")
+            if (cu == 0) # no new committers
+                if (isNewPMC(json,pmc,after))
+                    addLine(pmc, " - No changes (the PMC was established in the last 3 months)")
                 else
-                    addLine(pmc, " - <font color='red'>Description goes here</font>")
-                
-                addLine(pmc)
-        
-                a = animals[Math.floor(Math.random()*animals.length*0.999)]
-                addLine(pmc, "## Issues:")
-                addLine(pmc, " - <font color='red'>TODO - list any issues that require
board attention, \n  or say \"there are no issues requiring board attention at this time\"
- if not, the " + a + " will get you.</font>")
-                addLine(pmc)
-        
-                addLine(pmc, "## Activity:")
-                addLine(pmc, " - <font color='red'>TODO - the PMC <b><u>MUST</u></b>
provide this information</font>")
+                    addLine(pmc, " - No new changes to the committer base since last report.")
                 addLine(pmc)
-        
-                
-                a = animals[Math.floor(Math.random()*animals.length*0.999)]
-                addLine(pmc, "## Health report:")
-                addLine(pmc, " - <font color='red'>TODO - Please use this paragraph
to elaborate on why the current project activity (mails, commits, bugs etc) is at its current
level - Maybe " + a + " took over and are now controlling the project?</font>")
-                addLine(pmc)
-        
-                obj = document.createElement('div');
-                obj.setAttribute("id", "tab_" + pmc)
-                obj.style = "padding: 10px; text-align: left !important;"
-                obj.setAttribute("aria-hidden", "true")
-                title = document.createElement('h2')
-                title.innerHTML = json.pdata[pmc].name or pmc
-                obj.appendChild(title)
-                health = document.createElement('p');
-                if (json.health[pmc] && !isNaN(json.health[pmc]['cscore']))
-                    health.style.marginTop = "10px"
-                    health.innerHTML = "<b>Committee Health score:</b> <a
href='chi.py#" + pmc + "'><u><font color='" + hcolors[json.health[pmc]['cscore']]
+ "'>" + (6.33 + (json.health[pmc]['score'] * -1.00 * (20 / 12.25))).toFixed(2) + " ("
+ hvalues[json.health[pmc]['cscore']] + ")</u></font></a> <i>(This
is an automatically generated score, it is NOT authoritative in any way!)</i>"
-                    obj.appendChild(health)
-                
-                container.appendChild(obj)
-        
-        
-        
-                # Report date
-        
-                reportdate = buildPanel(pmc, "Report date")
-                if (json.pdata[pmc].chair)
-                    reportdate.innerHTML += "<b>Committee Chair: </b>" + json.pdata[pmc].chair
+ "<br>"
-                
-        
-                fetch("reportingcycles.json?" + thisHour, [pmc, reportdate, json.pdata[pmc].name],
setReportDate)
-        
-        
-                # LDAP committee + Committer changes
-        
-                mo = new Date().getMonth() - 3;
-                after = new Date();
-                after.setMonth(mo); # This also works if mo is negative
-                PMCchanges(json, pmc, after);
-        
-                changes = buildPanel(pmc, "PMC changes (From LDAP)");
-        
-                c = 0; # total number of committer + pmc changes since establishment
-                cu = 0; # total number of committer (user) changes
-                for x,y of json.changes[pmc].committer
-                    cu++;
-                    c++;
-                for x,y of json.changes[pmc].pmc
-                    c++;
-                nc = 0; # newest committer date
-                np = 0; # newest pmc date
-                ncn = null; # newest committer name
-                npn = null; # newest pmc name
-        
-                addLine(pmc, "## Committer base changes:")
-                addLine(pmc)
-                addLine(pmc, " - Currently " + json.count[pmc][1] + " committers.")
-                if (cu == 0) # no new committers
-                    if (isNewPMC(json,pmc,after))
-                        addLine(pmc, " - No changes (the PMC was established in the last
3 months)")
-                    else
-                        addLine(pmc, " - No new changes to the committer base since last
report.")
-                    addLine(pmc)
+            
+            if (c == 0) # no changes at all
+                if (isNewPMC(json,pmc,after))
+                    changes.innerHTML += "No changes - the PMC was established in the last
3 months."
+                else
+                    changes.innerHTML += "<font color='red'><b>No new changes
to the PMC or committer base detected - (LDAP error or no changes for &gt;2 years)</b></font>"
                 
-                if (c == 0) # no changes at all
+            else
+                changes.innerHTML += "<h5>Changes within the last 3 months:</h5>"
+    
+                # pre-flight check
+                npmc = 0; # recent committee group additions
+                for k, entry of json.changes[pmc].pmc
+                    if (entry[1] > after.getTime() / 1000)
+                        npmc++;
+                    
+                for k, entry of json.changes[pmc].pmc
+                    if (entry[1] > np) # latest pmc member date
+                        np = entry[1]
+                        npn = entry[0]; # latest pmc member name
+                    
+                    if (entry[1] > after.getTime() / 1000)
+                        changes.innerHTML += "&rarr; " + entry[0] + " was added to the
PMC on " + new Date(entry[1] * 1000).toDateString() + "<br>"
+    
+                if (npmc == 0) # PMC older than 3 months itself
                     if (isNewPMC(json,pmc,after))
-                        changes.innerHTML += "No changes - the PMC was established in the
last 3 months."
+                        changes.innerHTML += "&rarr; No new PMC members in the 3 months
since the PMC was established<br>";
                     else
-                        changes.innerHTML += "<font color='red'><b>No new changes
to the PMC or committer base detected - (LDAP error or no changes for &gt;2 years)</b></font>"
-                    
-                else
-                    changes.innerHTML += "<h5>Changes within the last 3 months:</h5>"
-        
-                    # pre-flight check
-                    npmc = 0; # recent committee group additions
-                    for k, entry of json.changes[pmc].pmc
-                        if (entry[1] > after.getTime() / 1000)
-                            npmc++;
-                        
-                    for k, entry of json.changes[pmc].pmc
-                        if (entry[1] > np) # latest pmc member date
-                            np = entry[1]
-                            npn = entry[0]; # latest pmc member name
-                        
-                        if (entry[1] > after.getTime() / 1000)
-                            changes.innerHTML += "&rarr; " + entry[0] + " was added to
the PMC on " + new Date(entry[1] * 1000).toDateString() + "<br>"
-        
-                    if (npmc == 0) # PMC older than 3 months itself
-                        if (isNewPMC(json,pmc,after))
-                            changes.innerHTML += "&rarr; No new PMC members in the 3
months since the PMC was established<br>";
-                        else
-                            changes.innerHTML += "&rarr; <font color='red'><b>No
new PMC members in the last 3 months.</b></font><br>";
-                        
-                    if (npn)
-                        changes.innerHTML += "&rarr; " + "<b>Last PMC addition:
</b>" + new Date(np * 1000).toDateString() + " (" + npn + ")<br>"
+                        changes.innerHTML += "&rarr; <font color='red'><b>No
new PMC members in the last 3 months.</b></font><br>";
                     
-        
-        
-                    # pre-flight check
-                    ncom = 0; # number of new committers
-                    for k, entry of json.changes[pmc].committer
-                        if (entry[1] > after.getTime() / 1000) # entry[1] is the first
seen timestamp
-                            ncom++;
-        
-                    if (ncom > 1)
-                        addLine(pmc, " - New commmitters:")
+                if (npn)
+                    changes.innerHTML += "&rarr; " + "<b>Last PMC addition: </b>"
+ new Date(np * 1000).toDateString() + " (" + npn + ")<br>"
+                
+    
+    
+                # pre-flight check
+                ncom = 0; # number of new committers
+                for k, entry of json.changes[pmc].committer
+                    if (entry[1] > after.getTime() / 1000) # entry[1] is the first seen
timestamp
+                        ncom++;
+    
+                if (ncom > 1)
+                    addLine(pmc, " - New commmitters:")
+                
+                for k, entry of json.changes[pmc].committer
+                    if (entry[1] > nc) # find the most recent entry
+                        nc = entry[1]  # the timestamp
+                        ncn = entry[0];# full name
                     
-                    for k, entry of json.changes[pmc].committer
-                        if (entry[1] > nc) # find the most recent entry
-                            nc = entry[1]  # the timestamp
-                            ncn = entry[0];# full name
-                        
-                        if (entry[1] > after.getTime() / 1000)
-                            changes.innerHTML += "&rarr; " + entry[0] + " was added as
a committer on " + new Date(entry[1] * 1000).toDateString() + "<br>"
-                            addLine(pmc, (if ncom > 1 then "   " else "") + " - " + entry[0]
+ " was added as a committer on " + new Date(entry[1] * 1000).toDateString())
-                        
-                    if (ncom == 0) 
-                        changes.innerHTML += "&rarr; <font color='red'><b>No
new committers in the last 3 months.</b></font><br>";
-                        addLine(pmc, " - No new committers added in the last 3 months")
+                    if (entry[1] > after.getTime() / 1000)
+                        changes.innerHTML += "&rarr; " + entry[0] + " was added as a
committer on " + new Date(entry[1] * 1000).toDateString() + "<br>"
+                        addLine(pmc, (if ncom > 1 then "   " else "") + " - " + entry[0]
+ " was added as a committer on " + new Date(entry[1] * 1000).toDateString())
                     
-        
-                    if (ncn) 
-                        if (nc < after.getTime() / 1000)
-                            addLine(pmc, " - Last committer addition was " + ncn + " at "
+ new Date(nc * 1000).toDateString())
-                        changes.innerHTML += "&rarr; " + "<b>Last committer addition:
</b>" + new Date(nc * 1000).toDateString() + " (" + ncn + ")<br>"
-                    else
-                        addLine(pmc, " - Last committer addition was more than 2 years ago")
-                        changes.innerHTML += "&rarr; " + "<b>Last committer addition:
</b><font color='red'>more than two years ago (not in the archive!)</font><br>"
-                    
-                    changes.innerHTML += "&rarr; " + "<b>Currently " + json.count[pmc][1]
+ " committers and " + json.count[pmc][0] + " PMC members."
-                    addLine(pmc)
+                if (ncom == 0) 
+                    changes.innerHTML += "&rarr; <font color='red'><b>No
new committers in the last 3 months.</b></font><br>";
+                    addLine(pmc, " - No new committers added in the last 3 months")
                 
+    
+                if (ncn) 
+                    if (nc < after.getTime() / 1000)
+                        addLine(pmc, " - Last committer addition was " + ncn + " at " + new
Date(nc * 1000).toDateString())
+                    changes.innerHTML += "&rarr; " + "<b>Last committer addition:
</b>" + new Date(nc * 1000).toDateString() + " (" + ncn + ")<br>"
+                else
+                    addLine(pmc, " - Last committer addition was more than 2 years ago")
+                    changes.innerHTML += "&rarr; " + "<b>Last committer addition:
</b><font color='red'>more than two years ago (not in the archive!)</font><br>"
                 
-                # Release data
-        
-                releases = buildPanel(pmc, "Releases")
-                addLine(pmc, "## Releases:")
+                changes.innerHTML += "&rarr; " + "<b>Currently " + json.count[pmc][1]
+ " committers and " + json.count[pmc][0] + " PMC members."
                 addLine(pmc)
-                nr = 0;
-                lr = null;
-                lrn = 0;
-                tr = 0
-                for version, date of json.releases[pmc]
-                    tr++;
-                    if (date > lrn)
-                        lrn = date
-                        lr = version
+            
+            
+            # Release data
+    
+            releases = buildPanel(pmc, "Releases")
+            addLine(pmc, "## Releases:")
+            addLine(pmc)
+            nr = 0;
+            lr = null;
+            lrn = 0;
+            tr = 0
+            for version, date of json.releases[pmc]
+                tr++;
+                if (date > lrn)
+                    lrn = date
+                    lr = version
+                
+                if (date >= after.getTime() / 1000)
+                    err = ""
+                    if (new Date(date * 1000) > new Date())
+                        err = " (<font color='red'>This seems wrong?!</font>)"
                     
-                    if (date >= after.getTime() / 1000)
-                        err = ""
-                        if (new Date(date * 1000) > new Date())
-                            err = " (<font color='red'>This seems wrong?!</font>)"
-                        
-                        releases.innerHTML += "&rarr; " + "<b>" + version + "</b>
was released on " + new Date(date * 1000).toDateString() + err + "<br>"
-                        addLine(pmc, " - " + version + " was released on " + new Date(date
* 1000).toDateString() + err)
-                        nr++;
-        
-                if (nr == 0)
-                    if (lr)
-                        releases.innerHTML += "&rarr; " + "<b>Last release was
" + lr + ", released on </b>" + new Date(lrn * 1000).toDateString() + "<br>"
-                        addLine(pmc, " - Last release was " + lr + " on " + new Date(lrn
* 1000).toDateString())
-                        if (lr.match("incubat") && !isNewPMC(json,pmc,after))
-                            releases.innerHTML += "<br><font color='red'><b>No
release since graduation</b></font><br><br>"
-                            addLine(pmc, " - <font color='red'><b>No release
since graduation??? [FIX!]</b></font>")
+                    releases.innerHTML += "&rarr; " + "<b>" + version + "</b>
was released on " + new Date(date * 1000).toDateString() + err + "<br>"
+                    addLine(pmc, " - " + version + " was released on " + new Date(date *
1000).toDateString() + err)
+                    nr++;
+    
+            if (nr == 0)
+                if (lr)
+                    releases.innerHTML += "&rarr; " + "<b>Last release was " +
lr + ", released on </b>" + new Date(lrn * 1000).toDateString() + "<br>"
+                    addLine(pmc, " - Last release was " + lr + " on " + new Date(lrn * 1000).toDateString())
+                    if (lr.match("incubat") && !isNewPMC(json,pmc,after))
+                        releases.innerHTML += "<br><font color='red'><b>No
release since graduation</b></font><br><br>"
+                        addLine(pmc, " - <font color='red'><b>No release since
graduation??? [FIX!]</b></font>")
+                else
+                    releases.innerHTML += "No release data could be found.<br>"
+                    addLine(pmc, " - <font color='red'>No release data could be found
[FIX!]</font>")
+    
+            releases.innerHTML += "<i>(A total of " + (tr - nr) + " older release(s)
were found for " + pmc + " in our db)</i><br>"
+            releases.innerHTML += "<br><a href='javascript:void(0);' onclick=\"$('#rdialog_"
+ pmc + "').dialog({minWidth: 450, minHeight: 240});\">Add a release</a>"
+            releases.innerHTML += " - <a href='javascript:void(0);' onclick=\"$('#dialog_"
+ pmc + "').dialog({minWidth: 450, minHeight: 240});\">Fetch releases from JIRA</a>"
+            releases.innerHTML += " - <a href='addrelease.html?" + pmc + "'>Manage
release versions</a><br>"
+    
+            if (tr > 0)
+                div = renderReleaseChart(json.releases[pmc], pmc, releases);
+                releases.appendChild(div)
+            
+            addLine(pmc)
+    
+            mlbox = buildPanel(pmc, "Mailing lists");
+    
+            ul = document.createElement('ul')
+            ul.style.textAlign = "left;"
+            mlbox.appendChild(ul)
+            prev = ""
+            f = 0
+            addLine(pmc, "## Mailing list activity:")
+            addLine(pmc)
+            addLine(pmc, " - <font color='red'>TODO Please explain what the following
statistics mean for the project." +
+                    " If there is nothing significant in the figures, omit this section.</font>")
+            addLine(pmc)
+            
+            first = ['users', 'dev', 'commits', 'private', 'bugs', 'modules-dev'];
+            
+            
+            for i,x of first
+                ml = pmc + ".apache.org-" + first[i]
+                if (ml != prev && ml.search("infra") < 0 && json.mail[pmc]
&& json.mail[pmc][ml]) 
+                    f++;
+                    prev = ml
+                    d = ml.split(".org-");
+                    mlname = d[1] + "@" + d[0] + ".org"
+                    lookup = d[0].split(/\./)[0] + "-" + d[1]
+    
+                    x = renderChart(json.mail[pmc], ml, obj, if (json.delivery[pmc] &&
json.delivery[pmc][lookup]) then json.delivery[pmc][lookup].weekly else {})
+                    total = x[0]
+                    diff = x[1]
+                    div = x[2]
+    
+                    add = ""
+                    if (json.delivery[pmc] && json.delivery[pmc][lookup])
+                        add = ":\n    - " + json.delivery[pmc][lookup].quarterly[0] + " emails
sent to list (" + json.delivery[pmc][lookup].quarterly[1] + " in previous quarter)";
+                    
+                    text = "Currently: " + total + " subscribers <font color='green'>(up
" + diff + " in the last 3 months)</font>"
+                    if (diff < 0) 
+                        text = "Currently: " + total + " subscribers <font color='red'>(down
" + diff + " in the last 3 months)</font>"
+                        if (d[1] != "private" && d[1] != "security" && d[1]
!= "commits")
+                            addLine(pmc, " - " + mlname + ": ")
+                            addLine(pmc, "    - " + total + " subscribers (down " + diff
+ " in the last 3 months)" + add)
+                            addLine(pmc)
                     else
-                        releases.innerHTML += "No release data could be found.<br>"
-                        addLine(pmc, " - <font color='red'>No release data could be
found [FIX!]</font>")
-        
-                releases.innerHTML += "<i>(A total of " + (tr - nr) + " older release(s)
were found for " + pmc + " in our db)</i><br>"
-                releases.innerHTML += "<br><a href='javascript:void(0);' onclick=\"$('#rdialog_"
+ pmc + "').dialog({minWidth: 450, minHeight: 240});\">Add a release</a>"
-                releases.innerHTML += " - <a href='javascript:void(0);' onclick=\"$('#dialog_"
+ pmc + "').dialog({minWidth: 450, minHeight: 240});\">Fetch releases from JIRA</a>"
-                releases.innerHTML += " - <a href='addrelease.html?" + pmc + "'>Manage
release versions</a><br>"
-        
-                if (tr > 0)
-                    div = renderReleaseChart(json.releases[pmc], pmc, releases);
-                    releases.appendChild(div)
-                
-                addLine(pmc)
-        
-                mlbox = buildPanel(pmc, "Mailing lists");
-        
-                ul = document.createElement('ul')
-                ul.style.textAlign = "left;"
-                mlbox.appendChild(ul)
-                prev = ""
-                f = 0
-                addLine(pmc, "## Mailing list activity:")
-                addLine(pmc)
-                addLine(pmc, " - <font color='red'>TODO Please explain what the following
statistics mean for the project." +
-                        " If there is nothing significant in the figures, omit this section.</font>")
-                addLine(pmc)
-                
-                first = ['users', 'dev', 'commits', 'private', 'bugs', 'modules-dev'];
-                
-                
-                for i,x of first
-                    ml = pmc + ".apache.org-" + first[i]
-                    if (ml != prev && ml.search("infra") < 0 && json.mail[pmc]
&& json.mail[pmc][ml]) 
-                        f++;
+                        if (d[1] != "private" && d[1] != "security" && d[1]
!= "commits")
+                            addLine(pmc, " - " + mlname + ": ")
+                            addLine(pmc, "    - " + total + " subscribers (up " + diff +
" in the last 3 months)" + add)
+                            addLine(pmc)
+    
+                    if (json.delivery[pmc] && json.delivery[pmc][lookup])
+                        text += " (" + json.delivery[pmc][lookup].quarterly[0] + " emails
sent in the past 3 months, " + json.delivery[pmc][lookup].quarterly[1] + " in the previous
cycle)"
+    
+                    p = document.createElement('li');
+                    p.innerHTML = "<h5>" + mlname + ":</h5>" + text
+                    p.appendChild(div)
+                    ul.appendChild(p)
+                    
+            for ml of json.mail[pmc]
+                skip = false
+                for i in first
+                    xml = pmc + ".apache.org-" + first[i]
+                    if (ml.search(xml) == 0)
+                        skip = true
+                if (!skip)
+    
+                    f++;
+                    if (ml != prev && ml.search("infra") < 0)
                         prev = ml
                         d = ml.split(".org-");
                         mlname = d[1] + "@" + d[0] + ".org"
                         lookup = d[0].split(/\./)[0] + "-" + d[1]
-        
                         x = renderChart(json.mail[pmc], ml, obj, if (json.delivery[pmc] &&
json.delivery[pmc][lookup]) then json.delivery[pmc][lookup].weekly else {})
                         total = x[0]
                         diff = x[1]
                         div = x[2]
-        
+    
                         add = ""
                         if (json.delivery[pmc] && json.delivery[pmc][lookup])
                             add = ":\n    - " + json.delivery[pmc][lookup].quarterly[0] +
" emails sent to list (" + json.delivery[pmc][lookup].quarterly[1] + " in previous quarter)";
@@ -474,7 +524,7 @@ renderFrontPage = (tpmc) ->
                         text = "Currently: " + total + " subscribers <font color='green'>(up
" + diff + " in the last 3 months)</font>"
                         if (diff < 0) 
                             text = "Currently: " + total + " subscribers <font color='red'>(down
" + diff + " in the last 3 months)</font>"
-                            if (d[1] != "private" && d[1] != "security" &&
d[1] != "commits")
+                            if (d[1] != "private" && d[1] != "security" &&
d[1] != "commits") 
                                 addLine(pmc, " - " + mlname + ": ")
                                 addLine(pmc, "    - " + total + " subscribers (down " + diff
+ " in the last 3 months)" + add)
                                 addLine(pmc)
@@ -483,100 +533,56 @@ renderFrontPage = (tpmc) ->
                                 addLine(pmc, " - " + mlname + ": ")
                                 addLine(pmc, "    - " + total + " subscribers (up " + diff
+ " in the last 3 months)" + add)
                                 addLine(pmc)
-        
+    
                         if (json.delivery[pmc] && json.delivery[pmc][lookup])
                             text += " (" + json.delivery[pmc][lookup].quarterly[0] + " emails
sent in the past 3 months, " + json.delivery[pmc][lookup].quarterly[1] + " in the previous
cycle)"
-        
+    
                         p = document.createElement('li');
                         p.innerHTML = "<h5>" + mlname + ":</h5>" + text
                         p.appendChild(div)
                         ul.appendChild(p)
                         
-                for ml of json.mail[pmc]
-                    skip = false
-                    for i in first
-                        xml = pmc + ".apache.org-" + first[i]
-                        if (ml.search(xml) == 0)
-                            skip = true
-                    if (!skip)
-        
-                        f++;
-                        if (ml != prev && ml.search("infra") < 0)
-                            prev = ml
-                            d = ml.split(".org-");
-                            mlname = d[1] + "@" + d[0] + ".org"
-                            lookup = d[0].split(/\./)[0] + "-" + d[1]
-                            x = renderChart(json.mail[pmc], ml, obj, if (json.delivery[pmc]
&& json.delivery[pmc][lookup]) then json.delivery[pmc][lookup].weekly else {})
-                            total = x[0]
-                            diff = x[1]
-                            div = x[2]
-        
-                            add = ""
-                            if (json.delivery[pmc] && json.delivery[pmc][lookup])
-                                add = ":\n    - " + json.delivery[pmc][lookup].quarterly[0]
+ " emails sent to list (" + json.delivery[pmc][lookup].quarterly[1] + " in previous quarter)";
-                            
-                            text = "Currently: " + total + " subscribers <font color='green'>(up
" + diff + " in the last 3 months)</font>"
-                            if (diff < 0) 
-                                text = "Currently: " + total + " subscribers <font color='red'>(down
" + diff + " in the last 3 months)</font>"
-                                if (d[1] != "private" && d[1] != "security" &&
d[1] != "commits") 
-                                    addLine(pmc, " - " + mlname + ": ")
-                                    addLine(pmc, "    - " + total + " subscribers (down "
+ diff + " in the last 3 months)" + add)
-                                    addLine(pmc)
-                            else
-                                if (d[1] != "private" && d[1] != "security" &&
d[1] != "commits")
-                                    addLine(pmc, " - " + mlname + ": ")
-                                    addLine(pmc, "    - " + total + " subscribers (up " +
diff + " in the last 3 months)" + add)
-                                    addLine(pmc)
-        
-                            if (json.delivery[pmc] && json.delivery[pmc][lookup])
-                                text += " (" + json.delivery[pmc][lookup].quarterly[0] +
" emails sent in the past 3 months, " + json.delivery[pmc][lookup].quarterly[1] + " in the
previous cycle)"
-        
-                            p = document.createElement('li');
-                            p.innerHTML = "<h5>" + mlname + ":</h5>" + text
-                            p.appendChild(div)
-                            ul.appendChild(p)
-                            
-                addLine(pmc)
-                
-                if json.bugzilla[pmc][0] or json.bugzilla[pmc][1] > 0
-                    renderBZ(pmc)
-                
-        
-                if json.jira[pmc][0] > 0 or json.jira[pmc][1] > 0 
-                    renderJIRA(pmc)
-                
-        
-        
-                # Reporting example
-                template = buildPanel(pmc, "Report template");
-                template.innerHTML += "<pre style='border: 2px dotted #444; padding: 10px;
background: #FFD;' contenteditable='true'>" + templates[pmc] + "</pre>"
-        
-                # Fetch from JIRA dialog
-                dialog = document.createElement('div');
-                dialog.setAttribute("id", "dialog_" + pmc);
-                dialog.setAttribute("title", "Fetch data from JIRA for " + pmc)
-                dialog.setAttribute("style", "display: none;")
-                if (jsdata.keys[pmc] && jsdata.keys[pmc].length > 0)
-                    dialog.innerHTML = "<p>Suggested JIRA Keys: <kbd>" + jsdata.keys[pmc].join(",
") + "</kbd></p>"
-                else
-                    dialog.innerHTML = "<p>No JIRA keys found - are you sure this project
uses JIRA?</p>"
-                
-                dialog.innerHTML += "<form><b>JIRA Project:</b><input
type='text' name='jira' placeholder='FOO'><br><b>Optional prepend:</b>
<input name='prepend' type='text' placeholder='Foo'/><br>"+
-                                   "<input type='button' value='Fetch from JIRA' onclick='fetchJIRA(\""
+ pmc + "\", this.form[\"jira\"].value, this.form[\"prepend\"].value);'></form>"+
-                                   "<p>If you have multiple JIRA projects and they
only have the version number in their release versions, please enter the component name in
the 'prepend' field.</p>"
-                document.getElementById('tab_' + pmc).appendChild(dialog)
-        
-                # Manually add release dialog
-                rdialog = document.createElement('div');
-                rdialog.setAttribute("id", "rdialog_" + pmc);
-                rdialog.setAttribute("title", "Add a release for " + pmc)
-                rdialog.setAttribute("style", "display: none;")
-                rdialog.innerHTML = "<form><b>Version:</b><input type='text'
name='version' placeholder='1.2.3'><br>"+
-                                    "<b>Date:</b> <input name='date' type='text'
placeholder='YYYY-MM-DD'/><br>"+
-                                    "<input type='button' value='Add release' onclick='addRelease(\""
+ pmc + "\", this.form[\"version\"].value, this.form[\"date\"].value);'></form>"
-                container.appendChild(rdialog)
-
+            addLine(pmc)
+            
+            if json.bugzilla[pmc][0] or json.bugzilla[pmc][1] > 0
+                renderBZ(pmc)
             
+    
+            if json.jira[pmc][0] > 0 or json.jira[pmc][1] > 0 
+                renderJIRA(pmc)
+            
+    
+    
+            # Reporting example
+            template = buildPanel(pmc, "Report template");
+            template.innerHTML += "<pre style='border: 2px dotted #444; padding: 10px;
background: #FFD;' contenteditable='true'>" + templates[pmc] + "</pre>"
+    
+            # Fetch from JIRA dialog
+            dialog = document.createElement('div');
+            dialog.setAttribute("id", "dialog_" + pmc);
+            dialog.setAttribute("title", "Fetch data from JIRA for " + pmc)
+            dialog.setAttribute("style", "display: none;")
+            if (jsdata.keys[pmc] && jsdata.keys[pmc].length > 0)
+                dialog.innerHTML = "<p>Suggested JIRA Keys: <kbd>" + jsdata.keys[pmc].join(",
") + "</kbd></p>"
+            else
+                dialog.innerHTML = "<p>No JIRA keys found - are you sure this project
uses JIRA?</p>"
+            
+            dialog.innerHTML += "<form><b>JIRA Project:</b><input type='text'
name='jira' placeholder='FOO'><br><b>Optional prepend:</b> <input
name='prepend' type='text' placeholder='Foo'/><br>"+
+                               "<input type='button' value='Fetch from JIRA' onclick='fetchJIRA(\""
+ pmc + "\", this.form[\"jira\"].value, this.form[\"prepend\"].value);'></form>"+
+                               "<p>If you have multiple JIRA projects and they only
have the version number in their release versions, please enter the component name in the
'prepend' field.</p>"
+            document.getElementById('tab_' + pmc).appendChild(dialog)
+    
+            # Manually add release dialog
+            rdialog = document.createElement('div');
+            rdialog.setAttribute("id", "rdialog_" + pmc);
+            rdialog.setAttribute("title", "Add a release for " + pmc)
+            rdialog.setAttribute("style", "display: none;")
+            rdialog.innerHTML = "<form><b>Version:</b><input type='text'
name='version' placeholder='1.2.3'><br>"+
+                                "<b>Date:</b> <input name='date' type='text'
placeholder='YYYY-MM-DD'/><br>"+
+                                "<input type='button' value='Add release' onclick='addRelease(\""
+ pmc + "\", this.form[\"version\"].value, this.form[\"date\"].value);'></form>"
+            container.appendChild(rdialog)
+
+        
             
 
 

Modified: comdev/reporter.apache.org/trunk/site/js/tabs.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/js/tabs.js?rev=1799048&r1=1799047&r2=1799048&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/js/tabs.js (original)
+++ comdev/reporter.apache.org/trunk/site/js/tabs.js Sun Jun 18 07:29:41 2017
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.9.3
-var HTML, PMCchanges, addLine, addRelease, addTab, animals, buildPanel, currentTab, epochSecsYYYYMMDD,
everyMonth, fetch, fetchJIRA, formatRm, getWednesdays, isArray, isHash, isNewPMC, jsdata,
loadBread, loadTabs, m, makeSelect, mergeData, nproject, post, postJSON, preloadTabs, renderBZ,
renderChart, renderFrontPage, renderJIRA, renderReleaseChart, setReportDate, tabs, templates,
toInt, txt,
+var HTML, PMCchanges, addLine, addRelease, addTab, animals, buildPanel, currentTab, epochSecsYYYYMMDD,
everyMonth, fetch, fetchJIRA, formatRm, getWednesdays, isArray, isHash, isNewPMC, jsdata,
loadBread, loadTabs, m, makeSelect, mergeData, nproject, post, postJSON, preloadTabs, renderBZ,
renderChart, renderFrontPage, renderJIRA, renderReleaseChart, rendered, setReportDate, tabs,
templates, toInt, txt,
   indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++)
{ if (i in this && this[i] === item) return i; } return -1; };
 
 HTML = (function() {
@@ -106,6 +106,8 @@ txt = function(a) {
 
 jsdata = {};
 
+rendered = {};
+
 templates = {};
 
 nproject = null;
@@ -363,6 +365,11 @@ renderFrontPage = function(tpmc) {
   for (i = j = 0, len1 = ref.length; j < len1; i = ++j) {
     pmc = ref[i];
     if (pmc === tpmc || !tpmc) {
+      if (rendered[pmc]) {
+        container.innerHTML = "";
+        container.appendChild(rendered[pmc]);
+        alert("cached");
+      }
       if ((ref1 = !pmc, indexOf.call(json.pmcdates, ref1) >= 0)) {
         continue;
       }
@@ -386,6 +393,7 @@ renderFrontPage = function(tpmc) {
       addLine(pmc, " - <font color='red'>TODO - Please use this paragraph to elaborate
on why the current project activity (mails, commits, bugs etc) is at its current level - Maybe
" + a + " took over and are now controlling the project?</font>");
       addLine(pmc);
       obj = document.createElement('div');
+      rendered[pmc] = obj;
       obj.setAttribute("id", "tab_" + pmc);
       obj.style = "padding: 10px; text-align: left !important;";
       obj.setAttribute("aria-hidden", "true");



Mime
View raw message