community-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1799042&view=rev
Log:
coffee fixups for mergeData

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

Modified: comdev/reporter.apache.org/trunk/site/js/coffee/preload.coffee
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/js/coffee/preload.coffee?rev=1799042&r1=1799041&r2=1799042&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/js/coffee/preload.coffee (original)
+++ comdev/reporter.apache.org/trunk/site/js/coffee/preload.coffee Sun Jun 18 07:02:33 2017
@@ -14,14 +14,13 @@ mergeData = (json, pmc) ->
     if pmc in jsdata.pmcs
         return
     if (nproject && nproject.length > 0)
-        for i in jsdata.pmcs
-            if (jsdata.pmcs[i] == nproject)
+        for xpmc, i in jsdata.pmcs
+            if (xpmc == nproject)
                 jsdata.pmcs.splice(i, 1);
                 break
             
     todo = new Array('count', 'mail', 'delivery', 'bugzilla', 'jira', 'changes', 'pmcdates',
'pdata', 'releases', 'keys', 'health')
-    for i in todo
-        key = todo[i]
+    for key, i in todo
         jsdata[key][pmc] = json[key][pmc];
     jsdata.pmcs.push(pmc)
     nproject = pmc

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=1799042&r1=1799041&r2=1799042&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:02:33 2017
@@ -1095,7 +1095,7 @@ tabs = [];
 jsdata = {};
 
 mergeData = function(json, pmc) {
-  var i, j, key, l, len1, len2, ref, todo;
+  var i, j, key, l, len1, len2, ref, todo, xpmc;
   if (!pmc) {
     jsdata = json;
     return;
@@ -1105,17 +1105,16 @@ mergeData = function(json, pmc) {
   }
   if (nproject && nproject.length > 0) {
     ref = jsdata.pmcs;
-    for (j = 0, len1 = ref.length; j < len1; j++) {
-      i = ref[j];
-      if (jsdata.pmcs[i] === nproject) {
+    for (i = j = 0, len1 = ref.length; j < len1; i = ++j) {
+      xpmc = ref[i];
+      if (xpmc === nproject) {
         jsdata.pmcs.splice(i, 1);
         break;
       }
     }
   }
   todo = new Array('count', 'mail', 'delivery', 'bugzilla', 'jira', 'changes', 'pmcdates',
'pdata', 'releases', 'keys', 'health');
-  for (l = 0, len2 = todo.length; l < len2; l++) {
-    i = todo[l];
+  for (i = l = 0, len2 = todo.length; l < len2; i = ++l) {
     key = todo[i];
     jsdata[key][pmc] = json[key][pmc];
   }



Mime
View raw message