You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kibble.apache.org by hu...@apache.org on 2018/02/13 16:27:19 UTC

[kibble] branch master updated: initial stab at expanding the lists when needed

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble.git


The following commit(s) were added to refs/heads/master by this push:
     new 93e0130  initial stab at expanding the lists when needed
93e0130 is described below

commit 93e01302d85b5eeba2851bdfa705f089d6fb984d
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Tue Feb 13 17:27:11 2018 +0100

    initial stab at expanding the lists when needed
---
 ui/js/coffee/widget_comstat.coffee | 28 ++++++++++++++--------
 ui/js/kibble.v1.js                 | 48 +++++++++++++++++++++++++++++---------
 2 files changed, 55 insertions(+), 21 deletions(-)

diff --git a/ui/js/coffee/widget_comstat.coffee b/ui/js/coffee/widget_comstat.coffee
index bf67f2f..75d588d 100644
--- a/ui/js/coffee/widget_comstat.coffee
+++ b/ui/js/coffee/widget_comstat.coffee
@@ -1,3 +1,10 @@
+comShow = (t) ->
+    rows = document.getElementsByTagName("tr")
+    for row in rows
+        if row.getAttribute("id").match("comstat_#{t}_")
+            row.style.display = "show"
+    document.getElementById("comstat_#{t}_more").style.display = "none"
+    
 comstat = (json, state) ->
     
     if json and json.stats
@@ -54,14 +61,15 @@ comstat = (json, state) ->
                 repo = json.bios[person].code[1].sourceURL
                 wh = new Date(json.bios[person].code[0] * 1000.0).toDateString()
                 person = json.bios[person].bio
+                dstyle = 'show'
                 if i > 6
-                    m = json.stats.code.newcomers.length - 7
-                    tr = mk('tr', {scope: 'row'}, [
-                        mk('td', {colspan: "3"}, "+#{m} more...")
+                    m = json.stats.issues.newcomers.length - 7
+                    tr = mk('tr', {scope: 'row', id: 'comstat_code_more'}, [
+                        mk('td', {colspan: "3"}, new HTML('a', { href: 'javascript:void(comShow("code"));'}, "+#{m} more..."))
                         ])
                     tb.inject(tr)
-                    break
-                tr = mk('tr', {scope: 'row'}, [
+
+                tr = mk('tr', {scope: 'row', id: "comstat_code_#{i}", style: { display: dstyle}}, [
                     mk('td', {}, new HTML('img', {style: { width: '32px', height: '32px'}, class: "img-circle img-responsive", src:"https://secure.gravatar.com/avatar/#{person.md5}.png?d=identicon"})),
                     mk('td', {}, mk('a', { href: "?page=people&email=#{oemail}"}, person.name)),
                     mk('td', {}, oemail),
@@ -117,15 +125,15 @@ comstat = (json, state) ->
                 key = json.bios[person].issue[1].key || url
                 wh = new Date(json.bios[person].issue[0] * 1000.0).toDateString()
                 person = json.bios[person].bio
+                dstyle = 'show'
                 if i > 6
                     m = json.stats.issues.newcomers.length - 7
-                    tr = mk('tr', {scope: 'row'}, [
-                        mk('td', {colspan: "3"}, "+#{m} more...")
+                    tr = mk('tr', {scope: 'row', id: 'comstat_issue_more'}, [
+                        mk('td', {colspan: "3"}, new HTML('a', { href: 'javascript:void(comShow("issue"));'}, "+#{m} more..."))
                         ])
                     tb.inject(tr)
-                    break
-                
-                tr = mk('tr', {scope: 'row'}, [
+
+                tr = mk('tr', {scope: 'row', id: "comstat_issue_#{i}", style: { display: dstyle}}, [
                     mk('td', {}, new HTML('img', {style: { width: '32px', height: '32px'}, class: "img-circle img-responsive", src:"https://secure.gravatar.com/avatar/#{person.md5}.png?d=identicon"})),
                     mk('td', {}, mk('a', { href: "?page=people&email=#{oemail}"}, person.name)),
                     mk('td', {}, oemail),
diff --git a/ui/js/kibble.v1.js b/ui/js/kibble.v1.js
index 099e108..00badca 100644
--- a/ui/js/kibble.v1.js
+++ b/ui/js/kibble.v1.js
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.10.0
-var API, APIVERSION, Chart, HTML, Row, Widget, aSourceTypes, accountCallback, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, cog, comstat, copyCSS, currentSources, dataTable, datepicker, datepickers, defaultOrgChanged, deletesource, doResetPass, donut, [...]
+var API, APIVERSION, Chart, HTML, Row, Widget, aSourceTypes, accountCallback, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, datepickers, defaultOrgChanged, deletesource, doResetPas [...]
   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; };
 
 signup = function(form) {
@@ -5302,8 +5302,20 @@ Row = (function() {
 
 })();
 
+comShow = function(t) {
+  var len, q, row, rows;
+  rows = document.getElementsByTagName("tr");
+  for (q = 0, len = rows.length; q < len; q++) {
+    row = rows[q];
+    if (row.getAttribute("id").match("comstat_" + t + "_")) {
+      row.style.display = "show";
+    }
+  }
+  return document.getElementById("comstat_" + t + "_more").style.display = "none";
+};
+
 comstat = function(json, state) {
-  var aa, ab, chk, hash, i, js, key, lb, len, len1, len2, len3, m, nl, notice, oemail, p, person, q, ref, ref1, ref2, ref3, repo, row, stbl, tb, tbl, tr, u, url, wh, widget;
+  var aa, ab, chk, dstyle, hash, i, js, key, lb, len, len1, len2, len3, m, nl, notice, oemail, p, person, q, ref, ref1, ref2, ref3, repo, row, stbl, tb, tbl, tr, u, url, wh, widget;
   if (json && json.stats) {
     row = new Row();
     p = new HTML('p', {}, globArgs.committersOnly === 'true' ? "You are currently only seeing stats for committers. To view statistics for all contributors (committers and authors), please uncheck the box below:" : "You are currently seeing stats for both committership and authorship of code. To view only committership stats, tick the box below:");
@@ -5366,20 +5378,27 @@ comstat = function(json, state) {
         repo = json.bios[person].code[1].sourceURL;
         wh = new Date(json.bios[person].code[0] * 1000.0).toDateString();
         person = json.bios[person].bio;
+        dstyle = 'show';
         if (i > 6) {
-          m = json.stats.code.newcomers.length - 7;
+          m = json.stats.issues.newcomers.length - 7;
           tr = mk('tr', {
-            scope: 'row'
+            scope: 'row',
+            id: 'comstat_code_more'
           }, [
             mk('td', {
               colspan: "3"
-            }, "+" + m + " more...")
+            }, new HTML('a', {
+              href: 'javascript:void(comShow("code"));'
+            }, "+" + m + " more..."))
           ]);
           tb.inject(tr);
-          break;
         }
         tr = mk('tr', {
-          scope: 'row'
+          scope: 'row',
+          id: "comstat_code_" + i,
+          style: {
+            display: dstyle
+          }
         }, [
           mk('td', {}, new HTML('img', {
             style: {
@@ -5464,20 +5483,27 @@ comstat = function(json, state) {
         key = json.bios[person].issue[1].key || url;
         wh = new Date(json.bios[person].issue[0] * 1000.0).toDateString();
         person = json.bios[person].bio;
+        dstyle = 'show';
         if (i > 6) {
           m = json.stats.issues.newcomers.length - 7;
           tr = mk('tr', {
-            scope: 'row'
+            scope: 'row',
+            id: 'comstat_issue_more'
           }, [
             mk('td', {
               colspan: "3"
-            }, "+" + m + " more...")
+            }, new HTML('a', {
+              href: 'javascript:void(comShow("issue"));'
+            }, "+" + m + " more..."))
           ]);
           tb.inject(tr);
-          break;
         }
         tr = mk('tr', {
-          scope: 'row'
+          scope: 'row',
+          id: "comstat_issue_" + i,
+          style: {
+            display: dstyle
+          }
         }, [
           mk('td', {}, new HTML('img', {
             style: {

-- 
To stop receiving notification emails like this one, please contact
humbedooh@apache.org.